To find ∫abf(x)dx, we usually look for an antiderivative F and evaluate F(b)−F(a). But what if we can't write down an antiderivative, like for ∫e−x2dx, or we only have a table of measured values? Then we have to estimate the integral.
Let's practise on an integral we can already find, ∫04(2+5x−x2)dx=380, or about 26.67, so we can see how close an estimate gets. Suppose we only know f(x)=2+5x−x2 at five points.
xf(x)0216283846
We split [0,4] into 4 equal pieces, which tests call subintervals, and build a rectangle on each one. But the curve's height changes across each piece, so which height should a rectangle use?
Estimate ∫04(2+5x−x2)dx from five values with left and right sums
Text solution
The width of each pieceThe interval has length 4−0=4, shared by 4 pieces.
width=44−0=1
Only the ends differThe values f(1),f(2) and f(3) are in both sums, because 1,2 and 3 are the right end of one piece and the left end of the next. Subtracting cancels them.
28−24=f(4)−f(0)=4
A left sum takes each height at the left end of its piece, and a right sum takes it at the right end. Any sum like these, where we cut an interval into pieces and add up width⋅height for each piece, is called a Riemann sum.
Left sum
=1⋅f(0)+1⋅f(1)+1⋅f(2)+1⋅f(3)+1⋅f(4)=24
Right sum
=1⋅f(0)+1⋅f(1)+1⋅f(2)+1⋅f(3)+1⋅f(4)=28
left sum+1⋅f(0)+1⋅f(1)+1⋅f(2)+1⋅f(3)=24right sum+1⋅f(1)+1⋅f(2)+1⋅f(3)+1⋅f(4)=28
The exact area lies between the two estimates, with the left sum below it and the right sum above it.
24<380<28
2
Overestimates, underestimates, and inscribed rectangles
Our left sum of 24 came out less than 380, while the right sum of 28 came out greater. Does a left sum always underestimate the integral? Look at the fourth left rectangle, on [3,4].
Compare left, inscribed, and circumscribed sums for y=2+5x−x2 on [0,4]
Text solution
The fourth pieceOn [0,3], each left end gives the smallest value on its piece, even on [2,3], where the curve peaks at 8.25 between two 8s. On [3,4],f falls from 8 to 6, so the left height is the largest value there, and that rectangle sits above the curve by as much as 2. The left sum is still under 380 only because the first three rectangles miss more area than the fourth one adds.
Left sum and inscribed sumOn [3,4], the inscribed height is the smallest value, f(4)=6, not the left height 8. That one piece is the whole difference.
24−22=8−6
Below the axisFor g(x)=−(2+5x−x2), each inscribed height is the value nearest 0 on its piece, so the inscribed sum is closer to 0 than the integral.
−380<−22<0
A left sum is guaranteed to be an underestimate when f increases across the whole interval [a,b]. Then the left end of every piece has the smallest value and the right end the largest. If f decreases across the whole interval, those roles swap.
When f increases
left sum<∫abf(x)dx<right sum
When f decreases
right sum<∫abf(x)dx<left sum
When f increases and then decreases, we choose the height on each piece separately instead. Inscribed rectangles fit inside the region, so each one uses the smallest value of f on its piece. Circumscribed rectangles cover the region, so each one uses the largest. That value can be inside the piece, like the local maximum f(2.5)=8.25 on [2,3].
Inscribed sum
=2+6+8+6=22
Circumscribed sum
=6+8+8.25+8=30.25
22<380<30.25
When the curve is below the x-axis, like g(x)=−(2+5x−x2), the heights are negative, and an inscribed rectangle reaches down only to the value nearest 0 on its piece.
inscribed=−2−6−8−6=−22
∫04−(2+5x−x2)dx=−380
Is a left sum always an underestimate?
Change where the function increases
3
Midpoint and trapezoid sums
The left and right sums took the height at an end of each piece, and they gave 24 and 28 around the exact 380≈26.67. Here are two ways to get closer.
Instead of an end, we can take the height at the middle of each piece. That's the midpoint sum.
Or we can connect the points on the curve at the two ends of each piece with a straight segment. That gives a trapezoid on each piece, and adding their areas gives the trapezoid sum. On [0,1], the trapezoid's area is the average of the left and right rectangles' areas.
1⋅22+6=4=21⋅2+1⋅6
That happens on every piece, so the same is true of the whole sums:
trapezoid sum=2left sum+right sum
Which of the two is too big, and which is too small? That depends on concavity.
Find the midpoint and trapezoid sums for ∫04(2+5x−x2)dx and compare them using concavity
Text solution
The four trapezoids
22+6+26+8+28+8+28+6=4+7+8+7=26=224+28
Concave down, so the trapezoids fall shortThe second derivative is −2, so f is concave down, and the curve lies above the segment joining any two of its points. Every trapezoid top is under the curve.
26<380
Turn the midpoint top onto the tangentTurning the top about its midpoint removes one triangle and adds an equal one, so the area stays 4.25. The tangent lies above a concave-down curve, so each midpoint rectangle has more area than the curve on its piece.
27>380
Here's that turn on [0,1], onto the tangent line at x=0.5.
f′(x)=5−2x,f′(0.5)=4
tangent at 0.5:y=4.25+4(x−0.5)x=0→2.25,x=1→6.25
tangent at 0.5:y=4.25+4(x−0.5)x=0→2.25,x=1→6.25
1⋅22.25+6.25=4.25=1⋅f(0.5)
If a function is concave up instead, both arguments reverse. The curve lies below its chords and above its tangent lines, so the trapezoid sum is an overestimate and the midpoint sum is an underestimate.
Notice that f is increasing on [0,1], but the trapezoid there has area 4, less than the exact ∫01(2+5x−x2)dx=625≈4.17. For trapezoid and midpoint sums, what decides over or under is concavity, not whether f is increasing or decreasing.
26<380<27
If a function is increasing, does its trapezoid sum have to be an overestimate?
Change concavity, keep the endpoints
4
Simpson's rule
For 2+5x−x2, the trapezoid sum on 4 pieces was 26, under the exact area of 380, and the midpoint sum was 27, over it. Can we combine them so their errors cancel out?
That's what Simpson's rule does. It groups the 4 pieces into 2 pairs of width 2,[0,2] and [2,4], which is why it needs an even number of pieces.
Use Simpson's rule with n=4 to estimate ∫04(2+5x−x2)dx
Text solution
Both sums on the pairsThe middles are 1 and 3, and the ends are 0,2 and 4. The trapezoid sum misses by twice as much as the midpoint sum.
2⋅f(1)+2⋅f(3)=28
10+14=24
28−380=34
380−24=38
Why it's 2 to 1On y=x2 over [−1,1], the exact area is 32, the trapezoid gives 2 and the midpoint gives 0. Both sums are exact for any line, and every parabola is an x2 term plus a line, so the ratio holds on every parabola.
2−32=34
32−0=32
Weight the midpoint sum twice
32⋅28+31⋅24=356+324=380
So Simpson's rule gives the midpoint sum twice the weight of the trapezoid sum, both taken on the pairs of pieces.
Simpson's rule
=32(midpoint sum)+31(trapezoid sum)
=32(midpoint sum)+31(trapezoid sum)
On any parabola, Simpson's rule gives the exact integral. Other curves aren't parabolas, but over a small pair a smooth curve is close to one, so the two errors almost cancel, and the estimate is usually far closer than the trapezoid or midpoint sum alone.
5
Sums from a table
When we have a formula, we can chop the interval into equal pieces. But when the values come from a table, the inputs aren't always evenly spaced.
tr(t)04273875103
Here the gaps between the times are 2,1,4, and 3. We don't know r(t) between these times, so an estimate is the best we can do.
Estimate ∫010r(t)dt from an unevenly spaced table
Text solution
Each piece has its own widthEach piece runs from one time in the table to the next.
2−07−3=2,=4,3−210−7=1=3
Multiply each height by its own widthAn average width of 410=2.5 for every piece would give 60, which is wrong: the height 8 stands on a piece of width 4. The trapezoid sum is still the average of the left and right sums.
2⋅4+1⋅7+4⋅8+3⋅5=62
2⋅7+1⋅8+4⋅5+3⋅3=51
56.5=262+51
We also can't tell whether these sums are overestimates or underestimates without knowing whether r(t) is increasing, decreasing, or concave up or down between the points.
When a table value is negative, a trapezoid's average height can be negative too. With heights 1 and −2 on a piece of width 2, part of the trapezoid is above the axis, but its net area is negative.
2⋅21+(−2)=2⋅(−21)=−1
For a midpoint sum from a table, the middle of each piece has to be an input that's listed. In the table for 2+5x−x2, pieces of width 1 would need 0.5,1.5,2.5, and 3.5, which aren't there. So we take two pieces of width 2, with middles 1 and 3. That's the same midpoint sum of 28 we used in Simpson's rule.
xf(x)0216283846
[0,2],[2,4],middles 1,3
Midpoint sum
=2⋅f(1)+2⋅f(3)=12+16=28
6
The limit of Riemann sums
With 4 pieces, the inscribed rectangles gave 22 and the circumscribed ones gave 30.25, with 380 between them. With 8 thinner pieces, the two sums close in on it.
4 pieces
22<380<30.25
30.25−22=8.25
8 pieces
24.375<380<28.625
28.625−24.375=4.25
As the pieces get thinner, that gap goes to 0, and both sums approach the exact area. The definite integral ∫04f(x)dx is that value. To write a sum for any number of pieces n, we use sigma notation, and then we'll read a limit of sums back as an integral.
Find the integral for limn→∞∑i=1n1+n4i⋅n4
Text solution
Sigma notation∑i=14 means we evaluate the term at i=1,2,3,4 and add them up, like the right sum with 4 pieces.
i=1∑4f(i)⋅1=28
The right sum with n piecesEach width is n4, and rectangle i ends i widths from 0, at n4i. At i=n, that's 4.
n→∞limi=1∑nf(n4i)⋅n4=∫04f(x)dx
Read the limit backThe n4 multiplying the height is the width, so the length is n⋅n4=4. Treating the right end 1+n4i as x, the height is x, the right bound is 5, and the left bound is 5−4=1.
∫15xdx=32(55−1)
With left ends instead, the heights are at n4(i−1), one width earlier. The right sum minus the left sum is just (f(4)−f(0))⋅n4=n16, which goes to 0, so both sums have the same limit.
Reading a limit of sums as an integral comes down to naming each part of the sum:
i=1∑nright end of rectangle i1+n4i⋅widthn4
n⋅n4i=n→1+45−4=4=5=1
We could also treat n4i as x. Then the bounds are 0 and 4, and the height is 1+x. That curve is y=x on [1,5] shifted 1 unit to the left, with the same rectangles and the same area, so either integral is a correct answer.
∫15xdx=∫041+xdx
Why do the inscribed and circumscribed sums approach the same area?
Narrower rectangles
Which integral does this limit of sums represent?
Read the rectangles
Summary
What a Riemann sum adds up
Riemann sum=width⋅height+width⋅height+⋯
Split the interval into pieces, and build a rectangle on each piece. A left sum uses the height at the left end, a right sum uses the right end, and a midpoint sum uses the middle.
When values come from a table, each piece's width is the difference between neighbouring inputs. For a midpoint sum, if the inputs are evenly spaced, combine every two steps into one piece so the middle of each piece is an input from the table.
Overestimates and underestimates from increasing or decreasing
When f increases across the whole interval, the left end gives the smallest value on each piece and the right end gives the largest. So the left sum is an underestimate and the right sum is an overestimate.
When f decreases across the whole interval, the left sum is an overestimate and the right sum is an underestimate. If f increases and then decreases, neither sum is guaranteed to be an overestimate or an underestimate.
Inscribed and circumscribed rectangles
0
1
2
3
4
x
y
2
6
8
6
6
8
8.25
8
inscribedcircumscribed=22=30.25
22<380<30.25
An inscribed rectangle stays inside the region on its piece, so its height is the value of f nearest the axis on that piece. A circumscribed rectangle covers the region on its piece, so its height is the value farthest from the axis.
When f changes between increasing and decreasing inside a piece, check its local maximum or minimum. On [2,3], the local maximum f(2.5)=8.25 is greater than the values at either endpoint, so the circumscribed rectangle uses height 8.25.
Trapezoid and midpoint sums
trapezoid sum=2left sum+right sum
Connecting the points on the curve at the ends of each piece gives us a trapezoid on that piece. The trapezoid sum is always the average of the left sum and the right sum.
When f is concave down across the whole interval, chords lie below the curve and tangent lines lie above it, so the trapezoid sum is an underestimate and the midpoint sum is an overestimate. When f is concave up across the whole interval, the trapezoid sum is an overestimate and the midpoint sum is an underestimate.
Simpson's rule
Simpson’s rule=32(midpoint sum)+31(trapezoid sum)on the pairs of pieces
Simpson's rule groups the pieces into pairs, so we need an even number of pieces n.
Because the trapezoid error on any parabola is twice the midpoint error on the opposite side, the errors cancel out completely, and Simpson's rule gives the exact integral. On a smooth curve, using small pairs usually gives a much closer estimate than either sum alone.
Turning a limit of sums into an integral
n→∞limi=1∑nright end ofrectangle i1+n4i⋅widthn4=∫15xdx=∫041+xdx
The factor n4 multiplying the height is the width of each rectangle. Multiplying that width by n gives the total interval length, n⋅n4=4.
The input 1+n4i is the right end of rectangle i, and the height is the square root of that right end. Setting i=n gives the right bound, 1+4=5. Subtracting the length 4 gives the left bound, 5−4=1, so the limit is ∫15xdx.
If we treat n4i as x instead, the interval goes from 0 to 4 with height 1+x, and we get ∫041+xdx. It's the same area, shifted 1 unit to the left.
7
Practice
Enter exact values unless a problem asks for an approximation.
1
Let f(x)=x2+1. (a) Find the left Riemann sum for ∫03f(x)dx with 3 subintervals of equal width. (b) Is it an overestimate or an underestimate of the integral? Explain.
The interval [0,3] is split into 3 equal pieces. What are the left endpoints of those pieces?
If you got overestimate Check whether f is increasing or decreasing on [0,3]. Concavity decides trapezoid and midpoint sums, not left sums.
If you got 17 That's the right Riemann sum. Use the values of f at the left endpoints x=0,1,2, not the right endpoints.
(b)
Is f increasing or decreasing on [0,3]? That tells you whether the smallest value on each piece is at its left end or its right end.
Find the left Riemann sumThe interval [0,3] has length 3, so 3 equal pieces have width 1, and we evaluate f at the left end of each piece.
width=33−0=1,[0,1],[1,2],[2,3]
1⋅f(0)+1⋅f(1)+1⋅f(2)=1+2+5=8
Check whether f is increasing or decreasingThe derivative is positive for x>0, so f is increasing on [0,3].
f′(x)=2x>0 for 0<x≤3
Because f is increasing, the smallest value on each piece is at its left endpoint, so every left rectangle lies below the curve, and the left sum is an underestimate.
∫03(x2+1)dx=9+3=12>8
2
The table gives values of v(t). Use a left Riemann sum with the four subintervals given by the table to estimate ∫06v(t)dt.
tv(t)021−13−34064
What is the width of [1,3], and what is the height v(1) at its left end?
If you got 7 Definite integrals count area below the axis as negative, so keep the negative signs on −1 and −3.If you got 1 That's the right Riemann sum. For each piece, take the value of v(t) at its left endpoint.
The t-values are not evenly spaced, so we find the width of each subinterval separately.
1−0=1,3−1=2,4−3=1,6−4=2
On each subinterval we multiply its width by the value of v at its left end, keeping the negative signs.
1⋅2+2⋅(−1)+1⋅(−3)+2⋅0=2−2−3+0=−3
3
Let f(x)=x2−3x+4. Find the sum of the areas of the inscribed rectangles for the region under y=f(x) on [0,4], using 4 subintervals of equal width.
On [1,2], the endpoints give f(1)=2 and f(2)=2. Is 2 the smallest value of f on that piece?
If you got 10 Check the second piece, [1,2]. The vertex of the parabola is inside that subinterval, and f(1.5)=1.75 is smaller than the endpoint values.If you got 12 That's the left Riemann sum. For inscribed rectangles, each height must be the smallest value of f on that piece. On [0,1],f(1)=2 is smaller than f(0)=4.
Four equal subintervals on [0,4] have width 1, so let's evaluate f(x) at each endpoint.
f(0)=4,f(1)=2,f(2)=2,f(3)=4,f(4)=8
Check for a minimum inside a pieceSetting f′(x)=0 gives the vertex at x=1.5 inside [1,2], where the value of f is less than at either endpoint.
f′(x)=2x−3=0→x=1.5,f(1.5)=2.25−4.5+4=1.75
For inscribed rectangles, take the smallest value of f on each piece, so we use 1.75 on [1,2] and the smaller endpoint value on the other three pieces.
[0,1]:2,[1,2]:1.75,[2,3]:2,[3,4]:4
1⋅2+1⋅1.75+1⋅2+1⋅4=9.75
4
(a) Use a trapezoid sum with 2 subintervals of equal width to estimate ∫04xdx. (b) Is it an overestimate or an underestimate? Explain.
The interval [0,4] is split into 2 equal pieces. What are the heights at x=0,2,4?
If you got overestimate Check the concavity of x. Whether a function increases or decreases decides left and right sums, but concavity decides trapezoid sums.
(b)
Is the second derivative of x positive or negative on (0,4)?
Each of the 2 subintervals has width 2, and the area of each trapezoid is its width times the average of its two heights.
width=2:2⋅20+2+2⋅22+4=2+2+2=2+22
Check concavityThe second derivative is negative for all x>0, so x is concave down.
(x)′′=−41x−23<0 for x>0
Because the curve is concave down, the straight line connecting the ends of each piece lies below the curve, so the trapezoid sum is an underestimate.
∫04xdx=316≈5.33>2+22≈4.83
5
The table gives values of f(x). Use a midpoint sum with 3 subintervals of equal width to estimate ∫012f(x)dx.
xf(x)0325486987104122
xf(x)03254869
xf(x)87104122
The three subintervals are [0,4],[4,8], and [8,12]. What are their midpoints?
If you got 36 Check the width of each subinterval. Dividing an interval of length 12 into 3 equal pieces gives width 4, not 2.
Find the subintervals and midpointsDividing the interval of length 12 into 3 equal pieces gives width 4, and the midpoint of each piece is in the table.
width=312−0=4:[0,4],[4,8],[8,12],middles 2,6,10
We read the values of f at the three midpoints from the table and multiply their sum by the width 4.
4⋅f(2)+4⋅f(6)+4⋅f(10)=4⋅(5+9+4)=72
6
Use Simpson's rule with n=4 to estimate ∫13x1dx.
Simpson's rule groups the 4 pieces into pairs. How many pairs are there?
On the pairs [1,2] and [2,3], what are the midpoints?
If you got ≈1.0987 Simpson's rule pairs the 4 pieces into 2 intervals of width 1. Find the midpoint and trapezoid sums on those two pairs, not on four pieces of width 0.5.If you got 1517 Check the weights. Simpson's rule gives weight 32 to the midpoint sum and 31 to the trapezoid sum.
Group the subintervals into pairsWith n=4, the 4 subintervals group into 2 pairs, [1,2] and [2,3], each of width 1.
n=4:1,1.5,2,2.5,3,pairs [1,2],[2,3]
On these two pairs, we find the midpoint sum using midpoints 1.5 and 2.5, and the trapezoid sum using the endpoints 1,2, and 3.
midpoint sum=1⋅1.51+1⋅2.51=32+52=1516
trapezoid sum=1⋅21+21+1⋅221+31=43+125=67
Simpson's rule takes 32 of the midpoint sum plus 31 of the trapezoid sum.
The exact integral is ln3≈1.0986, which is close to our estimate of 1.1 but not equal to it.
∫13x1dx=ln3≈1.0986
7
Evaluate n→∞limi=1∑n(1+n2i)3⋅n2.
The factor n2 is the width of each rectangle. What is the total length of the n rectangles?
When i=n, what value does 1+n2i reach?
If you got 4 That's the integral from 0 to 2. The sample point 1+n2i starts after x=1, not after x=0.
Find the bounds of the integralThe width of each rectangle is n2, so n rectangles span a total length of 2. At i=n, the right endpoint reaches 3, so the left bound is 3−2=1.
width n2→n⋅n2=2,i=n→1+2=3,3−2=1
The term 1+n2i is the right end of rectangle i, and the height is that value cubed, so the limit is the integral of x3 from 1 to 3.
On [1,3], what is the width of each of the n rectangles, and what is the right end of rectangle i?
If you got n→∞limi=1∑nln(n2i)⋅n2 The sample points n2i go from 0 to 2, so that limit gives the integral of lnx from 0 to 2.
If you got n→∞limi=1∑nln(1+n2i)⋅n1 The factor n1 doesn't match the subinterval width n2, so that limit gives 21∫13lnxdx.
If you got n→∞limi=1∑nln(1+ni)⋅n2 The sample points 1+ni only go from 1 to 2, not from 1 to 3.
Dividing the interval [1,3] of length 2 into n equal pieces gives rectangles of width n2.
[1,3]:width=n3−1=n2
Starting from x=1, each step moves right by n2, so rectangle i has right end 1+n2i and height ln(1+n2i).
right end of rectangle i=1+n2i:i=n→3
∫13lnxdx=n→∞limi=1∑nln(1+n2i)⋅n2
9
The table gives values of f′(x), and f(0)=5. Use a trapezoid sum with the four subintervals given by the table to estimate f(10). (Challenge)
xf′(x)0123647−2101
By the Fundamental Theorem of Calculus, what does ∫010f′(x)dx equal in terms of f(10) and f(0)?
What are the widths of the subintervals between neighbouring x-values in the table?
If you got 17.5 That's the trapezoid estimate for ∫010f′(x)dx. Remember to add the initial value f(0)=5 to find f(10).If you got 30.5 Check the sign of f′(7) in the table. The value is −2, not 2.
Relate f(10) to the integral of f′The integral of f′ gives the net change f(10)−f(0), so f(10) is f(0) plus the integral of f′.
∫010f′(x)dx=f(10)−f(0)→f(10)=f(0)+∫010f′(x)dx
We find each subinterval's width from the x-values and compute the trapezoid sum for the integral of f′(x), keeping the negative value at x=7.