Kittttttan*s Web

日本語 | English

Calculus

5.Integrals

5.3 Summation versus Integration

This section does integration the hard way. We find explicit formulas for ƒn = v1 + … + vn. From areas of rectangles, the limits produce the area ƒ(x) under a curve. According to the Fundamental Theorem, dfldx should return us to v(x)—and we verify in each case that it does.

May I recall that there is sometimes an easier way? If we can find an ƒ(x) whose derivative is u(x), then the integral of u is ƒ. Sums and limits are not required, when ƒ is spotted directly. The next section, which explains how to look for ƒ(x), will displace this one. (If we can't find an antiderivative we fall back on summation.) Given a successful ƒ, adding any constant produces another ƒ-since the derivative of the constant is zero. The right constant achieves ƒ(0) = 0, with no extra effort.

This section constructs ƒ(x) from sums. The next section searches for antiderivatives.

THE SIGMA NOTATION

In a section about sums, there has to be a decent way to express them. Consider 1² + 2² + 3² + 4². The individual terms are vj = j². Their sum can be written in summation notation, using the capital Greek letter Σ (pronounced sigma):

1² + 2² + 3² + 4² is writtenΣ4j².
j=1

Spoken aloud, that becomes "the sum of j2 from j = 1 to 4." It equals 30. The limits on j (written below and above C) indicate where to start and stop:

v1 + … + vn = Σnvj   and   v3 + … + v9 = Σ9vk.   (1)
j=1k=3

The k at the end of (1) makes an additional point. There is nothing special about the letter j. That is a "dummy variable," no better and no worse than k (or i). Dummy variables are only on one side (the side with C),and they have no effect on the sum. The upper limit n is on both sides. Here are six sums:

Σnk = 1 + 2 + 3 + … + n Σ4(-1)j = - 1 + 1 - 1 + 1 = 0 Σ5(2j − 1) = 1 + 3 + 5 + 7 + 9 = 5²
k=1j=1j=1
Σ0vi = v0 [only one term] Σ4j² = [meaningless?] Σ1 = 1 + ½ + ¼ + … = 2 [infinite series]
i=0j=1k=02k

The numbers 1 and n or 1 and 4 (or 0 and ∞) are the lower limit and upper limit. The dummy variable i or j or k is the index of summation. I hope it seems reasonable that the infinite series 1 + ½ + ¼ + … adds to 2. We will come back to it in Chapter 10.*

A sum like Σj-1n, 6 looks meaningless, but it is actually 6 + 6 + … + 6 = 6n. It follows the rules. In fact Σj-14j² is not meaningless either. Every term is j² and by the same rules. that sum is 4j². However the i was probably intended to be j. Then the sum is 1 + 4 + 9 + 16 = 30.

Question   What happens to these sums when the upper limits are changed to n?

Answer   The sum depends on the stopping point n. A formula is required (when possible). Integrals stop at x, sums stop at n, and we now look for special cases when ƒ(x) or ƒn can be found.

A SPECIAL SUMMATION FORMULA

How do you add the first 100 whole numbers? The problem is to compute

Σ100j = 1 + 2 + 3 + … + 98 + 99 + 100 = ?
j=1

If you were Gauss, you would see the answer at once. (He solved this problem at a ridiculous age, which gave his friends the idea of getting him into another class.) His solution was to combine 1 + 100, and 2 + 99, and 3 + 98, always adding to 101. There are fifty of those combinations. Thus the sum is (50)(101) = 5050.

The sum from 1 to n uses the same idea. The first and last terms add to n + 1. The next terms n − 1 and 2 also add to n + 1. If n is even (as 100 was) then there are in parts. Therefore the sum is in times n + 1:

Σnj = 1 + 2 + … + (n−1) + n = ½n(n+1).   (2)
j=1

The important term is ½n², but the exact sum is ½n² + ½n.

What happens if n is an odd number (like n = 99)? Formula (2) remains true. The combinations 1 + 99 and 2 + 98 still add to n + 1 = 100. There are ½(99) = 49½ such pairs, because the middle term (which is 50) has nothing to combine with. Thus 1 + 2 + + 99 equals 49½ times 100, or 4950.

Remark   That sum had to be 4950, because it is 5050 minus 100. The sum up to 99 equals the sum up to 100 with the last term removed. Our key formula ƒn − ƒn-1 = vn has turned up again!

EXAMPLE   Find the sum 101 + 102 + … + 200 of the second hundred numbers.

First solution   This is the sum from 1 to 200 minus the sum from 1 to 100:

Σ200j = Σ200j − Σ100j.   (3)
10111

The middle sum is ½(200)(201) and the last is ½(100)(101). Their difference is 15050. Note! I left out "j = " in the limits. It is there, but not written.

Second solution   The answer 15050 is exactly the sum of the first hundred numbers (which was 5050) plus an additional 10000. Believing that a number like 10000 can never turn up by accident, we look for a reason. It is found through changing the limits of summation:

Σ200j is the same sum as Σ100(k + 100).   (4)
j=101k=1

This is important, to be able to shift limits around. Often the lower limit is moved to zero or one, for convenience. Both sums have 100 terms (that doesn't change). The dummy variable j is replaced by another dummy variable k. They are related by j = k + 100 or equivalently by k = j − 100.

The variable must change everywhere—in the lower limit and the upper limit as well as inside the sum. If j starts at 101, then k = j − 100 starts at 1. If j ends at 200, k ends at 100. If j appears in the sum, it is replaced by k + 100 (and if j² appeared it would become (k + 100)²).

From equation (4) you see why the answer is 15050. The sum 1 + 2 + … + 100 is 5050 as before. 100 is added to each of those 100 terms. That gives 10000.

EXAMPLES OF CHANGING THE VARIABLE (and the limits)

Σ32j equals Σ42j-1   (here i = j-1). Both sums are 1 + 2 + 4 + 8
i=0j=1
Σnvi equals Σn-3vj+3   (here i = j-1 and j = i-3). Both sums are v3 + … + vn
i=3j=0

Why change n to n − 3? Because the upper limit is i = n. So j + 3 = n and j = n − 3.

A final step is possible, and you will often see it. The new variable j can be changed back to i. Dummy variables have no meaning of their own, but at first the result looks surprising:

Σ52i equals Σ62j-1 equals Σ62i-1.
i=0j=1i=1

With practice you might do that in one step, skipping the temporary letter j. Every i on the left becomes i − 1 on the right. Then i = 0, …, 5 changes to i = 1, …, 6. (At first two steps are safer.) This may seem a minor point, but soon we will be changing the limits on integrals instead of sums. Integration is parallel to summation, and it is better to see a "change of variable" here first.

Note about 1 + 2 + … + n. The good thing is that Gauss found the sum ½n(n + 1). The bad thing is that his method looked too much like a trick. I would like to show how this fits the fundamental rule connecting sums and differences:

if v1 + v2 + … + vn = ƒn then vn = ƒn − ƒn-1.   (5)

Gauss says that ƒn is ½n(n + 1). Reducing n by 1, his formula for ƒn-1 is ½(n − 1)n. The difference ƒn − ƒn-1 should be the last term n in the sum:

ƒn − ƒn-1 = ½n(n + 1) − ½(n − 1)n = ½(n² + n − n² + n) = n.   (6)

This is the one term vn = n that is included in ƒn but not in ƒn-1.

There is a deeper point here. For any sum ƒn, there are two things to check. The ƒ's must begin correctly and they must change correctly. The underlying idea is mathematical induction: Assume the statement is true below n. Prove it for n.

Goal:To prove that 1 + 2 + … + n = ƒn(n + 1). This is the guess ƒn.

Proof by induction:Check ƒ1 (it equals 1). Check ƒn − ƒn-1 (it equals n).

For n = 1 the answer ½n(n + 1) = ½⋅1⋅2 is correct. For n = 2 this formula ½⋅2⋅3 agrees with 1 + 2. But that separate test is not necessary! If ƒ1 is right, and if the change ƒn − ƒn-1 is right for every n, then ƒn must be right. Equation (6) was the key test, to show that the change in ƒ's agrees with v.

That is the logic behind mathematical induction, but I am not happy with most of the exercises that use it. There is absolutely no excitement. The answer is given by some higher power (like Gauss), and it is proved correct by some lower power (like us). It is much better when we lower powers find the answer for ourselves.* Therefore I will try to do that for the second problem, which is the sum of squares.

THE SUM OF j² AND THE INTEGRAL OF x²

An important calculation comes next. It is the area in Figure 5.6. One region is made up of rectangles, so its area is a sum of n pieces. The other region lies under the parabola v = x². It cannot be divided into rectangles, and calculus is needed.

The first problem is to find ƒn = 1² + 2² + 3² + … + n². This is a sum of squares, with ƒ1 = 1 and ƒ2 = 5 and ƒ3 = 14. The goal is to find the pattern in that sequence. By trying to guessf, we are copying what will soon be done for integrals.

Calculus looks for an ƒ(x) whose derivative is v(x). There ƒ is an antiderivative (or an integral). Algebra looks for ƒn's whose differences produce vn. Here ƒn could be called an antidiflerence (better to call it a sum).

Fig.5.6 Rectangles enclosing v = x² have area ((1/3)n³ + ½n² + (1/6)n)(Δx)³ = 1/3x³.

The best start is a good guess. Copying directly from integrals, we might try ƒn = (1/3)n³. To test if it is right, check whether ƒn − ƒn-1 produces vn = n²:

(1/3)n³ − (1/3)(n − 1)³ = (1/3)n³ − (1/3)(n³ − 3n² + 3n − 1) = n² − n + 1/3.

We see n², but also -n + 1/3. The guess (1/3)n³ needs correction terms. To cancel 1/3 in the difference, I subtract fn from the sum. To put back n in the difference, I add 1 + 2 + … + n = ½n(n + 1) to the sum. The new guess (which should be right) is

ƒn = (1/3)n³ + ½n(n + 1) − (1/3)n = (1/3)n³ + ½n² +(1/6)n.   (7)

To check this answer, verify first that ƒ1 = 1. Also ƒ2 = 5 and ƒ3 = 14. To be certain, verify that ƒn − ƒn-1 = n². For calculus the important term is (1/3)n³:

The sum Σnj² of the first n squares is 1n³ plus corrections 1n² and 1n.
j=1326

In practice (1/3)n³ is an excellent estimate. The sum of the first 100 squares is approximately (1/3)(100)³, or a third of a million. If we need the exact answer, equation (7) is available: the sum is 338,350. Many applications (example: the number of steps to solve 100 linear equations) can settle for (1/3)n³.

What is fascinating is the contrast with calculus. Calculus has no correction terms! They get washed away in the limit of thin rectangles. When the sum is replaced by the integral (the area), we get an absolutely clean answer:

The integral of v = x² from x = 0 to x = n is exactly (1/3)n³.

The area under the parabola, out to the point x = 100, is precisely a third of a million. We have to explain why, with many rectangles.

The idea is to approach an infinite number of infinitely thin rectangles. A hundred rectangles gave an area of 338,350. Now take a thousand rectangles. Their heights are (1/10)², (2/10)², … because the curve is v = x². The base of every rectangle is Δx = 1/10, and we add heights times base:

area of rectangles = (1/10)²(1/10) + (2/10)²(1/10) + … + (1000/10)²(1/10).

Factor out (1/10)³. What you have left is 1² + 2² + … + 1000², which fits the sum of squares formula. The exact area of the thousand rectangles is 333,833.5. I could try to guess ten thousand rectangles but I won't.

Main point:   The area is approaching 333,333.333. ... But the calculations are getting worse. It is time for algebra—which means that we keep "Δx" and avoid numbers.

The interval of length 100 is divided into n pieces of length Δx. (Thus n = 100/Δx.) The jth rectangle meets the curve v = x², so its height is (jΔx)². Its base is Δx, and we add areas:

area = (Δx)²(Δx) + (2Δx)²(Δx) + … + (nΔx)²(Δx) = Σj=1n(jΔx)²(Δx).   (8)

Factor out (Δx)³, leaving a sum of n squares. The area is (Δx)³ times ƒn, and n = 100/Δx:

(Δx)³1100³+1100²+1100=1100³ +1100²(Δx) +1100(Δx)².   (9)
3Δx2Δx6Δx326

This equation shows what is happening. The leading term is a third of a million, as predicted. The other terms are approaching zero! They contain Δx, and as the rectangles get thinner they disappear. They only account for the small corners of rectangles that lie above the curve. The vanishing of those corners will eventually be proved for any continuous functions—the area from the correction terms goes to zero—but here in equation (9) you see it explicitly.

The area under the curve came from the central idea of integration: 100/Δx rectangles of width Δx approach the limiting area = (1/3)(100)³. The rectangular area is ΣvjΔx. The exact area is ∫v(x)dx. In the limit Σ becomes ∫ and vj becomes v(x) and Δx becomes dx.

That completes the calculation for a parabola. It used the formula for a sum of squares, which was special. But the underlying idea is much more general. The limit of the sums agrees with the antiderivative: The antiderivative of v(x) = x² is ƒ(x) = (1/3)x³. According to the Fundamental Theorem, the area under v(x) is ƒ(x):

100v(x)dx = ƒ(100) − ƒ(0) = (1/3)(100)³.
0

That Fundamental Theorem is not yet proved! I mean it is not proved by us. Whether Leibniz or Newton managed to prove it, I am not quite sure. But it can be done. Starting from sums of differences, the difficulty is that we have too many limits at once. The sums of rjΔx are approaching the integral. The differences Δƒ/Δx approach the derivative. A real proof has to separate those steps, and Section 5.7 will do it.

Proved or not, you are seeing the main point. What was true for the numbers ƒj and vj is true in the limit for v(x) and ƒ(x). Now v(x) can vary continuously, but it is still the slope of ƒ(x). The reverse of slope is area.

(1 + 2 + 3 + 4)² = 1³ + 2³ + 3³ + 4³ Proof without words by Roger Nelsen (Mathematics Magazine 1990).

Finally we review the area under v = x. The sum of 1 + 2 + … + n is ½n² + ½n. This gives the area of n = 4/Δx rectangles, going out to x = 4. The heights are jΔx, the bases are Δx, and we add areas:

Σ4/Δx(jΔx)(Δx) = (Δx)²14²+14= 8 + 2Δx.   (10)
j=12Δx2Δx

With Δx = 1 the area is 1 + 2 + 3 + 4 = 10. With eight rectangles and Δx = ½, the area was 8 + 2Δx = 9. Sixteen rectangles of width ¼ brought the correction 2Δx down to ½. The exact area is 8. The error is proportional to Δx.

Important note   There you see a question in applied mathematics. If there is an error, what size is it? How does it behave as Δx → 0? The Δx term disappears in the limit, and (Δx)² disappears faster. But to get an error 10-6 of we need eight million rectangles:

2Δx = 2⋅4 / 8,000,000 = 10-6.

That is horrifying! The numbers 10, 9, 8½, 8¼, … seem to approach the area 8 in a satisfactory way, but the convergence is much too slow. It takes twice as much work to get one more binary digit in the answer—which is absolutely unacceptable. Somehow the Δx term must be removed. If the correction is (Δx)² instead of Δx, then a thousand rectangles will reach an accuracy of 10-6.

The problem is that the rectangles are unbalanced. Their right sides touch the graph of v, but their left sides are much too high. The best is to cross the graph in the middle of the interval—this is the midpoint rule. Then the rectangle sits halfway across the line v = x, and the error is zero. Section 5.8 comes back to this rule—and to Simpson's rule that fits parabolas and removes the (Δx)² term and is built into many calculators.

Finally we try the quick way. The area under v = x is ƒ = ½x², because dƒ/dx is v. The area out to x = 4 is ½(4)² = 8. Done.

Fig.5.7 Endpoint rules: error ∼ 1/(work) ∼ 1/n. Midpoint rule is better: error ∼ 1 / (work)².

Optional: pth powers   Our sums are following a pattern. First, 1 + … + n is ½n² plus ½n. The sum of squares is (1/3)n³ plus correction terms. The sum of pth powers is

1p + 2p + … + np = np+1 / (p+1) plus correction terms.   (11)

The correction involves lower powers of n, and you know what is coming. Those corrections disappear in calculus. The area under v = xp from 0 to n is

nxpdx = limΔx→0Σn/Δx(jΔx)p(Δx) = 1np+1.   (12)
x=0j=1p+1

Calculus doesn't care if the upper limit n is an integer, and it doesn't care if the power p is an integer. We only need p + 1 > 0 to be sure np+1 is genuinely the leading term. The antiderivative of v = xp is ƒ = xp+1 / (p+1).

We are close to interesting experiments. The correction terms disappear and the sum approaches the integral. Here are actual numbers for p = 1, when the sum and integral are easy: Sn = 1 + … + n and In = ∫xdx = ½n². The difference is Dn = ½n. The thing to watch is the relative error En = Dn/In:

nSnIn Dn = Sn − In En = Dn/In
1005050500050.010
200 20100 20000100.005

The number 20100 is ½(200)(201). Please write down the next line n = 400, and please find a formula for En. You can guess En from the table, or you can derive it from knowing Sn and In. The formula should show that En goes to zero. More important, it should show how quick (or slow) that convergence will be.

One more number—a third of a million—was mentioned earlier. It came from integrating x² from 0 to 100, which compares to the sum S100 of 100 squares:

npSnIn=(1/3)n³ D = S − I E = D/I
1002338350333333(1/3)5016(2/3).01505
200 2 2686700 2666666(2/3) 20033(1/3) .0075125

These numbers suggest a new idea, to keep n fixed and change p. The computer can find sums without a formula! With its help we go to fourth powers and square roots:

np S = 1p+…+np I = np+1 / (p+1)D = S − I En,p = D/I
10042050333330(1/3)(100)5 503333300.0252
100 ½671.4629(2/3)(100)3/24.79630.0072

In this and future tables we don't expect exact values. The last entries are rounded off, and the goal is to see the pattern. The errors En,p are sure to obey a systematic rule—they are proportional to 1/n and to an unknown number C(p) that depends on p. I hope you can push the experiments far enough to discover C(p). This is not an exercise with an answer in the back of the book—it is mathematics.