17

Day 17

Riemann Sums And Approximation


The Definite Integral as a Limit of Riemann Sums

The definite integral abf(x)dx\int_a^b f(x)\,dx is defined as the limit of sums of thin rectangles. That limit is the exact signed area between the graph and the xx-axis — everything else in the unit is a shortcut for computing it.

Core Theorem
abf(x)dx=limni=1nf(xi)Δx,Δx=ban\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x, \qquad \Delta x = \frac{b - a}{n}
where xix_i^* is any sample point in the ii-th subinterval. Area above the xx-axis counts as positive, area below as negative.

Worked Examples

Read these first — the full solution is shown, with the reasoning behind each move.

Worked Example 01Medium
Write the limit of a right Riemann sum that equals 15xdx\displaystyle\int_1^5 \sqrt{x}\,dx, using nn equal subintervals.
How to think about it

Key idea: Δx=51n=4n\Delta x = \frac{5 - 1}{n} = \frac{4}{n}, and the right endpoint of the ii-th subinterval is xi=1+iΔxx_i = 1 + i\,\Delta x.

Full solution

1. Step 1: Width and Sample Points

Δx=4n\Delta x = \dfrac{4}{n} and xi=1+4inx_i = 1 + \dfrac{4i}{n}.

2. Step 2: Assemble the Sum

15xdx=limni=1n1+4in4n\displaystyle\int_1^5 \sqrt{x}\,dx = \lim_{n \to \infty} \sum_{i=1}^{n} \sqrt{\,1 + \dfrac{4i}{n}\,}\cdot \dfrac{4}{n}.
Step-by-Step SOP
  1. 1

    Partition

    Divide [a,b][a, b] into nn subintervals of width Δx=ban\Delta x = \frac{b-a}{n}.
  2. 2

    Sample and Sum

    Pick a sample point xix_i^* in each subinterval, then form f(xi)Δx\sum f(x_i^*)\,\Delta x.
  3. 3

    Take the Limit

    abfdx=limn\int_a^b f\,dx = \lim_{n \to \infty} of that sum, when it exists.
  4. 4

    Convert Both Directions

    Be able to turn a given limit-of-a-sum into an integral (read off aa, bb, ff) and vice versa.

Practice — Your Turn

Try each one before opening the hint or the solution.

Practice 01Hard
Express limni=1n(2+3in)23n\displaystyle\lim_{n \to \infty} \sum_{i=1}^{n} \left(2 + \dfrac{3i}{n}\right)^2 \cdot \dfrac{3}{n} as a definite integral.
Need a hint?
Read off Δx=3n\Delta x = \frac{3}{n}, so ba=3b - a = 3. The sample point 2+3in2 + \frac{3i}{n} starts at 22, so a=2a = 2 and b=5b = 5; the function is ( )2(\ )^2.
Show solution

1. Step 1: Identify the Interval

Δx=3n\Delta x = \dfrac{3}{n} gives ba=3b - a = 3. The right endpoints run from just above 22 to 2+3=52 + 3 = 5, so [a,b]=[2,5][a, b] = [2, 5].

2. Step 2: Identify the Function

The factor being squared, 2+3in2 + \dfrac{3i}{n}, is the sample point xx. So f(x)=x2f(x) = x^2.

3. Step 3: Write the Integral

25x2dx\displaystyle\int_2^5 x^2\,dx.
Practice 02Easy
Evaluate 22xdx\displaystyle\int_{-2}^{2} x\,dx using the signed-area interpretation.
Need a hint?
Sketch y=xy = x from 2-2 to 22. The area below the axis on [2,0][-2, 0] cancels the area above it on [0,2][0, 2].
Show solution

1. Step 1: Split into Signed Pieces

On [2,0][-2, 0] the region is a triangle below the axis: signed area 2-2. On [0,2][0, 2] it is a triangle above the axis: signed area +2+2.

2. Step 2: Add

