BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Definite integrals and Riemann sums

The definite integral of f from a to b is the area under the graph: cut the interval into n thin strips, add up the areas of rectangles, and take the limit as the strips get thin. Done by hand for x², with a staircase pyramid to estimate 1² + 2² + ⋯ + n², it gives b³/3, and the pattern b, b²/2, b³/3 hints at a much faster way. Integrals are also cumulative sums: totals of anything that accumulates at a varying rate.

You need this first

Full reading path (13 pages)
  1. The derivative: slope of the tangent line and rate of change (18.01)
  2. Limits and continuity (18.01)
  3. Derivatives of sine and cosine, and the product and quotient rules (18.01)
  4. The chain rule and higher derivatives (18.01)
  5. Implicit differentiation and the derivatives of inverse functions (18.01)
  6. Exponentials and logarithms: the number e and its derivatives (18.01)
  7. Linear and quadratic approximations (18.01)
  8. Curve sketching with the first and second derivative (18.01)
  9. Sketching strategy and maximum–minimum problems (18.01)
  10. More max–min, and related rates (18.01)
  11. A ring on a string, and Newton's method (18.01)
  12. The mean value theorem and inequalities (18.01)
  13. Differentials and antiderivatives (18.01)
On this page · 7 sections
  1. Area under a curve
  2. The parabola, by hand
  3. Summation notation
  4. A pattern
  5. Riemann sums
  6. Integrals as cumulative sums
  7. Summary

The third unit of the course, and the second half of calculus, is integration (transcript, p. 1). This lecture defines the definite integral in two ways: as the area under a curve, the geometric view the course has used throughout, and as a cumulative sum (p. 1; notes, p. 1).

Area under a curve#

Take a curve y=f(x)y = f(x) above the xx-axis, between x=ax = a and x=bx = b. The area of the region between the curve and the axis has its own notation (transcript, p. 1):

Definite integral
area=∫abf(x) dx\text{area} = \int_a^b f(x)\,dx
In words

area equals the integral from a to b of f(x) d x

It is the definite integral: unlike the indefinite integral of the last lectures, it has limits, where it starts (aa) and where it ends (bb), and its value is a number. To compute it, three steps (pp. 1–2; notes, p. 1):

  1. Divide the region into thin strips and replace each by a rectangle. These are not exactly the strips: some rectangles overshoot the curve, some fall short.
  2. Add up the areas of the rectangles: easy, base times height.
  3. Take the limit as the rectangles get thinner. The small pieces missed or added shrink to nothing, and the sum hits the area on the nose.

The parabola, by hand#

The lecture does one example in full, f(x)=x2f(x) = x^2 from a=0a = 0 to an arbitrary bb, so that the pattern shows (transcript, pp. 2–5; notes, pp. 1–3). Cut [0,b][0, b] into nn equal pieces of width b/nb/n, and give each rectangle the height of the curve at its right end: (b/n)2(b/n)^2, (2b/n)2(2b/n)^2, …, (nb/n)2(nb/n)^2. Each overshoots. Factor out the common (b/n)3(b/n)^3:

Sum of the rectangles
bn(bn)2+bn(2bn)2+⋯+bn(nbn)2=b3n3(12+22+⋯+n2)\frac{b}{n}\Big(\frac{b}{n}\Big)^2 + \frac{b}{n}\Big(\frac{2b}{n}\Big)^2 + \cdots + \frac{b}{n}\Big(\frac{nb}{n}\Big)^2 = \frac{b^3}{n^3}\left(1^2 + 2^2 + \cdots + n^2\right)
In words

b over n ( b over n ) squared plus b over n ( 2 b over n ) squared plus and so on plus b over n ( n b over n ) squared equals b cubed over n cubed, times the quantity 1 squared plus 2 squared plus and so on plus n squared

How big is 12+22+⋯+n21^2 + 2^2 + \cdots + n^2? Build a staircase pyramid of unit-thick layers: an n×nn \times n layer at the bottom, (n−1)×(n−1)(n-1)\times(n-1) on top, up to a single block (transcript, pp. 4–5; notes, pp. 2–3). Its volume is exactly the sum. An ordinary pyramid with base n2n^2 and height nn fits inside it, and one with base (n+1)2(n+1)^2 and height n+1n + 1 fits around it. With volume 13\tfrac13 base × height:

