Chapter 11
Mechanics 1: Linear Kinematics and Calculus
Never mistake motion for action.
— Ernest Hemingway (1899–1961

“Ladies and gentlemen, may I direct your attention to the center ring. Witness before you two ordinary textbooks, one labeled College Physics and the other Calculus. Their combined 2,500+ pages weigh over 25 lbs. Yet in this chapter and the next, your brave stunt-authors will attempt a most death-defying and impossible spectacle of mysticism and subterfuge: to reduce these two massive books into a mere 150 pages!”

Just like any good circus act, this one is prefaced with a lot of build up to set your expectations. The difference here is that the purpose of our preface is to lower your expectations.

11.1Overview and Other Expectation-Reducing
Remarks

OK, there's no way we can really cover all of physics and calculus in two chapters. As any politician knows, the secret to effectively communicate complicated subject matter in a short amount of time is to use lies, both the omission and commission kind. Let's talk about each of these kinds of lies in turn, so you will know what's really in store.

11.1.1What is Left Out?

Just about everything—let's talk about what we are leaving out of physics first. To put the word “physics” on this chapter would be even more of an insult to people who do real physics than this chapter already is. We are concerned only with mechanics, and very simple mechanics of rigid bodies at that. Some topics traditionally found in a first-year physics textbook that are not discussed in this book include:

A note about energy and work is in order, because even in the limited context of mechanics, the fundamental concept of energy plays a central role in traditional presentations. Many problems are easier to solve by using conservation of energy than by considering the forces and applying Newton's laws. (In fact, an alternative to the Newtonian dynamics that we study in this book exists. It is known as Lagrangian dynamics and focuses on energy rather than forces. When used properly, both systems produce the same results, but Lagrangian dynamics can solve certain problems more elegantly and is especially adept at handling friction, compared to Newtonian dynamics.) However, at the time of this writing, basic general purpose digital simulations are based on Newtonian dynamics, and energy does not play a direct role. That isn't to say an understanding of energy is useless; indeed disobedience of the conservation of energy law is at the heart of many simulation problems! Thus, energy often arises more as a way to understand the (mis)behavior of a digital simulation, even if it doesn't appear in the simulation code directly.

Now let's talk about the ways in which this book will irritate calculus professors. We think that a basic understanding of calculus is really important to fully grasp many of the concepts from physics. Conversely, physics provides some of the best examples for explaining calculus. Calculus and physics are often taught separately, usually with calculus coming first. It is our opinion that this makes calculus harder to learn, since it robs the student of the most intuitive examples—the physics problems for which calculus was invented to solve! We hope interleaving calculus with physics will make it easier for you to learn calculus.

Our calculus needs are extremely modest in this book, and we have left out even more from calculus than we did from physics. After reading this chapter, you should know:

Of course, we are aware that a large number of readers may already have this knowledge. Take a moment to put yourself into one of the following categories:

  1. I know absolutely nothing about derivatives or integrals.
  2. I know the basic idea of derivatives and integrals, but probably couldn't solve any freshman calculus problems with a pencil and paper.
  3. I have studied some calculus.

Level 2 knowledge of calculus is sufficient for this book, and our goal is to move everybody who is currently in category 1 into category 2. If you're in category 3, our calculus discussions will be a (hopefully entertaining) review.We have no delusions that we can move anyone who is not already there into category 3.

11.1.2Some Helpful Lies about Our Universe

The universe is commonly thought to be discrete in both space and time. Not only is matter broken up into discrete chunks called atoms, but there is evidence that the very fabric of space and time is broken up into discrete pieces also. Now, there is a difference of opinion as to whether it's really that way or just appears that way because the only way we can interact with space is to throw particles at it, but it's our opinion that if it looks like a duck, walks like a duck, quacks like a duck, has webbed feet and a beak, then it's a good working hypothesis that it tastes good when put into eggrolls with a little dark sauce.

For a long time, the mere thought that the universe might not be continuous had not even considered the slightest possibility of crossing anybody's mind, until the ancient Greeks got a harebrained and totally unjustified idea that things might be made up of atoms. The fact that this later turned out to be true is regarded by many as being good luck rather then good judgment. Honestly, who would have thought it? After all, everyday objects, such as the desk on which one of the authors is currently resting his wrists as he types this sentence, give every appearance of having smooth, continuous surfaces. But who cares? Thinking of the desk as having a smooth, continuous surface is a harmless but useful delusion that lets the author rest his wrists comfortably without worrying about atomic bond energy and quantum uncertainty theory at all.

Not only is this trick of thinking of the world as continuous a handy psychological rationalization, it's also good mathematics. It turns out that the math of continuous things is a lot less unwieldy than the math of discrete things. That's why the people who were thinking about how the world works in the 15th century were happy to invent a mathematics for a continuous universe; experimentally, it was a good approximation to reality, and theoretically the math worked out nicely. Sir Isaac Newton was thus able to discover a lot of fundamental results about continuous mathematics, which we call “calculus,” and its application to the exploration of a continuous universe, which we call “physics.”

Now, we're mostly doing this so that we can model a game world inside a computer, which is inherently discrete. There's a certain amount of cognitive dissonance involved with programming a discrete simulation of a continuous model of a discrete universe, but we'll try not to let it bother us. Suffice it to say that we are in complete control of the discrete universe inside our game, and that means that we can choose the kind of physics that applies inside that universe. All we really need is for the physical laws to be sufficiently like the ones we're used to for the player to experience willing suspension of disbelief, and hopefully say, “Wow! Cool!” and want to spend more money. For almost all games that means a cozy Newtonian universe without the nasty details of quantum mechanics or relativity. Unfortunately, that means also that there are a pair of nasty trolls lurking under the bridge, going by the names of chaos and instability, but we will do our best to appease them.

For the moment, we are concerned about the motion of a small object called a “particle.” At any given moment, we know its position and velocity.1 The particle has mass. We do not concern ourselves with the orientation of the particle (for now), and thus we don't think of the particle as spinning. The particle does not have any size, either. We will defer adding those elements until later, when we shift from particles to rigid bodies.

We are studying classical mechanics, also known as Newtonian mechanics, which has several simplifying assumptions that are incorrect in general but true in everyday life in most ways that really matter to us. So we can darn well make sure they are true inside our computer world, if we please. These assumptions are:

The first two are shattered by relatively, and the second two by quantum mechanics. Thankfully, these two subjects are not necessary for video games, because your authors do not have more than a pedestrian understanding of them.

We will begin our foray into the field of mechanics by learning about kinematics, which is the study of the equations that describe the motion of a particle in various simple but commonplace situations. When studying kinematics, we are not concerned with the causes of motion—that is the subject of dynamics, which will be covered in Chapter 12. For now, “ours is not to question why,” ours is just to do the math to get equations that predict the position, velocity, and acceleration of the particle at any given time t , or die. Well, forget about the last part anyway.

Because we are treating our objects as particles and tracking their position only, we will not consider their orientation or rotational effects until Chapter 12. When rotation is ignored, all of the ideas of linear kinematics extend into 3D in a straightforward way, and so for now we will be limiting ourselves to 2D (and 1D). This is convenient, since the authors do not know how to design those little origami-like things that lay flat and then pop up when you open the book, and the publisher wouldn't let us even if we were compulsive enough to learn how to do it. Later we'll see why treating objects as particles is perfectly justifiable.

11.2Basic Quantities and Units

Mechanics is concerned with the relationship among three fundamental quantities in nature: length, time, and mass. Length is a quantity you are no doubt familiar with; we measure length using units such as centimeters, inches, meters, feet, kilometers, miles, and astronomical units.2 Time is another quantity we are very comfortable with measuring, in fact most of us probably learned how to read a clock before we learned how to measure distances.3 The units used to measure time are the familiar second, minute, day, week, fortnight,4 and so on. The month and the year are often not good units to use for time because different months and years have different durations.

The quantity mass is not quite as intuitive as length and time. The measurement of an object's mass is often thought of as measuring the “amount of stuff” in the object. This is not a bad (or at least, not completely terrible) definition, but its not quite right, either [1]. A more precise definition might be that mass is a measurement of inertia, that is, how much resistance an object has to being accelerated. The more massive an object is, the more force is required to start it in motion, stop its motion, or change its motion.

Mass is often confused with weight, especially since the units used to measure mass are also used to measure weight: the gram, pound, kilogram, ton, and so forth. The mass of an object is an intrinsic property of an object, whereas the weight is a local phenomenon that depends on the strength of the gravitational pull exerted by a nearby massive object. Your mass will be the same whether you are in Chicago, on the moon, near Jupiter, or light-years away from the nearest heavenly body, but in each case your weight will be very different. In this book and in most video games, our concerns are confined to a relatively small patch on a flat Earth, and we approximate gravity by a constant downward pull. It won't be too harmful to confuse mass and weight because gravity for us will be a constant. (But we couldn't resist a few cool exercises about the International Space Station.)

In many situations, we can discuss the relationship between the fundamental quantities without concern for the units of measurement we are using. In such situations, we'll find it useful to denote length, time, and mass by L , T , and M , respectively. One important such case is in defining derived quantities. We've said that length, time, and mass are the fundamental quantities—but what about other quantities, such as area, volume, density, speed, frequency, force, pressure, energy, power, or any of the numerous quantities that can be measured in physics? We don't give any of these their own capital letter, since each of these can be defined in terms of the fundamental quantities.

For example, we might express a measurement of area as a number of “square feet.” We have created a unit that is in terms of another unit. In physics, we say that a measurement of area has the unit “length squared,” or L2 . How about speed? We measure speed using the units such as miles per hour or meters per second. Thus speed is the ratio of a distance per unit time, or L / T .