22xdx=2+2=0\displaystyle\int_{-2}^{2} x\,dx = -2 + 2 = 0.
Common Pitfalls
  • Reading a Sum's Interval Off WrongFrom f(a+iΔx)Δx\sum f(a + i\Delta x)\Delta x with Δx=kn\Delta x = \frac{k}{n}, the interval has length kk and starts at aa — so b=a+kb = a + k, not b=kb = k.
  • Forgetting Signed Areaabfdx\int_a^b f\,dx is not total area unless f0f \ge 0 on [a,b][a, b]. Where f<0f < 0, the integral subtracts.

Left, Right, Midpoint, and Trapezoidal Sums

With finitely many subintervals you get an approximation, and the four standard choices — left endpoint, right endpoint, midpoint, and trapezoidal — each have a predictable bias. For a monotonic function you can say for certain whether an estimate is too big or too small.

Core Theorem
For nn subintervals of width Δx\Delta x on [a,b][a, b]:
Left sum
Ln=Δx[f(x0)+f(x1)++f(xn1)]L_n = \Delta x\big[f(x_0) + f(x_1) + \cdots + f(x_{n-1})\big]
Right sum
Rn=Δx[f(x1)+f(x2)++f(xn)]R_n = \Delta x\big[f(x_1) + f(x_2) + \cdots + f(x_n)\big]
Midpoint sum
Mn=Δx[f(xˉ1)++f(xˉn)]M_n = \Delta x\big[f(\bar{x}_1) + \cdots + f(\bar{x}_n)\big], where xˉi\bar{x}_i is the midpoint of subinterval ii
Trapezoidal sum
Tn=Δx2[f(x0)+2f(x1)+2f(x2)++2f(xn1)+f(xn)]=Ln+Rn2T_n = \dfrac{\Delta x}{2}\big[f(x_0) + 2f(x_1) + 2f(x_2) + \cdots + 2f(x_{n-1}) + f(x_n)\big] = \dfrac{L_n + R_n}{2}
Bias (for equal widths): if
ff is increasing, LnL_n underestimates and RnR_n overestimates (reversed if decreasing). If ff is concave up, TnT_n overestimates and MnM_n underestimates (reversed if concave down).

Worked Examples

Read these first — the full solution is shown, with the reasoning behind each move.

Worked Example 01Medium
Estimate 02x2dx\displaystyle\int_0^2 x^2\,dx with n=4n = 4 using (a) a left sum and (b) a right sum. State whether each is an over- or underestimate.
How to think about it

Key idea: Δx=0.5\Delta x = 0.5. Left uses f(0),f(0.5),f(1),f(1.5)f(0), f(0.5), f(1), f(1.5); right uses f(0.5),f(1),f(1.5),f(2)f(0.5), f(1), f(1.5), f(2). x2x^2 is increasing on [0,2][0, 2].

Full solution

1. Step 1: Left Sum

L4=0.5[0+0.25+1+2.25]=0.5(3.5)=1.75L_4 = 0.5\,[0 + 0.25 + 1 + 2.25] = 0.5(3.5) = 1.75.

2. Step 2: Right Sum

R4=0.5[0.25+1+2.25+4]=0.5(7.5)=3.75R_4 = 0.5\,[0.25 + 1 + 2.25 + 4] = 0.5(7.5) = 3.75.

3. Step 3: Bias

x2x^2 is increasing on [0,2][0, 2], so L4=1.75L_4 = 1.75 underestimates and R4=3.75R_4 = 3.75 overestimates. (Exact value: 832.667\frac{8}{3} \approx 2.667.)
Step-by-Step SOP
  1. 1

    Find Δx and the Grid Points

    Δx=ban\Delta x = \frac{b - a}{n}; the endpoints are a,a+Δx,a+2Δx,,ba, a + \Delta x, a + 2\Delta x, \dots, b.
  2. 2

    Pick the Heights

    Left = left endpoints; right = right endpoints; midpoint = subinterval centers; trapezoid = ends counted once, interior points doubled, all over 2.
  3. 3

    Judge the Bias

    Monotonic ⇒ left/right bias from the sign of ff'. Concavity ⇒ trapezoid/midpoint bias from the sign of ff''.