Trapping the sum
13n3  <  12+22+⋯+n2  <  13(n+1)3\tfrac13 n^3 \;<\; 1^2 + 2^2 + \cdots + n^2 \;<\; \tfrac13 (n+1)^3
In words

one third n cubed less than 1 squared plus 2 squared plus and so on plus n squared less than one third the quantity n plus 1, all cubed

Divide by n3n^3: the middle lies between 13\tfrac13 and 13(1+1/n)3\tfrac13(1 + 1/n)^3, which tends to 13\tfrac13 as n→∞n \to \infty. (The transcript has "13+(1+1/n)3\tfrac13 + (1 + 1/n)^3" at this point; it is a product, p. 5.) So

The area under x²
∫0bx2 dx=lim⁡n→∞b3n3(12+22+⋯+n2)=b33\int_0^b x^2\,dx = \lim_{n\to\infty}\frac{b^3}{n^3}\left(1^2 + 2^2 + \cdots + n^2\right) = \frac{b^3}{3}
In words

the integral from 0 to b of x squared d x equals the limit as n goes to infinity of b cubed over n cubed, times the quantity 1 squared plus 2 squared plus and so on plus n squared, equals b cubed over 3

Factoring out the simple part, b3/n3b^3/n^3, and analysing the hard sum on its own, is what you always do with such sums (pp. 5–6).

The parabola y=x2y = x^2 on [0,1][0, 1] and the tops of the four right-end rectangles, height (k/4)2(k/4)^2 on the kk-th strip, all from the formulas. The rectangles overshoot: their total area is 30/64 ≈ 0.469, against the true area 1/3.

Summation notation#

Long sums like these are abbreviated with a capital sigma (transcript, p. 6):

Summation notation
∑i=1nai=a1+a2+⋯+an,1n3∑i=1ni2  →  13 (n→∞)\sum_{i=1}^{n} a_i = a_1 + a_2 + \cdots + a_n, \qquad \frac{1}{n^3}\sum_{i=1}^{n} i^2 \;\to\; \frac13 \ (n \to \infty)
In words

the sum from i equals 1 to n of a sub i equals a one plus a two plus and so on plus a sub n, 1 over n cubed, times the sum from i equals 1 to n of i squared goes to one third (n goes to infinity )

The parabola's sum is ∑i=1nbn(ibn)2\sum_{i=1}^{n}\frac{b}{n}\left(\frac{ib}{n}\right)^2, and factoring out (b/n)3(b/n)^3 is just the distributive law (p. 6). Writing the first term as 121^2 shows that it follows the same pattern as the rest.

A pattern#

Two more examples need no sums at all, because their areas are known shapes (transcript, pp. 6–7; the notes, p. 3, do f(x)=xf(x) = x with a sum): under f(x)=xf(x) = x the region is a triangle, area 12b2\tfrac12 b^2; under f(x)=1f(x) = 1 it is a rectangle, area bb. Line them up:

The pattern
∫0b1 dx=b,∫0bx dx=b22,∫0bx2 dx=b33\int_0^b 1\,dx = b, \qquad \int_0^b x\,dx = \frac{b^2}{2}, \qquad \int_0^b x^2\,dx = \frac{b^3}{3}
In words

the integral from 0 to b of 1 d x equals b, the integral from 0 to b of x d x equals b squared over 2, the integral from 0 to b of x squared d x equals b cubed over 3

so a good guess is ∫0bx3 dx=b4/4\int_0^b x^3\,dx = b^4/4 (p. 7). The notes point out the key: the derivative of each area with respect to bb is the function itself, ddbb33=b2\frac{d}{db}\frac{b^3}{3} = b^2 (notes, p. 3). The next lecture makes this the fundamental theorem of calculus, and then integrals become as quick as derivatives. The lecturer adds a historical remark: Archimedes found the area under a parabola by a method so brilliant and difficult that, in the lecturer's view, it may have held mathematics back, because others could not see the simple pattern (p. 7). (Historians would add that Cavalieri and Fermat found the rule for xnx^n in the 1630s, before Newton and Leibniz.)