One last example is frequency. You probably know that frequency measures how many times something happens in a given time interval (how “frequently” it happens). For example, a healthy adult has an average heart rate of around 70 beats per minute (BPM). The motor in a car might be rotating at a rate of 5,000 revolutions per minute (RPM). The NTSC television standard is defined as 29.97 frames per second (FPS). Note that in each of these, we are counting how many times something happens within a given duration of time. So we can write frequency in generic units as 1 / T or T 1 , which you can read as “per unit time.” One of the most important measurements of frequency is the Hertz, abbreviated Hz, which means “per second.” When you express a frequency in Hz, you are describing the number of events, oscillations, heartbeats, video frames, or whatever per second. By definition, 1  Hz =1  s 1 .

Table 11.1 summarizes several quantities that are measured in physics, their relation to the fundamental quantities, and some common units used to measure them.

Quantity Notation SI unit Other units
Length L m cm , km , in , ft , mi , light year, furlong
Time T s min , hr , ms
Mass M kg g , slug, lb (pound-mass)
Velocity L / T m / s ft / s , m / hr , km / hr
Acceleration L / T2 m / s 2 ft / s 2 , (m / hr) / s , (km / hr) / s
Force ML / T2 N  (Newton) = kgm / s2 lb (pound-force), poundal
Area L2 m2 mm2 , cm2 , km2 , in2 , ft2 , mi2 ,acre, hectare
Volume L3 m3 mm3 , cm3 , L (liter), in3 , ft3 , teaspoon,fl oz (fluid ounce), cup, pint, quart, gallon
Pressure Force/Area = (ML / T2) / L2 = M / (LT2) Pa  (Pascal) = N / m2 = kg / (ms2) psi  ( lbs / in2 ), millibar, inch of mercury, atm  (atmosphere)
Energy Force × Length = (ML / T2)L = ML2 / T2 J  (Joule) = Nm2 = kgm s2m = kgm2 s2 kWhr  (kilowatt-hour), foot-pound, erg, calorie, BTU  (British thermal unit), ton of TNT
Power Energy / Time = (ML2 / T2) / T = ML2 / T3 W  (Watt) = J / s = kgm2 s2 s 1 = kgm2 s3 hp  (horsepower)
Frequency 1 / T=T 1 Hz=1 / s=s 1 = “per second” KHz=1,000 Hz , MHz=1,000,000 Hz , “per minute”, “per annum”
Table 11.1Selected physical quantities and common units of measurements

Of course, any real measurement doesn't make sense without attaching specific units to it. One way to make sure that your calculations always make sense is to carry around the units at all times and treat them like algebraic variables. For example, if you are computing a pressure and your answer comes out with the units m/s, you know you have done something wrong; pressure has units of force per unit area, or ML / (T2L2) . On the other hand, if you are solving a problem and you end up with an answer in pounds per square inch (psi), but you are looking for a value in Pascals, your answer is probably correct, but just needs to be converted to the desired units. This sort of reasoning is known as dimensional analysis. Carrying around the units and treating them as algebraic variables quite often highlights mistakes caused by different units of measurement, and also helps make unit conversion a snap.

Because unit conversion is an important skill, let's briefly review it here. The basic concept is that to convert a measurement from one set of units to another, we multiply that measurement by a well-chosen fraction that has a value of 1. Let's take a simple example: how many feet is 14.57 meters? Looking up the conversion factor,5 we see that 1  m 3.28083  ft . This means that 1  m / 3.28083  ft 1 . So let's take our measurement and multiply it by a special value of “1:”

(11.1)14.57  m =14.57  m ×114.57  m × 3.28083  ft 1  m 47.80  ft .