Practice — Your Turn

Try each one before opening the hint or the solution.

Practice 01Medium
For 02x2dx\displaystyle\int_0^2 x^2\,dx with n=4n = 4, compute the trapezoidal estimate T4T_4 and state whether it is an over- or underestimate.
Need a hint?
T4=L4+R42T_4 = \frac{L_4 + R_4}{2}, or use the Δx2[f0+2f1+2f2+2f3+f4]\frac{\Delta x}{2}[f_0 + 2f_1 + 2f_2 + 2f_3 + f_4] formula. x2x^2 is concave up.
Show solution

1. Step 1: Trapezoidal Formula

T4=0.52[f(0)+2f(0.5)+2f(1)+2f(1.5)+f(2)]=0.25[0+0.5+2+4.5+4]=0.25(11)=2.75T_4 = \dfrac{0.5}{2}\big[f(0) + 2f(0.5) + 2f(1) + 2f(1.5) + f(2)\big] = 0.25\,[0 + 0.5 + 2 + 4.5 + 4] = 0.25(11) = 2.75.

2. Step 2: Bias

x2x^2 is concave up on [0,2][0, 2], so the trapezoids lie above the curve and T4=2.75T_4 = 2.75 overestimates. (It also equals L4+R42=1.75+3.752\frac{L_4 + R_4}{2} = \frac{1.75 + 3.75}{2}.)
Practice 02Hard
gg is decreasing and concave down on [1,5][1, 5]. A student computes a midpoint sum M2M_2 and a trapezoidal sum T2T_2 for 15g(x)dx\int_1^5 g(x)\,dx. Which is larger, and which (if either) overestimates the integral?
Need a hint?
Concavity, not monotonicity, controls midpoint vs. trapezoid. Concave down flips the concave-up rules.
Show solution

1. Step 1: Apply the Concave-Down Rule

For a concave-down function, the trapezoid rule underestimates and the midpoint rule overestimates.

2. Step 2: Conclude

M2>15gdx>T2M_2 > \int_1^5 g\,dx > T_2. So M2M_2 is larger, M2M_2 overestimates, and T2T_2 underestimates. (The decreasing behavior is irrelevant to this comparison.)
Common Pitfalls
  • Using Monotonicity to Judge the Trapezoid RuleLeft/right bias comes from whether ff is increasing or decreasing. Trapezoid/midpoint bias comes from concavity — a different property.
  • Doubling the Endpoints in the Trapezoid FormulaIn TnT_n, the two outer values f(x0)f(x_0) and f(xn)f(x_n) are counted once; only the interior values are doubled.

Approximating an Integral from a Table of Values

AP free-response questions routinely give you a function only as a table — a few (t,f(t))(t, f(t)) pairs, often at unequal spacings — and ask for a Riemann or trapezoidal estimate of an integral, plus its meaning with units. The subinterval widths come straight from the table.

Core Theorem
With table points t0<t1<<tnt_0 < t_1 < \cdots < t_n (widths Δti=titi1\Delta t_i = t_i - t_{i-1}, possibly unequal):
Left sum
=Δtif(ti1)= \sum \Delta t_i \, f(t_{i-1}); Right sum =Δtif(ti)= \sum \Delta t_i \, f(t_i).
Trapezoid on each subinterval:
Δti2[f(ti1)+f(ti)]\dfrac{\Delta t_i}{2}\big[f(t_{i-1}) + f(t_i)\big], then add.
1baabf(t)dt\dfrac{1}{b - a}\displaystyle\int_a^b f(t)\,dt is the average value of ff over [a,b][a, b], in the units of ff.

Worked Examples

Read these first — the full solution is shown, with the reasoning behind each move.

Worked Example 01Medium
Water flows into a tank at rate r(t)r(t) liters/hour. The table gives rr: t=0,2,5,6t = 0, 2, 5, 6 hours with r(t)=3,7,10,8r(t) = 3, 7, 10, 8 liters/hour. Use a left Riemann sum with the three subintervals in the table to estimate 06r(t)dt\displaystyle\int_0^6 r(t)\,dt, and say what it represents with units.
How to think about it