Riemann sums#

The general procedure (transcript, p. 8; notes, p. 4): divide [a,b][a, b] into nn equal pieces of width Δx=(b−a)/n\Delta x = (b - a)/n; in the ii-th piece choose any point cic_i and use f(ci)f(c_i) as the height. (The parabola used right ends; left ends or midpoints work as well.) The sum of the areas is a Riemann sum, after the nineteenth-century mathematician Bernhard Riemann, and its limit is the definite integral:

Riemann sum and definite integral
lim⁡n→∞∑i=1nf(ci) Δx=∫abf(x) dx\lim_{n\to\infty}\sum_{i=1}^{n} f(c_i)\,\Delta x = \int_a^b f(x)\,dx
In words

the limit as n goes to infinity of the sum from i equals 1 to n of f( c sub i ) capital delta x equals the integral from a to b of f(x) d x

In the limit, Δx\Delta x becomes Leibniz's dxdx (p. 8).

Worked example

Three Riemann sums for x²

Estimate ∫01x2 dx\int_0^1 x^2\,dx with n=4n = 4 strips, using right ends, left ends and midpoints.

Right ends

14[(14)2+(24)2+(34)2+12]=3064≈0.469\tfrac14\left[(\tfrac14)^2 + (\tfrac24)^2 + (\tfrac34)^2 + 1^2\right] = \tfrac{30}{64} \approx 0.469.

Left ends and midpoints

Left: 14[0+116+416+916]=1464≈0.219\tfrac14\left[0 + \tfrac1{16} + \tfrac4{16} + \tfrac9{16}\right] = \tfrac{14}{64} \approx 0.219. Midpoints (18,38,58,78\tfrac18, \tfrac38, \tfrac58, \tfrac78): ≈0.328\approx 0.328.

Compare

The true value is 13≈0.333\tfrac13 \approx 0.333. The right sum overshoots and the left one falls short, because x2x^2 is increasing; the midpoint sum is much closer. All three tend to 13\tfrac13 as nn grows.

Integrals as cumulative sums#

The other interpretation: an integral adds up something that accumulates at a varying rate (transcript, pp. 9–10; notes, pp. 4–5). Suppose you borrow money at a rate f(t)f(t) in dollars per year, varying through the year, with tt in years. Over a short time Δt\Delta t (a day, 1/3651/365 of a year) you borrow f(t) Δtf(t)\,\Delta t dollars: the units work out. The total for the year is a Riemann sum, very close to an integral:

Total borrowed
∑i=1365f ⁣(i365)Δt  ≈  ∫01f(t) dt\sum_{i=1}^{365} f\!\left(\tfrac{i}{365}\right)\Delta t \;\approx\; \int_0^1 f(t)\,dt
In words

the sum from i equals 1 to 365 of f ( i over 365 ) capital delta t is approximately the integral from 0 to 1 of f(t) d t

The dtdt is not decoration: it keeps the units consistent (p. 9). What you owe at the end of the year also depends on how long each amount was borrowed. With interest compounded continuously at rate rr, an amount borrowed at time tt grows by a factor of er(1−t)e^{r(1 - t)} by the end of the year, so the total owed is ∫01f(t) er(1−t) dt\int_0^1 f(t)\,e^{r(1-t)}\,dt (p. 10). The notes take monthly steps (Δt=1/12\Delta t = 1/12) and simple interest instead, ∫01f(t) (1+r(1−t)) dt\int_0^1 f(t)\,\big(1 + r(1 - t)\big)\,dt (notes, p. 5, which call the total borrowed "dollars per year"; it is in dollars).

Worked example

Filling a tank and paying back a loan

(a) Water flows into a tank at f(t)=2+tf(t) = 2 + t litres per minute. How much flows in during the first 4 minutes? (b) You borrow steadily at $9000 per year. How much do you owe at the year's end, at 4% simple interest, and at 4% compounded continuously?

(a) The tank

Left and right sums with 1-minute steps give 2+3+4+5=142 + 3 + 4 + 5 = 14 and 3+4+5+6=183 + 4 + 5 + 6 = 18 litres. The exact area under the straight line is a trapezoid: 12(2+6)×4=16\tfrac12(2 + 6) \times 4 = 16 litres.

