Calculus

Benjamin Crowell

This book's web page is lightandmatter.com/calc. This is my attempt to make a version of the book for handheld e-book readers, despite what is, as of 2011, their poor support for math.

1. Rates of Change

2. To infinity --- and beyond!

3. Limits and continuity

4. Integration

5. Techniques

6. Improper integrals

7. Sequences and Series

8. Complex number techniques

9. Iterated integrals

(c) 2014 Benjamin Crowell, CC-BY-SA license. File generated 2014-4-14.

Chapter 1. Rates of Change

1.1 Change in discrete steps

Toward the end of the eighteenth century, a German elementary school teacher decided to keep his pupils busy by assigning them a long, boring arithmetic problem: to add up all the numbers from one to a hundred.1 The children set to work on their slates, and the teacher lit his pipe, confident of a long break. But almost immediately, a boy named Carl Friedrich Gauss brought up his answer: 5,050.

a / Adding the numbers from 1 to 7.

b / A trick for finding the sum.

Figure a suggests one way of solving this type of problem. The filled-in columns of the graph represent the numbers from 1 to 7, and adding them up means finding the area of the shaded region. Roughly half the square is shaded in, so if we want only an approximate solution, we can simply calculate 7^2/2=24.5.

But, as suggested in figure b, it's not much more work to get an exact result. There are seven sawteeth sticking out out above the diagonal, with a total area of 7/2, so the total shaded area is (7^2+7)/2=28. In general, the sum of the first n numbers will be (n^2+n)/2, which explains Gauss's result: (100^2+100)/2=5,050.

c / Carl Friedrich Gauss (1777-1855), a long time after graduating from elementary school.

Two sides of the same coin

Problems like this come up frequently. Imagine that each household in a certain small town sends a total of one ton of garbage to the dump every year. Over time, the garbage accumulates in the dump, taking up more and more space. Let's label the years as n=1, 2, 3,…, and let the function^2 x(n) represent the amount of garbage that has accumulated by the end of year n. If the population is constant, say 13 households, then garbage accumulates at a constant rate, and we have x(n)=13n.

But maybe the town's population is growing. If the population starts out as 1 household in year 1, and then grows to 2 in year 2, and so on, then we have the same kind of problem that the young Gauss solved. After 100 years, the accumulated amount of garbage will be 5,050 tons. The pile of refuse grows more quickly every year; the rate of change of x is not constant. Tabulating the examples we've done so far, we have this:

rate of change

accumulated result

13

13n

n

(n^2 + n) / 2

The rate of change of the function x can be notated as x·. Given the function x·, we can always determine the function x for any value of n by doing a running sum.

Likewise, if we know x, we can determine x· by subtraction. In the example where x=13n, we can find x·=x(n)-x(n-1)=13n-13(n-1)=13. Or if we knew that the accumulated amount of garbage was given by (n^2+n)/2, we could calculate the town's population like this:

d / x· is the slope of x.

The graphical interpretation of this is shown in figure d: on a graph of x=(n^2+n)/2, the slope of the line connecting two successive points is the value of the function x·.

In other words, the functions x and x· are like different sides of the same coin. If you know one, you can find the other --- with two caveats.

First, we've been assuming implicitly that the function x starts out at x(0)=0. That might not be true in general. For instance, if we're adding water to a reservoir over a certain period of time, the reservoir probably didn't start out completely empty. Thus, if we know x·, we can't find out everything about x without some further information: the starting value of x. If someone tells you x·=13, you can't conclude x=13n, but only x=13n+c, where c is some constant. There's no such ambiguity if you're going the opposite way, from x to x·. Even if x(0)≠ 0, we still have x·=13n+c-[13(n-1)+c]=13.

Second, it may be difficult, or even impossible, to find a formula for the answer when we want to determine the running sum x given a formula for the rate of change x·. Gauss had a flash of insight that led him to the result (n^2+n)/2, but in general we might only be able to use a computer spreadsheet to calculate a number for the running sum, rather than an equation that would be valid for all values of n.

Some guesses

Even though we lack Gauss's genius, we can recognize certain patterns. One pattern is that if x· is a function that gets bigger and bigger, it seems like x will be a function that grows even faster than x·. In the example of x·=n and x=(n^2+n)/2, consider what happens for a large value of n, like 100. At this value of n, x·=100, which is pretty big, but even without pawing around for a calculator, we know that x is going to turn out really really big. Since n is large, n^2 is quite a bit bigger than n, so roughly speaking, we can approximate x≈ n^2/2=5,000. 100 may be a big number, but 5,000 is a lot bigger. Continuing in this way, for n=1000 we have x·=1000, but x≈ 500,000 --- now x has far outstripped x·. This can be a fun game to play with a calculator: look at which functions grow the fastest. For instance, your calculator might have an x^2 button, an ex button, and a button for x! (the factorial function, defined as x!=1⋅ 2⋅…⋅ x, e.g., 4!=1 ⋅ 2 ⋅ 3 ⋅ 4=24). You'll find that 50^2 is pretty big, but e^50 is incomparably greater, and 50! is so big that it causes an error.

All the x and x· functions we've seen so far have been polynomials. If x is a polynomial, then of course we can find a polynomial for x· as well, because if x is a polynomial, then x(n)-x(n-1) will be one too. It also looks like every polynomial we could choose for x· might also correspond to an x that's a polynomial. And not only that, but it looks as though there's a pattern in the power of n. Suppose x is a polynomial, and the highest power of n it contains is a certain number --- the “order” of the polynomial. Then x· is a polynomial of that order minus one. Again, it's fairly easy to prove this going one way, passing from x to x·, but more difficult to prove the opposite relationship: that if x· is a polynomial of a certain order, then x must be a polynomial with an order that's greater by one.

We'd imagine, then, that the running sum of x·=n^2 would be a polynomial of order 3. If we calculate x(100)=1^2+2^2+…+100^2 on a computer spreadsheet, we get 338,350, which looks suspiciously close to 1,000,000/3. It looks like x(n)=n^3/3+…, where the dots represent terms involving lower powers of n such as n^2. The fact that the coefficient of the n^3 term is 1/3 is proved in problem 21 on p. 23.

e / A pyramid with a volume of 1^2+2^2+3^2.

Example 1

Figure e shows a pyramid consisting of a single cubical block on top, supported by a 2× 2 layer, supported in turn by a 3× 3 layer. The total volume is 1^2+2^2+3^2, in units of the volume of a single block.

Generalizing to the sum x(n)=1^2+2^2+…+n^2, and applying the result of the preceding paragraph, we find that the volume of such a pyramid is approximately (1/3)Ah, where A=n^2 is the area of the base and h=n is the height.

When n is very large, we can get as good an approximation as we like to a smooth-sided pyramid, and the error incurred in x(n)≈ (1/3)n^3+… by omitting the lower-order terms … can be made as small as desired.

We therefore conclude that the volume is exactly (1/3)Ah for a smooth-sided pyramid with these proportions.

This is a special case of a theorem first proved by Euclid (propositions XII-6 and XII-7) two thousand years before calculus was invented.

1.2 Continuous change

f / Isaac Newton (1643-1727)

Did you notice that I sneaked something past you in the example of water filling up a reservoir? The x and x· functions I've been using as examples have all been functions defined on the integers, so they represent change that happens in discrete steps, but the flow of water into a reservoir is smooth and continuous. Or is it? Water is made out of molecules, after all. It's just that water molecules are so small that we don't notice them as individuals. Figure g shows a graph that is discrete, but almost appears continuous because the scale has been chosen so that the points blend together visually.

g / On this scale, the graph of (n^2+n)/2 appears almost continuous.

The physicist Isaac Newton started thinking along these lines in the 1660's, and figured out ways of analyzing x and x· functions that were truly continuous. The notation x· is due to him (and he only used it for continuous functions). Because he was dealing with the continuous flow of change, he called his new set of mathematical techniques the method of fluxions, but nowadays it's known as the calculus.

h / The function x(t)=t^2/2, and its tangent line at the point (1,1/2).