Key idea: The widths are 20=22 - 0 = 2, 52=35 - 2 = 3, and 65=16 - 5 = 1. A left sum uses the value at the left end of each subinterval.

Full solution

1. Step 1: Widths and Left Values

Subintervals [0,2],[2,5],[5,6][0,2], [2,5], [5,6] with widths 2,3,12, 3, 1. Left values: r(0)=3r(0) = 3, r(2)=7r(2) = 7, r(5)=10r(5) = 10.

2. Step 2: Left Sum

2(3)+3(7)+1(10)=6+21+10=372(3) + 3(7) + 1(10) = 6 + 21 + 10 = 37.

3. Step 3: Interpret

06r(t)dt37\displaystyle\int_0^6 r(t)\,dt \approx 37 liters — the approximate total amount of water that flowed into the tank during the first 6 hours.
Step-by-Step SOP
  1. 1

    Read the Widths from the Table

    Δti=titi1\Delta t_i = t_i - t_{i-1} for each consecutive pair — do not assume they are equal.
  2. 2

    Choose the Method's Heights

    Left = left value; right = right value; trapezoid = average of the two end values.
  3. 3

    Multiply by Width and Add

    One term per subinterval, then sum.
  4. 4

    Interpret with Units

    r(t)dt\int r(t)\,dt is a total amount (units of rr × units of tt); 1ba\frac{1}{b-a}\int is an average value (units of ff).

Practice — Your Turn

Try each one before opening the hint or the solution.

Practice 01Medium
Using the same table (t=0,2,5,6t = 0, 2, 5, 6; r=3,7,10,8r = 3, 7, 10, 8), estimate 06r(t)dt\displaystyle\int_0^6 r(t)\,dt with a trapezoidal sum.
Need a hint?
On each subinterval, average the two endpoint values and multiply by that subinterval's width.
Show solution

1. Step 1: Trapezoid on Each Subinterval

[0,2][0,2]: 22(3+7)=10\dfrac{2}{2}(3 + 7) = 10. [2,5][2,5]: 32(7+10)=25.5\dfrac{3}{2}(7 + 10) = 25.5. [5,6][5,6]: 12(10+8)=9\dfrac{1}{2}(10 + 8) = 9.

2. Step 2: Add

10+25.5+9=44.510 + 25.5 + 9 = 44.5 liters.
Practice 02Hard
The table gives the temperature H(t)H(t) in °C of a pool: t=0,3,6,9t = 0, 3, 6, 9 hours with H=18,21,24,23H = 18, 21, 24, 23. Using a trapezoidal sum over [0,9][0, 9], estimate the average temperature of the pool over those 9 hours.
Need a hint?
Average value =1909H(t)dt= \frac{1}{9}\int_0^9 H(t)\,dt. Estimate the integral with trapezoids first (equal width 3), then divide by 9.
Show solution

1. Step 1: Trapezoidal Estimate of the Integral

Equal width 33: 32[H(0)+2H(3)+2H(6)+H(9)]=32[18+42+48+23]=32(131)=196.5\dfrac{3}{2}\big[H(0) + 2H(3) + 2H(6) + H(9)\big] = \dfrac{3}{2}\big[18 + 42 + 48 + 23\big] = \dfrac{3}{2}(131) = 196.5.

2. Step 2: Divide by the Interval Length

Average temperature 196.5921.83 C\approx \dfrac{196.5}{9} \approx 21.83\ ^\circ\mathrm{C}.
Common Pitfalls
  • Assuming Equal Subinterval WidthsTable tt-values are often unevenly spaced. Multiply each term by its own Δt\Delta t, not by a single shared width.
  • Answering with No Units or Context"37\approx 37" loses points. Write "37\approx 37 liters, the total water in over the first 6 hours."
Gary Chang

Gary Chang

Calculus Educator

5+ Years of Calculus Teaching Experience | AP Calculus Specialist. Dedicated to helping students master calculus through step-by-step logic and clear visualizations.