(b) Simple interest

∫019000 (1+0.04(1−t)) dt=9000×(1+0.02)=9180\int_0^1 9000\,\big(1 + 0.04(1 - t)\big)\,dt = 9000 \times (1 + 0.02) = 9180 dollars: on average each dollar is borrowed for half a year.

(b) Continuous compounding

∫019000 e0.04(1−t) dt=9000×e0.04−10.04≈9182\int_0^1 9000\,e^{0.04(1 - t)}\,dt = 9000 \times \dfrac{e^{0.04} - 1}{0.04} \approx 9182 dollars, a little more.

Summary#

  • The definite integral ∫abf(x) dx\int_a^b f(x)\,dx is the area under y=f(x)y = f(x) above [a,b][a, b]: a number.
  • Compute it by rectangles: divide, add, take the limit. For x2x^2, a staircase pyramid traps 12+⋯+n21^2 + \cdots + n^2 between 13n3\tfrac13 n^3 and 13(n+1)3\tfrac13(n+1)^3, giving ∫0bx2 dx=b3/3\int_0^b x^2\,dx = b^3/3.
  • Riemann sum: ∑f(ci) Δx\sum f(c_i)\,\Delta x with Δx=(b−a)/n\Delta x = (b - a)/n and any cic_i in each piece; its limit is the integral.
  • The pattern bb, b2/2b^2/2, b3/3b^3/3 (each area's derivative in bb is the function) leads to the fundamental theorem.
  • Integrals are cumulative sums: a rate in units per time, times dtdt, added up, gives a total.

Symbols on this page

Show the 30 symbols used here
Δ\Delta capital delta.
A change or difference in a quantity, e.g. Δx = x₂ − x₁. Say it: “capital delta”.
ℓ\ell script l.
A length or distance; ℓ_p is a physical distance and ℓ_c a comoving one. Unit: m (a comoving ℓ_c is in notches, Guth's units). Say it: “ell”.
∞\infty infinity.
Infinity: larger than any number. Say it: “infinity”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
∝\propto proportional to.
Is proportional to: doubling one doubles the other. Say it: “is proportional to”.
≥\ge greater than or equal.
Is greater than or equal to. Say it: “is greater than or equal to”.
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
×\times times.
Times (multiplication). Between two vectors: the cross product. Say it: “times”.
∫\int integral.
Integral: the sum of infinitely many small pieces, such as the area under a curve. Say it: “the integral of”.
∑\sum sum.
Sum: add up the terms over the range written below and above. Say it: “the sum of”.
lim⁡\lim limit.
Limit: the value approached as the variable written below approaches its target. Say it: “the limit”.
aa a.
The left end of the interval [a, b]: where the integral starts. In the cosmology note, a(t) is the scale factor of the universe. Say it: “a”.
cc c.
In the cosmology note, the speed of light (c_i, with a subscript, is a chosen point in a strip). Say it: “c”.
kk k.
The number of a rectangle strip: the k-th strip has height (k/4)². Say it: “k”.
t0t_{0} today.
Today: the present time, about 13.8 billion years after the Big Bang in the real universe (simple models on some pages give other ages). Unit: s (usually billions of years). Say it: “t nought”.
xx x.
The variable along the horizontal axis. Say it: “x”.
yy y.
The height of the graph, y = f(x). Say it: “y”.
tt t.
Time: in years in the borrowing example, minutes in the tank example; in the cosmology note, cosmic time. Say it: “t”.
dd d.
As in dx and dt: the infinitesimal width that Δx becomes in the limit; d/db is the derivative with respect to b. Say it: “d”.
ii i.
The label of a strip or term in a sum, running from 1 to n. Say it: “i”.
nn n.
The number of strips (rectangles) the interval is cut into. Say it: “n”.
ee e.
Euler's number, e ≈ 2.718, the base of the exponential. Say it: “e”.
ff f.
The function whose graph bounds the area (in the borrowing example, the borrowing rate in dollars per year; in the tank example, the inflow in litres per minute). Say it: “f”.
rr r.
The interest rate, per year (0.04 for 4%). Say it: “r”.
bb b.
The right end of the interval [a, b]: where the integral stops. Say it: “b”.
a1a_{1} a one.
The first term of a sum. Say it: “a one”.
a2a_{2} a two.
The second term of a sum. Say it: “a two”.
aia_{i} initial scale factor.
The i-th term of a sum. Say it: “a sub i”.
ana_{n} a n.
The last (n-th) term of a sum. Say it: “a sub n”.
cic_{i} c i.
The point chosen in the i-th strip; f(c_i) is that rectangle's height. Say it: “c sub i”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 26 words used here

New here

definite integral.
The integral of a function between two limits, a single number: the area under the graph between them, with parts below the axis counted negative.
fundamental theorem of calculus.
The theorem that integrating and differentiating undo each other, so a definite integral can be found from any antiderivative.
Riemann sum.
An estimate of an integral: cut the interval into strips, multiply each strip's width by a value of the function in it, and add.

Also used

integration.
Finding an integral: adding up very many small pieces, or finding an antiderivative. Explained in Differentials and antiderivatives.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
indefinite integral.
The family of all antiderivatives of a function, written ∫ f(x) dx = F(x) + c with an arbitrary constant c. Explained in Differentials and antiderivatives.
limit.
The value a quantity gets closer and closer to, as near as we like, as its input approaches some value, without having to reach it. Explained in Rates of change and area under a graph.
distributive.
Of a product: spreading over a sum, so that a times (b + c) equals a times b plus a times c. Explained in Vector analysis: why the dot product has a cosine.
derivative.
The rate at which a function changes as its input changes: the slope of its graph at a point. Explained in Position and velocity in one dimension.
with respect to.
Taking that variable as the one that changes: a derivative with respect to t measures change as t changes, others held fixed. Explained in Average value, weighted averages and probability.
integral.
A sum of very many very small pieces, such as the area under a graph; it undoes taking a derivative. Explained in Rates of change and area under a graph.
parabola.
The U-shaped curve of y = ax² + bx + c, also the path of a thrown ball when air resistance is ignored. Explained in Quadratics and power laws.
continuous.
Without breaks, gaps or jumps: a continuous graph can be drawn without lifting the pen; a continuous quantity can take every value in a range. Explained in The rocket equation.
Big Bang.
The hot, dense early state from which the whole observable universe has been expanding for about 13.8 billion years. Explained in The Big Bang.
interval.
A stretch between two values or two moments; in maths, all the numbers between two end points. Explained in Time dilation, length contraction and the interval.
horizon distance.
The present distance of the farthest objects whose light has had time to reach us since the Big Bang. Explained in Inflation.
flat universe.
A universe with exactly the critical density, whose space has no curvature and which expands forever, ever more slowly. Explained in Open, closed and flat universes.
theorem.
A statement that has been proved true, step by step, from definitions and earlier results. Explained in Limits and continuity.

Academic

transcript.
A written record of exactly what was said in a recorded lecture, word for word.
notation.
A system of symbols used to write ideas down briefly, such as dy/dx for a derivative.
on the nose.
Exactly; precisely right, with no error at all.
arbitrary.
Free to be chosen as one likes; any choice gives a correct result.
abbreviation.
A shortened form of a word or phrase, such as "eq." for equation.
consistent.
Agreeing with, and not contradicting, something else, such as the data, another result, or itself.
by a factor of.
Multiplied or divided by the stated number.
naive.
Simple and first-guess, without the corrections or care a fuller treatment adds.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

33 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. Which of these is the definite integral ∫abf(x) dx\int_a^b f(x)\,dx, for f≥0f \ge 0?
  2. Using right endpoints with n=4n = 4, the Riemann sum for ∫01x2 dx\int_0^1 x^2\,dx is…
  3. Following the pattern ∫0b1 dx=b\int_0^b 1\,dx = b, ∫0bx dx=b2/2\int_0^b x\,dx = b^2/2, ∫0bx2 dx=b3/3\int_0^b x^2\,dx = b^3/3, what is ∫02x3 dx\int_0^2 x^3\,dx?
  4. Water flows into a tank at f(t)=2+tf(t) = 2 + t litres per minute. How much flows in during the first 4 minutes?
0 of 4 answered

Flashcards

1 / 3