Newton was a physicist, and he needed to invent the calculus as part of his study of how objects move. If an object is moving in one dimension, we can specify its position with a variable x, and x will then be a function of time, t. The rate of change of its position, x·, is its speed, or velocity. Earlier experiments by Galileo had established that when a ball rolled down a slope, its position was proportional to t^2, so Newton inferred that a graph like figure h would be typical for any object moving under the influence of a constant force. (It could be 7t^2, or t^2/42, or anything else proportional to t^2, depending on the force acting on the object and the object's mass.)

Because the functions are continuous, not discrete, we can no longer define the relationship between x and x· by saying x is a running sum of x·'s, or that x· is the difference between two successive x's. But we already found a geometrical relationship between the two functions in the discrete case, and that can serve as our definition for the continuous case: x is the area under the graph of x·, or, if you like, x· is the slope of the graph of x. For now we'll concentrate on the slope idea.

i / This line isn't a tangent line: it crosses the graph.

This definition is still a little vague, because we haven't defined what we mean by the “slope” of a curving graph. For a discrete graph like figure d, we could define it as the slope of the line drawn between neighboring points. Visually, it's clear that the continuous version of this is something like the line drawn in figure h. This is referred to as the tangent line.

We still need to convert this intuitive idea of a tangent line into a formal definition. In a typical example like figure h, the tangent line can be defined as the line that touches the graph at a certain point, but, unlike the line in figure i, doesn't cut across the graph at that point.3 By measuring with a ruler on figure h, we find that the slope is very close to 1, so evidently x·(1)=1. To prove this, we construct the function representing the line: ℓ(t)=t-1/2. We want to prove that this line doesn't cross the graph of x(t)=t^2/2. The difference between the two functions, x-ℓ, is the polynomial t^2/2-t+1/2, and this polynomial will be zero for any value of t where the line touches or crosses the curve. We can use the quadratic formula to find these points, and the result is that there is only one of them, which is t=1. Since x-ℓ is positive for at least some points to the left and right of t=1, and it only equals zero at t=1, it must never be negative, which means that the line always lies below the curve, never crossing it.

A derivative

That proves that x·(1)=1, but it was a lot of work, and we don't want to do that much work to evaluate x· at every value of t. There's a way to avoid all that, and find a formula for x·. Compare figures h and j. They're both graphs of the same function, and they both look the same. What's different? The only difference is the scales: in figure j, the t axis has been shrunk by a factor of 2, and the x axis by a factor of 4. The graph looks the same, because doubling t quadruples t^2/2. The tangent line here is the tangent line at t=2, not t=1, and although it looks like the same line as the one in figure h, it isn't, because the scales are different. The line in figure h had a slope of rise/run=1/1=1, but this one's slope is 4/2=2. That means x·(2)=2. In general, this scaling argument shows that x·(t)=t for any t.

j / The function t^2/2 again. How is this different from figure h?

This is called differentiating: finding a formula for the function x·, given a formula for the function x. The term comes from the idea that for a discrete function, the slope is the difference between two successive values of the function. The function x· is referred to as the derivative of the function x, and the art of differentiating is differential calculus. The opposite process, computing a formula for x when given x·, is called integrating, and makes up the field of integral calculus; this terminology is based on the idea that computing a running sum is like putting together (integrating) many little pieces.

Note the similarity between this result for continuous functions,

and our earlier result for discrete ones,

The similarity is no coincidence. A continuous function is just a smoothed-out version of a discrete one. For instance, the continuous version of the staircase function shown in figure b on page 7 would simply be a triangle without the saw teeth sticking out; the area of those ugly sawteeth is what's represented by the n/2 term in the discrete result x=(n^2+n)/2, which is the only thing that makes it different from the continuous result x=t^2/2.

Properties of the derivative

It follows immediately from the definition of the derivative that multiplying a function by a constant multiplies its derivative by the same constant, so for example since we know that the derivative of t^2/2 is t, we can immediately tell that the derivative of t^2 is 2t, and the derivative of t^2/17 is 2t/17.

Also, if we add two functions, their derivatives add. To give a good example of this, we need to have another function that we can differentiate, one that isn't just some multiple of t^2. An easy one is t: the derivative of t is 1, since the graph of x=t is a line with a slope of 1, and the tangent line lies right on top of the original line.

Example 2

The derivative of 5t^2+2t is the derivative of 5t^2 plus the derivative of 2t, since derivatives add. The derivative of 5t^2 is 5 times the derivative of t^2, and the derivative of 2t is 2 times the derivative of t, so putting everything together, we find that the derivative of 5t^2+2t is (5)(2t)+(2)(1)=10t+2.

The derivative of a constant is zero, since a constant function's graph is a horizontal line, with a slope of zero. We now know enough to differentiate any second-order polynomial.

Example 3

◊ An insect pest from the United States is inadvertently released in a village in rural China. The pests spread outward at a rate of s kilometers per year, forming a widening circle of contagion. Find the number of square kilometers per year that become newly infested. Check that the units of the result make sense. Interpret the result.

◊ Let t be the time, in years, since the pest was introduced. The radius of the circle is r=st, and its area is a=π r^2=π(st)2. To make this look like a polynomial, we have to rewrite it as a=(π s^2)t^2. The derivative is

The units of s are km/year, so squaring it gives km^2/year^2. The 2 and the π are unitless, and multiplying by t gives units of km^2/year, which is what we expect for a·, since it represents the number of square kilometers per year that become infested.

Interpreting the result, we notice a couple of things. First, the rate of infestation isn't constant; it's proportional to t, so people might not pay so much attention at first, but later on the effort required to combat the problem will grow more and more quickly. Second, we notice that the result is proportional to s^2. This suggests that anything that could be done to reduce s would be very helpful. For instance, a measure that cut s in half would reduce a· by a factor of four.

Higher-order polynomials

So far, we have the following results for polynomials up to order 2:

function

derivative

1

0

t

1

t^2

2t

Interpreting 1 as t^0, we detect what seems to be a general rule, which is that the derivative of tk is ktk-1. The proof is straightforward but not very illuminating if carried out with the methods developed in this chapter, so I've relegated it to page 140. It can be proved much more easily using the methods of chapter 2.

Example 4

◊ If x=2t^7-4t+1, find x·.

◊ This is similar to example 2, the only difference being that we can now handle higher powers of t. The derivative of t^7 is 7t^6, so we have

Example 5

◊ Calculate 3-1 and 3.01-1. Does this seem consistent with a conjecture that the rule for differentiating tk holds for k<0?

◊ We have 3-1≈ 0.33333 and 3.01-1≈ 0.332223, the difference being -1.1× 10-3. This suggests that the graph of x=1/t has a tangent line at t=3 with a slope of about

If the rule for differentiating tk were to hold, then we would have x·=-t^{-2}, and evaluating this at x=3 would give -1/9, which is indeed about -0.11. Yes, the rule does appear to hold for negative k, although this numerical check does not constitute a proof. A proof is given in example 10 on p. 27.

The second derivative

I described how Galileo and Newton found that an object subject to an external force, starting from rest, would have a velocity x· that was proportional to t, and a position x that varied like t^2. The proportionality constant for the velocity is called the acceleration, a, so that x·=at and x=at^2/2. For example, a sports car accelerating from a stop sign would have a large acceleration, and its velocity at at a given time would therefore be a large number. The acceleration can be thought of as the derivative of the derivative of x, written x¨, with two dots. In our example, x¨=a. In general, the acceleration doesn't need to be constant. For example, the sports car will eventually have to stop accelerating, perhaps because the backward force of air friction becomes as great as the force pushing it forward. The total force acting on the car would then be zero, and the car would continue in motion at a constant speed.

Example 6

Suppose the pilot of a blimp has just turned on the motor that runs its propeller, and the propeller is spinning up. The resulting force on the blimp is therefore increasing steadily, and let's say that this causes the blimp to have an acceleration x¨=3t, which increases steadily with time. We want to find the blimp's velocity and position as functions of time.

For the velocity, we need a polynomial whose derivative is 3t. We know that the derivative of t^2 is 2t, so we need to use a function that's bigger by a factor of 3/2: x·=(3/2)t^2. In fact, we could add any constant to this, and make it x·=(3/2)t^2+14, for example, where the 14 would represent the blimp's initial velocity. But since the blimp has been sitting dead in the air until the motor started working, we can assume the initial velocity was zero. Remember, any time you're working backwards like this to find a function whose derivative is some other function (integrating, in other words), there is the possibility of adding on a constant like this.

Finally, for the position, we need something whose derivative is (3/2)t^2. The derivative of t^3 would be 3t^2, so we need something half as big as this: x=t^3/2.

k / The functions 2t, t^2 and 7t^2.

The second derivative can be interpreted as a measure of the curvature of the graph, as shown in figure k. The graph of the function x=2t is a line, with no curvature. Its first derivative is 2, and its second derivative is zero. The function t^2 has a second derivative of 2, and the more tightly curved function 7t^2 has a bigger second derivative, 14.

l / The functions t^2 and 3-t^2.

Positive and negative signs of the second derivative indicate concavity. In figure l, the function t^2 is like a cup with its mouth pointing up. We say that it's “concave up,” and this corresponds to its positive second derivative. The function 3-t^2, with a second derivative less than zero, is concave down. Another way of saying it is that if you're driving along a road shaped like t^2, going in the direction of increasing t, then your steering wheel is turned to the left, whereas on a road shaped like 3-t^2 it's turned to the right.

m / The functions t^3 has an inflection point at t=0.

Figure m shows a third possibility. The function t^3 has a derivative 3t^2, which equals zero at t=0. This called a point of inflection. The concavity of the graph is down on the left, up on the right. The inflection point is where it switches from one concavity to the other. In the alternative description in terms of the steering wheel, the inflection point is where your steering wheel is crossing from left to right.

1.3 Applications

Maxima and minima

When a function goes up and then smoothly turns around and comes back down again, it has zero slope at the top. A place where x·=0, then, could represent a place where x was at a maximum. On the other hand, it could be concave up, in which case we'd have a minimum. The term extremum refers to either a maximum or a minimum.

Example 7

◊ Fred receives a mysterious e-mail tip telling him that his investment in a certain stock will have a value given by x=-2t^4+(6.4577×10^10)t, where t>= 2005 is the year. Should he sell at some point? If so, when?

◊ If the value reaches a maximum at some time, then the derivative should be zero then. Taking the derivative and setting it equal to zero, we have

Obviously the solution at t=-2006.0 is bogus, since the stock market didn't exist four thousand years ago, and the tip only claimed the function would be valid for t>= 2005.

Should Fred sell on New Year's eve of 2006?

But this could be a maximum, a minimum, or an inflection point. Fred definitely does not want to sell at t=2006 if it's a minimum! To check which of the three possibilities hold, Fred takes the second derivative:

Plugging in t=2006.0, we find that the second derivative is negative at that time, so it is indeed a maximum.

Implicit in this whole discussion was the assumption that the maximum or minimum occurred where the function was smooth. There are some other possibilities.

In figure n, the function's minimum occurs at an end-point of its domain.

n / The function x=√ t has a minimum at t=0, which is not a place where x·=0. This point is the edge of the function's domain.

o / The function x=|t| has a minimum at t=0, which is not a place where x·=0. This is a point where the function isn't differentiable.

Another possibility is that the function can have a minimum or maximum at some point where its derivative isn't well defined. Figure o shows such a situation. There is a kink in the function at t=0, so a wide variety of lines could be placed through the graph there, all with different slopes and all staying on one side of the graph. There is no uniquely defined tangent line, so the derivative is undefined.

Example 8

◊ Rancher Rick has a length of cyclone fence L with which to enclose a rectangular pasture. Show that he can enclose the greatest possible area by forming a square with sides of length L/4.

◊ If the width and length of the rectangle are t and u, and Rick is going to use up all his fencing material, then the perimeter of the rectangle, 2t+2u, equals L, so for a given width, t, the length is u=L/2-t. The area is a=tu=t(L/2-t). The function only means anything realistic for 0≤ t≤ L/2, since for values of t outside this region either the width or the height of the rectangle would be negative. The function a(t) could therefore have a maximum either at a place where a·=0, or at the endpoints of the function's domain. We can eliminate the latter possibility, because the area is zero at the endpoints.

To evaluate the derivative, we first need to reexpress a as a polynomial:

The derivative is

Setting this equal to zero, we find t=L/4, as claimed. This is a maximum, not a minimum or an inflection point, because the second derivative is the constant a¨=-2, which is negative for all t, including t=L/4.

Propagation of errors

The Women's National Basketball Association says that balls used in its games should have a radius of 11.6 cm, with an allowable range of error of plus or minus 0.1 cm (one millimeter). How accurately can we determine the ball's volume?

p / How accurately can we determine the ball's volume?

The equation for the volume of a sphere gives V=(4/3)π r^3=6538 cm^3 (about six and a half liters). We have a function V(r), and we want to know how much of an effect will be produced on the function's output V if its input r is changed by a certain small amount. Since the amount by which r can be changed is small compared to r, it's reasonable to take the tangent line as an approximation to the actual graph. The slope of the tangent line is the derivative of V, which is 4π r^2. (This is the ball's surface area.) Setting (slope)=(rise)/(run) and solving for the rise, which represents the change in V, we find that it could be off by as much as (4π r^2)(0.1 cm)=170 cm^3. The volume of the ball can therefore be expressed as 6500± 170 cm^3, where the original figure of 6538 has been rounded off to the nearest hundred in order to avoid creating the impression that the 3 and the 8 actually mean anything --- they clearly don't, since the possible error is out in the hundreds' place.

This calculation is an example of a very common situation that occurs in the sciences, and even in everyday life, in which we base a calculation on a number that has some range of uncertainty in it, causing a corresponding range of uncertainty in the final result. This is called propagation of errors. The idea is that the derivative expresses how sensitive the function's output is to its input.

The example of the basketball could also have been handled without calculus, simply by recalculating the volume using a radius that was raised from 11.6 to 11.7 cm, and finding the difference between the two volumes. Understanding it in terms of calculus, however, gives us a different way of getting at the same ideas, and often allows us to understand more deeply what's going on. For example, we noticed in passing that the derivative of the volume was simply the surface area of the ball, which provides a nice geometric visualization. We can imagine inflating the ball so that its radius is increased by a millimeter. The amount of added volume equals the surface area of the ball multiplied by one millimeter, just as the amount of volume added to the world's oceans by global warming equals the oceans' surface area multiplied by the added depth.

For an example of an insight that we would have missed if we hadn't applied calculus, consider how much error is incurred in the measurement of the width of a book if the ruler is placed on the book at a slightly incorrect angle, so that it doesn't form an angle of exactly 90 degrees with spine. The measurement has its minimum (and correct) value if the ruler is placed at exactly 90 degrees. Since the function has a minimum at this angle, its derivative is zero. That means that we expect essentially no error in the measurement if the ruler's angle is just a tiny bit off. This gives us the insight that it's not worth fiddling excessively over the angle in this measurement. Other sources of error will be more important. For example, is the book a uniform rectangle? Are we using the worn end of the ruler as its zero, rather than letting the ruler hang over both sides of the book and subtracting the two measurements?

Homework Problems

1. Graph the function t^2 in the neighborhood of t=3, draw a tangent line, and use its slope to verify that the derivative equals 2t at this point. (solution in the pdf version of the book)

2. Graph the function sin et in the neighborhood of t=0, draw a tangent line, and use its slope to estimate the derivative. Answer: 0.5403023058. (You will of course not get an answer this precise using this technique.) (solution in the pdf version of the book)

3. Differentiate the following functions with respect to t: 1, 7, t, 7t, t^2, 7t^2, t^3, 7t^3. (solution in the pdf version of the book)

4. Differentiate 3t^7-4t^2+6 with respect to t. (solution in the pdf version of the book)

5. Differentiate at^2+bt+c with respect to t. [Thompson, 1919] (solution in the pdf version of the book)

6. Find two different functions whose derivatives are the constant 3, and give a geometrical interpretation. (solution in the pdf version of the book)

7. Find a function x whose derivative is x·=t^7. In other words, integrate the given function. (solution in the pdf version of the book)

8. Find a function x whose derivative is x·=3t^7. In other words, integrate the given function. (solution in the pdf version of the book)

9. Find a function x whose derivative is x·=3t^7-4t^2+6. In other words, integrate the given function. (solution in the pdf version of the book)

10. Let t be the time that has elapsed since the Big Bang. In that time, one would imagine that light, traveling at speed c, has been able to travel a maximum distance ct. (In fact the distance is several times more than this, because according to Einstein's theory of general relativity, space itself has been expanding while the ray of light was in transit.) The portion of the universe that we can observe would then be a sphere of radius ct, with volume v=(4/3)π r^3=(4/3)π(ct)3. Compute the rate v· at which the volume of the observable universe is increasing, and check that your answer has the right units, as in example 3 on page 14. (solution in the pdf version of the book)

11. Kinetic energy is a measure of an object's quantity of motion; when you buy gasoline, the energy you're paying for will be converted into the car's kinetic energy (actually only some of it, since the engine isn't perfectly efficient). The kinetic energy of an object with mass m and velocity v is given by K=(1/2)mv^2. For a car accelerating at a steady rate, with v=at, find the rate K· at which the engine is required to put out kinetic energy. K·, with units of energy over time, is known as the power. Check that your answer has the right units, as in example 3 on page 14. (solution in the pdf version of the book)

12. A metal square expands and contracts with temperature, the lengths of its sides varying according to the equation ℓ=(1+α T)ℓo. Find the rate of change of its surface area a with respect to temperature. That is, find a·, where the variable with respect to which you're differentiating is the temperature, T. Check that your answer has the right units, as in example 3 on page 14. (solution in the pdf version of the book)

13. Find the second derivative of 2t^3-t. (solution in the pdf version of the book)

14. Locate any points of inflection of the function t^3+t^2. Verify by graphing that the concavity of the function reverses itself at this point. (solution in the pdf version of the book)

15. Let's see if the rule that the derivative of tk is ktk-1 also works for k<0. Use a graph to test one particular case, choosing one particular negative value of k, and one particular value of t. If it works, what does that tell you about the rule? If it doesn't work? (solution in the pdf version of the book)

16. Two atoms will interact via electrical forces between their protons and electrons. To put them at a distance r from one another (measured from nucleus to nucleus), a certain amount of energy E is required, and the minimum energy occurs when the atoms are in equilibrium, forming a molecule. Often a fairly good approximation to the energy is the Lennard-Jones expression

where k and a are constants. Note that, as proved in chapter 2, the rule that the derivative of tk is ktk-1 also works for k<0. Show that there is an equilibrium at r=a. Verify (either by graphing or by testing the second derivative) that this is a minimum, not a maximum or a point of inflection. (solution in the pdf version of the book)

17. Prove that the total number of maxima and minima possessed by a third-order polynomial is at most two. (solution in the pdf version of the book)

18. Functions f and g are defined on the whole real line, and are differentiable everywhere. Let s=f+g be their sum. In what ways, if any, are the extrema of f, g, and s related? (solution in the pdf version of the book)

19. Euclid proved that the volume of a pyramid equals (1/3)bh, where b is the area of its base, and h its height. A pyramidal tent without tent-poles is erected by blowing air into it under pressure. The area of the base is easy to measure accurately, because the base is nailed down, but the height fluctuates somewhat and is hard to measure accurately. If the amount of uncertainty in the measured height is plus or minus eh, find the amount of possible error eV in the volume. (solution in the pdf version of the book)

20. A hobbyist is going to measure the height to which her model rocket rises at the peak of its trajectory. She plans to take a digital photo from far away and then do trigonometry to determine the height, given the baseline from the launchpad to the camera and the angular height of the rocket as determined from analysis of the photo. Comment on the error incurred by the inability to snap the photo at exactly the right moment. (solution in the pdf version of the book)

21. Prove, as claimed on p. 10, that if the sum 1^2+2^2+…+n^2 is a polynomial, it must be of third order, and the coefficient of the n^3 term must be 1/3. (solution in the pdf version of the book)

(c) 1998-2013 Benjamin Crowell, licensed under the Creative Commons Attribution-ShareAlike license. Photo credits are given at the end of the Adobe Acrobat version.

Footnotes

[1] I'm giving my own retelling of a hoary legend. We don't really know the exact problem, just that it was supposed to have been something of this flavor.

[2] Recall that when x is a function, the notation x(n) means the output of the function when the input is n. It doesn't represent multiplication of a number x by a number n.

[3] In the case where the original graph is itself a line, the tangent line simply coincides with the graph, and this also satisfies the definition, because the tangent line doesn't cut across the graph; it lies on top of it. There is one other exceptional case, called a point of inflection, which we won't worry about right now. For a more complicated definition that correctly handles all the cases, see page 139.

Chapter 2. To infinity --- and beyond!

Little kids readily pick up the idea of infinity. “When I grow up, I'm gonna have a million Barbies.” “Oh yeah? Well, I'm gonna have a billion.” “Well, I'm gonna have infinity Barbies.” “So what? I'll have two infinity of them.” Adults laugh, convinced that infinity, ∞, is the biggest number, so 2∞ can't be any bigger. This is the idea behind a joke in the movie Toy Story. Buzz Lightyear's slogan is “To infinity --- and beyond!” We assume there isn't any beyond. Infinity is supposed to be the biggest there is, so by definition there can't be anything bigger, right?

2.1 Infinitesimals

a / Gottfried Leibniz (1646-1716)

Actually mathematicians have invented many different logical systems for working with infinity, and in most of them infinity does come in different sizes and flavors. Newton, as well as the German mathematician Leibniz who invented calculus independently,2 had a strong intuitive idea that calculus was really about numbers that were infinitely small: infinitesimals, the opposite of infinities. For instance, consider the number 1.1^2=1.21. That 2 in the first decimal place is the same 2 that appears in the expression 2t for the derivative of t^2.

b / A close-up view of the function x=t^2, showing the line that connects the points (1,1) and (1.1,1.21).

Figure b shows the idea visually. The line connecting the points (1,1) and (1.1,1.21) is almost indistinguishable from the tangent line on this scale. Its slope is (1.21-1)/(1.1-1)=2.1, which is very close to the tangent line's slope of 2. It was a good approximation because the points were close together, separated by only 0.1 on the t axis.

If we needed a better approximation, we could try calculating 1.01^2=1.0201. The slope of the line connecting the points (1,1) and (1.01,1.0201) is 2.01, which is even closer to the slope of the tangent line.

c / A geometrical interpretation of the derivative of t^2.

Another method of visualizing the idea is that we can interpret x=t^2 as the area of a square with sides of length t, as suggested in figure c. We increase t by an infinitesimally small number dt. The d is Leibniz's notation for a very small difference, and dt is to be read as a single symbol, “dee-tee,” not as a number d multiplied by a number t. The idea is that dt is smaller than any ordinary number you could imagine, but it's not zero. The area of the square is increased by dx = 2tdt +dt^2, which is analogous to the finite numbers 0.21 and 0.0201 we calculated earlier. Where before we divided by a finite change in t such as 0.1 or 0.01, now we divide by dt, producing

for the derivative. On a graph like figure b, dx/dt is the slope of the tangent line: the change in x divided by the changed in t.

But adding an infinitesimal number dt onto 2t doesn't really change it by any amount that's even theoretically measurable in the real world, so the answer is really 2t. Evaluating it at t=1 gives the exact result, 2, that the earlier approximate results, 2.1 and 2.01, were getting closer and closer to.

Example 1

To show the power of infinitesimals and the Leibniz notation, let's prove that the derivative of t^3 is 3t^2:

where the dots indicate infinitesimal terms that we can neglect.

This result required significant sweat and ingenuity when proved on page 140 by the methods of chapter 1, and not only that but the old method would have required a completely different method of proof for a function that wasn't a polynomial, whereas the new one can be applied more generally, as we'll see presently in examples 10-13.

It's easy to get the mistaken impression that infinitesimals exist in some remote fairyland where we can never touch them. This may be true in the same artsy-fartsy sense that we can never truly understand √2, because its decimal expansion goes on forever, and we therefore can never compute it exactly. But in practical work, that doesn't stop us from working with √2. We just approximate it as, e.g., 1.41. Infinitesimals are no more or less mysterious than irrational numbers, and in particular we can represent them concretely on a computer. If you go to lightandmatter.com/calc/inf, you'll find a web-based calculator called Inf, which can handle infinite and infinitesimal numbers. It has a built-in symbol, d, which represents an infinitesimally small number such as the dx's and dt's we've been handling symbolically.

Let's use Inf to verify that the derivative of t^3, evaluated at t=1, is equal to 3, as found by plugging in to the result of example 9. The : symbol is the prompt that shows you Inf is ready to accept your typed input.

: ((1+d)^3-1)/d

3+3d+d^2

As claimed, the result is 3, or close enough to 3 that the infinitesimal error doesn't matter in real life. It might look like Inf did this example by using algebra to simplify the expression, but in fact Inf doesn't know anything about algebra. One way to see this is to use Inf to compare d with various real numbers:

: d<1

true

: d<0.01

true

: d<0.0000001

true

: d<0

false

If d were just a variable being treated according to the axioms of algebra, there would be no way to tell how it compared with other numbers without having some special information. Inf doesn't know algebra, but it does know that d is a positive number that is less than any positive real number that can be represented using decimals or scientific notation.

Example 2

In example 5 on p. 15, we made a rough numerical check to see if the differentiation rule tk → ktk-1, which was proved on p. 140 for k=1, 2, 3, ..., was also valid for k=-1, i.e., for the function x=1/t. Let's look for an actual proof. To find a natural method of attack, let's first redo the numerical check in a slightly more suggestive form. Again approximating the derivating at t=3, we have

Let's apply the grade-school technique for subtracting fractions, in which we first get them over the same denominator:

The result is

Replacing 3 with t and 0.01 with dt, this becomes

d / Graphs of sin t, and its derivative cos t.

Example 3

The derivative of x=sin t, with t in units of radians, is

and with the trig identity sin(α+β)=sinαcosβ+cosαsinβ, this becomes

Applying the small-angle approximations sin u≈ u and cos u≈ 1, we have

where “...” represents the error caused by the small-angle approximations.

This is essentially all there is to the computation of the derivative, except for the remaining technical point that we haven't proved that the small-angle approximations are good enough. In example 9 on page 26, when we calculated the derivative of t^3, the resulting expression for the quotient dx/dt came out in a form in which we could inspect the “...” terms and verify before discarding them that they were infinitesimal. The issue is less trivial in the present example. This point is addressed more rigorously on page 141.

Figure d shows the graphs of the function and its derivative. Note how the two graphs correspond. At t=0, the slope of sin t is at its largest, and is positive; this is where the derivative, cos t, attains its maximum positive value of 1. At t=π/2, sin t has reached a maximum, and has a slope of zero; cos t is zero here. At t=π, in the middle of the graph, sin t has its maximum negative slope, and cos t is at its most negative extreme of -1.

Physically, sin t could represent the position of a pendulum as it moved back and forth from left to right, and cos t would then be the pendulum's velocity.

Example 4

What about the derivative of the cosine? The cosine and the sine are really the same function, shifted to the left or right by π/2. If the derivative of the sine is the same as itself, but shifted to the left by π/2, then the derivative of the cosine must be a cosine shifted to the left by π/2:

The next example will require a little trickery. By the end of this chapter you'll learn general techniques for cranking out any derivative cookbook-style, without having to come up with any tricks.

e / The function x=1/(1-t).

Example 5

◊ Find the derivative of 1/(1-t), evaluated at t=0.

◊ The graph shows what the function looks like. It blows up to infinity at t=1, but it's well behaved at t=0, where it has a positive slope.

For insight, let's calculate some points on the curve. The point at which we're differentiating is (0,1). If we put in a small, positive value of t, we can observe how much the result increases relative to 1, and this will give us an approximation to the derivative. For example, we find that at t=0.001, the function has the value 1.001001001001, and so the derivative is approximately (1.001-1)/(.001-0), or about 1. We can therefore conjecture that the derivative is exactly 1, but that's not the same as proving it.

But let's take another look at that number 1.001001001001. It's clearly a repeating decimal. In other words, it appears that

and we can easily verify this by multiplying both sides of the equation by 1-1/1000 and collecting like powers. This is a special case of the geometric series

which can be derived^1 by doing synthetic division (the equivalent of long division for polynomials), or simply verified, after forming the conjecture based on the numerical example above, by multiplying both sides by 1-t.

As we'll see in section 2.2, and have been implicitly assuming so far, infinitesimals obey all the same elementary laws of algebra as the real numbers, so the above derivation also holds for an infinitesimal value of t. We can verify the result using Inf:

: 1/(1-d)

1+d+d^2+d^3+d^4

Notice, however, that the series is truncated after the first five terms. This is similar to the truncation that happens when you ask your calculator to find √2 as a decimal.

The result for the derivative is

2.2 Safe use of infinitesimals

The idea of infinitesimally small numbers has always irked purists. One prominent critic of the calculus was Newton's contemporary George Berkeley, the Bishop of Cloyne. Although some of his complaints are clearly wrong (he denied the possibility of the second derivative), there was clearly something to his criticism of the infinitesimals. He wrote sarcastically, “They are neither finite quantities, nor quantities infinitely small, nor yet nothing. May we not call them ghosts of departed quantities?”

f / Bishop George Berkeley (1685-1753)

Infinitesimals seemed scary, because if you mishandled them, you could prove absurd things. For example, let du be an infinitesimal. Then 2du is also infinitesimal. Therefore both 1/du and 1/(2du) equal infinity, so 1/du = 1/(2du). Multiplying by du on both sides, we have a proof that 1=1/2.

In the eighteenth century, the use of infinitesimals became like adultery: commonly practiced, but shameful to admit to in polite circles. Those who used them learned certain rules of thumb for handling them correctly. For instance, they would identify the flaw in my proof of 1=1/2 as my assumption that there was only one size of infinity, when actually 1/du should be interpreted as an infinity twice as big as 1/(2du). The use of the symbol ∞ played into this trap, because the use of a single symbol for infinity implied that infinities only came in one size. However, the practitioners of infinitesimals had trouble articulating a clear set of principles for their proper use, and couldn't prove that a self-consistent system could be built around them.

By the twentieth century, when I learned calculus, a clear consensus had formed that infinite and infinitesimal numbers weren't numbers at all. A notation like dx/dt, my calculus teacher told me, wasn't really one number divided by another, it was merely a symbol for something called a limit,

where Δ x and Δ t represented finite changes. I'll give a formal definition (actually two different formal definitions) of the term “limit” in section 3.2, but intuitively the concept is that we can get as good an approximation to the derivative as we like, provided that we make Δ t small enough.

That satisfied me until we got to a certain topic (implicit differentiation) in which we were encouraged to break the dx away from the dt, leaving them on opposite sides of the equation. I buttonholed my teacher after class and asked why he was now doing what he'd told me you couldn't really do, and his response was that dx and dt weren't really numbers, but most of the time you could get away with treating them as if they were, and you would get the right answer in the end. Most of the time!? That bothered me. How was I supposed to know when it wasn't “most of the time?”

g / Abraham Robinson (1918-1974)

But unknown to me and my teacher, mathematician Abraham Robinson had already shown in the 1960's that it was possible to construct a self-consistent number system that included infinite and infinitesimal numbers. He called it the hyperreal number system, and it included the real numbers as a subset.3

Moreover, the rules for what you can and can't do with the hyperreals turn out to be extremely simple. Take any true statement about the real numbers. Suppose it's possible to translate it into a statement about the hyperreals in the most obvious way, simply by replacing the word “real” with the word “hyperreal.” Then the translated statement is also true. This is known as the transfer principle.

Let's look back at my bogus proof of 1=1/2 in light of this simple principle. The final step of the proof, for example, is perfectly valid: multiplying both sides of the equation by the same thing. The following statement about the real numbers is true:

For any real numbers a, b, and c, if a=b, then ac=bc.

This can be translated in an obvious way into a statement about the hyperreals:

For any hyperreal numbers a, b, and c, if a=b, then ac=bc.

However, what about the statement that both 1/du and 1/(2du) equal infinity, so they're equal to each other? This isn't the translation of a statement that's true about the reals, so there's no reason to believe it's true when applied to the hyperreals --- and in fact it's false.

What the transfer principle tells us is that the real numbers as we normally think of them are not unique in obeying the ordinary rules of algebra. There are completely different systems of numbers, such as the hyperreals, that also obey them.

How, then, are the hyperreals even different from the reals, if everything that's true of one is true of the other? But recall that the transfer principle doesn't guarantee that every statement about the reals is also true of the hyperreals. It only works if the statement about the reals can be translated into a statement about the hyperreals in the most simple, straightforward way imaginable, simply by replacing the word “real” with the word “hyperreal.” Here's an example of a true statement about the reals that can't be translated in this way:

For any real number a, there is an integer n that is greater than a.

This one can't be translated so simplemindedly, because it refers to a subset of the reals called the integers. It might be possible to translate it somehow, but it would require some insight into the correct way to translate that word “integer.” The transfer principle doesn't apply to this statement, which indeed is false for the hyperreals, because the hyperreals contain infinite numbers that are greater than all the integers. In fact, the contradiction of this statement can be taken as a definition of what makes the hyperreals special, and different from the reals: we assume that there is at least one hyperreal number, H, which is greater than all the integers.

As an analogy from everyday life, consider the following statements about the student body of the high school I attended:

1. Every student at my high school had two eyes and a face.

2. Every student at my high school who was on the football team was a jerk.

Let's try to translate these into statements about the population of California in general. The student body of my high school is like the set of real numbers, and the present-day population of California is like the hyperreals. Statement 1 can be translated mindlessly into a statement that every Californian has two eyes and a face; we simply substitute “every Californian” for “every student at my high school.” But statement 2 isn't so easy, because it refers to the subset of students who were on the football team, and it's not obvious what the corresponding subset of Californians would be. Would it include everybody who played high school, college, or pro football? Maybe it shouldn't include the pros, because they belong to an organization covering a region bigger than California. Statement 2 is the kind of statement that the transfer principle doesn't apply to.4

Example 6

As a nontrivial example of how to apply the transfer principle, let's consider how to handle expressions like the one that occurred when we wanted to differentiate t^2 using infinitesimals:

I argued earlier that 2t+dt is so close to 2t that for all practical purposes, the answer is really 2t. But is it really valid in general to say that 2t+dt is the same hyperreal number as 2t? No. We can apply the transfer principle to the following statement about the reals:

For any real numbers a and b, with b≠ 0, a+b≠ a.

Since dt isn't zero, 2t+dt≠ 2t.

More generally, example 14 leads us to visualize every number as being surrounded by a “halo” of numbers that don't equal it, but differ from it by only an infinitesimal amount. Just as a magnifying glass would allow you to see the fleas on a dog, you would need an infinitely strong microscope to see this halo. This is similar to the idea that every integer is surrounded by a bunch of fractions that would round off to that integer. We can define the standard part of a finite hyperreal number, which means the unique real number that differs from it infinitesimally. For instance, the standard part of 2t+dt, notated \st(2t+dt), equals 2t. The derivative of a function should actually be defined as the standard part of dx/dt, but we often write dx/dt to mean the derivative, and don't worry about the distinction.

One of the things Bishop Berkeley disliked about infinitesimals was the idea that they existed in a kind of hierarchy, with dt^2 being not just infinitesimally small, but infinitesimally small compared to the infinitesimal dt. If dt is the flea on a dog, then dt^2 is a submicroscopic flea that lives on the flea, as in Swift's doggerel: “Big fleas have little fleas/ On their backs to ride 'em,/ and little fleas have lesser fleas,/And so, ad infinitum.” Berkeley's criticism was off the mark here: there is such a hierarchy. Our basic assumption about the hyperreals was that they contain at least one infinite number, H, which is bigger than all the integers. If this is true, then 1/H must be less than 1/2, less than 1/100, less then 1/1,000,000 --- less than 1/n for any integer n. Therefore the hyperreals are guaranteed to include infinitesimals as well, and so we have at least three levels to the hierarchy: infinities comparable to H, finite numbers, and infinitesimals comparable to 1/H. If you can swallow that, then it's not too much of a leap to add more rungs to the ladder, like extra-small infinitesimals that are comparable to 1/H^2. If this seems a little crazy, it may comfort you to think of statements about the hyperreals as descriptions of limiting processes involving real numbers. For instance, in the sequence of numbers 1.1^2=1.21, 1.01^2=1.0201, 1.001^2=1.002001, ..., it's clear that the number represented by the digit 1 in the final decimal place is getting smaller faster than the contribution due to the digit 2 in the middle.

One subtle issue here, which I avoided mentioning in the differentiation of the sine function on page 28, is whether the transfer principle is sufficient to let us define all the functions that appear as familiar keys on a calculator: x^2, √x, sin x, cos x, ex, and so on. After all, these functions were originally defined as rules that would take a real number as an input and give a real number as an output. It's not trivially obvious that their definitions can naturally be extended to take a hyperreal number as an input and give back a hyperreal as an output. Essentially the answer is that we can apply the transfer principle to them just as we would to statements about simple arithmetic, but I've discussed this a little more on page 149.

2.3 The product rule

When I first learned calculus, it seemed to me that if the derivative of 3t was 3, and the derivative of 7t was 7, then the derivative of t multiplied by t ought to be just plain old t, not 2t. The reason there's a factor of 2 in the correct answer is that t^2 has two reasons to grow as t gets bigger: it grows because the first factor of t is increasing, but also because the second one is. In general, it's possible to find the derivative of the product of two functions any time we know the derivatives of the individual functions.

The product rule

If x and y are both functions of t, then the derivative of their product is

The proof is easy. Changing t by an infinitesimal amount dt changes the product xy by an amount

whose standard part is the result to be proved.

Example 7

◊ Find the derivative of the function tsin t.

◊

Figure h gives the geometrical interpretation of the product rule. Imagine that the king, in his castle at the southwest corner of his rectangular kingdom, sends out a line of infantry to expand his territory to the north, and a line of cavalry to take over more land to the east. In a time interval dt, the cavalry, which moves faster, covers a distance dx greater than that covered by the infantry, dy. However, the strip of territory conquered by the cavalry, y dx, isn't as great as it could have been, because in our example y isn't as big as x.

h / A geometrical interpretation of the product rule.

A helpful feature of the Leibniz notation is that one can easily use it to check whether the units of an answer make sense. If we measure distances in meters and time in seconds, then xy has units of square meters (area), and so does the change in the area, d(xy). Dividing by dt gives the number of square meters per second being conquered. On the right-hand side of the product rule, dx/dt has units of meters per second (velocity), and multiplying it by y makes the units square meters per second, which is consistent with the left-hand side. The units of the second term on the right likewise check out. Some beginners might be tempted to guess that the product rule would be d(xy)/dt=(dx/dt)(dy/dt), but the Leibniz notation instantly reveals that this can't be the case, because then the units on the left, m^2/s, wouldn't match the ones on the right, m^2/s^2.

Because this unit-checking feature is so helpful, there is a special way of writing a second derivative in the Leibniz notation. What Newton called x¨, Leibniz wrote as

Although the different placement of the 2's on top and bottom seems strange and inconsistent to many beginners, it actually works out nicely. If x is a distance, measured in meters, and t is a time, in units of seconds, then the second derivative is supposed to have units of acceleration, in units of meters per second per second, also written (m/s)/s, or m/s^2. (The acceleration of falling objects on Earth is 9.8 m/s^2 in these units.) The Leibniz notation is meant to suggest exactly this: the top of the fraction looks like it has units of meters, because we're not squaring x, while the bottom of the fraction looks like it has units of seconds squared, because it looks like we're squaring dt. Therefore the units come out right. It's important to realize, however, that the symbol d isn't a number (not a real one, and not a hyperreal one, either), so we can't really square it; the notation is not to be taken as a literal statement about infinitesimals.

Example 8

A tricky use of the product rule is to find the derivative of √t. Since √t can be written as t1/2, we might suspect that the rule d(tk)/dt=ktk-1 would work, giving a derivative 1/2t^{-1/2}=1/(2√t). However, the method from ch. 1 used to prove that rule proved on p.140 only work if k is an integer, so the best we could do would be to confirm our conjecture approximately by graphing or numerical estimation.

Using the product rule, we can write f(t)=d√t/dt for our unknown derivative, and back into the result using the product rule:

But dt/dt=1, so f(t)=1/(2√t) as claimed.

The trick used in example 16 can also be used to prove that the power rule d(xn)/dx=nxn-1 applies to cases where n is an integer less than 0, but I'll instead prove this on page 41 by a technique that doesn't depend on a trick, and also applies to values of n that aren't integers.

i / Three clowns on seesaws demonstrate the chain rule.

2.4 The chain rule

Figure i shows three clowns on seesaws. If the leftmost clown moves down by a distance dx, the middle one will come up by dy, but this will also cause the one on the right to move down by dz. If we want to predict how much the rightmost clown will move in response to a certain amount of motion by the leftmost one, we have

This is called the chain rule. It says that if a change in x causes y to change, and y then causes z to change, then this chain of changes has a cascading effect. Mathematically, there is no big mystery here. We simply cancel dy on the top and bottom. The only minor subtlety is that we would like to be able to be sloppy by using an expression like dy/dx to mean both the quotient of two infinitesimal numbers and a derivative, which is defined as the standard part of this quotient. This sloppiness turns out to be all right, as proved on page 151.

Example 9

◊ Jane hikes 3 kilometers in an hour, and hiking burns 70 calories per kilometer. At what rate does she burn calories?

◊ We let x be the number of hours she's spent hiking so far, y the distance covered, and z the calories spent. Then

Example 10

◊ Figure j shows a piece of farm equipment containing a train of gears with 13, 21, and 42 teeth. If the smallest gear is driven by a motor, relate the rate of rotation of the biggest gear to the rate of rotation of the motor.

◊ Let x, y, and z be the angular positions of the three gears. Then by the chain rule,

j / Example 18.

The chain rule lets us find the derivative of a function that has been built out of one function stuck inside another.

Example 11

◊ Find the derivative of the function z(x)=sin(x^2).

◊ Let y(x)=x^2, so that z(x)=sin(y(x)). Then

The way people usually say it is that the chain rule tells you to take the derivative of the outside function, the sine in this case, and then multiply by the derivative of “the inside stuff,” which here is the square. Once you get used to doing it, you don't need to invent a third, intermediate variable, as we did here with y.

Example 12

Let's express the chain rule without the use of the Leibniz notation. Let the function f be defined by f(x)=g(h(x)). Then the derivative of f is given by f'(x)=g'(h(x))⋅ h'(x).

Example 13

◊ We've already proved that the derivative of tk is ktk-1 for k=-1 (example 10 on p. 27) and for k=1, 2, 3, ... (p. 140). Use these facts to extend the rule to all integer values of k.

◊ For k<0, the function x=tk can be written as x=(t-1)-k, where -k is positive. Applying the chain rule, we find dx/dt=(-k)(t-1)-k-1(-t-2)=ktk-1.

2.5 Exponentials and logarithms

The exponential

The exponential function ex, where e=2.71828… is the base of natural logarithms, comes constantly up in applications as diverse as credit-card interest, the growth of animal populations, and electric circuits. For its derivative we have

The second factor, (edx-1)/dx, doesn't have x in it, so it must just be a constant. Therefore we know that the derivative of ex is simply ex, multiplied by some unknown constant,

A rough check by graphing at, say x=0, shows that the slope is close to 1, so c is close to 1. Numerical calculation also shows that, for example, (e0.001-1)/0.001=1.00050016670838 is very close to 1. But how do we know it's exactly one when dx is really infinitesimal? We can use Inf:

: [exp(d)-1]/d

1+0.5d+...

(The ... indicates where I've snipped some higher-order terms out of the output.) It seems clear that c is equal to 1 except for negligible terms involving higher powers of dx. A rigorous proof is given on page 151.

Example 14

◊ The concentration of a foreign substance in the bloodstream generally falls off exponentially with time as c=coe-t/a, where co is the initial concentration, and a is a constant. For caffeine in adults, a is typically about 7 hours. An example is shown in figure k. Differentiate the concentration with respect to time, and interpret the result. Check that the units of the result make sense.

◊ Using the chain rule,

This can be interpreted as the rate at which caffeine is being removed from the blood and put into the person's urine. It's negative because the concentration is decreasing. According to the original expression for x, a substance with a large a will take a long time to reduce its concentration, since t/a won't be very big unless we have large t on top to compensate for the large a on the bottom. In other words, larger values of a represent substances that the body has a harder time getting rid of efficiently. The derivative has a on the bottom, and the interpretation of this is that for a drug that is hard to eliminate, the rate at which it is removed from the blood is low.

It makes sense that a has units of time, because the exponential function has to have a unitless argument, so the units of t/a have to cancel out. The units of the result come from the factor of co/a, and it makes sense that the units are concentration divided by time, because the result represents the rate at which the concentration is changing.

k / Example 22. A typical graph of the concentration of caffeine in the blood, in units of milligrams per liter, as a function of time, in hours.

Example 15

◊ Find the derivative of the function y=10x.

◊ In general, one of the tricks to doing calculus is to rewrite functions in forms that you know how to handle. This one can be rewritten as a base-e exponent:

Applying the chain rule, we have the derivative of the exponential, which is just the same exponential, multiplied by the derivative of the inside stuff:

In other words, the “c” referred to in the discussion of the derivative of ex becomes c=ln 10 in the case of the base-10 exponential.

The logarithm

The natural logarithm is the function that undoes the exponential. In a situation like this, we have

where on the left we're thinking of y as a function of x, and on the right we consider x to be a function of y. Applying this to the natural logarithm,

l / Differentiation and integration of functions of the form xn. Constants out in front of the functions are not shown, so keep in mind that, for example, the derivative of x^2 isn't x, it's 2x.

This is noteworthy because it shows that there must be an exception to the rule that the derivative of xn is nxn-1, and the integral of xn-1 is xn/n. (On page 37 I remarked that this rule could be proved using the product rule for negative integer values of k, but that I would give a simpler, less tricky, and more general proof later. The proof is example 24 below.) The integral of x-1 is not x^0/0, which wouldn't make sense anyway because it involves division by zero.5 Likewise the derivative of x^0=1 is 0x-1, which is zero. Figure l shows the idea. The functions xn form a kind of ladder, with differentiation taking us down one rung, and integration taking us up. However, there are two special cases where differentiation takes us off the ladder entirely.

Example 16

◊ Prove d(xn)/dx=nxn-1 for any real value of n, not just an integer.

◊

(For n=0, the result is zero.)

When I started the discussion of the derivative of the logarithm, I wrote y=ln x right off the bat. That meant I was implicitly assuming x was positive. More generally, the derivative of ln|x| equals 1/x, regardless of the sign (see problem 29 on page 50).

2.6 Quotients

So far we've been successful with a divide-and-conquer approach to differentiation: the product rule and the chain rule offer methods of breaking a function down into simpler parts, and finding the derivative of the whole thing based on knowledge of the derivatives of the parts. We know how to find the derivatives of sums, differences, and products, so the obvious next step is to look for a way of handling division. This is straightforward, since we know that the derivative of the function 1/u=u-1 is -u-2. Let u and v be functions of x. Then by the product rule,

This is so easy to rederive on demand that I suggest not memorizing it.

By the way, notice how the notation becomes a little awkward when we want to write a derivative like d(v/u)/dx. When we're differentiating a complicated function, it can be uncomfortable trying to cram the expression into the top of the d…/d… fraction. Therefore it would be more common to write such an expression like this:

This could be considered an abuse of notation, making d look like a number being divided by another number dx, when actually d is meaningless on its own. On the other hand, we can consider the symbol d/dx to represent the operation of differentiation with respect to x; such an interpretation will seem more natural to those who have been inculcated with the taboo against considering infinitesimals as numbers in the first place.

Using the new notation, the quotient rule becomes

The interpretation of the minus sign is that if u increases, v/u decreases.

Example 17

◊ Differentiate y=x/(1+3x), and check that the result makes sense.

◊ We identify v with x and u with 1+x. The result is

One way to check that the result makes sense is to consider extreme values of x. For very large values of x, the 1 on the bottom of x/(1+3x) becomes negligible compared to the 3x, and the function y approaches x/3x=1/3 as a limit. Therefore we expect that the derivative dy/dx should approach zero, since the derivative of a constant is zero. It works: plugging in bigger and bigger numbers for x in the expression for the derivative does give smaller and smaller results. (In the second term, the denominator gets bigger faster than the numerator, because it has a square in it.)

Another way to check the result is to verify that the units work out. Suppose arbitrarily that x has units of gallons. (If the 3 on the bottom is unitless, then the 1 would have to represent 1 gallon, since you can't add things that have different units.) The function y is defined by an expression with units of gallons divided by gallons, so y is unitless. Therefore the derivative dy/dx should have units of inverse gallons. Both terms in the expression for the derivative do have those units, so the units of the answer check out.

2.7 Differentiation on a computer

In this chapter you've learned a set of rules for evaluating derivatives: derivatives of products, quotients, functions inside other functions, etc. Because these rules exist, it's always possible to find a formula for a function's derivative, given the formula for the original function. Not only that, but there is no real creativity required, so a computer can be programmed to do all the drudgery. For example, you can download a free, open-source program called Yacas from yacas.sourceforge.net and install it on a Windows or Linux machine. There is even a version you can run in a web browser without installing any special software: http://yacas.sourceforge.net/ yacasconsole.html .

A typical session with Yacas looks like this:

Example 18

D(x) x^2

2*x

D(x) Exp(x^2)

2*x*Exp(x^2)

D(x) Sin(Cos(Sin(x)))

-Cos(x)*Sin(Sin(x))

*Cos(Cos(Sin(x)))

Upright type represents your input, and italicized type is the program's output.

First I asked it to differentiate x^2 with respect to x, and it told me the result was 2x. Then I did the derivative of ex^2, which I also could have done fairly easily by hand. (If you're trying this out on a computer as you read along, make sure to capitalize functions like Exp, Sin, and Cos.) Finally I tried an example where I didn't know the answer off the top of my head, and that would have been a little tedious to calculate by hand.

Unfortunately things are a little less rosy in the world of integrals. There are a few rules that can help you do integrals, e.g., that the integral of a sum equals the sum of the integrals, but the rules don't cover all the possible cases. Using Yacas to evaluate the integrals of the same functions, here's what happens.6

Example 19

Integrate(x) x^2

x^3/3

Integrate(x) Exp(x^2)

Integrate(x)Exp(x^2)

Integrate(x)   Sin(Cos(Sin(x)))<br/>

Integrate(x)

Sin(Cos(Sin(x)))

The first one works fine, and I can easily verify that the answer is correct, by taking the derivative of x^3/3, which is x^2. (The answer could have been x^3/3+7, or x^3/3+c, where c was any constant, but Yacas doesn't bother to tell us that.) The second and third ones don't work, however; Yacas just spits back the input at us without making any progress on it. And it may not be because Yacas isn't smart enough to figure out these integrals. The function ex^2 can't be integrated at all in terms of a formula containing ordinary operations and functions such as addition, multiplication, exponentiation, trig functions, exponentials, and so on.

That's not to say that a program like this is useless. For example, here's an integral that I wouldn't have known how to do, but that Yacas handles easily:

Example 20

Integrate(x) Sin(Ln(x))

(x*Sin(Ln(x)))/2

-(x*Cos(Ln(x)))/2

This one is easy to check by differentiating, but I could have been marooned on a desert island for a decade before I could have figured it out in the first place. There are various rules, then, for integration, but they don't cover all possible cases as the rules for differentiation do, and sometimes it isn't obvious which rule to apply. Yacas's ability to integrate sin ln x shows that it had a rule in its bag of tricks that I don't know, or didn't remember, or didn't realize applied to this integral.

Back in the 17th century, when Newton and Leibniz invented calculus, there were no computers, so it was a big deal to be able to find a simple formula for your result. Nowadays, however, it may not be such a big deal. Suppose I want to find the derivative of sin cos sin x, evaluated at x=1. I can do something like this on a calculator:

Example 21

sin cos sin 1 =

0.61813407

sin cos sin 1.0001 =

0.61810240

(0.61810240-0.61813407) /.0001 = <br/>

-0.3167

I have the right answer, with plenty of precision for most realistic applications, although I might have never guessed that the mysterious number -0.3167 was actually -(cos 1)(sinsin 1)(coscossin 1). This could get a little tedious if I wanted to graph the function, for instance, but then I could just use a computer spreadsheet, or write a little computer program. In this chapter, I'm going to show you how to do derivatives and integrals using simple computer programs, using Yacas. The following little Yacas program does the same thing as the set of calculator operations shown above:

Example 22

\nn f(x):=Sin(Cos(Sin(x)))

\nn x:=1

\nn dx:=.0001

\nn N( (f(x+dx)-f(x))/dx )

-0.3166671628

(I've omitted all of Yacas's output except for the final result.) Line 1 defines the function we want to differentiate. Lines 2 and 3 give values to the variables x and dx. Line 4 computes the derivative; the N( ) surrounding the whole thing is our way of telling Yacas that we want an approximate numerical result, rather than an exact symbolic one.

An interesting thing to try now is to make dx smaller and smaller, and see if we get better and better accuracy in our approximation to the derivative.

Example 23

\nn g(x,dx):=  N( (f(x+dx)-f(x))/dx )

\nn g(x,.1)

-0.3022356406

\nn g(x,.0001)

-0.3166671628

\nn g(x,.0000001)

-0.3160458019

\nn g(x,.00000000000000001)

0

Line 5 defines the derivative function. It needs to know both x and dx. Line 6 computes the derivative using dx=0.1, which we expect to be a lousy approximation, since dx is really supposed to be infinitesimal, and 0.1 isn't even that small. Line 7 does it with the same value of dx we used earlier. The two results agree exactly in the first decimal place, and approximately in the second, so we can be pretty sure that the derivative is -0.32 to two figures of precision. Line 8 ups the ante, and produces a result that looks accurate to at least 3 decimal places. Line 9 attempts to produce fantastic precision by using an extremely small value of dx. Oops --- the result isn't better, it's worse! What's happened here is that Yacas computed f(x) and f(x+dx), but they were the same to within the precision it was using, so f(x+dx)-f(x) rounded off to zero.7

Example 31 demonstrates the concept of how a derivative can be defined in terms of a limit:

The idea of the limit is that we can theoretically make Δ y/Δ x approach as close as we like to dy/dx, provided we make Δ x sufficiently small. In reality, of course, we eventually run into the limits of our ability to do the computation, as in the bogus result generated on line 9 of the example.

Homework Problems

1. Carry out a calculation like the one in example 9 on page 26 to show that the derivative of t^4 equals 4t^3. (solution in the pdf version of the book)

2. Example 12 on page 29 gave a tricky argument to show that the derivative of cos t is -sin t. Prove the same result using the method of example 11 instead. (solution in the pdf version of the book)

3. Suppose H is a big number. Experiment on a calculator to figure out whether √H+1-√H-1 comes out big, normal, or tiny. Try making H bigger and bigger, and see if you observe a trend. Based on these numerical examples, form a conjecture about what happens to this expression when H is infinite. (solution in the pdf version of the book)

4. Suppose dx is a small but finite number. Experiment on a calculator to figure out how √dx compares in size to dx. Try making dx smaller and smaller, and see if you observe a trend. Based on these numerical examples, form a conjecture about what happens to this expression when dx is infinitesimal. (solution in the pdf version of the book)

5. To which of the following statements can the transfer principle be applied? If you think it can't be applied to a certain statement, try to prove that the statement is false for the hyperreals, e.g., by giving a counterexample.

(a) For any real numbers x and y, x+y=y+x.

(b) The sine of any real number is between -1 and 1.

(c) For any real number x, there exists another real number y that is greater than x.

(d) For any real numbers x≠ y, there exists another real number z such that x<z<y.

(e) For any real numbers x≠ y, there exists a rational number z such that x<z<y. (A rational number is one that can be expressed as an integer divided by another integer.)

(f) For any real numbers x, y, and z, (x+y)+z=x+(y+z).

(g) For any real numbers x and y, either x<y or x=y or x>y.

(h) For any real number x, x+1≠ x. (solution in the pdf version of the book)

6. If we want to pump air or water through a pipe, common sense tells us that it will be easier to move a larger quantity more quickly through a fatter pipe. Quantitatively, we can define the resistance, R, which is the ratio of the pressure difference produced by the pump to the rate of flow. A fatter pipe will have a lower resistance. Two pipes can be used in parallel, for instance when you turn on the water both in the kitchen and in the bathroom, and in this situation, the two pipes let more water flow than either would have let flow by itself, which tells us that they act like a single pipe with some lower resistance. The equation for their combined resistance is R=1/(1/R_1+1/R_2). Analyze the case where one resistance is finite, and the other infinite, and give a physical interpretation. Likewise, discuss the case where one is finite, but the other is infinitesimal. (solution in the pdf version of the book)

7. Naively, we would imagine that if a spaceship traveling at u=3/4 of the speed of light was to shoot a missile in the forward direction at v=3/4 of the speed of light (relative to the ship), then the missile would be traveling at u+v=3/2 of the speed of light. However, Einstein's theory of relativity tells us that this is too good to be true, because nothing can go faster than light. In fact, the relativistic equation for combining velocities in this way is not u+v, but rather (u+v)/(1+uv). In ordinary, everyday life, we never travel at speeds anywhere near the speed of light. Show that the nonrelativistic result is recovered in the case where both u and v are infinitesimal. (solution in the pdf version of the book)

8. Differentiate (2x+3)100 with respect to x. (solution in the pdf version of the book)

9. Differentiate (x+1)100(x+2)200 with respect to x. (solution in the pdf version of the book)

10. Differentiate the following with respect to x: e7x, eex. (In the latter expression, as in all exponentials nested inside exponentials, the evaluation proceeds from the top down, i.e., e(ex), not (ee)x.) (solution in the pdf version of the book)

11. Differentiate asin(bx+c) with respect to x. (solution in the pdf version of the book)

12. Let x=tp/q, where p and q are positive integers. By a technique similar to the one in example 21 on p. 38, prove that the differentiation rule for tk holds when k=p/q.qwe (solution in the pdf version of the book)

13. Find a function whose derivative with respect to x equals asin(bx+c). That is, find an integral of the given function. (solution in the pdf version of the book)

14. Use the chain rule to differentiate ((x^2)2)2, and show that you get the same result you would have obtained by differentiating x^8. [M. Livshits] (solution in the pdf version of the book)

15. The range of a gun, when elevated to an angle θ, is given by

Find the angle that will produce the maximum range. (solution in the pdf version of the book)

16. Differentiate sin cos tan x with respect to x.

17. The hyperbolic cosine function is defined by

Find any minima and maxima of this function. (solution in the pdf version of the book)

18. Show that the function sin(sin(sin x)) has maxima and minima at all the same places where sin x does, and at no other places. (solution in the pdf version of the book)

19. Let f(x)=|x|+x and g(x)=x|x|+x. Find the derivatives of these functions at x=0 in terms of (a) slopes of tangent lines and (b) infinitesimals. (solution in the pdf version of the book)

20. In free fall, the acceleration will not be exactly constant, due to air resistance. For example, a skydiver does not speed up indefinitely until opening her chute, but rather approaches a certain maximum velocity at which the upward force of air resistance cancels out the force of gravity. The expression for the distance dropped by of a free-falling object, with air resistance, is^8

where g is the acceleration the object would have without air resistance, the function cosh has been defined in problem 17, and A is a constant that depends on the size, shape, and mass of the object, and the density of the air. (For a sphere of mass m and diameter d dropping in air, A=4.11m/d^2. Cf. problem 10, p. 115.)

(a) Differentiate this expression to find the velocity. Hint: In order to simplify the writing, start by defining some other symbol to stand for the constant √g/A.

(b) Show that your answer can be reexpressed in terms of the function tanh defined by tanh x=(ex-e-x)/(ex+e-x).

(c) Show that your result for the velocity approaches a constant for large values of t.

(d) Check that your answers to parts b and c have units of velocity. (solution in the pdf version of the book)

21. Differentiate tanθ with respect to θ. (solution in the pdf version of the book)

22. Differentiate √[3]{x} with respect to x. (solution in the pdf version of the book)

23. Differentiate the following with respect to x:

(a) y=√x^2+1

(b) y=√x^2+a^2

(c) y=1/√a+x

(d) y=a/√a-x^2

[Thompson, 1919] (solution in the pdf version of the book)

24. Differentiate ln(2t+1) with respect to t. (solution in the pdf version of the book)

25. If you know the derivative of sin x, it's not necessary to use the product rule in order to differentiate 3sin x, but show that using the product rule gives the right result anyway. (solution in the pdf version of the book)

26. The Γ function (capital Greek letter gamma) is a continuous mathematical function that has the property Γ(n)=1⋅2⋅…⋅(n-1) for n an integer. Γ(x) is also well defined for values of x that are not integers, e.g., Γ(1/2) happens to be √π. Use computer software that is capable of evaluating the Γ function to determine numerically the derivative of Γ(x) with respect to x, at x=2. (In Yacas, the function is called Gamma.) (solution in the pdf version of the book)

27. For a cylinder of fixed surface area, what proportion of length to radius will give the maximum volume? (solution in the pdf version of the book)

28. This problem is a variation on problem 11 on page 21. Einstein found that the equation K=(1/2)mv^2 for kinetic energy was only a good approximation for speeds much less than the speed of light, c. At speeds comparable to the speed of light, the correct equation is

(a) As in the earlier, simpler problem, find the power dK/dt for an object accelerating at a steady rate, with v=at.

(b) Check that your answer has the right units.

(c) Verify that the power required becomes infinite in the limit as v approaches c, the speed of light. This means that no material object can go as fast as the speed of light. (solution in the pdf version of the book)

29. Prove, as claimed on page 42, that the derivative of ln |x| equals 1/x, for both positive and negative x. (solution in the pdf version of the book)

30. On even function is one with the property f(-x)=f(x). For example, cos x is an even function, and xn is an even function if n is even. An odd function has f(-x)=-f(x). Prove that the derivative of an even function is odd. (solution in the pdf version of the book)

31. Suppose we have a list of numbers x_1,… xn, and we wish to find some number q that is as close as possible to as many of the xi as possible. To make this a mathematically precise goal, we need to define some numerical measure of this closeness. Suppose we let h=(x_1-q)2+…+(xn-q)2, which can also be notated using Σ, uppercase Greek sigma, as h=\sum_{i=1}n (xi-q)2. Then minimizing h can be used as a definition of optimal closeness. (Why would we not want to use h=\sum_{i=1}n (xi-q)?) Prove that the value of q that minimizes h is the average of the xi.

32. Use a trick similar to the one used in example 16 to prove that the power rule d(xk)/dx=kxk-1 applies to cases where k is an integer less than 0. (solution in the pdf version of the book)

33. The plane of Euclidean geometry is today often described as the set of all coordinate pairs (x,y), where x and y are real. We could instead imagine the plane F that is defined in the same way, but with x and y taken from the set of hyperreal numbers. As a third alternative, there is the plane G in which the finite hyperreals are used. In E, Euclid's parallel postulate holds: given a line and a point not on the line, there exists exactly one line passing through the point that does not intersect the line. Does the parallel postulate hold in F? In G? Is it valid to associate only E with the plane described by Euclid's axioms? (solution in the pdf version of the book)

34. Discuss the following statement: The repeating decimal 0.999… is infinitesimally less than one. (solution in the pdf version of the book)

35. Example 20 on page 38 expressed the chain rule without the Leibniz notation, writing a function f defined by f(x)=g(h(x)). Suppose that you're trying to remember the rule, and two of the possibilities that come to mind are f'(x)=g'(h(x)) and f'(x)=g'(h(x))h(x). Show that neither of these can possibly be right, by considering the case where x has units. You may find it helpful to convert both expressions back into the Leibniz notation. (solution in the pdf version of the book)

36. When you tune in a radio station using an old-fashioned rotating dial you don't have to be exactly tuned in to the right frequency in order to get the station. If you did, the tuning would be infinitely sensitive, and you'd never be able to receive any signal at all! Instead, the tuning has a certain amount of “slop” intentionally designed into it. The strength of the received signal s can be expressed in terms of the dial's setting f by a function of the form

where a, b, and fo are constants. This functional form is in fact very general, and is encountered in many other physical contexts. The graph below shows the resulting bell-shaped curve. Find the frequency f at which the maximum response occurs, and show that if b is small, the maximum occurs close to, but not exactly at, fo. (solution in the pdf version of the book)

m / The function of problem 36, with a=3, b=1, and fo=1.

n / Problem 37. A set of light rays is emitted from the tip of the glamorous movie star's nose on the film, and reunited to form a spot on the screen which is the image of the same point on his nose. The distances have been distorted for clarity. The distance y represents the entire length of the theater from front to back.

37. In a movie theater, the image on the screen is formed by a lens in the projector, and originates from one of the frames on the strip of celluloid film (or, in the newer digital projection systems, from a liquid crystal chip). Let the distance from the film to the lens be x, and let the distance from the lens to the screen be y. The projectionist needs to adjust x so that it is properly matched with y, or else the image will be out of focus. There is therefore a fixed relationship between x and y, and this relationship is of the form

where f is a property of the lens, called its focal length. A stronger lens has a shorter focal length. Since the theater is large, and the projector is relatively small, x is much less than y. We can see from the equation that if y is sufficiently large, the left-hand side of the equation is dominated by the 1/x term, and we have x ≈ f. Since the 1/y term doesn't completely vanish, we must have x slightly greater than f, so that the 1/x term is slightly less than 1/f. Let x=f+dx, and approximate dx as being infinitesimally small. Find a simple expression for y in terms of f and dx. (solution in the pdf version of the book)

38. Why might the expression 1∞ be considered an indeterminate form? (solution in the pdf version of the book)

(c) 1998-2013 Benjamin Crowell, licensed under the Creative Commons Attribution-ShareAlike license. Photo credits are given at the end of the Adobe Acrobat version.

Footnotes

[1] As a technical aside, it's not necessary for our present purposes to go into the issue of how to make the most general possible definition of what is meant by a sum like this one which has an infinite number of terms; the only fact we'll need here is that the error in finite sum obtained by leaving out the “...” has only higher powers of t. This is taken up in more detail in ch. 7. Note that the series only gives the right answer for t<1. E.g., for t=1, it equals 1+1+1+…, which, if it means anything, clearly means something infinite.

[2] There is some dispute over this point. Newton and his supporters claimed that Leibniz plagiarized Newton's ideas, and merely invented a new notation for them.

[3] The main text of this book treats infinitesimals with the minimum fuss necessary in order to avoid the common goofs. More detailed discussions are often relegated to the back of the book, as in example 11 on page 28. The reader who wants to learn even more about the hyperreal system should consult the list of further reading on page 201.

[4] For a slightly more precise and formal statement of the transfer principle, see page 143.

[5] Speaking casually, one can say that division by zero gives infinity. This is often a good way to think when trying to connect mathematics to reality. However, it doesn't really work that way according to our rigorous treatment of the hyperreals. Consider this statement: “For a nonzero real number a, there is no real number b such that a=0b.” This means that we can't divide a by 0 and get b. Applying the transfer principle to this statement, we see that the same is true for the hyperreals: division by zero is undefined. However, we can divide a finite number by an infinitesimal, and get an infinite result, which is almost the same thing.

[6] If you're trying these on your own computer, note that the long input line for the function sin cos sin x shouldn't be broken up into two lines as shown in the listing.

[7] Yacas can do arithmetic to any precision you like, although you may run into practical limits due to the amount of memory your computer has and the speed of its CPU. For fun, try N(Pi,1000), which tells Yacas to compute π numerically to 1000 decimal places.

[8] Jan Benacka and Igor Stubna, The Physics Teacher, 43 (2005) 432.

Chapter 3. Limits and continuity

3.1 Continuity

Intuitively, a continuous function is one whose graph has no sudden jumps in it; the graph is all a single connected piece. Such a function can be drawn without picking the pen up off of the paper. Formally, a function f(x) is defined to be continuous if for any real x and any infinitesimal dx, f(x+dx)-f(x) is infinitesimal.

Example 1

Let the function f be defined by f(x)=0 for x≤ 0, and f(x)=1 for x>0. Then f(x) is discontinuous, since for dx>0, f(0+dx)-f(0)=1, which isn't infinitesimal.

a / Example 32. The black dot indicates that the endpoint of the lower ray is part of the ray, while the white one shows the contrary for the ray on the top.

If a function is discontinuous at a given point, then it is not differentiable at that point. On the other hand, the example y=|x| shows that a function can be continuous without being differentiable.

In most cases, there is no need to invoke the definition explicitly in order to check whether a function is continuous. Most of the functions we work with are defined by putting together simpler functions as building blocks. For example, let's say we're already convinced that the functions defined by g(x)=3x and h(x)=sin x are both continuous. Then if we encounter the function f(x)=sin(3x), we can tell that it's continuous because its definition corresponds to f(x)=h(g(x)). The functions g and h have been set up like a bucket brigade, so that g takes the input, calculates the output, and then hands it off to h for the final step of the calculation. This method of combining functions is called composition. The composition of two continuous functions is also continuous. Just watch out for division. The function f(x)=1/x is continuous everywhere except at x=0, so for example 1/sin(x) is continuous everywhere except at multiples of π, where the sine has zeroes.

The intermediate value theorem

Another way of thinking about continuous functions is given by the intermediate value theorem. Intuitively, it says that if you are moving continuously along a road, and you get from point A to point B, then you must also visit every other point along the road; only by teleporting (by moving discontinuously) could you avoid doing so. More formally, the theorem states that if y is a continuous real-valued function on the real interval from a to b, and if y takes on values y_1 and y_2 at certain points within this interval, then for any y_3 between y_1 and y_2, there is some real x in the interval for which y(x)=y_3.

b / The intermediate value theorem states that if the function is continuous, it must pass through y_3.

The intermediate value theorem seems so intuitively appealing that if we want to set out to prove it, we may feel as though we're being asked to prove a proposition such as, “a number greater than 10 exists.” If a friend wanted to bet you a six-pack that you couldn't prove this with complete mathematical rigor, you would have to get your friend to spell out very explicitly what she thought were the facts about integers that you were allowed to start with as initial assumptions. Are you allowed to assume that 1 exists? Will she grant you that if a number n exists, so does n+1? The intermediate value theorem is similar. It's stated as a theorem about certain types of functions, but its truth isn't so much a matter of the properties of functions as the properties of the underlying number system. For the reader with a interest in pure mathematics, I've discussed this in more detail on page 156 and given an abbreviated proof. (Most introductory calculus texts do not prove it at all.)

Example 2

◊ Show that there is a solution to the equation 10x+x=1000.

◊ We expect there to be a solution near x=3, where the function f(x)=10x+x=1003 is just a little too big. On the other hand, f(2)=102 is much too small. Since f has values above and below 1000 on the interval from 2 to 3, and f is continuous, the intermediate value theorem proves that a solution exists between 2 and 3. If we wanted to find a better numerical approximation to the solution, we could do it using Newton's method, which is introduced in section 5.1.

Example 3

◊ Show that there is at least one solution to the equation cos x=x, and give bounds on its location.

◊ This is a transcendental equation, and no amount of fiddling with algebra and trig identities will ever give a closed-form solution, i.e., one that can be written down with a finite number of arithmetic operations to give an exact result. However, we can easily prove that at least one solution exists, by applying the intermediate value theorem to the function x-cos x. The cosine function is bounded between -1 and 1, so this function must be negative for x<-1 and positive for x>1. By the intermediate value theorem, there must be a solution in the interval -1 ≤ x ≤ 1. The graph, c, verifies this, and shows that there is only one solution.

c / The function x-cos x constructed in example 34.

Example 4

◊ Prove that every odd-order polynomial P with real coefficients has at least one real root x, i.e., a point at which P(x)=0.

◊ Example 34 might have given the impression that there was nothing to be learned from the intermediate value theorem that couldn't be determined by graphing, but this example clearly can't be solved by graphing, because we're trying to prove a general result for all polynomials.

To see that the restriction to odd orders is necessary, consider the polynomial x^2+1, which has no real roots because x^2>0 for any real number x.

To fix our minds on a concrete example for the odd case, consider the polynomial P(x)=x^3-x+17. For large values of x, the linear and constant terms will be negligible compared to the x^3 term, and since x^3 is positive for large values of x and negative for large negative ones, it follows that P is sometimes positive and sometimes negative.

Making this argument more general and rigorous, suppose we had a polynomial of odd order n that always had the same sign for real x. Then by the transfer principle the same would hold for any hyperreal value of x. Now if x is infinite then the lower-order terms are infinitesimal compared to the xn term, and the sign of the result is determined entirely by the xn term, but xn and (-x)n have opposite signs, and therefore P(x) and P(-x) have opposite signs. This is a contradiction, so we have disproved the assumption that P always had the same sign for real x. Since P is sometimes negative and sometimes positive, we conclude by the intermediate value theorem that it is zero somewhere.

Example 5

◊ Show that the equation x=sin 1/x has infinitely many solutions.

◊ This is another example that can't be solved by graphing; there is clearly no way to prove, just by looking at a graph like d, that it crosses the x axis infinitely many times. The graph does, however, help us to gain intuition for what's going on. As x gets smaller and smaller, 1/x blows up, and sin 1/x oscillates more and more rapidly. The function f is undefined at 0, but it's continuous everywhere else, so we can apply the intermediate value theorem to any interval that doesn't include 0.

We want to prove that for any positive u, there exists an x with 0<x<u for which f(x) has either desired sign. Suppose that this fails for some real u. Then by the transfer principle the nonexistence of any real x with the desired property also implies the nonexistence of any such hyperreal x. But for an infinitesimal x the sign of f is determined entirely by the sine term, since the sine term is finite and the linear term infinitesimal. Clearly sin 1/x can't have a single sign for all values of x less than u, so this is a contradiction, and the proposition succeeds for any u. It follows from the intermediate value theorem that there are infinitely many solutions to the equation.

d / The function x-sin 1/x.

The extreme value theorem

In chapter 1, we saw that locating maxima and minima of functions may in general be fairly difficult, because there are so many different ways in which a function can attain an extremum: e.g., at an endpoint, at a place where its derivative is zero, or at a nondifferentiable kink. The following theorem allows us to make a very general statement about all these possible cases, assuming only continuity.

The extreme value theorem states that if f is a continuous real-valued function on the real-number interval defined by a ≤ x ≤ b, then f has maximum and minimum values on that interval, which are attained at specific points in the interval.

Let's first see why the assumptions are necessary. If we weren't confined to a finite interval, then y=x would be a counterexample, because it's continuous and doesn't have any maximum or minimum value. If we didn't assume continuity, then we could have a function defined as y=x for x < 1, and y=0 for x >= 1; this function never gets bigger than 1, but it never attains a value of 1 for any specific value of x.

The extreme value theorem is proved, in a somewhat more general form, on page 159.

Example 6

◊ Find the maximum value of the polynomial P(x)=x^3+x^2+x+1 for -5 ≤ x ≤ 5.

◊ Polynomials are continuous, so the extreme value theorem guarantees that such a maximum exists. Suppose we try to find it by looking for a place where the derivative is zero. The derivative is 3x^2+2x+1, and setting it equal to zero gives a quadratic equation, but application of the quadratic formula shows that it has no real solutions. It appears that the function doesn't have a maximum anywhere (even outside the interval of interest) that looks like a smooth peak. Since it doesn't have kinks or discontinuities, there is only one other type of maximum it could have, which is a maximum at one of its endpoints. Plugging in the limits, we find P(-5)=-104 and P(5)=156, so we conclude that the maximum value on this interval is 156.

3.2 Limits

Historically, the calculus of infinitesimals as created by Newton and Leibniz was reinterpreted in the nineteenth century by Cauchy, Bolzano, and Weierstrass in terms of limits. All mathematicians learned both languages, and switched back and forth between them effortlessly, like the lady I overheard in a Southern California supermarket telling her mother, “Let's get that one, con los nuts.” Those who had been trained in infinitesimals might hear a statement using the language of limits, but translate it mentally into infinitesimals; to them, every statement about limits was really a statement about infinitesimals. To their younger colleagues, trained using limits, every statement about infinitesimals was really to be understood as shorthand for a limiting process. When Robinson laid the rigorous foundations for the hyperreal number system in the 1960's, a common objection was that it was really nothing new, because every statement about infinitesimals was really just a different way of expressing a corresponding statement about limits; of course the same could have been said about Weierstrass's work of the preceding century! In reality, all practitioners of calculus had realized all along that different approaches worked better for different problems; problem 13 on page 84 is an example of a result that is much easier to prove with infinitesimals than with limits.

The Weierstrass definition of a limit is this:

Definition of the limit

We say that ℓ is the limit of the function f(x) as x approaches a, written

if the following is true: for any real number ε, there exists another real number δ such that for all x in the interval a-δ≤ x ≤ a+δ, the value of f lies within the range from ℓ-ε to ℓ+ε.

Intuitively, the idea is that if I want you to make f(x) close to ℓ, I just have to tell you how close, and you can tell me that it will be that close as long as x is within a certain distance of a.

In terms of infinitesimals, we have:

Definition of the limit

We say that ℓ is the limit of the function f(x) as x approaches a, written

if the following is true: for any infinitesimal number dx, the value of f(a+dx) is finite, and the standard part of f(a+dx) equals ℓ.

The two definitions are equivalent. As remarked previously, the derivative dx/dt can be defined as the limit \lim_{Δ t→0} (Δ x/Δ t), and if we use the Weierstrass definition of the limit, this means that the derivative can be defined entirely in terms of the real number system, without the user of hyperreal numbers.

Sometimes a limit can be evaluated simply by plugging in numbers:

Example 7

◊ Evaluate

◊ Plugging in x=0, we find that the limit is 1.

In some examples, plugging in fails if we try to do it directly, but can be made to work if we massage the expression into a different form:

Example 8

◊ Evaluate

◊ Plugging in x=0 fails because division by zero is undefined.

Intuitively, however, we expect that the limit will be well defined, and will equal 2, because for very small values of x, the numerator is dominated by the 2/x term, and the denominator by the 1/x term, so the 7 and 8686 terms will matter less and less as x gets smaller and smaller.

To demonstrate this more rigorously, a trick that works is to multiply both the top and the bottom by x, giving

which equals 2 when we plug in x=0, so we find that the limit is zero.

This example is a little subtle, because when x equals zero, the function is not defined, and moreover it would not be valid to multiply both the top and the bottom by x. In general, it's not valid algebra to multiply both the top and the bottom of a fraction by 0, because the result is 0/0, which is undefined. But we didn't actually multiply both the top and the bottom by zero, because we never let x equal zero. Both the Weierstrass definition and the definition in terms of infinitesimals only refer to the properties of the function in a region very close to the limiting point, not at the limiting point itself.

This is an example in which the function was not well defined at a certain point, and yet the limit of the function was well defined as we approached that point. In a case like this, where there is only one point missing from the domain of the function, it is natural to extend the definition of the function by filling in the “gap tooth.” Example 41 below shows that this kind of filling-in procedure is not always possible.

e / Example 40, the function 1/x^2.

Example 9

◊ Investigate the limiting behavior of 1/x^2 as x approaches 0, and 1.

◊ At x=1, plugging in works, and we find that the limit is 1.

At x=0, plugging in doesn't work, because division by zero is undefined. Applying the definition in terms of infinitesimals to the limit as x approaches 0, we need to find out whether 1/(0+dx)2 is finite for infinitesimal dx, and if so, whether it always has the same standard part. But clearly 1/(0+dx)2=dx-2 is always infinite, and we conclude that this limit is undefined.

f / Example 41, the function tan-1(1/x).

Example 10

◊ Investigate the limiting behavior of f(x)=tan-1(1/x) as x approaches 0.

◊ Plugging in doesn't work, because division by zero is undefined.

In the definition of the limit in terms of infinitesimals, the first requirement is that f(0+dx) be finite for infinitesimal values of dx. The graph makes this look plausible, and indeed we can prove that it is true by the transfer principle. For any real x we have -π/2 ≤ f(x) ≤ π/2, and by the transfer principle this holds for the hyperreals as well, and therefore f(0+dx) is finite.

The second requirement is that the standard part of f(0+dx) have a uniquely defined value. The graph shows that we really have two cases to consider, one on the right side of the graph, and one on the left. Intuitively, we expect that the standard part of f(0+dx) will equal π/2 for positive dx, and -π/2 for negative, and thus the second part of the definition will not be satisfied. For a more formal proof, we can use the transfer principle. For real x with 0<x<1, for example, f is always positive and greater than 1, so we conclude based on the transfer principle that f(0+dx)>1 for positive infinitesimal dx. But on similar grounds we can be sure that f(0+dx)<-1 when dx is negative and infinitesimal. Thus the standard part of f(0+dx) can have different values for different infinitesimal values of dx, and we conclude that the limit is undefined.

In examples like this, we can define a kind of one-sided limit, notated like this:

where the notations x→ 0- and x→ 0+ are to be read “as x approaches zero from below,” and “as x approaches zero from above.”

3.3 L'H\^{o}pital's rule

Consider the limit

Plugging in doesn't work, because we get 0/0. Division by zero is undefined, both in the real number system and in the hyperreals. A nonzero number divided by a small number gives a big number; a nonzero number divided by a very small number gives a very big number; and a nonzero number divided by an infinitesimal number gives an infinite number. On the other hand, dividing zero by zero means looking for a solution to the equation 0=0q, where q is the result of the division. But any q is a solution of this equation, so even speaking casually, it's not correct to say that 0/0 is infinite; it's not infinite, it's anything we like.

Since plugging in zero didn't work, let's try estimating the limit by plugging in a number for x that's small, but not zero. On a calculator,

It looks like the limit is 1. We can confirm our conjecture to higher precision using Yacas's ability to do high-precision arithmetic:

N(Sin(10^-20)/10^-20,50)

0.99999999999999999

9999999999999999999

99998333333333

It's looking pretty one-ish. This is the idea of the Weierstrass definition of a limit: it seems like we can get an answer as close to 1 as we like, if we're willing to make x as close to 0 as necessary. The graph helps to make this plausible.

g / The graph of sin x/x.

The general idea here is that for small values of x, the small-angle approximation sin x≈ x obtains, and as x gets smaller and smaller, the approximation gets better and better, so sin x/x gets closer and closer to 1.

But we still haven't proved rigorously that the limit is exactly 1. Let's try using the definition of the limit in terms of infinitesimals.

In fact, this limit is the same one we would use if we were evaluating the derivative of the sine function, applying the definition of the derivative as a limit.

We can check our work using Inf:

: (sin d)/d

1+(-0.16667)d^2+...

(The ... is where I've snipped trailing terms from the output.)

Our example involving the limit of sin x/x is a special case of the following rule for calculating limits involving 0/0:

L'H\^{o}pital's rule (simplest form)

pital's rule (simplest form)} If u and v are functions with u(a)=0 and v(a)=0, the derivatives v·(a) and v·(a) are defined, and the derivative v·(a)≠ 0, then

Proof: Since u(a)=0, and the derivative du/dx is defined at a, u(a+dx)=du is infinitesimal, and likewise for v. By the definition of the limit, the limit is the standard part of

where by assumption the numerator and denominator are both defined (and finite, because the derivative is defined in terms of the standard part). The standard part of a quotient like p/q equals the quotient of the standard parts, provided that both p and q are finite (which we've established), and q ≠ 0 (which is true by assumption). But the standard part of du/dx is the definition of the derivative u·, and likewise for dv/dx, so this establishes the result.

We will generalize L'H\^{o}pital's rule on p. 65.

By the way, the housetop accent on the “\^{o}” in l'H\^{o}pital means that in Old French it used to be spelled and pronounced “l'Hospital,” but the “s” later became silent, so they stopped writing it. So yes, it is the same word as “hospital.”

Example 11

As remarked above, the example of \lim{x→0} sin x/x is in some sense circular, since the limit is equivalent to the definition of the derivative of the sine function, so we already need to know the limit in order to evaluate the limit! As an example that isn't circular, let's evaluate

The derivative of the top is cos x, and the derivative of the bottom is 1. Evaluating these at x=0 gives 1 and 1, so the answer is 1/1=1.

Example 12

◊ Evaluate

◊ Taking the derivatives of the top and bottom, we find ex/1, which equals 1 when evaluated at x=0.

Example 13

◊ Evaluate

◊ Plugging in x=1 fails, because both the top and the bottom are zero. Taking the derivatives of the top and bottom, we find 1/(2x-2), which blows up to infinity when x=1. To symbolize the fact that the limit is undefined, and undefined because it blows up to infinity, we write

3.4 Another perspective on indeterminate forms

An expression like 0/0, called an indeterminate form, can be thought of in a different way in terms of infinitesimals. Suppose I tell you I have two infinitesimal numbers d and e in my pocket, and I ask you whether d/e is finite, infinite, or infinitesimal. You can't tell, because d and e might not be infinitesimals of the same order of magnitude. For instance, if e=37d, then d/e=1/37 is finite; but if e=d^2, then d/e is infinite; and if d=e^2, then d/e is infinitesimal. Acting this out with numbers that are small but not infinitesimal,

On the other hand, suppose I tell you I have an infinitesimal number d and a finite number x, and I ask you to speculate about d/x. You know for sure that it's going to be infinitesimal. Likewise, you can be sure that x/d is infinite. These aren't indeterminate forms.

We can do something similar with infinite numbers. If H and K are both infinite, then H-K is indeterminate. It could be infinite, for example, if H was positive infinite and K=H/2. On the other hand, it could be finite if H=K+1. Acting this out with big but finite numbers,

Example 14

◊ If H is a positive infinite number, is √H+1-√H-1 finite, infinite, infinitesimal, or indeterminate?

◊ Trying it with a finite, big number, we have

which is clearly a wannabe infinitesimal. We can verify the result using Inf:

: H=1/d

d^-1

: sqrt(H+1)-sqrt(H-1)

d^1/2+0.125d^5/2+...

For convenience, the first line of input defines an infinite number H in terms of the calculator's built-in infinitesimal d. The result has only positive powers of d, so it's clearly infinitesimal.

More rigorously, we can rewrite the expression as √H(√1+1/H-√1-1/H). Since the derivative of the square root function √x evaluated at x=1 is 1/2, we can approximate this as

which is infinitesimal.

3.5 Limits at infinity

The definition of the limit in terms of infinitesimals extends immediately to limiting processes where x gets bigger and bigger, rather than closer and closer to some finite value. For example, the function 3+1/x clearly gets closer and closer to 3 as x gets bigger and bigger. If a is an infinite number, then the definition says that evaluating this expression at a+dx, where dx is infinitesimal, gives a result whose standard part is 3. It doesn't matter that a happens to be infinite, the definition still works. We also note that in this example, it doesn't matter what infinite number a is; the limit equals 3 for any infinite a. We can write this fact as

where the symbol ∞ is to be interpreted as “nyeah nyeah, I don't even care what infinite number you put in here, I claim it will work out to 3 no matter what.” The symbol ∞ is not to be interpreted as standing for any specific infinite number. That would be the type of fallacy that lay behind the bogus proof on page 30 that 1=1/2, which assumed that all infinities had to be the same size.

A somewhat different example is the arctangent function. The arctangent of 1000 equals approximately 1.5698, and inputting bigger and bigger numbers gives answers that appear to get closer and closer to π/2≈1.5707. But the arctangent of -1000 is approximately -1.5698, i.e., very close to -π/2. From these numerical observations, we conjecture that

equals π/2 for positive infinite a, but -π/2 for negative infinite a. It would not be correct to write

because it does matter what infinite number we pick. Instead we write

Some expressions don't have this kind of limit at all. For example, if you take the sines of big numbers like a thousand, a million, etc., on your calculator, the results are essentially random numbers lying between -1 and 1. They don't settle down to any particular value, because the sine function oscillates back and forth forever. To prove formally that \lim_{x→ +∞} sin x is undefined, consider that the sine function, defined on the real numbers, has the property that you can always change its result by at least 0.1 if you add either 1.5 or -1.5 to its input. For example, sin(.8)≈ 0.717, and sin(.8-1.5)≈-0.644. Applying the transfer principle to this statement, we find that the same is true on the hyperreals. Therefore there cannot be any value ℓ that differs infinitesimally from sin a for all positive infinite values of a.

Often we're interested in finding the limit as x approaches infinity of an expression that is written as an indeterminate form like H/K, where both H and K are infinite.

Example 15

◊ Evaluate the limit

◊ Intuitively, if x gets large enough the constant terms will be negligible, and the top and bottom will be dominated by the 2x and x terms, respectively, giving an answer that approaches 2.

One way to verify this is to divide both the top and the bottom by x, giving

If x is infinite, then the standard part of the top is 2, the standard part of the bottom is 1, and the standard part of the whole thing is therefore 2.

Another approach is to use l'H\^{o}pital's rule. The derivative of the top is 2, and the derivative of the bottom is 1, so the limit is 2/1=2.

3.6 Generalizations of l'H\^{o}pital's rule

Mathematical theorems are sometimes like cars. I own a Honda Fit that is about as bare-bones as you can get these days, but persuading a dealer to sell me that car was like pulling teeth. The salesman was absolutely certain that any sane customer would want to pay an extra $1,800 for such crucial amenities as floor mats and a chrome tailpipe. L'H\^{o}pital's rule in its most general form is a much fancier piece of machinery than the stripped down model described on p. 61. The price you pay for the deluxe model is that the proof becomes much more complicated than the one-liner that sufficed for the simple version.

Multiple applications of the rule

In the following example, we have to use l'H\^{o}pital's rule twice before we get an answer.

Example 16

◊ Evaluate

◊ Applying l'H\^{o}pital's rule gives

which still produces 0/0 when we plug in x=π. Going again, we get

The reason that this always works is outlined on p. 152.

The indeterminate form ∞/∞

Consider an example like this:

This is an indeterminate form like ∞/∞ rather than the 0/0 form for which we've already proved l'H\^{o}pital's rule. As proved on p. 153, l'H\^{o}pital's rule applies to examples like this as well.

Example 17

◊ Evaluate

◊ Both the numerator and the denominator go to infinity. Differentiation of the top and bottom gives (-x-2)/(-2x-2) = 1/2. We can see that the reason the rule worked was that (1) the constant terms were irrelevant because they become negligible as the 1/x terms blow up; and (2) differentiating the blowing-up 1/x terms makes them into the same x-2 on top and bottom, which cancel.

Note that we could also have gotten this result without l'H\^{o}pital's rule, simply by multiplying both the top and the bottom of the original expression by x in order to rewrite it as (x+1)/(x+2).

Limits at infinity

It is straightforward to prove a variant of l'H\^{o}pital's rule that allows us to do limits at infinity. The general proof is left as an exercise (problem 8, p. 68). The result is that l'H\^{o}pital's rule is equally valid when the limit is at ±∞ rather than at some real number a.

Example 18

◊ Evaluate

◊ We could use a change of variable to make this into example 39 on p. 59, which was solved using an ad hoc and multiple-step procedure. But having established the more general form of l'H\^{o}pital's rule, we can do it in one step. Differentiation of the top and bottom produces

Homework Problems

1. (a) Prove, using the Weierstrass definition of the limit, that if \lim_{x→ a} f(x) = F and \lim_{x→ a} g(x) = G both exist, them \lim_{x→ a} [f(x)+g(x)] = F+G, i.e., that the limit of a sum is the sum of the limits. (b) Prove the same thing using the definition of the limit in terms of infinitesimals. (solution in the pdf version of the book)

2. Sketch the graph of the function e-1/x, and evaluate the following four limits:

(solution in the pdf version of the book)

3. Verify the following limits.

[Granville, 1911] (solution in the pdf version of the book)

4. Evaluate

exactly, and check your result by numerical approximation. (solution in the pdf version of the book)

5. Amy is asked to evaluate

She applies l'H\^{o}pital's rule, differentiating top and bottom to find 1/ex, which equals 1 when she plugs in x=0. What is wrong with her reasoning? (solution in the pdf version of the book)

6. Evaluate

exactly, and check your result by numerical approximation. (solution in the pdf version of the book)

7. Evaluate

exactly, and check your result by numerical approximation. (solution in the pdf version of the book)

8. Prove a form of l'H\^{o}pital's rule stating that

is equal to the limit of f'/g' at infinity. Hint: change to some new variable u such that x→∞ corresponds to u→0. (solution in the pdf version of the book)

9. Prove that the linear function y=ax+b, where a and b are real, is continuous, first using the definition of continuity in terms of infinitesimals, and then using the definition in terms of the Weierstrass limit. (solution in the pdf version of the book)

(c) 1998-2013 Benjamin Crowell, licensed under the Creative Commons Attribution-ShareAlike license. Photo credits are given at the end of the Adobe Acrobat version.

Chapter 4. Integration

4.1 Definite and indefinite integrals

Because any formula can be differentiated symbolically to find another formula, the main motivation for doing derivatives numerically would be if the function to be differentiated wasn't known in symbolic form. A typical example might be a two-person network computer game, in which player A's computer needs to figure out player B's velocity based on knowledge of how her position changes over time. But in most cases, it's numerical integration that's interesting, not numerical differentiation.

As a warm-up, let's see how to do a running sum of a discrete function using Yacas. The following program computes the sum 1+2+…+100 discussed to on page 7. Now that we're writing real computer programs with Yacas, it would be a good idea to enter each program into a file before trying to run it. In fact, some of these examples won't run properly if you just start up Yacas and type them in one line at a time. If you're using Adobe Reader to read this book, you can do Tools>Basic>Select, select the program, copy it into a file, and then edit out the line numbers.

Example 1

\nn n := 1;

\nn sum := 0;

\nn While (n<=100) [

\nn   sum := sum+n;

\nn   n := n+1;

\nn ];

\nn Echo(sum);

The semicolons are to separate one instruction from the next, and they become necessary now that we're doing real programming. Line 1 of this program defines the variable n, which will take on all the values from 1 to 100. Line 2 says that we haven't added anything up yet, so our running sum is zero so far. Line 3 says to keep on repeating the instructions inside the square brackets until n goes past 100. Line 4 updates the running sum, and line 5 updates the value of n. If you've never done any programming before, a statement like n:=n+1 might seem like nonsense --- how can a number equal itself plus one? But that's why we use the := symbol; it says that we're redefining n, not stating an equation. If n was previously 37, then after this statement is executed, n will be redefined as 38. To run the program on a Linux computer, do this (assuming you saved the program in a file named sum.yacas):

% yacas -pc sum.yacas

5050

Here the \verb@One way of stating this result is

The capital Greek letter Σ, sigma, is used because it makes the “s” sound, and that's the first sound in the word “sum.” The n=1 below the sigma says the sum starts at 1, and the 100 on top says it ends at 100. The n is what's known as a dummy variable: it has no meaning outside the context of the sum. Figure a shows the graphical interpretation of the sum: we're adding up the areas of a series of rectangular strips. (For clarity, the figure only shows the sum going up to 7, rather than 100.)

a / Graphical interpretation of the sum 1+2+…+7.

Now how about an integral? Figure b shows the graphical interpretation of what we're trying to do: find the area of the shaded triangle. This is an example we know how to do symbolically, so we can do it numerically as well, and check the answers against each other. Symbolically, the area is given by the integral. To integrate the function x·(t)=t, we know we need some function with a t^2 in it, since we want something whose derivative is t, and differentiation reduces the power by one. The derivative of t^2 would be 2t rather than t, so what we want is x(t)=t^2/2. Let's compute the area of the triangle that stretches along the t axis from 0 to 100: x(100)=100^2/2=5000.

b / Graphical interpretation of the integral of the function x·(t)=t.

Figure c shows how to accomplish the same thing numerically. We break up the area into a whole bunch of very skinny rectangles. Ideally, we'd like to make the width of each rectangle be an infinitesimal number dx, so that we'd be adding up an infinite number of infinitesimal areas. In reality, a computer can't do that, so we divide up the interval from t=0 to t=100 into H rectangles, each with finite width dt=100/H. Instead of making H infinite, we make it the largest number we can without making the computer take too long to add up the areas of the rectangles.

c / Approximating the integral numerically.

Example 2

\nn tmax := 100;

\nn H := 1000;

\nn dt := tmax/H;

\nn sum := 0;

\nn t := 0;

\nn While (t<=tmax) [

\nn   sum := N(sum+t*dt);

\nn   t := N(t+dt);

\nn ];

\nn Echo(sum);

In example 51, we split the interval from t=0 to 100 into H=1000 small intervals, each with width dt=0.1. The result is 5,005, which agrees with the symbolic result to three digits of precision. Changing H to 10,000 gives 5,000.5, which is one more digit. Clearly as we make the number of rectangles greater and greater, we're converging to the correct result of 5,000.

In the Leibniz notation, the thing we've just calculated, by two different techniques, is written like this:

It looks a lot like the Σ notation, with the Σ replaces by a flattened-out letter “S.” The t is a dummy variable. What I've been casually referring to as an integral is really two different but closely related things, known as the definite integral and the indefinite integral.

Definition of the indefinite integral

If x· is a function, then a function x is an indefinite integral of x· if, as implied by the notation, dx/dt=x·.

Interpretation: Doing an indefinite integral means doing the opposite of differentiation. All the possible indefinite integrals are the same function except for an additive constant.

Example 3

◊ Find the indefinite integral of the function x·(t)=t.

◊ Any function of the form

x(t)=t^2/2+c ,

where c is a constant, is an indefinite integral of this function, since its derivative is t.

Definition of the definite integral

If x· is a function, then the definite integral of x· from a to b is defined as

where Δ t=(b-a)/H.

Interpretation: What we're calculating is the area under the graph of x·, from a to b. (If the graph dips below the t axis, we interpret the area between it and the axis as a negative area.) The thing inside the limit is a calculation like the one done in example 51, but generalized to a≠ 0. If H was infinite, then Δ t would be an infinitesimal number dt.

4.2 The fundamental theorem of calculus

The fundamental theorem of calculus

Let x be an indefinite integral of x·, and let x· be a continuous function (one whose graph is a single connected curve). Then

The fundamental theorem is proved on page 154. The idea it expresses is that integration and differentiation are inverse operations. That is, integration undoes differentiation, and differentiation undoes integration.

Example 4

◊ Interpret the definite integral

graphically; then evaluate it it both symbolically and numerically, and check that the two results are consistent.

d / The definite integral \int_1^2 (1/t)dt.

◊ Figure d shows the graphical interpretation. The numerical calculation requires a trivial variation on the program from example 51:

a := 1;

b := 2;

H := 1000;

dt := (b-a)/H;

sum := 0;

t := a;

While (t<=b) [

sum := N(sum+(1/t)*dt);

t := N(t+dt);

];

Echo(sum);

The result is 0.693897243, and increasing H to 10,000 gives 0.6932221811, so we can be fairly confident that the result equals 0.693, to 3 decimal places.

Symbolically, the indefinite integral is x=ln t. Using the fundamental theorem of calculus, the area is ln 2-ln 1≈ 0.693147180559945.

Judging from the graph, it looks plausible that the shaded area is about 0.7.

This is an interesting example, because the natural log blows up to negative infinity as t approaches 0, so it's not possible to add a constant onto the indefinite integral and force it to be equal to 0 at t=0. Nevertheless, the fundamental theorem of calculus still works.

4.3 Properties of the integral

Let f and g be two functions of x, and let c be a constant. We already know that for derivatives,

But since the indefinite integral is just the operation of undoing a derivative, the same kind of rules must hold true for indefinite integrals as well:

And since a definite integral can be found by plugging in the upper and lower limits of integration into the indefinite integral, the same properties must be true of definite integrals as well.

Example 5

◊ Evaluate the indefinite integral

◊ Using the additive property, the integral becomes

Then the property of scaling by a constant lets us change this to

We need a function whose derivative is x, which would be x^2/2, and one whose derivative is sin x, which must be -cos x, so the result is

4.4 Applications

Averages

In the story of Gauss's problem of adding up the numbers from 1 to 100, one interpretation of the result, 5,050, is that the average of all the numbers from 1 to 100 is 50.5. This is the ordinary definition of an average: add up all the things you have, and divide by the number of things. (The result in this example makes sense, because half the numbers are from 1 to 50, and half are from 51 to 100, so the average is half-way between 50 and 51.)

Similarly, a definite integral can also be thought of as a kind of average. In general, if y is a function of x, then the average, or mean, value of y on the interval from x=a to b can be defined as

In the continuous case, dividing by b-a accomplishes the same thing as dividing by the number of things in the discrete case.

Example 6

◊ Show that the definition of the average makes sense in the case where the function is a constant.

◊ If y is a constant, then we can take it outside of the integral, so

Example 7

◊ Find the average value of the function y=x^2 for values of x ranging from 0 to 1.

The mean value theorem

If the continuous function y(x) has the average value y- on the interval from x=a to b, then y attains its average value at least once in that interval, i.e., there exists ξ with a<ξ<b such that y(ξ)=y-.

The mean value theorem is proved on page 161. The special case in which y-=0 is known as Rolle's theorem.

Example 8

◊ Verify the mean value theorem for y=x^2 on the interval from 0 to 1.

◊ The mean value is 1/3, as shown in example 56. This value is achieved at x=√1/3=1/√3, which lies between 0 and 1.

Work

In physics, work is a measure of the amount of energy transferred by a force; for example, if a horse sets a wagon in motion, the horse's force on the wagon is putting some energy of motion into the wagon. When a force F acts on an object that moves in the direction of the force by an infinitesimal distance dx, the infinitesimal work done is dW=Fdx. Integrating both sides, we have W=\intab Fdx, where the force may depend on x, and a and b represent the initial and final positions of the object.

Example 9

◊ A spring compressed by an amount x relative to its relaxed length provides a force F=kx. Find the amount of work that must be done in order to compress the spring from x=0 to x=a. (This is the amount of energy stored in the spring, and that energy will later be released into the toy bullet.)

◊

The reason W grows like a^2, not just like a, is that as the spring is compressed more, more and more effort is required in order to compress it.

Probability

Mathematically, the probability that something will happen can be specified with a number ranging from 0 to 1, with 0 representing impossibility and 1 representing certainty. If you flip a coin, heads and tails both have probabilities of 1/2. The sum of the probabilities of all the possible outcomes has to have probability 1. This is called normalization.

e / Normalization: the probability of picking land plus the probability of picking water adds up to 1.

So far we've discussed random processes having only two possible outcomes: yes or no, win or lose, on or off. More generally, a random process could have a result that is a number. Some processes yield integers, as when you roll a die and get a result from one to six, but some are not restricted to whole numbers, e.g., the height of a human being, or the amount of time that a uranium-238 atom will exist before undergoing radioactive decay. The key to handling these continuous random variables is the concept of the area under a curve, i.e., an integral.

f / Probability distribution for the result of rolling a single die.

Consider a throw of a die. If the die is “honest,” then we expect all six values to be equally likely. Since all six probabilities must add up to 1, then probability of any particular value coming up must be 1/6. We can summarize this in a graph, f. Areas under the curve can be interpreted as total probabilities. For instance, the area under the curve from 1 to 3 is 1/6+1/6+1/6=1/2, so the probability of getting a result from 1 to 3 is 1/2. The function shown on the graph is called the probability distribution.

g / Rolling two dice and adding them up.

Figure g shows the probabilities of various results obtained by rolling two dice and adding them together, as in the game of craps. The probabilities are not all the same. There is a small probability of getting a two, for example, because there is only one way to do it, by rolling a one and then another one. The probability of rolling a seven is high because there are six different ways to do it: 1+6, 2+5, etc.

If the number of possible outcomes is large but finite, for example the number of hairs on a dog, the graph would start to look like a smooth curve rather than a ziggurat.

What about probability distributions for random numbers that are not integers? We can no longer make a graph with probability on the y axis, because the probability of getting a given exact number is typically zero. For instance, there is zero probability that a person will be exactly 200 cm tall, since there are infinitely many possible results that are close to 200 but not exactly two, for example 199.99999999687687658766. It doesn't usually make sense, therefore, to talk about the probability of a single numerical result, but it does make sense to talk about the probability of a certain range of results. For instance, the probability that a randomly chosen person will be more than 170 cm and less than 200 cm in height is a perfectly reasonable thing to discuss. We can still summarize the probability information on a graph, and we can still interpret areas under the curve as probabilities.

h / A probability distribution for human height.

But the y axis can no longer be a unitless probability scale. In the example of human height, we want the x axis to have units of meters, and we want areas under the curve to be unitless probabilities. The area of a single square on the graph paper is then

If the units are to cancel out, then the height of the square must evidently be a quantity with units of inverse centimeters. In other words, the y axis of the graph is to be interpreted as probability per unit height, not probability.

Another way of looking at it is that the y axis on the graph gives a derivative, dP/dx: the infinitesimally small probability that x will lie in the infinitesimally small range covered by dx.

Example 10

◊ A computer language will typically have a built-in subroutine that produces a fairly random number that is equally likely to take on any value in the range from 0 to 1. If you take the absolute value of the difference between two such numbers, the probability distribution is of the form dP/dx=k(1-x). Find the value of the constant k that is required by normalization.

◊

self-check:

Compare the number of people with heights in the range of 130-135 cm to the number in the range 135-140.

(answer in the back of the PDF version of the book)

i / The average can be interpreted as the balance point of the probability distribution.

When one random variable is related to another in some mathematical way, the chain rule can be used to relate their probability distributions.

j / Example 60.

Example 11

◊ A laser is placed one meter away from a wall, and spun on the ground to give it a random direction, but if the angle u shown in figure j doesn't come out in the range from 0 to π/2, the laser is spun again until an angle in the desired range is obtained. Find the probability distribution of the distance x shown in the figure. The derivative dtan-1z/dz=1/(1+z^2) will be required (see example 66, page 88).

◊ Since any angle between 0 and π/2 is equally likely, the probability distribution dP/du must be a constant, and normalization tells us that the constant must be dP/du=2/π.

The laser is one meter from the wall, so the distance x, measured in meters, is given by x=tan u. For the probability distribution of x, we have

Note that the range of possible values of x theoretically extends from 0 to infinity. Problem 7 on page 104 deals with this.

If the next Martian you meet asks you, “How tall is an adult human?,” you will probably reply with a statement about the average human height, such as “Oh, about 5 feet 6 inches.” If you wanted to explain a little more, you could say, “But that's only an average. Most people are somewhere between 5 feet and 6 feet tall.” Without bothering to draw the relevant bell curve for your new extraterrestrial acquaintance, you've summarized the relevant information by giving an average and a typical range of variation. The average of a probability distribution can be defined geometrically as the horizontal position at which it could be balanced if it was constructed out of cardboard, i. This is a different way of working with averages than the one we did earlier. Before, had a graph of y versus x, we implicitly assumed that all values of x were equally likely, and we found an average value of y. In this new method using probability distributions, the variable we're averaging is on the x axis, and the y axis tells us the relative probabilities of the various x values.

For a discrete-valued variable with n possible values, the average would be

and in the case of a continuous variable, this becomes an integral,

Example 12

◊ For the situation described in example 59, find the average value of x.

◊

Sometimes we don't just want to know the average value of a certain variable, we also want to have some idea of the amount of variation above and below the average. The most common way of measuring this is the standard deviation, defined by

The idea here is that if there was no variation at all above or below the average, then the quantity (x-x-) would be zero whenever dP/dx was nonzero, and the standard deviation would be zero. The reason for taking the square root of the whole thing is so that the result will have the same units as x.

Example 13

◊ For the situation described in example 59, find the standard deviation of x.

◊ The square of the standard deviation is

Homework Problems

1. Write a computer program similar to the one in example 53 on page 74 to evaluate the definite integral

(solution in the pdf version of the book)

2. Evaluate the integral

and draw a sketch to explain why your result comes out the way it does. (solution in the pdf version of the book)

3. Sketch the graph that represents the definite integral

and estimate the result roughly from the graph. Then evaluate the integral exactly, and check against your estimate. (solution in the pdf version of the book)

4. Make a rough guess as to the average value of sin x for 0<x<π, and then find the exact result and check it against your guess. (solution in the pdf version of the book)

5. Show that the mean value theorem's assumption of continuity is necessary, by exhibiting a discontinuous function for which the theorem fails. (solution in the pdf version of the book)

6. Show that the fundamental theorem of calculus's assumption of continuity for x· is necessary, by exhibiting a discontinuous function for which the theorem fails. (solution in the pdf version of the book)

7. Sketch the graphs of y=x^2 and y=√x for 0≤ x≤ 1. Graphically, what relationship should exist between the integrals \int_0^1 x^2dx and \int_0^1 √xdx? Compute both integrals, and verify that the results are related in the expected way.

8. Evaluate \int√bx√{x}dx, where b is a constant. (solution in the pdf version of the book)

9. In a gasoline-burning car engine, the exploding air-gas mixture makes a force on the piston, and the force tapers off as the piston expands, allowing the gas to expand. (a) In the approximation F=k/x, where x is the position of the piston, find the work done on the piston as it travels from x=a to x=b, and show that the result only depends on the ratio b/a. This ratio is known as the compression ratio of the engine. (b) A better approximation, which takes into account the cooling of the air-gas mixture as it expands, is F=kx-1.4. Compute the work done in this case.

k / Problem 9.

10. A certain variable x varies randomly from -1 to 1, with probability distribution dP/dx=k(1-x^2).

(a) Determine k from the requirement of normalization.

(b) Find the average value of x.

(c) Find its standard deviation.

11. Suppose that we've already established that the derivative of an odd function is even, and vice versa. (See problem 30, p. 50.) Something similar can be proved for integration. However, the following is not quite right.

Let f be even, and let g=\int f(x)dx be its indefinite integral. Then by the fundamental theorem of calculus, f is the derivative of g. Since we've already established that the derivative of an odd function is even, we conclude that g is odd.

Find all errors in the proof. (solution in the pdf version of the book)

12. A perfectly elastic ball bounces up and down forever, always coming back up to the same height h. Find its average height.

l / Problem 13.

13. The figure shows a curve with a tangent line segment of length 1 that sweeps around it, forming a new curve that is usually outside the old one. Prove Holditch's theorem, which states that the new curve's area differs from the old one's by π. (This is an example of a result that is much more difficult to prove without making use of infinitesimals.)

(c) 1998-2013 Benjamin Crowell, licensed under the Creative Commons Attribution-ShareAlike license. Photo credits are given at the end of the Adobe Acrobat version.

Chapter 5. Techniques

5.1 Newton's method

In the 1958 science fiction novel Have Space Suit --- Will Travel, by Robert Heinlein, Kip is a high school student who wants to be an engineer, and his father is trying to convince him to stretch himself more if he wants to get anything out of his education:

“Why did Van Buren fail of re-election? How do you extract the cube root of eighty-seven?”

Van Buren had been a president; that was all I remembered. But I could answer the other one. “If you want a cube root, you look in a table in the back of the book.”

Dad sighed. “Kip, do you think that table was brought down from on high by an archangel?”

We no longer use tables to compute roots, but how does a pocket calculator do it? A technique called Newton's method allows us to calculate the inverse of any function efficiently, including cases that aren't preprogrammed into a calculator. In the example from the novel, we know how to calculate the function y=x^3 fairly accurately and quickly for any given value of x, but we want to turn the equation around and find x when y=87. We start with a rough mental guess: since 4^3=64 is a little too small, and 5^3=125 is much too big, we guess x≈ 4.3. Testing our guess, we have 4.3^3=79.5. We want y to get bigger by 7.5, and we can use calculus to find approximately how much bigger x needs to get in order to accomplish that:

Increasing our value of x to 4.3+0.14=4.44, we find that 4.44^3=87.5 is a pretty good approximation to 87. If we need higher precision, we can go through the process again with Δ y=-0.5, giving

This second iteration gives an excellent approximation.

a / Example 63.

Example 1

◊ Figure 63 shows the astronomer Johannes Kepler's analysis of the motion of the planets. The ellipse is the orbit of the planet around the sun. At t=0, the planet is at its closest approach to the sun, A. At some later time, the planet is at point B. The angle x (measured in radians) is defined with reference to the imaginary circle encompassing the orbit. Kepler found the equation

where the period, T, is the time required for the planet to complete a full orbit, and the eccentricity of the ellipse, e, is a number that measures how much it differs from a circle. The relationship is complicated because the planet speeds up as it falls inward toward the sun, and slows down again as it swings back away from it.

The planet Mercury has e=0.206. Find the angle x when Mercury has completed 1/4 of a period.

◊ We have

y = x-(0.206)sin x ,

and we want to find x when y=2π/4=1.57. As a first guess, we try x=π/2 (90 degrees), since the eccentricity of Mercury's orbit is actually much smaller than the example shown in the figure, and therefore the planet's speed doesn't vary all that much as it goes around the sun. For this value of x we have y=1.36, which is too small by 0.21.

(The derivative dy/dx happens to be 1 at x=π/2.) This gives a new value of x, 1.57+.21=1.78. Testing it, we have y=1.58, which is correct to within rounding errors after only one iteration. (We were only supplied with a value of e accurate to three significant figures, so we can't get a result with precision better than about that level.)

5.2 Implicit differentiation

We can differentiate any function that is written as a formula, and find a result in terms of a formula. However, sometimes the original problem can't be written in any nice way as a formula. For example, suppose we want to find dy/dx in a case where the relationship between x and y is given by the following equation:

y^7+y = x^7+x^2 .

There is no equivalent of the quadratic formula for seventh-order polynomials, so we have no way to solve for one variable in terms of the other in order to differentiate it. However, we can still find dy/dx in terms of x and y. Suppose we let x grow to x+dx. Then for example the x^2 term will grow to (x+dx)2=x+2dx+dx^2. The squared infinitesimal is negligible, so the increase in x^2 was really just 2dx, and we've really just computed the derivative of x^2 with respect to x and multiplied it by dx. In symbols,

That is, the change in x^2 is 2x times the change in x. Doing this to both sides of the original equation, we have

This still doesn't give us a formula for the derivative in terms of x alone, but it's not entirely useless. For instance, if we're given a numerical value of x, we can always use Newton's method to find y, and then evaluate the derivative.

5.3 Methods of integration

Change of variable

Sometimes an unfamiliar-looking integral can be made into a familiar one by substituting a new variable for an old one. For example, we know how to integrate 1/x --- the answer is ln x --- but what about

Let u=2x+1. Differentiating both sides, we have du=2dx, or dx=du/2, so

This technique is known as a change of variable or a substitution. (Because the letter u is often employed, you may also see it called u-substitution.)

In the case of a definite integral, we have to remember to change the limits of integration to reflect the new variable.

Example 2

◊ Evaluate \int_3^4 dx/(2x+1).

◊ As before, let u=2x+1.

Sometimes, as in the next example, a clever substitution is the secret to doing a seemingly impossible integral.

Example 3

◊ Evaluate

◊ The only hope for reducing this to a form we can do is to let u=√ x. Then dx=d(u^2)=2udu, so

Example 65 really isn't so tricky, since there was only one logical choice for the substitution that had any hope of working. The following is a little more dastardly.

Example 4

◊ Evaluate

◊ The substitution that works is x=tan u. First let's see what this does to the expression 1+x^2. The familiar identity

so 1+x^2 becomes \sec^2 u. But differentiating both sides of x=tan u gives

so the integral becomes

What mere mortal would ever have suspected that the substitution x=tan u was the one that was needed in example 66? One possible answer is to give up and do the integral on a computer:

Integrate(x) 1/(1+x^2)

ArcTan(x)

Another possible answer is that you can usually smell the possibility of this type of substitution, involving a trig function, when the thing to be integrated contains something reminiscent of the Pythagorean theorem, as suggested by figure b. The 1+x^2 looks like what you'd get if you had a right triangle with legs 1 and x, and were using the Pythagorean theorem to find its hypotenuse.

b / The substitution x=tan u.

Example 5

◊ Evaluate \int dx/√1-x^2.

◊ The √1-x^2 looks like what you'd get if you had a right triangle with hypotenuse 1 and a leg of length x, and were using the Pythagorean theorem to find the other leg, as in figure c. This motivates us to try the substitution x=cos u, which gives dx=-sin udu and √1-x^2=√1-cos^2u=sin u. The result is

c / The substitution x=cos u.

Integration by parts

Figure d shows a technique called integration by parts. If the integral \int vdu is easier than the integral \int udv, then we can calculate the easier one, and then by simple geometry determine the one we wanted. Identifying the large rectangle that surrounds both shaded areas, and the small white rectangle on the lower left, we have

d / Integration by parts.

In the case of an indefinite integral, we have a similar relationship derived from the product rule:

Integrating both sides, we have the following relation.

Integration by parts

Since a definite integral can always be done by evaluating an indefinite integral at its upper and lower limits, one usually uses this form. Integrals don't usually come prepackaged in a form that makes it obvious that you should use integration by parts. What the equation for integration by parts tells us is that if we can split up the integrand into two factors, one of which (the dv) we know how to integrate, we have the option of changing the integral into a new form in which that factor becomes its integral, and the other factor becomes its derivative. If we choose the right way of splitting up the integrand into parts, the result can be a simplification.

Example 6

◊ Evaluate

◊ There are two obvious possibilities for splitting up the integrand into factors,

The first one is the one that lets us make progress. If u=x, then du=dx, and if dv=cos xdx, then integration gives v=sin x.

Of the two possibilities we considered for u and dv, the reason this one helped was that differentiating x gave dx, which was simpler, and integrating cos xdx gave sin x, which was no more complicated than before. The second possibility would have made things worse rather than better, because integrating xdx would have given x^2/2, which would have been more complicated rather than less.

Example 7

◊ Evaluate \int ln x dx.

◊ This one is a little tricky, because it isn't explicitly written as a product, and yet we can attack it using integration by parts. Let u=ln x and dv=dx.

Example 8

◊ Evaluate \int x^2 ex dx.

◊ Integration by parts lets us split the integrand into two factors, integrate one, differentiate the other, and then do that integral. Integrating or differentiating ex does nothing. Integrating x^2 increases the exponent, which makes the problem look harder, whereas differentiating x^2 knocks the exponent down a step, which makes it look easier. Let u=x^2 and dv=ex dx, so that du=2xdx and v=ex. We then have

Although we don't immediately know how to evaluate this new integral, we can subject it to the same type of integration by parts, now with u=x and dv=ex dx. After the second integration by parts, we have:

Partial fractions

Given a function like

we can rewrite it over a common denominator like this:

But note that the original form is easily integrated to give

while faced with the form

[4] -2/(x^2-1), we wouldn't have known how to integrate it.

Note that the original function was of the form (-1)/…+(+1)/… It's not a coincidence that the two constants on top, -1 and +1, are opposite in sign but equal in absolute value. To see why, consider the behavior of this function for large values of x. Looking at the form -1/(x-1)+1/(x+1), we might naively guess that for a large value of x such as 1000, it would come out to be somewhere on the order thousandths. But looking at the form -2/(x^2-1), we would expect it to be way down in the millionths. This seeming paradox is resolved by noting that for large values of x, the two terms in the form -1/(x-1)+1/(x+1) very nearly cancel. This cancellation could only have happened if the constants on top were opposites like plus and minus one.

The idea of the method of partial fractions is that if we want to do an integral of the form

where P(x) is an nth order polynomial, we rewrite 1/P as

where r_1 ... rn are the roots of the polynomial, i.e., the solutions of the equation P(r)=0. If the polynomial is second-order, you can find the roots r_1 and r_2 using the quadratic formula; I'll assume for the time being that they're real. For higher-order polynomials, there is no surefire, easy way of finding the roots by hand, and you'd be smart simply to use computer software to do it. In Yacas, you can find the real roots of a polynomial like this:

FindRealRoots(x^4-5*x^3

-25*x^2+65*x+84)

\{3.,7.,-4.,-1.\}

(I assume it uses Newton's method to find them.) The constants Ai can then be determined by algebra, or by the following trick.

Numerical method

Suppose we evaluate 1/P(x) for a value of x very close to one of the roots. In the example of the polynomial x^4-5x^3-25x^2+65x+84, let r_1 ... r_4 be the roots in the order in which they were returned by Yacas. Then A_1 can be found by evaluating 1/P(x) at x=3.000001:

P(x):=x^4-5*x^3-25*x^2

+65*x+84

N(1/P(3.000001))

-8928.5702094768

We know that for x very close to 3, the expression

will be dominated by the A_1 term, so

By the same method we can find the other four constants:

dx:=.000001

N(1/P(7+dx),30)*dx

0.2840908276e-2

N(1/P(-4+dx),30)*dx

-0.4329006192e-2

N(1/P(-1+dx),30)*dx

0.1041666664e-1

(The N( ,30) construct is to tell Yacas to do a numerical calculation rather than an exact symbolic one, and to use 30 digits of precision, in order to avoid problems with rounding errors.) Thus,

The desired integral is

As in the simpler example I started off with, where P was second order and we got A_1=-A_2, in this n=4 example we expect that A_1+A_2+A_3+A_4=0, for otherwise the large-x behavior of the partial-fraction form would be 1/x rather than 1/x^4. This is a useful way of checking the result: -8.93+2.84-4.33+10.4=-.02≈0.

Complications

There are two possible complications:

First, the same factor may occur more than once, as in x^3-5x^2+7x-3=(x-1)(x-1)(x-3). In this example, we have to look for an answer of the form A/(x-1)+B/(x-1)2+C/(x-3), the solution being -.25/(x-1)-.5/(x-1)2+.25/(x-3).

Second, the roots may be complex. This is no show-stopper if you're using computer software that handles complex numbers gracefully. (You can choose a c that makes the result real.) In fact, as discussed in section 8.3, some beautiful things can happen with complex roots. But as an alternative, any polynomial with real coefficients can be factored into linear and quadratic factors with real coefficients. For each quadratic factor Q(x), we then have a partial fraction of the form (A+Bx)/Q(x), where A and B can be determined by algebra. In Yacas, this can be done using the Apart function.

Example 9

◊ Evaluate the integral

using the method of partial fractions.

◊ First we use Yacas to look for real roots of the polynomial:

FindRealRoots(x^4-8*x^3

+8*x^2-8*x+7)

\{1.,7.\}

Unfortunately this polynomial seems to have only two real roots; the rest are complex. We can divide out the factor (x-1)(x-7), but that still leaves us with a second-order polynomial, which has no real roots. One approach would be to factor the polynomial into the form (x-1)(x-7)(x-p)(x-q), where p and q are complex, as in section 8.3. Instead, let's use Yacas to expand the integrand in terms of partial fractions:

Apart(1/(x^4-8*x^3

+8*x^2-8*x+7))

((2*x)/25+3/50)/(x^2+1)

+1/(300*(x-7))

+(-1)/(12*(x-1))

We can now rewrite the integral like this:

In fact, Yacas should be able to do the whole integral for us from scratch, but it's best to understand how these things work under the hood, and to avoid being completely dependent on one particular piece of software. As an illustration of this gem of wisdom, I found that when I tried to make Yacas evaluate the integral in one gulp, it choked because the calculation became too complicated! Because I understood the ideas behind the procedure, I was still able to get a result through a mixture of computer calculations and working it by hand. Someone who didn't have the knowledge of the technique might have tried the integral using the software, seen it fail, and concluded, incorrectly, that the integral was one that simply couldn't be done. A computer is no substitute for understanding.

Residue method

On p. 92 I introduced the trick of carrying out the method of partial fractions by evaluating 1/P(x) numerically at x=ri+ε, near where 1/P blows up. Sometimes we would like to have an exact result rather than a numerical approximation. We can accomplish this by using an infinitesimal number dx rather than a small but finite ε. For simplicity, let's assume that all of the n roots ri are distinct, and that P's highest-order term is xn. We can then write P as the product P(x)=(x-r_1)(x-r_2)…(x-rn). For products like this, there is a notation Π (capital Greek letter “pi”) that works like Σ does for sums:

It's not necessary that the roots be real, but for now we assume that they are. We want to find the coefficients Ai such that

We then have

where … represents finite terms that are negligible compared to the infinite ones. Multiplying on both sides by dx, we have

where the … now stand for infinitesimals which must in fact cancel out, since both Ai and 1/P' are real numbers.

Example 10

◊ The partial-fraction decomposition of the function

was found numerically on p. 92. The coefficient of the 1/(x-3) term was found numerically to be A_1≈ -8.930×10-3. Determine it exactly using the residue method.

◊ Differentiation gives P'(x)=4x^3-15x^2-50x+65. We then have A_1=1/P'(3)=-1/112.

Integrals that can't be done

Integral calculus was invented in the age of powdered wigs and harpsichords, so the original emphasis was on expressing integrals in a form that would allow numbers to be plugged in for easy numerical evaluation by scribbling on scraps of parchment with a quill pen. This was an era when you might have to travel to a large city to get access to a table of logarithms.

In this computationally impoverished environment, one always wanted to get answers in what's known as closed form and in terms of elementary functions.

A closed form expression means one written using a finite number of operations, as opposed to something like the geometric series 1+x+x^2+x^3+…, which goes on forever.

Elementary functions are usually taken to be addition, subtraction, multiplication, division, logs, and exponentials, as well as other functions derivable from these. For example, a cube root is allowed, since √[3]x=e^{(1/3)ln x}, and so are trig functions and their inverses, since, as we will see in chapter 8, they can be expressed in terms of logs and exponentials.

In theory, “closed form” doesn't mean anything unless we state the elementary functions that are allowed. In practice, when people refer to closed form, they usually have in mind the particular set of elementary functions described above.

A traditional freshman calculus course spends such a vast amount of time teaching you how to do integrals in closed form that it may be easy to miss the fact that this is impossible for the vast majority of integrands that you might randomly write down. Here are some examples of impossible integrals:

The first of these is a form that is extremely important in statistics (it describes the area under the standard “bell curve”), so you can see that impossible integrals aren't just obscure things that don't pop up in real life.

People who are proficient at doing integrals in closed form generally seem to work by a process of pattern matching. They recognize certain integrals as being of a form that can't be done, so they know not to try.

Example 11

◊ Students! Stand at attention! You will now evaluate \int e^{-x^2+7x} dx in closed form.

◊ No sir, I can't do that. By a change of variables of the form u=x+c, where c is a constant, we could clearly put this into the form \int e^{-x^2} dx, which we know is impossible.

Sometimes an integral such as \int e^{-x^2} dx is important enough that we want to give it a name, tabulate it, and write computer subroutines that can evaluate it numerically. For example, statisticians define the “error function” \operatorname{erf}(x)=(2/√π) \int e^{-x^2} dx. Sometimes if you're not sure whether an integral can be done in closed form, you can put it into computer software, which will tell you that it reduces to one of these functions. You then know that it can't be done in closed form. For example, if you ask the popular web site integrals.com to do \int e^{-x^2+7x} dx, it spits back (1/2)e^{49/4}√π\operatorname{erf}(x-7/2). This tells you both that you shouldn't be wasting your time trying to do the integral in closed form and that if you need to evaluate it numerically, you can do that using the erf function.

As shown in the following example, just because an indefinite integral can't be done, that doesn't mean that we can never do a related definite integral.

Example 12

◊ Evaluate \int_0^{π/2} e^{-tan^2 x}(tan^2x+1)dx.

◊ The obvious substitution to try is u=tan x, and this reduces the integrand to e-x^2. This proves that the corresponding indefinite integral is impossible to express in closed form. However, the definite integral can be expressed in closed form; it turns out to be √π/2. The trick for proving this is given in example 99 on p. 134.

Sometimes computer software can't say anything about a particular integral at all. That doesn't mean that the integral can't be done. Computers are stupid, and they may try brute-force techniques that fail because the computer runs out of memory or CPU time. For example, the integral \int dx/(x^{10000}-1) (problem 15, p. 127) can be done in closed form using the techniques of chapter 8, and it's not too hard for a proficient human to figure out how to attack it, but every computer program I've tried it on has failed silently.

Homework Problems

1. Graph the function y=ex-7x and get an approximate idea of where any of its zeroes are (i.e., for what values of x we have y(x)=0). Use Newton's method to find the zeroes to three significant figures of precision.

2. The relationship between x and y is given by xy = sin y+x^2y^2.

(a) Use Newton's method to find the nonzero solution for y when x=3. Answer: y=0.2231

(b) Find dy/dx in terms of x and y, and evaluate the derivative at the point on the curve you found in part a. Answer: dy/dx=-0.0379

Based on an example by Craig B. Watkins.

3. Suppose you want to evaluate

and you've found

in a table of integrals. Use a change of variable to find the answer to the original problem.

4. Evaluate

5. Evaluate

6. Evaluate

7. Evaluate

where b is a constant.

8. Evaluate

9. Evaluate

10. Use integration by parts to evaluate the following integrals.

11. Evaluate

Hint: Use integration by parts more than once.

12. Evaluate

13. Evaluate

14. Evaluate

15. Apply integration by parts twice to

examine what happens, and manipulate the result in order to solve the original integral. (An approach that doesn't rely on tricks is given in example 91 on p. 123.)

16. Plan, but do not actually carry out the steps that would be required in order to generalize the result of example 70 on p. 91 in order to evaluate

where a and b are constants. Which is easier, the generalization from 2 to a, or the one from e to b? Do we need to introduce any restrictions on a or b? (solution in the pdf version of the book)

17. The integral \int e^{-x^2}dx can't be done in closed form. Knowing this, use a change of variable to write down a different integral that also can't be done in closed form.

18. Consider the integral

where p is a constant. There is an obvious substitution. If this is to result in an integral that can be evaluated in closed form by a series of integrations by parts, what are the possible values of p? Don't actually complete the integral; just determine what values of p will work. (solution in the pdf version of the book)

19. Evaluate the hundredth derivative of the function

(x^2+1)/(x^3-x) using paper and pencil. [Vladimir Arnol'd] (solution in the pdf version of the book)

(c) 1998-2013 Benjamin Crowell, licensed under the Creative Commons Attribution-ShareAlike license. Photo credits are given at the end of the Adobe Acrobat version.

Chapter 6. Improper integrals

6.1 Integrating a function that blows up

When we integrate a function that blows up to infinity at some point in the interval we're integrating, the result may be either finite or infinite.

Example 1

◊ Integrate the function y=1/√x from x=0 to x=1.

◊ The function blows up to infinity at one end of the region of integration, but let's just try evaluating it, and see what happens.

The result turns out to be finite. Intuitively, the reason for this is that the spike at x=0 is very skinny, and gets skinny fast as we go higher and higher up.

a / The integral \int_0^1 dx/√x is finite.

Example 2

◊ Integrate the function y=1/x^2 from x=0 to x=1.

◊

Division by zero is undefined, so the result is undefined.

Another way of putting it, using the hyperreal number system, is that if we were to integrate from ε to 1, where ε was an infinitesimal number, then the result would be -1+1/ε, which is infinite. The smaller we make ε, the bigger the infinite result we get out.

Intuitively, the reason that this integral comes out infinite is that the spike at x=0 is fat, and doesn't get skinny fast enough.

b / The integral \int_0^1 dx/x^2 is infinite.

These two examples were examples of improper integrals.

6.2 Limits of integration at infinity

Another type of improper integral is one in which one of the limits of integration is infinite. The notation

means the limit of \intaH f(x)dx, where H is made to grow bigger and bigger. Alternatively, we can think of it as an integral in which the top end of the interval of integration is an infinite hyperreal number. A similar interpretation applies when the lower limit is -∞, or when both limits are infinite.

Example 3

◊ Evaluate

◊

As H gets bigger and bigger, the result gets closer and closer to 1, so the result of the improper integral is 1.

Note that this is the same graph as in example 75, but with the x and y axes interchanged; this shows that the two different types of improper integrals really aren't so different.

c / The integral \int_1^∞ dx/x^2 is finite.

Example 4

◊ Newton's law of gravity states that the gravitational force between two objects is given by F=Gm_1m_2/r^2, where G is a constant, m_1 and m_2 are the objects' masses, and r is the center-to-center distance between them. Compute the work that must be done to take an object from the earth's surface, at r=a, and remove it to r=∞.

◊

The answer is inversely proportional to a. In other words, if we were able to start from higher up, less work would have to be done.

Homework Problems

1. Integrate

or show that it diverges.

2. Integrate

or show that it diverges.

3. Integrate

or show that it diverges.

4. Integrate

or show that it diverges. (solution in the pdf version of the book)

5. Integrate

or show that it diverges. (Problem 15 on p. 99 suggests a trick for doing the indefinite integral.)

6. Prove that

converges, but don't evaluate it.

7. (a) Verify that the probability distribution dP/dx given in example 60 on page 80 is properly normalized.

(b) Find the average value of x, or show that it diverges.

(c) Find the standard deviation of x, or show that it diverges.

8. Prove

(c) 1998-2013 Benjamin Crowell, licensed under the Creative Commons Attribution-ShareAlike license. Photo credits are given at the end of the Adobe Acrobat version.

Chapter 7. Sequences and Series

7.1 Infinite sequences

Consider an infinite sequence of numbers like 1/2, 2/3, 3/4, 4/5, ... We want to define this as approaching 1, or “converging to 1.” The way to do this is to make a function f(n), which is only well defined for integer values of n. Then f(1)=1/2, f(2)=2/3, and in general f(n)=n/(n+1). With just a little tinkering, our definitions of limits can be applied to this type of function (see problem 1 on page 114).

7.2 Infinite series

A related question is how to rigorously define the sum of infinitely many numbers, which is referred to as an infinite series. An example is the geometric series 1+x+x^2+x^3+…=1/(1-x), which we used casually on page 29. The general concept of an infinite series goes back to ancient Greek mathematics. Various supposed paradoxes about infinite series, such as Zeno's paradox, were exhibited, influencing Euclid to sidestep the issue in his Elements, where in Book IX, Proposition 35 he provides only an expression (1-xn)/(1-x) for the nth partial sum of the geometric series. The case where n gets so big that xn becomes negligible is left to the reader's imagination, as in one of those scenes in a romance novel that ends with something like “...and she surrendered...” For those with modern training, the idea is that an infinite sum like 1+1+1+… would clearly give an infinite result, but this is only because the terms are all staying the same size. If the terms get smaller and smaller, and get smaller fast enough, then the result can be finite. For example, consider the geometric series in the case where x=1/2, for which we expect the result 1/(1-1/2)=2. We have

which at the successive steps of addition equals 1, 1^1/2, 1^3/4, 1^7/8, 1^15/16, .... We're getting closer and closer to 2, cutting the distance in half at each step. Clearly we can get as close as we like to 2, if we're willing to add enough terms.

Note that we ended up wanting to talk about the partial sums of the series. This is the right way to get a rigorous definition of the convergence of series in general. In the case of the geometric series, for example, we can define a sequence of the partial sums 1, 1+x, 1+x+x^2, ... We can then define convergence and limits of series in terms of convergence and limits of the partial sums.

It's instructive to see what happens to the geometric series with x=0.1. The geometric series becomes

1 + 0.1 + 0.01 + 0.001 + … .

The partial sums are 1, 1.1, 1.11, 1.111, ... We can see vividly here that adding another term will only affect the result in a certain decimal place, without affecting any of the earlier ones. For instance, if we needed a result that was valid to three digits past the decimal place, we could stop at 1.111, being assured that we had attained a good enough approximation. If we wanted an exact result, we could also observe that multiplying the result by 9 would give 9.999…, which is the same as 10, so the result must be 10/9, which is in agreement with 1/(1-1/10)=10/9.

One thing to watch out for with infinite series is that the axioms of the real number system only talk about finite sums, so it's easy to get wrong results by attempting to apply them to infinite ones (see problem 2 on page 114).

7.3 Tests for convergence

There are many different tests that can be used to determine whether a sequence or series converges. I'll briefly state three of the most useful, with sketches of their proofs.

Bounded and increasing sequences : A sequence that always increases, but never surpasses a certain value, converges.

This amounts to a restatement of the completeness axiom for the real numbers stated on page 157, and is therefore to be interpreted not so much as a statement about sequences but as one about the real number system. In particular, it fails if interpreted as a statement about sequences confined entirely to the rational number system, as we can see from the sequence 1, 1.4, 1.41, 1.414, ... consisting of the successive decimal approximations to √2, which does not converge to any rational-number value.

Example 1

◊ Prove that the geometric series 1+1/2+1/4+… converges.

◊ The sequence of partial sums is increasing, since each term is positive. Each term closes half of the remaining gap separating the previous partial sum from 2, so the sum never surpasses 2. Since the partial sums are increasing and bounded, they converge to a limit.

Once we know that a particular series converges, we can also easily infer the convergence of other series whose terms get smaller faster. For example, we can be certain that if the geometric series converges, so does the series

whose terms get smaller faster than any base raised to the power n.

Alternating series with terms approaching zero : If the terms of a series alternate in sign and approach zero, then the series converges.

Sketch of a proof: The even partial sums form an increasing sequence, the odd sums a decreasing one. Neither of these sequences of partial sums can be unbounded, since the difference between partial sums n and n+1 would then have to be unbounded, but this difference is simply the nth term, and the terms approach zero. Since the even partial sums are increasing and bounded, they converge to a limit, and similarly for the odd ones. The two limits must be equal, since the terms approach zero.

Example 2

◊ Prove that the series 1-1/2+1/3-1/4+… converges.

◊ Its convergence follows because it is an alternating series with decreasing terms. The sum turns out to be ln 2, although the convergence of the series is so slow that an extremely large number of terms is required in order to obtain a decent approximation,

The integral test : If the terms of a series an are positive and decreasing, and f(x) is a positive and decreasing function on the real number line such that f(n)=an, then the sum of an from n=1 to ∞ converges if and only if \int_1^∞ f(x)dx does.

Sketch of proof: Since the theorem is supposed to hold for both convergence and divergence, and is also an “if and only if,” there are actually four cases to prove, of which we pick the representative one where the integral is known to converge and we want to prove convergence of the corresponding sum. The sum and the integral can be interpreted as the areas under two graphs: one like a smooth ramp and one like a staircase. Sliding the staircase half a unit to the left, it lies entirely underneath the ramp, and therefore the area under it is also finite.

Example 3

◊ Prove that the series 1+1/2+1/3+… diverges.

◊ The integral of 1/x is ln x, which diverges as x approaches infinity, so the series diverges as well.

The ratio test : If the limit R=\lim_{n→∞}|a_{n+1}/an| exists, then the sum of an converges if R<1 and diverges if R>1.

The proof can be obtained by comparing with a geometric series.

Example 4

◊ Prove that the series 1+1/2^2+1/3^3+… converges.

◊ R is easily proved to be 0, so the sum converges by the ratio test.

At this point it will seem like a mystery how anyone could have proved the exact results claimed for some of the “special” series, such as 1-1/2+1/3-1/4+…=ln 2. Problems like these are not the main focus of the chapter, and in fact there is no well-defined toolbox of techniques that will allow any such “nice” series to be evaluated exactly. Even a relatively innocent-looking example like 1-2+2-2+3-2+… defeated some of the best mathematicians of Europe for years (see problem 16, p. 116). It is currently unknown whether some apparently simple series such as \sum_{n=1}^∞ 1/(n^3 sin^2 n) converge.1

7.4 Taylor series

If you calculate e0.1 on your calculator, you'll find that it's very close to 1.1. This is because the tangent line at x=0 on the graph of ex has a slope of 1 (dex/dx=ex=1 at x=0), and the tangent line is a good approximation to the exponential curve as long as we don't get too far away from the point of tangency.

a / The function ex, and the tangent line at x=0.

How big is the error? The actual value of e0.1 is 1.10517091807565…, which differs from 1.1 by about 0.005. If we go farther from the point of tangency, the approximation gets worse. At x=0.2, the error is about 0.021, which is about four times bigger. In other words, doubling x seems to roughly quadruple the error, so the error is proportional to x^2; it seems to be about x^2/2. Well, if we want a handy-dandy, super-accurate estimate of ex for small values of x, why not just account for this error. Our new and improved estimate is

for small values of x.

b / The function ex, and the approximation 1+x+x^2/2.

Figure b shows that the approximation is now extremely good for sufficiently small values of x. The difference is that whereas 1+x matched both the y-intercept and the slope of the curve, 1+x+x^2/2 matches the curvature as well. Recall that the second derivative is a measure of curvature. The second derivatives of the function and its approximation are

c / The function ex, and the approximation 1+x+x^2/2+x^3/6.

We can do even better. Suppose we want to match the third derivatives. All the derivatives of ex, evaluated at x=0, are 1, so we just need to add on a term proportional to x^3 whose third derivative is one. Taking the first derivative will bring down a factor of 3 in front, and taking and the second derivative will give a 2, so to cancel these out we need the third-order term to be (1/2)(1/3):

Figure c shows the result. For a significant range of x values close to zero, the approximation is now so good that we can't even see the difference between the two functions on the graph.

On the other hand, figure d shows that the cubic approximation for somewhat larger negative and positive values of x is poor --- worse, in fact, than the linear approximation, or even the constant approximation ex=1. This is to be expected, because any polynomial will blow up to either positive or negative infinity as x approaches negative infinity, whereas the function ex is supposed to get very close to zero for large negative x. The idea here is that derivatives are local things: they only measure the properties of a function very close to the point at which they're evaluated, and they don't necessarily tell us anything about points far away.

d / The function ex, and the approximation 1+x+x^2/2+x^3/6, on a wider scale.

It's a remarkable fact, then, that by taking enough terms in a polynomial approximation, we can always get as good an approximation to ex as necessary --- it's just that a large number of terms may be required for large values of x. In other words, the infinite series

always gives exactly ex. But what is the pattern here that would allows us to figure out, say, the fourth-order and fifth-order terms that were swept under the rug with the symbol “...”? Let's do the fifth-order term as an example. The point of adding in a fifth-order term is to make the fifth derivative of the approximation equal to the fifth derivative of ex, which is 1. The first, second, ... derivatives of x^5 are

The notation for a product like 1⋅2⋅…⋅ n is n!, read “n factorial.” So to get a term for our polynomial whose fifth derivative is 1, we need x^5/5!. The result for the infinite series is

where the special case of 0!=1 is assumed.2 This infinite series is called the Taylor series for ex, evaluated around x=0, and it's true, although I haven't proved it, that this particular Taylor series always converges to ex, no matter how far x is from zero.

In general, the Taylor series around x=0 for a function y is

where the condition for equality of the nth order derivative is

Here the notation .|x=0 means that the derivative is to be evaluated at x=0.

A Taylor series can be used to approximate other functions besides ex, and when you ask your calculator to evaluate a function such as a sine or a cosine, it may actually be using a Taylor series to do it. Taylor series are also the method Inf uses to calculate most expressions involving infinitesimals. In example 13 on page 29, we saw that when Inf was asked to calculate 1/(1-d), where d was infinitesimal, the result was the geometric series:

: 1/(1-d)

1+d+d^2+d^3+d^4

These are also the the first five terms of the Taylor series for the function y=1/(1-x), evaluated around x=0. That is, the geometric series 1+x+x^2+x^3+… is really just one special example of a Taylor series, as demonstrated in the following example.

Example 5

◊ Find the Taylor series of y=1/(1-x) around x=0.

◊ Rewriting the function as y=(1-x)-1 and applying the chain rule, we have

The pattern is that the nth derivative is n!. The Taylor series therefore has an=n!/n!=1:

If you flip back to page 106 and compare the rate of convergence of the geometric series for x=0.1 and 0.5, you'll see that the sum converged much more quickly for x=0.1 than for x=0.5. In general, we expect that any Taylor series will converge more quickly when x is smaller. Now consider what happens at x=1. The series is now 1+1+1+…, which gives an infinite result, and we shouldn't have expected any better behavior, since attempting to evaluate 1/(1-x) at x=1 gives division by zero. For x>1, the results become nonsense. For example, 1/(1-2)=-1, which is finite, but the geometric series gives 1+2+4+…, which is infinite.

In general, every function's Taylor series around x=0 converges for all values of x in the range defined by |x|<r, where r is some number, known as the radius of convergence. Also, if the function is defined by putting together other functions that are well behaved (in the sense of converging to their own Taylor series in the relevant region), then the Taylor series will not only converge but converge to the correct value. For the function ex, the radius happen to be infinite, whereas for 1/(1-x) it equals 1. The following example shows a worst-case scenario.

e / The function e-1/x^2 never converges to its Taylor series.

Example 6

The function y=e-1/x^2, shown in figure e, never converges to its Taylor series, except at x=0. This is because the Taylor series for this function, evaluated around x=0 is exactly zero! At x=0, we have y=0, dy/dx=0, d^2 y/dx^2=0, and so on for every derivative. The zero function matches the function y(x) and all its derivatives to all orders, and yet is useless as an approximation to y(x). The radius of convergence of the Taylor series is infinite, but it doesn't give correct results except at x=0. The reason for this is that y was built by composing two functions, w(x)=-1/x^2 and y(w)=ew. The function w is badly behaved at x=0 because it blows up there. In particular, it doesn't have a well-defined Taylor series at x=0.

Example 7

◊ Find the Taylor series of y=sin x, evaluated around x=0.

◊ The first few derivatives are

We can see that there will be a cycle of sin, cos, -sin, and -cos, repeating indefinitely. Evaluating these derivatives at x=0, we have 0, 1, 0, -1, .... All the even-order terms of the series are zero, and all the odd-order terms are ±1/n!. The result is

The linear term is the familiar small-angle approximation sin x≈ x.

The radius of convergence of this series turns out to be infinite. Intuitively the reason for this is that the factorials grow extremely rapidly, so that the successive terms in the series eventually start diminish quickly, even for large values of x.

Example 8

Suppose that we want to evaluate a limit of the form

where u(0)=v(0)=0. L'H\^{o}pital's rule tells us that we can do this by taking derivatives on the top and bottom to form u'/v', and that, if necessary, we can do more than one derivative, e.g., u”/v”. This was proved on p. 152 using the mean value theorem. But if u and v are both functions that converge to their Taylor series, then it is much easier to see why this works. For example, suppose that their Taylor series both have vanishing constant and linear terms, so that u=ax^2+… and v=bx^2+…. Then u”=2a+…, and v”=2b+….

A function's Taylor series doesn't have to be evaluated around x=0. The Taylor series around some other center x=c is given by

where

To see that this is the right generalization, we can do a change of variable, defining a new function g(x)=f(x-c). The radius of convergence is to be measured from the center c rather than from 0.

Example 9

◊ Find the Taylor series of ln x, evaluated around x=1.

◊ Evaluating a few derivatives, we get

Note that evaluating these at x=0 wouldn't have worked, since division by zero is undefined; this is because ln x blows up to negative infinity at x=0. Evaluating them at x=1, we find that the nth derivative equals ± (n-1)!, so the coefficients of the Taylor series are ± (n-1)!/n!=±1/n, except for the n=0 term, which is zero because ln 1=0. The resulting series is

We can predict that its radius of convergence can't be any greater than 1, because ln x blows up at 0, which is at a distance of 1 from 1.

Homework Problems

1. Modify the Weierstrass definition of the limit to apply to infinite sequences. (solution in the pdf version of the book)

2. (a) Prove that the infinite series 1-1+1-1+1-1+… does not converge to any limit, using the generalization of the Weierstrass limit found in problem 1. (b) Criticize the following argument. The series given in part a equals zero, because addition is associative, so we can rewrite it as (1-1)+(1-1)+(1-1)+… (solution in the pdf version of the book)

3. Use the integral test to prove the convergence of the geometric series for 0<x<1. (solution in the pdf version of the book)

4. Determine the convergence or divergence of the following series.

(a) 1+1/2^2+1/3^2+…

(b) 1/lnln 3-1/lnln 6+1/ln ln 9-1/lnln 12+…

(c)

(d)

(solution in the pdf version of the book)

5. Give an example of a series for which the ratio test is inconclusive. (solution in the pdf version of the book)

6. Find the Taylor series expansion of cos x around x=0. Check your work by combining the first two terms of this series with the first term of the sine function from example 85 on page 112 to verify that the trig identity sin^2 x+cos^2 x=1 holds for terms up to order x^2.

7. In classical physics, the kinetic energy K of an object of mass m moving at velocity v is given by K=1/2mv^2. For example, if a car is to start from a stoplight and then accelerate up to v, this is the theoretical minimum amount of energy that would have to be used up by burning gasoline. (In reality, a car's engine is not 100% efficient, so the amount of gas burned is greater.)

Einstein's theory of relativity states that the correct equation is actually

where c is the speed of light. The fact that it diverges as v → c is interpreted to mean that no object can be accelerated to the speed of light.

Expand K in a Taylor series, and show that the first nonvanishing term is equal to the classical expression. This means that for velocities that are small compared to the speed of light, the classical expression is a good approximation, and Einstein's theory does not contradict any of the prior empirical evidence from which the classical expression was inferred.

8. Expand (1+x)1/3 in a Taylor series around x=0. The value x=28 lies outside this series' radius of convergence, but we can nevertheless use it to extract the cube root of 28 by recognizing that 281/3=3(28/27)1/3. Calculate the root to four significant figures of precision, and check it in the obvious way.

9. Find the Taylor series expansion of log_2 x around x=1, and use it to evaluate log_2 1.0595 to four significant figures of precision. Check your result by using the fact that 1.0595 is approximately the twelfth root of 2. This number is the ratio of the frequencies of two successive notes of the chromatic scale in music, e.g., C and D-flat.

10. In free fall, the acceleration will not be exactly constant, due to air resistance. For example, a skydiver does not speed up indefinitely until opening her chute, but rather approaches a certain maximum velocity at which the upward force of air resistance cancels out the force of gravity. If an object is dropped from a height h, and the time it takes to reach the ground is used to measure the acceleration of gravity, g, then the relative error in the result due to air resistance is^3

where b=h/A, and A is a constant that depends on the size, shape, and mass of the object, and the density of the air. (For a sphere of mass m and diameter d dropping in air, A=4.11m/d^2. Cf. problem 20, p. 49.) Evaluate the constant and linear terms of the Taylor series for the function E(b).

11. (a) Prove that the convergence of an infinite series is unaffected by omitting some initial terms. (b) Similarly, prove that convergence is unaffected by multiplying all the terms by some constant factor.

12. The identity

is known as the “Sophomore's dream,” because at first glance it looks like the kind of plausible but false statement that someone would naively dream up. Verify it numerically by machine computation.

13. Does sin x+sin sin x+sinsinsin x+… converge? (solution in the pdf version of the book)

14. Evaluate

(solution in the pdf version of the book)

15. Evaluate

to six decimal places.

16. Euler was the first to prove

This problem had defeated other great mathematicians of his time, and was famous enough to be given a special name, the Basel problem. Here we present an argument based closely on Euler's and pose the problem of how to exploit Euler's technique further in order to prove

From the Taylor series for the sine function, we find the related series

The partial sums of this series are polynomials that approximate f for small values of x. If such a polynomial were exact rather than approximate, then it would have zeroes at x=π^2, 4π^2, 9π^2, ..., and we could write it as the product of its linear factors. Euler assumed, without any more rigorous proof, that this factorization procedure could be extended to the infinite series, so that f could be represented as the infinite product

By multiplying this out and equating its linear term to that of the Taylor series, we find the claimed result.

Extend this procedure to the x^2 term and prove the result claimed for the sum of the inverse fourth powers of the integers. (The sums with odd exponents >= 3 are much harder, and relatively little is known about them. The sum of the inverse cubes is known as Apèry's constant.)

17. Does

converge, or not? (solution in the pdf version of the book)

18. Evaluate

where n is an integer.

19. Determine the convergence of the series

and if it converges, evaluate it. (solution in the pdf version of the book)

20. Determine the convergence of the series

and if it converges, evaluate it. (solution in the pdf version of the book)

21. For what integer values of p should we expect the series

to converge? A rigorous proof is very difficult and may even be an open problem, but it is relatively straightforward to give a convincing argument. (solution in the pdf version of the book)

(c) 1998-2013 Benjamin Crowell, licensed under the Creative Commons Attribution-ShareAlike license. Photo credits are given at the end of the Adobe Acrobat version.

Footnotes

[1] Alekseyev, “On convergence of the Flint Hills series,” arxiv.org/abs/1104.5100v1

[2] This makes sense, because, for example, 4!=5!/5, 3!=4!/4, etc., so we should have 0!=1!/1.

[3] Jan Benacka and Igor Stubna, The Physics Teacher, 43 (2005) 432.

Chapter 8. Complex number techniques

8.1 Review of complex numbers

For a more detailed treatment of complex numbers, see ch. 3 of James Nearing's free book at

http://www.physics.miami.edu/ nearing/mathmethods/.

a / Visualizing complex numbers as points in a plane.

b / Addition of complex numbers is just like addition of vectors, although the real and imaginary axes don't actually represent directions in space.

c / A complex number and its conjugate.

We assume there is a number, i, such that i^2=-1. The square roots of -1 are then i and -i. (In electrical engineering work, where i stands for current, j is sometimes used instead.) This gives rise to a number system, called the complex numbers, containing the real numbers as a subset. Any complex number z can be written in the form z=a+bi, where a and b are real, and a and b are then referred to as the real and imaginary parts of z. A number with a zero real part is called an imaginary number. The complex numbers can be visualized as a plane, figure a, with the real number line placed horizontally like the x axis of the familiar x-y plane, and the imaginary numbers running along the y axis. The complex numbers are complete in a way that the real numbers aren't: every nonzero complex number has two square roots. For example, 1 is a real number, so it is also a member of the complex numbers, and its square roots are -1 and 1. Likewise, -1 has square roots i and -i, and the number i has square roots 1/√2+i/√2 and -1/√2-i/√2.

Complex numbers can be added and subtracted by adding or subtracting their real and imaginary parts, figure b. Geometrically, this is the same as vector addition.

The complex numbers a+bi and a-bi, lying at equal distances above and below the real axis, are called complex conjugates. The results of the quadratic formula are either both real, or complex conjugates of each other. The complex conjugate of a number z is notated as z- or z^*.

The complex numbers obey all the same rules of arithmetic as the reals, except that they can't be ordered along a single line. That is, it's not possible to say whether one complex number is greater than another. We can compare them in terms of their magnitudes (their distances from the origin), but two distinct complex numbers may have the same magnitude, so, for example, we can't say whether 1 is greater than i or i is greater than 1.

Example 1

◊ Prove that 1/√2+i/√2 is a square root of i.

◊ Our proof can use any ordinary rules of arithmetic, except for ordering.

Example 88 showed one method of multiplying complex numbers. However, there is another nice interpretation of complex multiplication. We define the argument of a complex number, figure d, as its angle in the complex plane, measured counterclockwise from the positive real axis. Multiplying two complex numbers then corresponds to multiplying their magnitudes, and adding their arguments, figure e.

d / A complex number can be described in terms of its magnitude and argument.

e / The argument of uv is the sum of the arguments of u and v.

self-check:

Using this interpretation of multiplication, how could you find the square roots of a complex number?

(answer in the back of the PDF version of the book)

Example 2

The magnitude |z| of a complex number z obeys the identity |z|2=zz-. To prove this, we first note that z- has the same magnitude as z, since flipping it to the other side of the real axis doesn't change its distance from the origin. Multiplying z by z- gives a result whose magnitude is found by multiplying their magnitudes, so the magnitude of zz- must therefore equal |z|2. Now we just have to prove that zz- is a positive real number. But if, for example, z lies counterclockwise from the real axis, then z- lies clockwise from it. If z has a positive argument, then z- has a negative one, or vice-versa. The sum of their arguments is therefore zero, so the result has an argument of zero, and is on the positive real axis. 1

This whole system was built up in order to make every number have square roots. What about cube roots, fourth roots, and so on? Does it get even more weird when you want to do those as well? No. The complex number system we've already discussed is sufficient to handle all of them. The nicest way of thinking about it is in terms of roots of polynomials. In the real number system, the polynomial x^2-1 has two roots, i.e., two values of x (plus and minus one) that we can plug in to the polynomial and get zero. Because it has these two real roots, we can rewrite the polynomial as (x-1)(x+1). However, the polynomial x^2+1 has no real roots. It's ugly that in the real number system, some second-order polynomials have two roots, and can be factored, while others can't. In the complex number system, they all can. For instance, x^2+1 has roots i and -i, and can be factored as (x-i)(x+i). In general, the fundamental theorem of algebra states that in the complex number system, any nth-order polynomial can be factored completely into n linear factors, and we can also say that it has n complex roots, with the understanding that some of the roots may be the same. For instance, the fourth-order polynomial x^4+x^2 can be factored as (x-i)(x+i)(x-0)(x-0), and we say that it has four roots, i, -i, 0, and 0, two of which happen to be the same. This is a sensible way to think about it, because in real life, numbers are always approximations anyway, and if we make tiny, random changes to the coefficients of this polynomial, it will have four distinct roots, of which two just happen to be very close to zero. I've given a proof of the fundamental theorem of algebra on page 162.

8.2 Euler's formula

Having expanded our horizons to include the complex numbers, it's natural to want to extend functions we knew and loved from the world of real numbers so that they can also operate on complex numbers. The only really natural way to do this in general is to use Taylor series. A particularly beautiful thing happens with the functions ex, sin x, and cos x:

If x=iφ is an imaginary number, we have

eiφ = cos φ + i sin φ ,

a result known as Euler's formula. The geometrical interpretation in the complex plane is shown in figure f.

f / The complex number eiφ lies on the unit circle.

Although the result may seem like something out of a freak show at first, applying the definition^3 of the exponential function makes it clear how natural it is:

When x=iφ is imaginary, the quantity (1+iφ/n) represents a number lying just above 1 in the complex plane. For large n, (1+iφ/n) becomes very close to the unit circle, and its argument is the small angle φ/n. Raising this number to the nth power multiplies its argument by n, giving a number with an argument of φ.

g / Leonhard Euler (1707-1783)

Euler's formula is used frequently in physics and engineering.

Example 3

◊ Write the sine and cosine functions in terms of exponentials.

◊ Euler's formula for x=-iφ gives cos φ - i sin φ, since cos(-θ)=cosθ, and sin(-θ)=-sinθ.

Example 4

◊ Evaluate

◊ Problem 15 on p. 99 suggested a special-purpose trick for doing this integral. An approach that doesn't rely on tricks is to rewrite the cosine in terms of exponentials:

Since this result is the integral of a real-valued function, we'd like it to be real, and in fact it is, since the first and second terms are complex conjugates of one another. If we wanted to, we could use Euler's theorem to convert it back to a manifestly real result.2

Example 5

Euler found the equation

which allowed the computation of π to high precision in the era before electronic calculators, since the Taylor series for the inverse tangent converges rapidly for small inputs. A cute way of proving the validity of the equation is to calculate

(7+i)20(79+3i)8

as follows in Yacas:

(7+I)^20*(79+3*I)^8;

-1490116119384765625

00000000000000

The fact that it is purely real, and has a negative real part, demonstrates that the quantity on the right side of the original equation equals π+2π n, where n is an integer. Numerical estimation shows that n=0. Although the proof was straightforward, it provides zero insight into how Euler figured it out in the first place!

8.3 Partial fractions revisited

Suppose we want to evaluate the integral

by the method of partial fractions. The quadratic formula tells us that the roots are i and -i, setting 1/(x^2+1)=A/(x+i)+B/(x-i) gives A=i/2 and B=-i/2, so

The attractive thing about this approach, compared with the method used on page 88, is that it doesn't require any tricks. If you came across this integral ten years from now, you could pull out your old calculus book, flip through it, and say, “Oh, here we go, there's a way to integrate one over a polynomial --- partial fractions.” On the other hand, it's odd that we started out trying to evaluate an integral that had nothing but real numbers, and came out with an answer that isn't even obviously a real number.

But what about that expression (x+i)/(x-i)? Let's give it a name, w. The numerator and denominator are complex conjugates of one another. Since they have the same magnitude, we must have |w|=1, i.e., w is a complex number that lies on the unit circle, the kind of complex number that Euler's formula refers to. The numerator has an argument of tan-1(1/x)=π/2-tan-1x, and the denominator has the same argument but with the opposite sign. Division means subtracting arguments, so arg w=π-2tan-1x. That means that the result can be rewritten using Euler's formula as

In other words, it's the same result we found before, but found without the need for trickery.

Example 6

◊ Evaluate \int dx/sin x.

◊ This can be tackled by rewriting the sine function in terms of complex exponentials, changing variables to u=eix, and then using partial fractions.

Homework Problems

1. Find arg i, arg(-i), and arg 37, where arg z denotes the argument of the complex number z.

2. Visualize the following multiplications in the complex plane using the interpretation of multiplication in terms of multiplying magnitudes and adding arguments: (i)(i)=-1, (i)(-i)=1, (-i)(-i)=-1.

3. If we visualize z as a point in the complex plane, how should we visualize -z?

4. Find four different complex numbers z such that z^4=1.

5. Compute the following:

6. Write the function tan x in terms of complex exponentials.

7. Evaluate \int sin^3 xdx.

8. Use Euler's theorem to derive the addition theorems that express sin(a+b) and cos(a+b) in terms of the sines and cosines of a and b. (solution in the pdf version of the book)

9. Evaluate

(solution in the pdf version of the book)

10. Find every complex number z such that z^3=1. (solution in the pdf version of the book)

11. Factor the expression x^3-y^3 into factors of the lowest possible order, using complex coefficients. (Hint: use the result of problem 10.) Then do the same using real coefficients. (solution in the pdf version of the book)

12. Evaluate

13. Evaluate

14. Consider the equation f'(x)=f(f(x)). This is known as a differential equation: an equation that relates a function to its own derivatives. What is unusual about this differential equation is that the right-hand side involves the function nested inside itself. Given, for example, the value of f(0), we expect the solution of this equation to exist and to be uniquely defined for all values of x. That doesn't mean, however, that we can write down such a solution as a closed-form expression. Show that two closed-form expressions do exist, of the form f(x)=axb, and find the two values of b. (solution in the pdf version of the book)

15. (a) Discuss how the integral

could be evaluated, in principle, in closed form. (b) See what happens when you try to evaluate it using computer software. (c) Express it as a finite sum. (solution in the pdf version of the book)

(c) 1998-2013 Benjamin Crowell, licensed under the Creative Commons Attribution-ShareAlike license. Photo credits are given at the end of the Adobe Acrobat version.

Footnotes

[1] I cheated a little. If z's argument is 30 degrees, then we could say z-'s was -30, but we could also call it 330. That's OK, because 330+30 gives 360, and an argument of 360 is the same as an argument of zero.

[2] In general, the use of complex number techniques to do an integral could result in a complex number, but that complex number would be a constant, which could be subsumed within the usual constant of integration.

[3] See page 151 for an explanation of where this definition comes from and why it makes sense.

Chapter 9. Iterated integrals

9.1 Integrals inside integrals

In various applications, you need to do integrals stuck inside other integrals. These are known as iterated integrals, or double integrals, triple integrals, etc. Similar concepts crop up all the time even when you're not doing calculus, so let's start by imagining such an example. Suppose you want to count how many squares there are on a chess board, and you don't know how to multiply eight times eight. You could start from the upper left, count eight squares across, then continue with the second row, and so on, until you how counted every square, giving the result of 64. In slightly more formal mathematical language, we could write the following recipe: for each row, r, from 1 to 8, consider the columns, c, from 1 to 8, and add one to the count for each one of them. Using the sigma notation, this becomes

If you're familiar with computer programming, then you can think of this as a sum that could be calculated using a loop nested inside another loop. To evaluate the result (again, assuming we don't know how to multiply, so we have to use brute force), we can first evaluate the inside sum, which equals 8, giving

Notice how the “dummy” variable c has disappeared. Finally we do the outside sum, over r, and find the result of 64.

Now imagine doing the same thing with the pixels on a TV screen. The electron beam sweeps across the screen, painting the pixels in each row, one at a time. This is really no different than the example of the chess board, but because the pixels are so small, you normally think of the image on a TV screen as continuous rather than discrete. This is the idea of an integral in calculus. Suppose we want to find the area of a rectangle of width a and height b, and we don't know that we can just multiply to get the area ab. The brute force way to do this is to break up the rectangle into a grid of infinitesimally small squares, each having width dx and height dy, and therefore the infinitesimal area dA = dx dy. For convenience, we'll imagine that the rectangle's lower left corner is at the origin. Then the area is given by this integral:

Notice how the leftmost integral sign, over y, and the rightmost differential, dy, act like bookends, or the pieces of bread on a sandwich. Inside them, we have the integral sign that runs over x, and the differential dx that matches it on the right. Finally, on the innermost layer, we'd normally have the thing we're integrating, but here's it's 1, so I've omitted it. Writing the lower limits of the integrals with x= and y= helps to keep it straight which integral goes with with differential. The result is

Example 1

[Area of a triangle] ◊ Find the area of a 45-45-90 right triangle having legs a.

◊ Let the triangle's hypotenuse run from the origin to the point (a,a), and let its legs run from the origin to (0,a), and then to (a,a). In other words, the triangle sits on top of its hypotenuse. Then the integral can be set up the same way as the one before, but for a particular value of y, values of x only run from 0 (on the y axis) to y (on the hypotenuse). We then have

Note that in this example, because the upper end of the x values depends on the value of y, it makes a difference which order we do the integrals in. The x integral has to be on the inside, and we have to do it first.

Example 2

[Volume of a cube] ◊ Find the volume of a cube with sides of length a.

◊ This is a three-dimensional example, so we'll have integrals nested three deep, and the thing we're integrating is the volume dV = dx dy dz.

Example 3

[Area of a circle] ◊ Find the area of a circle.

◊ To make it easy, let's find the area of a semicircle and then double it. Let the circle's radius be r, and let it be centered on the origin and bounded below by the x axis. Then the curved edge is given by the equation R^2=x^2+y^2, or y=√R^2-x^2. Since the y integral's limit depends on x, the x integral has to be on the outside. The area is

The definite integral equals π, as you can find using a trig substitution or simply by looking it up in a table, and the result is, as expected, π R^2/2 for the area of the semicircle. Doubling it, we find the expected result of π R^2 for a full circle.

9.2 Applications

Up until now, the integrand of the innermost integral has always been 1, so we really could have done all the double integrals as single integrals. The following example is one in which you really need to do iterated integrals.

a / The famous tightrope walker Charles Blondin uses a long pole for its large moment of inertia.

Example 4

[Moments of inertia] The moment of inertia is a measure of how difficult it is to start an object rotating (or stop it). For example, tightrope walkers carry long poles because they want something with a big moment of inertia. The moment of inertia is defined by I=\int R^2 dm, where dm is the mass of an infinitesimally small portion of the object, and R is the distance from the axis of rotation.

To start with, let's do an example that doesn't require iterated integrals. Let's calculate the moment of inertia of a thin rod of mass M and length L about a line perpendicular to the rod and passing through its center.

Now let's do one that requires iterated integrals: the moment of inertia of a cube of side b, for rotation about an axis that passes through its center and is parallel to four of its faces.

Let the origin be at the center of the cube, and let x be the rotation axis.

The fact that the last step is a trivial integral results from the symmetry of the problem. The integrand of the remaining double integral breaks down into two terms, each of which depends on only one of the variables, so we break it into two integrals,

which we know have identical results. We therefore only need to evaluate one of them and double the result:

9.3 Polar coordinates

b / René Descartes (1596-1650)

Philosopher and mathematician René Descartes originated the idea of describing plane geometry using (x,y) coordinates measured from a pair of perpendicular coordinate axes. These rectangular coordinates are known as Cartesian coordinates, in his honor.

c / Polar coordinates.

As a logical extension of Descartes' idea, one can find different ways of defining coordinates on the plane, such as the polar coordinates in figure c. In polar coordinates, the differential of area, figure d can be written as da=R dRd φ. The idea is that since dR and d φ are infinitesimally small, the shaded area in the figure is very nearly a rectangle, measuring dR is one dimension and Rd φ in the other. (The latter follows from the definition of radian measure.)

d / The differential of area in polar coordinates

Example 5

◊ A disk has mass M and radius b. Find its moment of inertia for rotation about the axis passing perpendicularly through its center.

◊

e / The function e-x^2, example 99.

Example 6

In statistics, the standard “bell curve” (also known as the normal distribution or Gaussian) is shaped like e-x^2. An area under this curve is proportional to the probability that x lies within a certain range. To fix the constant of proportionality, we need to evaluate

which corresponds to a probability of 1. As discussed on p. 95, the corresponding indefinite integral can't be done in closed form. The definite integral from -∞ to +∞, however, can be evaluated by the following devious trick due to Poisson. We first write I^2 as a product of two copies of the integral.

Since the variable of integration x is a “dummy” variable, we can choose it to be any letter of the alphabet. Let's change the second one to y:

This is in principle a pointless and trivial change, but it suggests visualizing the right-hand side in the Cartesian plane, and considering it as the integral of a single function that depends on both x and y:

Switching to polar coordinates, we have

which can be done using the substitution u=R^2, du=2R dR:

9.4 Spherical and cylindrical coordinates

In cylindrical coordinates (R,φ,z), z measures distance along the axis, R measures distance from the axis, and φ is an angle that wraps around the axis.

f / Cylindrical coordinates.

The differential of volume in cylindrical coordinates can be written as dv = R dR dz d φ. This follows from adding a third dimension, along the z axis, to the rectangle in figure d.

Example 7

◊ Show that the expression for dv has the right units.

◊ Angles are unitless, since the definition of radian measure involves a distance divided by a distance. Therefore the only factors in the expression that have units are R, dR, and dz. If these three factors are measured, say, in meters, then their product has units of cubic meters, which is correct for a volume.

Example 8

◊ Find the volume of a cone whose height is h and whose base has radius b.

◊ Let's plan on putting the z integral on the outside of the sandwich. That means we need to express the radius rmax of the cone in terms of z. This comes out nice and simple if we imagine the cone upside down, with its tip at the origin. Then since we have rmax(z=0)=0, and rmax(h)=b, evidently rmax=zb/h.

As a check, we note that the answer has units of volume. This is the classical result, known by the ancient Egyptians, that a cone has one third the volume of its enclosing cylinder.

In spherical coordinates (r,θ,φ), the coordinate r measures the distance from the origin, and θ and φ are analogous to latitude and longitude, except that θ is measured down from the pole rather than from the equator.

g / Spherical coordinates.

The differential of volume in spherical coordinates is dv = r^2sinθ drdθdφ.

Example 9

◊ Find the volume of a sphere.

◊

Homework Problems

1. Pascal's snail (named after \'{E}tienne Pascal, father of Blaise Pascal) is the shape shown in the figure, defined by R=b(1+cosθ) in polar coordinates.

(a) Make a rough visual estimate of its area from the figure.

(b) Find its area exactly, and check against your result from part a.

(c) Show that your answer has the right units. [Thompson, 1919]

h / Problem 1: Pascal's snail with b=1.

2. A cone with a curved base is defined by r≤ b and θ≤ π/4 in spherical coordinates.

(a) Find its volume.

(b) Show that your answer has the right units.

3. Find the moment of inertia of a sphere for rotation about an axis passing through its center.

4. A jump-rope swinging in circles has the shape of a sine function. Find the volume enclosed by the swinging rope, in terms of the radius b of the circle at the rope's fattest point, and the straight-line distance ℓ between the ends.

5. A curvy-sided cone is defined in cylindrical coordinates by 0≤ z≤ h and R≤ kz^2. (a) What units are implied for the constant k? (b) Find the volume of the shape. (c) Check that your answer to b has the right units.

6. The discovery of nuclear fission was originally explained by modeling the atomic nucleus as a drop of liquid. Like a water balloon, the drop could spin or vibrate, and if the motion became sufficiently violent, the drop could split in half --- undergo fission. It was later learned that even the nuclei in matter under ordinary conditions are often not spherical but deformed, typically with an elongated ellipsoidal shape like an American football. One simple way of describing such a shape is with the equation

where c=0 for a sphere, c>0 for an elongated shape, and c<0 for a flattened one. Usually for nuclei in ordinary matter, c ranges from about 0 to +0.2. The constant k is introduced because without it, a change in c would entail not just a change in the shape of the nucleus, but a change in its volume as well. Observations show, on the contrary, that the nuclear fluid is highly incompressible, just like ordinary water, so the volume of the nucleus is not expected to change significantly, even in violent processes like fission. Calculate the volume of the nucleus, throwing away terms of order c^2 or higher, and show that k=1/3 is required in order to keep the volume constant.

7. This problem is a continuation of problem 6, and assumes the result of that problem is already known. The nucleus 168Er has the type of elongated ellipsoidal shape described in that problem, with c>0. Its mass is 2.8×10-25 kg, it is observed to have a moment of inertia of 2.62×10^{-54} kg\!⋅\!m^2 for end-over-end rotation, and its shape is believed to be described by b≈ 6×10-15 m and c≈ 0.2. Assuming that it rotated rigidly, the usual equation for the moment of inertia could be applicable, but it may rotate more like a water balloon, in which case its moment of inertia would be significantly less because not all the mass would actually flow. Test which type of rotation it is by calculating its moment of inertia for end-over-end rotation and comparing with the observed moment of inertia.

8. Von Kármán found empirically that when a fluid flows turbulently through a cylindrical pipe, the velocity of flow v varies according to the “1/7 power law,” v/vo=(1-r/R)1/7, where vo is the velocity at the center of the pipe, R is the radius of the pipe, and r is the distance from the axis. Find the average velocity at which water is transported through the pipe.

(c) 1998-2013 Benjamin Crowell, licensed under the Creative Commons Attribution-ShareAlike license. Photo credits are given at the end of the Adobe Acrobat version.

Table of Contents

Chapter 1. Rates of Change

Chapter 2. To infinity --- and beyond!

Chapter 3. Limits and continuity

Chapter 4. Integration

Chapter 5. Techniques

Chapter 6. Improper integrals

Chapter 7. Sequences and Series

Chapter 8. Complex number techniques

Chapter 9. Iterated integrals