Our conversion factor tells us that the numerator and denominator of the fraction in Equation (11.1) are equal: 3.28083 feet is equal to 1 meter. Because the numerator and denominator are equal, the “value” of this fraction is 1. (In a physical sense, though, certainly numerically the fraction doesn't equal 1.) And we know that multiplying anything by 1 does not change its value. Because we are treating the units as algebraic variables, the m on the left cancels with the m in the bottom of the fraction.

Of course, applying one simple conversion factor isn't too difficult, but consider a more complicated example. Let's convert 188 km/hr to ft/s. This time we need to multiply by “1” several times:

188 km hr × 1  hr 3600  s × 1000  m 1  km × 3.28083  ft 1  m 171 ft s .

11.3Average Velocity

We begin our study of kinematics by taking a closer look at the simple concept of speed. How do we measure speed? The most common method is to measure how much time it takes to travel a fixed distance. For example, in a race, we say that the fastest runner is the one who finishes the race in the shortest amount of time.

Consider the fable of the tortoise and the hare. In the story, they decide to have a race, and the hare, after jumping to an early lead, becomes overconfident and distracted. He stops during the race to take a nap, smell the flowers, or some other form of lollygagging. Meanwhile, the tortoise plods along, eventually passing the hare and crossing the finish line first. Now this is a math book and not a self-help book, so please ignore the moral lessons about focus and perseverance that the story contains, and instead consider what it has to teach us about average velocity. Examine Figure 11.1, which shows a plot of the position of each animal over time.

Figure 11.1 Plot of position versus time during the race between the tortoise and the hare

A play-by-play of the race is as follows. The gun goes off at time t0 , and the hare sprints ahead to time t1 . At this point his hubris causes him to slow his pace, until time t2 when a cute female passes by in the opposite direction. (Her position over time is not depicted in the diagram.) At this point a different tragic male trait causes the hare to turn around and walk with her, and he proceeds to chat her up. At t3 , he realizes that his advances are getting him nowhere, and he begins to pace back and forth along the track dejectedly until time t4 . At that point, he decides to take a nap. Meanwhile, the tortoise has been making slow and steady progress, and at time t5 , he catches up with the sleeping hare. The tortoise plods along and crosses the tape at t6 . Quickly thereafter, the hare, perhaps awakened by the sound of the crowd celebrating the tortoise's victory, wakes up at time t7 and hurries in a frenzy to the finish. At t8 , the hare crosses the finish line, where he is humiliated by all his peers, and the cute girl bunny, too.

To measure the average velocity of either animal during any time interval, we divide the animal's displacement by the duration of the interval. We'll be focusing on the hare, and we'll denote the position of the hare as x , or more explicitly as x(t) , to emphasize the fact that the hare's position varies as a function of time. It is a common convention to use the capital Greek letter delta (“ Δ ”) as a prefix to mean “amount of change in.” For example, Δx would mean “the change in the hare's position,” which is a displacement of the hare. Likewise Δt means “the change in the current time,” or simply, “elapsed time between two points.” Using this notation, the average velocity of the hare from ta to tb is given by the equation

Definition of average velocity
average velocity = displacement elapsed time = Δx Δt = x(tb)x(ta) tbta .

This is the definition of average velocity. No matter what specific units we use, velocity always describes the ratio of a length divided by a time, or to use the notation discussed in Section 11.2, velocity is a quantity with units L / T .

If we draw a straight line through any two points on the graph of the hare's position, then the slope of that line measures the average velocity of the hare over the interval between the two points. For example, consider the average velocity of the hare as he decelerates from time t1 to t2 , as shown in Figure 11.2. The slope of the line is the ratio Δx / Δt . This slope is also equal to the tangent of the angle marked α , although for now the values Δx and Δt are the ones we will have at our fingertips, so we won't need to do any trig.

Figure 11.2Determining average velocity graphically

Returning to Figure 11.1, notice that the hare's average velocity from t2 to t3 is negative. This is because velocity is defined as the ratio of net displacement over time. Compare this to speed, which is the total distance divided by time and cannot be negative. The sign of displacement and velocity are sensitive to the direction of travel, whereas distance and speed are intrinsically nonnegative. We've already spoken about these distinctions way back in Section 2.2. Of course it's obvious that the average velocity is negative between t2 and t3 , since the hare was going backwards during the entire interval. But average velocity can also be negative on an interval even in situations where forward progress is being made for a portion of the interval, such as the larger interval between t2 and t4 . It's a case of “one step forward, two steps back.”

Average velocity can also be zero, as illustrated during the hare's nap from t4 to t7 . In fact, the average velocity will be zero any time an object starts and ends at the same location, even if it was it motion during the entire interval! (“Two steps forward, two steps back.”) Two such intervals are illustrated in Figure 11.3.

Figure 11.3 Two intervals during which the hare has no net displacement, and thus his average velocity is zero

And, of course, the final lesson of the fable is that the average velocity of the tortoise is greater than the average velocity of the hare, at least from t0 to t7 , when the tortoise crosses the finish line. This is true despite the fact that the hare's average speed was higher, since he certainly traveled a larger distance with all the female distractions and pacing back and forth.

One last thing to point out. If we assume the hare learned his lesson and congratulated the tortoise (after all, let's not attribute to the poor animal all the negative personality traits!), then at t=t8 they were standing at the same place. This means their net displacements from t0 to t8 are the same, and thus they have the same average velocity during this interval.

11.4Instantaneous Velocity and the Derivative

We've seen how physics defines and measures the average velocity of an object over an interval, that is, between two time values that differ by some finite amount Δt . Often, however, it's useful to be able to speak of an object's instantaneous velocity, which means the velocity of the object for one value of t , a single moment in time. You can see that this is not a trivial question because the familiar methods for measuring velocity, such as

average velocity = displacement elapsed time = Δx Δt = x(tb)x(ta) tbta ,

don't work when we are considering only a single instant in time. What are ta and tb , when we are looking at only one time value? In a single instant, displacement and elapsed time are both zero; so what is the meaning of the ratio Δx / Δt ? This section introduces a fundamental tool of calculus known as the derivative. The derivative was invented by Newton to investigate precisely the kinematics questions we are asking in this chapter. However, its applicability extends to virtually every problem where one quantity varies as a function of some other quantity. (In the case of velocity, we are interested in how position varies as a function of time.)

Because of the vast array of problems to which the derivative can be applied, Newton was not the only one to investigate it. Primitive applications of integral calculus to compute volumes and such date back to ancient Egypt. As early as the 5th century, the Greeks were exploring the building blocks of calculus such as infinitesimals and the method of exhaustion. Newton usually shares credit with the German mathematician Gottfried Leibniz6 (1646–1716) for inventing calculus in the 17th century, although Persian and Indian writings contain examples of calculus concepts being used. Many other thinkers made significant contributions, includingFermat, Pascal, and Descartes.7 It's somewhat interesting that many of the earlier applications of calculus were integrals, even though most calculus courses cover the “easier” derivative before the “harder” integral.

We first follow in the steps of Newton and start with the physical example of velocity, which we feel is the best example for obtaining intuition about how the derivative works. Afterwards, we consider several other examples where the derivative can be used, moving from the physical to the more abstract.

11.4.1Limit Arguments and the Definition of the Derivative

Back to the question at hand: how do we measure instantaneous velocity? First, let's observe one particular situation for which it's easy: if an object moves with constant velocity over an interval, then the velocity is the same at every instant in the interval. That's the very definition of constant velocity. In this case, the average velocity over the interval must be the same as the instantaneous velocity for any point within that interval. In a graph such as Figure 11.1, it's easy to tell when the object is moving at constant velocity because the graph is a straight line. In fact, almost all of Figure 11.1 is made up of straight line segments,8 so determining instantaneous velocity is as easy as picking any two points on a straight-line interval (the endpoints of the interval seem like a good choice, but any two points will do) and determining the average velocity between those endpoints.

But consider the interval from t1 to t2 , during which the hare's overconfidence causes him to gradually decelerate. On this interval, the graph of the hare's position is a curve, which means the slope of the line, and thus the velocity of the hare, is changing continuously. In this situation, measuring instantaneous velocity requires a bit more finesse.

For concreteness in this example, let's assign some particular numbers. To keep those numbers round (and also to stick with the racing theme), please allow the whimsical choice to measure time in minutes and distance in furlongs.9 We will assign t1=1  min and t2=3  min , so the total duration is 2 minutes. Let's say that during this interval, the hare travels from x(1)=4  fur to x(3)=8  fur .10 For purposes of illustration, we will set our sights on the answer to the question: what is the hare's instantaneous velocity at t=2.5  min ? This is all depicted in Figure 11.4.

Figure 11.4 What is the hare's velocity at t=2.5  min ?

It's not immediately apparent how we might measure or calculate the velocity at the exact moment t=2.5 , but observe that we can get a good approximation by computing the average velocity of a very small interval near t=2.5 . For a small enough interval, the graph is nearly the same as a straight line segment, and the velocity is nearly constant, and so the instantaneous velocity at any given instant within the interval will not be too far off from the average velocity over the whole interval.

In Figure 11.5, we fix the left endpoint of a line segment at t=2.5 and move the right endpoint closer and closer. As you can see, the shorter the interval, the more the graph looks like a straight line, and the better our approximation becomes. Thinking graphically, as the second endpoint moves closer and closer to t=2.5 , the slope of the line between the endpoints will converge to the slope of the line that is tangent to the curve at this point. A tangent line is the graphical equivalent of instantaneous velocity, since it measures the slope of the curve just at that one point.

Figure 11.5 Approximating instantaneous velocity as the average velocity of a smaller and smaller interval

Let's carry out this experiment with some real numbers and see if we cannot approximate the instantaneous velocity of the hare. In order to do this, we'll need to be able to know the position of the hare at any given time, so now would be a good time to tell you that the position of the hare is given by the function11

x(t)=t2+6t1.

Table 11.2 shows tabulated calculations for average velocity over intervals with a right hand endpoint t+Δt that moves closer and closer to t=2.5 .

The right-most column, which is the average velocity, appears to be converging to a velocity of 1 furlong/minute. But how certain are we that this is the correct value? Although we do not have any calculation that will produce a resulting velocity of exactly 1 furlong/minute, for all practical purposes, we may achieve any degree of accuracy desired by using this approximation technique and choosing Δt sufficiently small. (We are ignoring issues related to the precision of floating point representation of numbers in a computer.)

t Δt t+Δt x(t) x(t+Δt) x(t+Δt)x(t) x(t+Δt)x(t) Δt
[6pt] 2.500 0.500 3.000 7.750 8.0000 0.2500 0.5000
2.500 0.100 2.600 7.750 7.8400 0.0900 0.9000
2.500 0.050 2.550 7.750 7.7975 0.0475 0.9500
2.500 0.010 2.510 7.750 7.7599 0.0099 0.9900
2.500 0.005 2.505 7.750 7.7549 0.0049 0.9950
2.500 0.001 2.501 7.750 7.7509 0.0009 0.9990
Table 11.2Calculating average velocity for intervals of varying durations

This is a powerful argument. We have essentially assigned a value to an expression that we cannot evaluate directly. Although it is mathematically illegal to substitute Δt=0 into the expression, we can argue that for smaller and smaller values of Δt , we converge to a particular value. In the parlance of calculus, this value of 1 furlong/minute is a limiting value, meaning that as we take smaller and smaller positive values for Δt , the result of our computation approaches 1, but does not cross it (or reach it exactly).

Convergence arguments such as this are defined with rigor in calculus by using a formalized tool known as a limit. The mathematical notation for this is

(11.2)v(t)=lim Δt0 x(t+Δt)x(t) Δt .

The notation ` ' is usually read as “approaches” or “goes to.” So the right side of Equation (11.2) might be read as

The limit of  x(t+Δt)x(t) Δt   as  Δt  approaches zero,''

or

The limit as  Δt  approaches zero of  x(t+Δt)x(t) Δt .''

In general, an expression of the form lim ak [ blah ] is interpreted to mean “The value that [blah] converges to, as a gets closer and closer to k .”

This is an important idea, as it defines what we mean by instantaneous velocity.

Instantaneous velocity at a given time t may be interpreted as the average velocity of an interval that contains t , in the limit as the duration of the interval approaches zero.

We won't have much need to explore the full power of limits or get bogged down in the finer points; that is the mathematical field of analysis, and would take us a bit astray from our current, rather limited,12 objectives. We are glossing over some important details13 so that we can focus on one particular case, and that is the use of limits to define the derivative.

The derivative measures the rate of change of a function. Remember that “function” is just a fancy word for any formula, computation, or procedure that takes an input and produces an output. The derivative quantifies the rate at which the output of the function will change in response to a change to the input. If x denotes the value of a function at a specific time  t , the derivative of that function at t is the ratio dx / dt . The symbol dx represents the change in the output produced by a very small change in the input, represented by dt . We'll speak more about these “small changes” in more detail in just a moment.

For now, we are in an imaginary racetrack where rabbits and turtles race and moral lessons are taught through metaphor. We have a function with an input of t , the number of minutes elapsed since the start of the race, and an output of x , the distance of the hare along the racetrack. The rule we use to evaluate our function is the expression x(t)=t2+6t1 . The derivative of this function tells us the rate of change of the hare's position with respect to time and is the definition of instantaneous velocity. Just previously, we defined instantaneous velocity as the average velocity taken over smaller and smaller intervals, but this is essentially the same as the definition of the derivative. We just phrased it the first time using terminology specific to position and velocity.

When we calculate a derivative, we won't end up with a single number. Expecting the answer to “What is the velocity of the hare?” to be a single number makes sense only if the velocity is the same everywhere. In such a trivial case we don't need derivatives, we can just use average velocity. The interesting situation occurs when the velocity varies over time. When we calculate the derivative of a position function in such cases, we get a velocity function, which allows us to calculate the instantaneous velocity at any point in time.

The previous three paragraphs express the most important concepts in this section, so please allow us to repeat them.

A derivative measures a rate of change. Since velocity is the rate of change of position with respect to time, the derivative of the position function is the velocity function.

The next few sections discuss the mathematics of derivatives in a bit more detail, and we return to kinematics in Section 11.5. This material is aimed at those who have not had14 first-year calculus. If you already have a calculus background, you can safely skip ahead to Section 11.5 unless you feel in need of a refresher.

Section 11.4.2 lists several examples of derivatives to give you a better understanding of what it means to measure a rate of change, and also to back up our claim that the derivative has very broad applicability. Section 11.4.3 gives the formal mathematical definition of the derivative15 and shows how to use this definition to solve problems. We also finally figure out how fast that hare was moving at t=2.5 . Section 11.4.4 lists various commonly used alternate notations for derivatives, and finally, Section 11.4.5 lists just enough rules about derivatives to satisfy the very modest differential calculus demands of this book.

11.4.2Examples of Derivatives

Velocity may be the easiest introduction to the derivative, but it is by no means the only example. Let's look at some more examples to give you an idea of the wide array of problems to which the derivative is applied.

The simplest types of examples are to consider other quantities that vary with time. For example, if R(t) is the reading of a rain meter at a given time t , then the derivative, denoted R(t) , describes how hard it was raining at time t . Perhaps P(t) is the reading of a pressure valve on a tank containing some type of gas. Assuming the pressure reading is proportional to the mass of the gas inside the chamber,16 the rate of change P(t) indicates how fast gas is flowing into or out of the chamber attime t .

There are also physical examples for which the independent variable is not time. The prototypical case is a function y(x) that gives the height of some surface above a reference point at the horizontal position x . For example, perhaps x is the distance along our metaphorical racetrack and y measures the height at that point above or below the altitude at the starting point. The derivative y(x) of this function is the slope of the surface at x , where positive slopes mean the runners are running uphill, and negative values indicate a downhill portion of the race. This example is not really a new example, because we've looked at graphs of functions and considered how the derivative is a measure of the slope of the graph in 2D.

Now let's become a bit more abstract, but still keep a physical dimension as the independent variable. Let's say that for a popular rock-climbing wall, we know a function S(y) that describes, for a given height y , what percentage of rock climbers are able to reach that height or higher. If we assume the climbers start at y=0 , then S(0)=100% . Clearly S(y) is a nonincreasing function that eventually goes all the way down to 0%at some maximum height y max that nobody has ever reached.

Now consider the interpretation of derivative S(y) . Of course, S(y)0 , since S(y) is nonincreasing. A large negative value of S(y) is an indication that the height y is an area where climbers are likely to drop17 out. Perhaps the wall at that height is a challenging area. S(y) closer to zero is an indication that fewer climbers drop out at height y . Perhaps there is a plateau that climbers can reach, and there they rest. We might expect S(y) to decrease just after this plateau, since the climbers are more rested. In fact, S(y) might also become closer to zero just before the plateau, because as climbers begin to get close to this milestone, they push a bit harder and are more reluctant to give up.18

Figure 11.6Happiness versus salary

One last example. Figure 11.6 shows happiness as a function of salary. In this case, the derivative is essentially the same thing as what economists would call “marginal utility.” It's the ratio of additional units of happiness per additional unit of income. According this figure, the marginal utility of income decreases, which of course is the famous law of diminishing returns. According to our research,19 it even becomes negative after a certain point, where the troubles associated with high income begin to outweigh the psychological benefits. The economist-speak phrase “negative marginal utility” is translated into everyday language as “stop doing that.”

11.4.3Calculating Derivatives from the Definition

Now we're ready for the official20 definition of the derivative found in most math textbooks, and to see how we can compute derivatives using the definition. A derivative can be understood as the limiting value of Δx / Δt , the ratio of the change in output divided by the change in input, taken as we make Δt infinitesimally small. Let's repeat this description using mathematical notation. It's an equation we gave earlier in the chapter, only this time we put a big box around it, because that's what math books do to equations that are definitions.

The Definition of a Derivative
(11.3) dx dt =lim Δt0 Δx Δt =lim Δt0 x(t+Δt)x(t) Δt .

Here the notation for the derivative dx / dt is known as Leibniz's notation. The symbols dx and dt are known as infinitesimals. Unlike Δx and Δt , which are variables representing finite changes in value, dx and dt are symbols representing “an infinitesimally small change.” Why is it so important that we use a very small change? Why can't we just take the ratio Δx / Δt directly? Because the rate of change is varying continuously. Even within a very small interval of Δt=.0001 , it is not constant. This is why a limit argument is used, to make the interval as small as we can possibly make it—infinitesimally small.

In certain circumstances, infinitesimals may be manipulated like algebraic variables (and you can also attach units of measurement to them and carry out dimensional analysis to check your work). The fact that such manipulations are often correct is what gives Leibniz notation its intuitive appeal. However, because they are infinitely small values, they require special handling, similar to the symbol , and so should not be tossed around willy-nilly. For the most part, we interpret the notation dx dt not as a ratio of two variables, but as a single symbol that means “the derivative of x with respect to t .” This is the safest procedure and avoids any chance of the aforementioned willy-nilliness. We have more to say later on Leibniz and other notations, but first, let's finally calculate a derivative and answer the burning question: how fast was the hare traveling at t=2.5 ?

Differentiating a simple function by using the definition Equation (11.3) is an important rite of passage, and we are proud to help you cross this threshold. The typical procedure is this:

  1. Substitute x(t) and x(t+Δt) into the definition. (In our case, x(t)=t2+6t1 ).
  2. Perform algebraic manipulations until it is legal to substitute Δt=0 . (Often this boils down to getting Δt out of the denominator.)
  3. Substitute Δt=0 , which evaluates the expression “at the limit,” removing the limit notation.
  4. Simplify the result.

Applying this procedure to our case yields

v(t)= dx dt =lim Δt0 x(t+Δt)x(t) Δt =lim Δt0 [(t+Δt)2+6(t+Δt)1](t2+6t1) Δt =lim Δt0 (t22t(Δt)(Δt)2+6t+6(Δt)1)+(t26t+1) Δt =lim Δt0 2t(Δt)(Δt)2+6(Δt) Δt =lim Δt0 Δt (2tΔt+6) Δt (11.4)=lim Δt0 2tΔt+6 .

Now we are at step 3. Taking the limit in Equation (11.4) is now easy; we simply substitute Δt=0 . This substitution was not legal earlier because there was a Δt in the denominator:

v(t)= dx dt =lim Δt0 2tΔt+6 =2t(0)+6(11.5)=2t+6.
v(2.0)=2(2.0)+6=2.0 v(2.4)=2(2.4)+6=1.2 v(2.5)=2(2.5)+6=1.0
v(2.6)=2(2.6)+6=0.8 v(3.0)=2(3.0)+6=0.0
Figure 11.7The hare's velocity and corresponding tangent line at selected times

Finally! Equation (11.5) is the velocity function we've been looking for. It allows us to plug in any value of t and compute the instantaneous velocity of the hare at that time. Putting in t=2.5 , we arrive at the answer to our question:

v(t)=2t+6,v(2.5)=2(2.5)+6=1.

So the instantaneous velocity of the hare at t=2.5 was precisely 1 furlong per minute, just as our earlier arguments predicted. But now we can say it with confidence.

Figure 11.7 shows this point and several others along the interval we've been studying. For each point, we have calculated the instantaneous velocity at that point according to Equation (11.5) and have drawn the tangent line with the same slope.

It's very instructive to compare the graphs of position and velocity side by side. Figure 11.8 compares the position and velocity of our fabled racers.

Figure 11.8 Comparing position and velocity

There are several interesting observations to be made about Figure 11.8.

At this point, we should acknowledge a few ways in which our explanation of the derivative differs from most calculus textbooks. Our approach has been to focus on one specific example, that of instantaneous velocity. This has led to some cosmetic differences, such as notation. But there were also many finer points that we are glossing over. For example, we have not bothered defining continuous functions, or given rigorous definitions for when the derivative is defined and when it is not defined. We have discussed the idea behind what a limit is, but have not provided a formal definition or considered limits when approached from the left and right, and the criteria for the existence of a well-defined limit. We feel that leading off with the best intuitive example is always the optimum way to teach something, even if it means “lying” to the reader for a short while. If we were writing a calculus textbook, at this point we would back up and correct some of our lies, reviewing the finer points and giving more precise definitions.

However, since this is not a calculus textbook, we will only warn you that what we said above is the big picture, but isn't sufficient to handle many edge cases when functions do weird things like go off into infinity or exhibit “jumps” or “gaps.” Fortunately, such edge cases just don't happen too often for functions that model physical phenomena, and so these details won't become an issue for us in the context of physics.

We do have room, however, to mention alternate notations for the derivative that you are likely to encounter.

11.4.4Notations for the Derivative

Several different notations for derivatives are in common use. Let's point out some ways that other texts might look different from what we've said here. First of all, there is a trivial issue of naming. Most calculus textbooks define the derivative in very general terms, where the output variable is named y , the symbol x refers to the input variable rather than the output variable, and the function is simply named f . In other words, the function being differentiated is y=f(x) . Furthermore, many will assign the shrinking “step amount” to the variable h rather than using the Δ notation, which has advantages when solving the equations that result when you work out derivatives from the definition.22 With these variables, they would define the derivative as

Definition of a derivative using variables in most calculus textbooks
(11.6) dy dx =lim h0 y(x+h)y(x) h .

The differences between Equations (11.3) and (11.6) are clearly cosmetic.

A variation on the Leibniz notation we prefer in this book is to prefix an expression with d / dt to mean “the derivative with respect to t of this thing on the right.” For example

d dt (t2+5t)

can be read as “the derivative with respect to t of t2+5t .” This is a very descriptive and intuitive notation. If we call the expression on the right x , and interpret the juxtaposition of symbols as multiplication, we can pull the x back on top of the fraction to get our original notation, as in

d dt (t2+5t)= d dt x= dx dt .

It's important to interpret these manipulations as notational manipulations rather than having any real mathematical meaning. The notation is attractive because such algebraic manipulations with the infinitesimals often work out. But we reiterate our warning to avoid attaching much mathematical meaning to such operations.

Another common notation is to refer to the derivative of a function f(x) with a prime: f(x) . This is known as prime notation or Lagrange's

notation. It's used when the independent variable that we are differentiating with respect to is implied or understood by context. Using this notation we would define velocity as the derivative of the position function by v(t)=x(t) .

One last notation, which was invented by Newton and is used mostly when the independent variable is time (such as in the physics equations Newton invented), is dot notation. A derivative is indicated by putting a dot over the variable; for example, v(t)= x˙ (t) .

Here is a summary of the different notations for the derivative you will see, using velocity and position as the example:

v(t)= dx dt =d dt x(t)=x(t)= x˙ (t).

11.4.5A Few Differentiation Rules and Shortcuts

Now let's return to calculating derivatives. In practice, it's seldom necessary to go back to the definition of the derivative in order to differentiate an expression. Instead, there are simplifying rules that allow you to break down complicated functions into smaller pieces that can then be differentiated. There are also special functions, such as lnx and tanx , for which the hard work of applying the definition has already been done and written down in those tables that line the insides of the front and back covers of calculus books. To differentiate expressions containing such functions, one simply refers to the table (although we're going to do just a bit of this “hard work” ourselves for sine and cosine).

In this book, our concerns are limited to the derivatives of a very small set of functions, which luckily can be differentiated with just a few simple rules. Unfortunately, we don't have the space here to develop the mathematical derivations behind these rules, so we are simply going to accompany each rule with a brief explanation as to how it is used, and a (mathematically nonrigorous) intuitive argument to help you convince yourself that it works.

Our first rule, known as the constant rule, states that the derivative of a constant function is zero. A constant function is a function that always produces the same value. For example, x(t)=3 is a constant function. You can plug in any value of t , and this function outputs the value 3. Since, the derivative measures how fast the output of a function changes in response to changes in the input t , in the case of a constant function, the output never changes, and so the derivative is x(t)=0 .

The Constant Rule
d dt k=0,k is any constant.

The next rule, sometimes known as the sum rule, says that differentiation is a linear operator. The meaning of “linear” is essentially identical to our definition given in Chapter 5, but let's review it in the context of the derivative. To say that the derivative is a linear operator means two things. First, to take the derivative of a sum, we can just take the derivative of each piece individually, and add the results together. This is intuitive—the rate of change of a sum is the total rate of change of all the parts added together. For example, consider a man who moves about on a train. His position in world space can be described as the sum of the train's position, plus the man's position in the body space of the train.23 Likewise, his velocity relative to the ground is the sum of the train's velocity relative to the ground, plus his velocity relative to the train.

Derivative of a Sum
(11.7) d dt [f(t)+g(t)] = d dt f(t)+ d dt g(t).

The second property of linearity is that if we multiply a function by some constant, the derivative of that function gets scaled by that same constant. One easy way to see that this must be true is to consider unit conversions. Let's return to our favorite function that yields a hare's displacement as a function of time, measured in furlongs. Taking the derivative of this function with respect to time yields a velocity, in furlongs per minute. If somebody comes along who doesn't like furlongs, we can switch from furlongs to meters, by scaling the original position function by a factor of 201.168. This must scale the derivative by the same factor, or else the hare would suddenly change speed just because we switched to another unit.

Derivative of a Function Times a Constant
(11.8) d dt [kf(t)] =k [ d dt f(t)] ,k is any constant.

If we combine Equations (11.7) and (11.8), we can state the linearity rule in a more general way.

The Sum Rule
(11.4.5) d dt [af(t)+bg(t)] =a [ d dt f(t)] +b [ d dt g(t)] .

The linear property of the derivative is very important since it allows us to break down many common functions into smaller, easier pieces.

One of the most important and common functions that needs to be differentiated also happens to be the easiest: the polynomial. Using the linear property of the derivative, we can break down, for example, a fourth-degree polynomial with ease:

x(t)=c4t4+c3t3+c2t2+c1t+c0, dx dt = d dt [c4t4+c3t3+c2t2+c1t+c0](11.9)=c4 [ d dt t4] +c3 [ d dt t3] +c2 [ d dt t2] +c1 [ d dt t] + [ d dt c0] .

The last derivative d dt c0 is zero by the constant rule, since c0 does not vary. This leaves us with four simple derivatives, each of which can be plugged into the definition of a derivative, Equation (11.3), without too much trouble. Solving each of these four individually is considerably easier than plugging the original polynomial into Equation (11.3). If you do go through this exercise (like every first-year calculus student does), you notice two things. First of all, the algebraic tedium increases as the power of t gets higher. Second, a quite obvious pattern is revealed, known as the power rule.

The Power Rule
d dt tn=nt n1 ,n is an integer.

This rule gives us the answers to the four derivatives needed above:

d dt t4=4t3, d dt t3=3t2, d dt t2=2t1=2t, d dt t=1t0=1.

Notice in the last equation we used the identity t0=1 . However, even without that identity,24 it should be very clear that d dt t must be unity. Remember that the derivative answers the question, “What is the rate of change of the output, relative to the rate of change of the input?” In the case of d dt t , the “output” and the “input” are both the variable t , and so their rates of change are equal. Thus the ratio that defines the derivative is equal to one.

One last comment before we plug these results into Equation (11.9) to differentiate our polynomial. Using the identity t0=1 , the power rule is brought into harmony with the constant rule:

Derivative of a constant, using the power rule
d dt k= d dt (kt0) Using  t0=1,=k [ d dt t0] Linear property of derivative ,=k[0(t 1 )] Power rule for  n=0,=0.

Let's get back to our fourth-degree polynomial. With the sum and power rule at our disposal, we can make quick work of it:

x(t)=c4t4+c3t3+c2t2+c1t+c0, dx dt =4c4t3+3c3t2+2c2t+c1.

Below are several more examples of how the power rule can be used. Notice that the power rule works for negative exponents as well:

d dt (3t54t)=15t44, d dt (t 100 100+π) =t 99 , d dt (1t+4t3) = d dt (t 1 +4t 3 ) =t 2 12t 4 = 1 t212t4.

11.4.6Derivatives of Some Special Functions
with Taylor Series

This section looks at some very special examples of differentiating polynomials. Given any arbitrary function f(x) , the Taylor series of f is a way to express f as a polynomial. Each successive term in the polynomial is determined by taking a higher order derivative of the function, which is perhaps the main point of Taylor series that you should learn when you take a real calculus class, but right now we're not interested in where Taylor series come from, just that they exist. The Taylor series is a very useful tool in video games because it provides polynomial approximations, which are “easy” to evaluate in a computer, for functions that are otherwise “hard” to evaluate. We don't have the space to discuss much of anything about Taylor series in general, but we would like to look at a few important examples of Taylor series. The Taylor series for the sine and cosine functions are

Taylor series for sin(x) and cos(x)
sinx=x x3 3! + x5 5! x7 7! + x9 9! +,(11.10)cosx=1 x2 2! + x4 4! x6 6! + x8 8! +.

This pattern continues forever; in other words, to compute the exact value of sinx would require us to evaluate an infinite number of terms. However, notice that the denominators of the terms are growing very rapidly, which means we can approximate sinx simply by stopping after a certain number of terms, and ignore the rest.

This is exactly the process by which trigonometric functions are computed inside a computer. First, trig identities are used to get the argument into a restricted range (since the functions are periodic). This is done because when the Taylor series is truncated, its accuracy is highest near a particular value of x , and in the case of the trig functions, this point is usually chosen to be x=0 .25 Then the Taylor series polynomial with, say, four terms is evaluated. This approximation is highly accurate. Stopping at the x7 term is sufficient to calculate sinx to about five and a half decimal digits for 1<x<+1 .

All this trivia concerning approximations is interesting, but our real reason for bringing up Taylor series is to use them as nontrivial examples of differentiating polynomials with the power rule, and also to learn some interesting facts about the sine, cosine, and exponential functions. Let's use the power rule to differentiate the Taylor series expansion of sin(x) . It's not that complicated—we just have to differentiate each term by itself. We're not even intimidated by the fact that there are an infinite number of terms:

Differentiating Taylor series for sin(x)
d dx sinx= d dx (x x3 3! + x5 5! x7 7! + x9 9! +) = d dx x d dx x3 3! + d dx x5 5! d dx x7 7! + d dx x9 9! +(Sum rule)=1 3x2 3! + 5x4 4! 7x6 7! + 9x8 9! +(Power rule)(11.11)=1 x2 2! + x4 4! x6 6! + x8 8! +

In the above derivation, we first used the sum rule, which says that to differentiate the whole Taylor polynomial, we can differentiate each term individually. Then we applied the power rule to each term, in each case multiplying by the exponent and decrementing it by one. (And also remembering that d dx  x=1 for the first term.) To understand the last step, remember the definition of the factorial operator: n!=1×2×3××n . Thus the constant in the numerator of each term cancels out the highest factor in the factorial in the denominator.

Does Equation (11.11) the last look familiar? It should, because it's the same as Equation (11.10), the Taylor series for cosx . In other words, we now know the derivative of sinx , and by a similar process we can also obtain the derivative of cosx . Let's state these facts formally.26

Derivatives of Sine and Cosine
d dx sinx=cosx, d dx cosx=sinx.

The derivatives of the sine and cosine functions will become useful in later sections.

Now let's look at one more important special function that will play an important role later in this book, which will be convenient to be able to differentiate, and which also happens to have a nice, tidy Taylor series. The function we're referring to is the exponential function, denoted ex . The mathematical constant e2.718282 has many well known and interesting properties, and pops up in all sorts of problems from finance to signal processing. Much of e 's special status is related to the unique nature of the function ex . One manifestation of this unique nature is that ex has such a beautiful Taylor series:

Taylor series of ex
(11.12)ex=1+x+ x2 2! + x3 3! + x4 4! + x5 5! +

Taking the derivative gives us

d dx ex= d dx   (1+x+ x2 2! + x3 3! + x4 4! + x5 5! +) =0+1+ x 1! + x2 2! + x3 3! + x4 4! +=1+x+ x2 2! + x3 3! + x4 4! +

But this result is equivalent to the definition of ex in Equation (11.12); the only difference between them is the cosmetic issue of when to stop listing terms explicitly and end with the “ ”. In other words, the exponential function is its own derivative: d / dx ex=ex . The exponential function is the only function that can boast this unique property. (To be more precise, any multiple of the exponential function, including zero, has this quality.)

The Exponential Function Is Its Own Derivative
d dx ex=ex.

It is this special property about the exponential function that makes it unique and causes it to come up so frequently in applications. Anytime the rate of change of some value is proportionate to the value itself, the exponential function will almost certainly arise somewhere in the math that describes the dynamics of the system.

The example most of us are familiar with is compound interest. Let P(t) be the amount of money in your bank account at time t ; assume the amount is accruing interest. The rate of change per time interval—the amount of interest earned—is proportional to the amount of money in your account. The more money you have, the more interest you are earning, and the faster it grows. Thus, the exponential function works its way into finance with the equation P(t)=P0e rt , which describes the amount of money at any given time t , assuming an initial amount P0 grows at an interest rate of r , where the interest is compounded continually.

You might have noticed that the Taylor series of ex is strikingly similar to the series representation of sinx and cosx . This similarity hints at a deep and surprising relationship between the exponential functions and the trig functions, which we explore in Exercise 11.

We hope this brief encounter with Taylor series, although a bit outside of our main thrust, has sparked your interest in a mathematical tool that is highly practical, in particular for its fundamental importance to all sorts of approximation and numerical calculations in a computer. We also hope it was an interesting non-trivial example of differentiation of a polynomial. It also has given us a chance to discuss the derivatives of the sine, cosine, and exponential functions; these derivatives come up again in latersections.

11.4.7The Chain Rule

The chain rule is the last rule of differentiation we discuss here. The chain rule tells us how to determine the rate of change of a function when the argument to that function is itself some other function we know how to differentiate.

In the race between the tortoise and hare, we never really thought much about exactly what our function x(t) measured, we just said it was the “position” of the hare. Let's say that the course was actually a winding track with hills and bridges and even a vertical loop, and that the function that we graphed and previously named x(t) actually measures the linear distance along this winding path, rather than, say, a horizontal position. To avoid the horizontal connotations associated with the symbol x , let's introduce the variable s , which gives the distance along the track (in furlongs, of course).

Let's say that we have a function y(s) that describes the altitude of the track at a given distance. The derivative dy / ds tells us very basic things about the track at that location. A value of zero means the course is flat at that location, a positive value means the runners are running uphill, and a large positive or negative value indicates a location where the track is very steep.

Now consider the composite function y(s(t)) . You should be able to convince yourself that this tells us the hare's altitude for any given time t . The derivative dy / dt tells us how fast the hare was moving vertically, at a given time t . This is very different from dy / ds . How might we calculate dy / dt ? You might be tempted to say that to make this determination, we simply find out where the hare was on the track at time t , and then the answer is the slope of the track at this location. In math symbols, you are saying that the vertical velocity is y(s(t)) . But that isn't right. For example, while the hare was taking a nap ( ds / dt=0 ), it doesn't matter what the slope of the track was; since he wasn't moving along it, his vertical velocity is zero! In fact, at a certain point in the race he turned around and ran on the track in the wrong direction ( ds / dt<0 ), so his vertical velocity dy / dt would be opposite of the track slope dy / ds . And obviously if he sprints quickly over a place in the track, his vertical velocity will be higher than if he strolled slowly over that same spot. But likewise, where the track is flat, it doesn't matter how fast he runs across it, his vertical velocity will be zero. So we see that the hare's vertical velocity is the product of his speed (measured parametrically along the track) and the slope of the track at that point.

This rule is known as the chain rule. It is particularly intuitive when written in Leibniz notation, because the ds infinitesimals appear to “cancel.”

The Chain Rule of Differentiation
dy dt = dy ds ds dt .

Here are a few examples, using functions we now know how to differentiate:

Examples of the
chain rule
d dt sin3x=3cos3x,d dt sin(x2)=2xcos(x2),d dt e cosx+3x =(sinx+3)e cosx+3x ,d dt e sin3x+sin(x2) =(3cos3x+2xcos(x2))e sin3x+sin(x2) .

We're going to put calculus from a purely mathematical perspective on the shelf for a while and return our focus to kinematics. (After all, our purpose in discussing calculus was, like Ike Newton, to improve our understanding of mechanics.) However, it won't be long before we will return to calculus with the discussion of the integral and the fundamental theorem of calculus.

11.5Acceleration

We've made quite a fuss about the distinction between instantaneous velocity and average velocity, and this distinction is important (and the fuss is justified) when the velocity is changing continuously. In such situations, we might be interested to know the rate at which the velocity is changing. Luckily we have just learned about the derivative, whose raison d'être is to investigate rates of change. When we take the derivative of a velocity function v(t) we get a new function describing how quickly the velocity is increasing or decreasing at that instant. This instantaneous rate of change is an important quantity in physics, and it goes by a familiar name: acceleration.

In ordinary conversation, the verb “accelerate” typically means “speed up.” However, in physics, the word “acceleration” carries a more general meaning and may refer to any change in velocity, not just an increase in speed. In fact, a body can undergo an acceleration even when its speed is constant! How can this be? Velocity is a vector value, which means it has both magnitude and direction. If the direction of the velocity changes, but the magnitude (its speed) remains the same, we say that the body is experiencing an acceleration. Such terminology is not mere nitpicking with words, the acceleration in this case is a very real sensation that would be felt by, say, two people riding in the back seat of a swerving car who find themselves pressed together to one side. We have more to say about this particular situation in Section 11.8.

We can learn a lot about acceleration just by asking ourselves what sort of units we should use to measure it. For velocity, we used the generic units of L / T , unit length per unit time. Velocity is a rate of change of position ( L ) per unit time ( T ), and so this makes sense. Acceleration is the rate of change of velocity per unit time, and so it must be expressed in terms of “unit velocity per unit time.” In fact, the units used to measure velocity are L / T2 . If you are disturbed by the idea of “time squared,” think of it instead as (L / T) / T , which makes more explicit the fact that it is a unit of velocity (L / T) per unit time.

For example, an object in free fall near Earth's surface accelerates at a rate of about 32  ft / s 2 , or 9.8  m / s 2 . Let's say that you are dangling a metal bearing off the side of Willis Tower.27 You drop the bearing, and it begins accelerating, adding 9.8  m / s to its downward velocity each second. (We are ignoring wind resistance.) After, say, 2.4 seconds, its velocity will be

2.4  s ×32  ft s 2 =76.8  ft s .

More generally, the velocity at an arbitrary time t of an object under constant acceleration is given by the simple linear formula

(11.13)v(t)=v0+at,

where v0 is the initial velocity at time t=0 , and a is the constant acceleration. We study the motion of objects in free fall in more detail in Section 11.6, but first, let's look at a graphical representation of acceleration. Figure 11.9 shows plots of a position function and the corresponding velocity and acceleration functions.

Figure 11.9 Plots of position, velocity, and acceleration over time.

You should study Figure 11.9 until it makes sense to you. In particular, here are some noteworthy observations:

The accelerations experienced by an object can vary as a function of time, and indeed we can continue this process of differentiation, resulting in yet another function of time, which some people call the “jerk” function. We stick with the position function and its first two derivatives in this book. Furthermore, it's very instructive to consider situations in which the acceleration is constant (or at least has constant magnitude). This is precisely what we're going to do in the next few sections.

Section 11.6 considers objects under constant acceleration, such as objects in free fall and projectiles. This will provide an excellent backdrop to introduce the integral, the complement to the derivative, in Section 11.7. Then Section 11.8 examines objects traveling in a circular path, which experience an acceleration that has a constant magnitude but a direction that changes continually and always points towards the center of the circle.

11.6Motion under Constant Acceleration

Let's look now at the trajectory an object takes when it accelerates at a constant rate over time. This is a simple case, but a common one, and an important one to fully understand. In fact, the equations of motion we present in this section are some of the most important mechanics equations to know by heart, especially for video game programming.

Before we begin, let's consider an even simpler type of motion—motion with constant velocity. Motion with constant velocity is a special case of motion with constant acceleration—the case where the acceleration is constantly zero. The motion of a particle with constant velocity is an intuitive linear equation, essentially the same as Equation (9.1), the equation of a ray. In one dimension, the position of a particle as a function of time is

(11.14)x(t)=x0+vt,

where x0 is the position of the particle at time t=0 , and v is the constant velocity.

Now let's consider objects moving with constant acceleration. We've already mentioned at least one important example: when they are in free fall, accelerating due to gravity. (We'll ignore wind resistance and all other forces.) Motion in free fall is often called projectile motion. We start out in one dimension here to keep things simple. Our goal is a formula x(t) for the position of a particle at a given time.

Take our example of illegal ball-bearing-bombing off of Willis Tower. Let's set a reference frame where x increases in the downward direction, and x0=0 . In other words, x(t) measures the distance the object has fallen from its drop height at time t . We also assume for now that initial velocity is v0=0  ft / s , meaning you merely release the ball bearing and don't throw it.

At this point, we don't even know what form x(t) should take, so we're a bit stuck. The “front door” to this solution seems to be locked for us at the moment, so instead we try to sneak around and enter through the back, using an approach similar to the one we used earlier to define instantaneous velocity. We'll consider ways that we might approximate the answer and then watch what happens as the approximations get better and better.

6 Slices ,Δt=0.40t0v0Δx0.000.000.000.4012.805.120.8025.6010.241.2038.4015.361.6051.2020.482.0064.0025.60 Total 76.80 12 Slices ,Δt=0.20t0v0Δx0.000.000.000.206.401.280.4012.802.560.6019.203.840.8025.605.121.0032.006.401.2038.407.681.4044.808.961.6051.2010.241.8057.6011.522.0064.0012.802.2070.4014.08 Total 84.48 24 Slices ,Δt=0.10t0v0Δx0.000.000.000.103.200.320.206.400.640.309.600.960.4012.801.280.5016.001.600.6019.201.920.7022.402.240.8025.602.560.9028.802.881.0032.003.201.1035.203.521.2038.403.841.3041.604.161.4044.804.481.5048.004.801.6051.205.121.7054.405.441.8057.605.761.9060.806.082.0064.006.402.1067.206.722.2070.407.042.3073.607.36 Total 88.32
Table 11.3Values for different numbers of slices

Let's make our example a bit more specific. Earlier, we computed that after being in free fall for 2.4 seconds, the ball bearing would have a velocity of v(2.4)=76.8  ft / s . However, we didn't say anything about how far it had traveled during that time. Let's try to compute this distance, which is x(2.4) . To do this, we chop up the total 2.4 second interval into a number of smaller “slices” of time, and approximate how far the ball bearing travels during each slice. We can approximate the total distance traveled as the sum of the distances traveled during each slice. To approximate how far the ball bearing travels during one single slice, we first compute the velocity of the ball bearing at the start of the slice by using Equation (11.13). Then we approximate the distance traveled during the slice by plugging this velocity as the constant velocity for the slice into Equation (11.14).

Table 11.3 shows tabulated values for 6, 12, and 24 slices. For each slice, t0 refers to the starting time of the slice, v0 is the velocity at the start of the slice (computed according to Equation (11.13) as v0=t0×32  ft / s 2 ), Δt is the duration of the slice, and Δx is our approximation for the displacement during the slice (computed according to Equation (11.14) as Δx=v0Δt ).

Since each slice has a different initial velocity, we are accounting for the fact that the velocity changes over the entire interval. (In fact, the computation of the starting velocity for the slice is not an approximation—it is exact.) However, since we ignore the change in velocity within a slice, our answer is only an approximation. Taking more and more slices, we get better and better approximations, although it's difficult to tell to what value these approximations are converging. Let's look at the problem graphically to see if we can gain some insight.

In Figure 11.10, each rectangle represents one time interval in our approximation. Notice that the distance traveled during an interval is the same as the area of the corresponding rectangle:

( area of rectangle )=( width of rectangle )×( height of rectangle )=( duration of slice )×( velocity used for slice )=( displacement during slice ).
Figure 11.10 Graphical representation of Table 11.3

Now we come to the key observation. As we increase the number of slices, the total area of the rectangles becomes closer and closer to the area of the triangle under the velocity curve. In the limit, if we take an infinite number of rectangles, the two areas will be equal. Now, since total displacement of the falling ball bearing is equal to the total area of the rectangles, which is equal to the area under the curve, we are led to an important discovery.

The distance traveled is equal to the area under the velocity curve.

We have come to this conclusion by using a limit argument very similar to the one we made to define instantaneous velocity—we consider how a series of approximations converges in the limit as the approximation error goes to zero.

Notice that we have made no assumptions in this argument about v(t) . In the example at hand, it is a simple linear function, and the graph is a straight line; however, you should be able to convince yourself that this

procedure will work for any arbitrary velocity function.28 This limit argument is a formalized tool in calculus known as the Riemann integral, which we will consider in Section 11.7. That will also be the appropriate time to consider the general case of any v(t) . However, since there is so much we can learn from this specific example, let's keep it simple as long as possible.

Remember the question we're trying to answer: how far does an object travel after being dropped at an initial zero velocity and then accelerated due to gravity for 2.4 seconds at a constant rate of 32  ft / s 2 ? How does this new realization about the equivalence of distance traveled and the area under the graph of v(t) help us? In this special case, v(t) is a simple linear function, and the area under the curve from t=0 to t=2.4 is a triangle. That's an easy shape for us to compute an area. The base of this triangle has length 2.4  s , and the height is v(2.4)=76.8  ft / s , so the area is

base × height 2 = 2.4  s ×76.8  ft / s 2 =92.16  ft .

Thus after a mere 2.4 seconds, the ball bearing had already dropped more than 92 feet!

That solves the specific problem at hand, but let's be more general. Remember that the larger goal was a kinematic equation x(t) that predicts an object's position given any initial position and any initial velocity. First, let's replace the constant 2.4 with an arbitrary time t . Next, let's remove the assumption that the object initially has zero velocity, and instead allow an arbitrary initial velocity v0 . This means the area under the curve v(t) is no longer a triangle—it is a triangle on top of a rectangle, as shown in Figure 11.11.

Figure 11.11 Calculating displacement at time t , given initial velocity v0 and constant acceleration a

The rectangle has base t and height v0 , and its area represents the distance that would be traveled if there were no acceleration. The triangle on top of the rectangle also has base t , and the height is at , the difference in v(t) compared to the initial velocity as a result of the acceleration at the rate a over the duration of t seconds. Summing these two parts together yields the total displacement, which we denote as Δx :

Δx=(Area~of~rectangle)+(Area~of~triangle)= (Rectanglebase) (Rectangleheight) + 12 (Trianglebase) (Triangleheight) =(t)(v0)+(1 / 2)(t)(at)=v0t+(1 / 2)at2.

We have just derived a very useful equation, so let's highlight it so that people who are skimming will notice it.

Formula for Displacement Given Initial Velocity and Constant Acceleration
(11.15)Δx=v0t+(1 / 2)at2.

Equation (11.15) is one of only a handful of equations in this book that are worth memorizing. It is very useful for solving practical problems that arise in physics simulations.29

It's common that we only need the displacement Δx , and the absolute position x(t) doesn't matter. However, since the function x(t) was our stated goal, we can easily express x(t) in terms of Equation (11.15) by adding the displacement to our initial position, which we denote as x0 :

x(t)=x0+Δx=x0+v0t+(1 / 2)at2.

Let's work through some examples to show the types of problems that can be solved by using Equation (11.15) and its variants. One tempting scenario is to let our ball bearing hit the ground. The observation deck on the 103rd floor of Willis Tower is 1,353 ft above the sidewalk. If it is dropped from that height, how long will it take to fall to the bottom? Solving Equation (11.15) for t , we have

Solving for time
Δx=v0t+(1 / 2)at20=(a / 2)t2+v0tΔxt= v0±v024(a / 2)(Δx) 2(a / 2) (quadratic formula)(11.16)t= v0±v02+2aΔx a .

Equation (11.16) is a very useful general equation. Plugging in the numbers specific to this problem, we have

t= v0±v02+2aΔx a = (0)±(0)2+2(32  ft / s 2)(1353  ft ) 32  ft / s 2
=± 86592 ( ft / s )2 32  ft / s 2 ± 294.3  ft / s 32  ft / s 2 ±9.197  s .

The square root in Equation (11.16) introduces the possibility for two solutions. We always use the root that results in a positive value for t .30

Naturally, a person in the business of dropping ball bearings from great heights is interested in how much damage he can do, so the next logical question is, “How fast is the ball bearing traveling when it hits the sidewalk?” To answer this question, we plug the total travel time into Equation (11.13):

v(t)=v0+at=0  ft / s +(32  ft / s 2)(9.197  s )=294.3  ft / s .

If we ignore wind resistance, at the moment of impact, the ball bearing is traveling at a speed that covers a distance of roughly a football field in one second! You can see why the things we are doing in our imagination are illegal in real life. Let's keep doing them.

Now let's assume that instead of just dropping the ball bearing, we give it an initial velocity (we toss it up or down). It was our free choice to decide whether up or down is positive in these examples, and we have chosen +x to be the downward direction, so that means the initial velocity will be negative. What must the initial velocity be in order for the ball bearing to stay in the air only a few seconds longer, say a total of 12 seconds? Once again, we'll first manipulate Equation (11.15) to get a general solution; this time we'll be solving for v0 :

Solving for initial velocity
Δx=v0t+(1 / 2)at2,v0t=Δx+(1 / 2)at2,v0=Δx / t(1 / 2)at.

And now plugging in the numbers for our specific problem, we have

v0=Δx / t(1 / 2)at=(1353  ft ) / (12.0  s )(1 / 2)(32  ft / s 2)(12.0  s )=112.8  ft / s 192  ft / s =79.2  ft / s .

Notice that the result is negative, indicating an upwards velocity. If we give the ball bearing this initial velocity, we might wonder how long it takes for the bearing to come back down to its initial position. Using Equation (11.16) and letting Δx=0 , we have

t= v0±v02+2aΔx a = (79.2  ft / s )±(79.2  ft / s )2+2(32  ft / s 2)(0  ft ) 32  ft / s 2 = 79.2  ft / s ±(79.2  ft / s )2 32  ft / s 2 = 79.2  ft / s ±79.2  ft / s 32  ft / s 2 =0 or 4.95  s .

It's no surprise that t=0 is a solution; we were solving for the time values when the ball bearing was at its initial position.

Examine the graph in Figure 11.12, which plots the position and velocity of an object moving under constant velocity a with an initial velocity v0 , where v0 and a have opposite signs. Let's make three key observations. Although we use terms such as “height,” which are specific to projectile motion, similar statements are true anytime the signs of v0 and a are opposite.

Figure 11.12Projectile motion

The first observation is that the projectile reaches its maximum height, denoted x max , when the acceleration has consumed all of the velocity and v(t)=0 . It's easy to solve for the time when this will occur by using Equation (11.13), v(t)=v0+at :

Time to reach apex
v(t)=0,v0+at=0,t=v0 / a.

Right now we are in one dimension and considering only the height. But if we are in more than one dimension, only the velocity parallel to the acceleration must vanish. There could be horizontal velocity, for example. We discuss projectile motion in more than one dimension in just a moment.

The second observation is that the time it takes for the object to travel from its maximum altitude to its initial altitude, denoted te in Figure 11.12, is the same as the time taken to reach the maximum. In other words, the projectile reaches its apex at te / 2 .

The third and final observation is that the velocity at t=te , which we have denoted ve , has the same magnitude as the initial velocity v0 , but the opposite sign.

Before we look at projectile motion in more than one dimension, let's summarize the formulas we have derived in this section. The first two are the only ones worth memorizing; the others can be derived from them.

Summary of Kinematics Equations Dealing with Constant Acceleration
v(t)=v0+at,Δx=v0t+(1 / 2)at2,x(t)=x0+Δx=x0+v0t+(1 / 2)at2,v0=Δx / t(1 / 2)at,(11.17)t= v0±v02+2aΔx a ,a=2 Δxv0t t2 .

Extending the ideas from the previous section into 2D or 3D is mostly just a matter of switching to vector notation; x , v , and a become p , v , and a , respectively.31 Of course, the time t remains a scalar:

Equations for motion under constant acceleration, in
vector form
v (t)= v 0+t a ,(11.18)Δ p = v 0t+(t2 / 2) a ,(11.19) p (t)= p 0+Δ p = p 0+t v 0+(t2 / 2) a , v 0=Δ p / t(1 / 2)at, a =2 Δ p t v 0 t2 .

Note that we didn't make a vector version of Equation (11.17); we'll get to that in a moment.

This seemingly trivial change in notation is actually hiding two rather deep facts. First, in the algebraic sense, the vector notation is really just shorthand for sets of parallel scalar equations for x , y , and z . The important point is that the three (Cartesian) coordinates are completely independent of one another. For example, we can make calculations regarding y and completely ignore the other dimensions, provided that the hypothesis of constant acceleration is met for the object's motion. If it were not for the independence of the coordinates, we could not make this change in notation. The second fact hidden in this notation is that, when we view the vectors in the equations above as geometric rather than algebraic entities, the particular coordinate system used to describe those vectors is irrelevant. We don't even need to specify one. Of course, this is a basic principle of physics: Mother Nature doesn't know what coordinate system you are using.

We were able to leap from 1D to 3D mostly just by bolding a few letters due to the independence of the coordinates. However, there is a bit more to say about projectile motion in multiple dimensions because there are situations where we need to consider the effects of all the coordinates at the same time. One situation has already been alluded to by the lack of a vector equation corresponding to Equation (11.17). In other words, how could we solve for time t given a displacement Δ p , acceleration a , and initial velocity v 0 ? In one dimension, the projectile is “confined” and basically cannot help but hitting the target implied by Δx .32 But in two or more dimensions, the situation is more complicated. The increase in complexity that attends the increase in dimensions is analogous to computing the intersection of two rays (see Section A.8). In 2D, any two rays must intersect unless they are parallel, whereas in 3D, the possibility exists for skew rays, which are not parallel but do not intersect.

For example, earlier we computed how long it would take for a ball bearing dropped from a great height to hit the sidewalk below, which is a one-dimensional problem. The corresponding three-dimensional problem would be to try to drop the ball bearing into a bucket which is free to move around on the sidewalk. Let's say that the bucket is off to our left. Our initial velocity had better have some leftward component then, or else the ball bearing won't land in the bucket. Another indication that the multi-dimensional case is more complicated than 1D is that a direct translation of Equation (11.17) into vector form results in nonsensical operations of taking the square root of a vector and dividing one vector by another.

The key to solving this problem is to realize that any horizontal changes (either to the bucket's position or the initial velocity of the ball bearing) do not affect how long it takes the ball bearing to reach the sidewalk. This is because the coordinates are independent from one another. The horizontal velocity and acceleration do not interact with the vertical velocity and acceleration. To be specific, let's switch to our standard 3D coordinate system, which has +y pointing up and x and z in the horizontal plane. The time it takes the ball bearing to reach the altitude of the bucket depends only on the equations having to do with y ; the x - and z -coordinates can be ignored for this purpose.33 In other words, calculating the time when a projectile will reach a target is still a one-dimensional calculation—we just need to chose which direction to use. We can apply Equation (11.17) to solve for a time of impact t . But this solution is just a proposal. We know that if the projectile were to hit the target, it would do so at this time. To make sure we really did hit the target, we must plug this time of alleged impact into Equation (11.19) to see where the projectile will be at that location, and verify that the position of the projectile is within appropriate tolerances.

Let's talk a bit more about exactly what it means to “chose which direction to use,” as was stated in the previous paragraph. In cases of simple projectile motion, such as the ball-bearing example, where gravity is the constant acceleration, the direction to choose is obvious: use the direction of gravity. Furthermore, because coordinate systems are chosen such that “up” is one of the cardinal axes, the process of solving a one-dimensional problem in that direction is a trivial matter of plucking out the appropriate Cartesian coordinate and discarding the others. In general, however, the situation can be more complicated. But before we discuss the details of the general case, there are a few more things we can say about this very important and common special situation.

Figure 11.13Projectile motion

To study projectile motion where acceleration is solely due to gravity, which is a constant and acts along a cardinal axis, let's establish a 2D coordinate space where +y is up and x is the horizontal axis. Without loss of generality we can rotate our plane such that it contains the initial velocity, and thus the entire trajectory of the particle. We choose +x in the horizontal direction of the initial velocity. We also simplify things by setting the origin at the object's initial position. This notation (along with a few other items that we'll need in a moment) are illustrated in Figure 11.13.

Reviewing the notation in Figure 11.13, we see that we can express the position of the particle as a function of time either as p (t) , or we can refer to an individual coordinate with x(t) and y(t) . Instantaneous velocity (not shown on the diagram), can be denoted in vector form either as v (t) or using derivative notation as p˙ (t) . The scalar velocity components will be denoted using derivative notation as x˙ (t) and y˙ (t) . The initial position and velocity will be denoted by adding a subscript 0 ( y˙ 0 is the initial vertical velocity). We denote the acceleration due to gravity as either g or g .

Let's state the equations for velocity and position using the notation just described:

(11.20) p˙ (t)= v 0+t g , x˙ (t)= x˙ 0, y˙ (t)= y˙ 0+gt,(11.21) p (t)=t v 0+(t2 / 2) g ,x(t)=t x˙ 0,y(t)=t y˙ 0+(1 / 2)gt2.

The distances labeled h and d in Figure 11.13 are often of interest; they are the apex height and horizontal travel distance, respectively. As discussed earlier in a one-dimensional context, the maximum height is reached when all of the initial velocity in the upwards direction has been consumed by gravity, in other words when y˙ (t)=0 . This occurs at time

Time to reach apex
ta= y˙ 0 / g,

and at this time, the height is equal to

Altitude at apex
h=y(ta)=ta y˙ 0+(1 / 2)gta2=( y˙ 0 / g) y˙ 0+(1 / 2)g( y˙ 0 / g)2=( y˙ 02 / g)+(1 / 2)( y˙ 02 / g)= y˙ 02 / 2g.

We stated earlier that the time for the object to come back down to its initial height (which we denoted te ) was twice the time needed to reach its apex; however, at that time we merely appealed to a diagram. This time, let's verify it algebraically:

Time to return to
initial altitude.
y(t)=t y˙ 0+(1 / 2)gt2,0=te y˙ 0+(1 / 2)gte2,(initial position is at the origin)(1 / 2)gte2=te y˙ 0,te=2 y˙ 0 / g. (divide by  (1 / 2)gte )

As expected, the flight time te is twice the time needed to reach the apex. Now, let's compute d , the horizontal distance traveled:

Horizontal travel distance
d=x(te)=te x˙ 0=2 y˙ 0 x˙ 0 / g.

Of course, te and d are based on the assumption that we want to know when the projectile returns to its initial altitude. This is important when launching a projectile from a flat ground plane. If the projectile isn't launched from the ground, or if the ground isn't flat, then we'll need to consider where the parabola intersects the ground plane.

We often wish to specify the initial velocity in terms of an angle and speed, rather than velocities along each axes. In other words, we wish to use polar coordinates rather than Cartesian. As shown in Figure 11.13, we denote the initial launch speed as s0 (which is equal to the magnitude of v 0 ) and the launch angle as θ . Converting the initial velocity from Cartesian to polar coordinates (see Section 7.1.3 if you don't remember how), we get

x˙ 0=s0cosθ, y˙ 0=s0sinθ.

Plugging this into our kinematics Equations (11.20) and (11.21), we get the equations of motion for a projectile in terms of its launch angle and speed:

x˙ (t)=s0cosθ, y˙ (t)=s0sinθ+gt,x(t)=ts0cosθ,y(t)=ts0sinθ+(1 / 2)gt2.

We can also express te , h , and d in terms of s0 and θ :

Important quantities in projectile motion, expressed in terms of launch angle and speed
ta= y˙ 0 / g=(s0sinθ) / g=s0(sinθ) / g,te=2 y˙ 0 / g=2(s0sinθ) / g=2s0(sinθ) / g,d=2 y˙ 0 x˙ 0 / g=2(s0sinθ)(s0cosθ) / g=2s02(sinθ)(cosθ) / g,h=(1 / 2) y˙ 02 / g=(1 / 2)(s0sinθ)2 / g=s02(sin2θ) / 2g.

These equations are highly practical because they directly capture the relationship between the “user-friendly” quantities of launch speed, launch angle, flight time, and flight distance.

At this point, let's pause to make an interesting observation about the relationship between the initial speed s0 and the horizontal distance traveled d . It's a quadratic relationship, meaning when we increase s0 by a factor of k , we increase d by a factor of k2 . It might seem more natural for the relationship to be linear, meaning that d would increase by the same factor k . We can understand the quadratic relationship by breaking the initial velocity into its horizontal and vertical components, denoted earlier as x˙ 0 and y˙ 0 , respectively. It's not difficult to see that increasing x˙ 0 will increase d by the same factor. Less obvious is that the same is true for y˙ 0 . This is true because the duration that the object is airborne is proportional to y˙ 0 . So if we increase the vertical velocity, we give the object more time to travel. Thus any scale factor we apply to s will affect the distance twice, once as a result of the increased ground velocity due to x˙ 0 , and again as a result of the increased travel time due to y˙ 0 . This produces a quadratic relationship between s and d .

Now let's return to a question we put on hold from earlier: how might we determine the point of impact for any arbitrary vectors Δ p , a , and v 0 ? We said before that the key was to “choose a direction” and solve a one-dimensional problem in that direction. If a cardinal direction is chosen, we just throw out the other coordinates. For an arbitrary direction, we project the problem onto a line in that direction. Any component of displacement, velocity, or acceleration perpendicular to that line is discarded during the projection. We learned how to project onto a line and measure displacement in a particular direction by using the dot product in Section 2.11. All that is left is to select a direction.

Assuming the projectile hits the target, we will get the same value for t no matter what direction we choose. But that doesn't mean the choice is irrelevant. For example, in the ball-bearing example, it would be a disaster to chose the +x or +z directions, since there is no acceleration in either of those directions and application of Equation (11.17) would result in a division by zero. This suggests the strategy of simply using a itself as the direction of projection. To do this, we dot each vector quantity with a , making the substitutions Δx=Δ p a , v= v a , and a= a a . Then these scalar quantities can be plugged into Equation (11.17). Exercise 10 explores this in more detail.

11.7The Integral

We have just showed that the total displacement of an object in a time interval is equal to the area under the plot of the object's velocity. We used the example of constant acceleration, which has a simple graph, and the area was easy to solve geometrically. We did not pursue in further generality the limit argument that led us to the surprising equivalence, because this special case has such compelling applications. Now we are ready to discuss more general cases. The need to compute a “continuous summation,” where the rate of growth is a known function, is a common concept in engineering and science. The calculus tool used to compute these sums is the integral.

If you have already studied integral calculus and have a good intuition about what the integral is used for, then you can safely skip ahead to Section 11.8, when our focus returns to the subject of mechanics. However, if you've never had integral calculus or if your intuition about the integral is a bit shaky, keep reading.

There are two important ways of approaching the integral. The first way is essentially to make the notion of “summing up many tiny elements” a bit more precise and introduce some mathematical formalism. The other way is to compare the integral to the derivative. It's important to understand both interpretations. The integral is a bit more difficult to grasp than the derivative, but for reasons that become apparent later, it plays a much greater role in physics simulations and many other areas of video game programming. Understanding what the integral does is very important, even if the vast assortment of pen-and-paper techniques to compute integrals analytically is not very useful in our case, being replaced instead by techniques of numerical integration.

Let's turn our informal summation into mathematics notation, in which we compute the area under the curve f(x) in the interval axb . We partition this interval into n slices, each having the width Δx=(ba) / n . The i th rectangle will have a left-hand coordinate xi , a height equal to f(xi) , and an area of f(xi)Δx . Using summation notation, we add up all these rectangles: