Build integrals from first principles using partitions and Riemann sums
An integral is an area built from rectangles. Make the rectangles thinner below and watch the estimates close in on one answer, or fail to.
Choose left, right, midpoint, or random sample points, then add rectangles. Every choice closes in on the same area.
Riemann Sum
1.920000
Exact Integral
2.666667
Error
0.746667
The Riemann sum approximates the integral by summing rectangle areas:
Sn = Σ f(xi*) · Δxi
As n → ∞, the sum converges to the definite integral (for integrable functions).
The Riemann integral is built from approximating areas with rectangles. We partition an interval, form upper and lower sums, and take limits as the partition becomes finer. A function is Riemann integrable when the upper and lower integrals agree.
Approximate the integral by summing rectangle areas. Choose left, right, midpoint, or random sample points. Watch convergence as you increase the number of rectangles.
Key insight: Regardless of how sample points are chosen within each subinterval, the Riemann sum converges to the same value for integrable functions.
Add subintervals and watch the upper and lower sums squeeze together.
Upper Sum U
3.5200
Lower Sum L
1.9200
Gap (U - L)
1.6000
Exact ∫
2.6667
Upper sum U(f, P): Use supremum of f on each subinterval
Lower sum L(f, P): Use infimum of f on each subinterval
A function is Riemann integrable iff sup L(f, P) = inf U(f, P) (the upper and lower integrals agree). As the partition gets finer, U and L squeeze together toward the integral value.
The upper sum uses supremums, the lower sum uses infimums. For integrable functions, they squeeze together as the partition refines.
Key insight: A bounded function f is integrable on [a, b] if and only if for every ε > 0, there exists a partition P with U(f, P) - L(f, P) < ε.
Compare Thomae's function T(x) with the Dirichlet function D(x) as you add subintervals. One gap shrinks toward zero; the other never does.
Continuous functions are always integrable
U - L = 0.100000
Gap shrinks as n increases → function is integrable
A bounded function f on [a, b] is Riemann integrable iff:
For every ε > 0, ∃ partition P such that U(f, P) - L(f, P) < ε
• Continuous functions: Always integrable
• Finitely many discontinuities: Still integrable
• Monotone functions: Always integrable
• Dirichlet function: NOT integrable (discontinuous everywhere)
• Thomae function: Integrable! (continuous on irrationals)
Continuous functions are always integrable. But what about discontinuous functions? Explore the surprising integrability of Thomae's function and the failure of the Dirichlet function.
Key insight: By Lebesgue's criterion, a bounded function is Riemann integrable if and only if its set of discontinuities has measure zero.
Move x and watch the accumulated area F(x) grow. The slope of F always matches the height of f at x.
f(1.50) = 2.2500
F'(1.50) = 2.2500
They match! (FTC Part 1)
Part 1 (Differentiation): If F(x) = ∫[a,x] f(t) dt, then F'(x) = f(x)
d/dx [∫[a,x] f(t) dt] = f(x)
Part 2 (Evaluation): If F is an antiderivative of f, then
∫[a,b] f(x) dx = F(b) - F(a)
The FTC connects the two fundamental operations: differentiation and integration are inverses!
The FTC connects differentiation and integration: the derivative of the accumulation function F(x) = ∫[a,x] f(t) dt equals f(x). See this relationship in action.
Key insight: If f is continuous and F(x) = ∫[a,x] f(t) dt, then F'(x) = f(x). Integration and differentiation are inverse operations.
FTC Part 2 — if F is an antiderivative of f on [a, b], then ∫[a,b] f(x) dx = F(b) - F(a)
Pick a function and push the upper bound toward infinity. The partial integrals either level off or keep growing.
Partial Integrals:
Integral Converges
∫[1,∞) 1/x² dx = 1 (converges)
An improper integral has either an infinite limit or an unbounded integrand:
∫[a,∞) f(x) dx = limN→∞ ∫[a,N] f(x) dx
• ∫[1,∞) 1/x² dx = 1 (converges - area is finite)
• ∫[1,∞) 1/x dx = ∞ (diverges - area is infinite)
• p-test: ∫[1,∞) 1/xp dx converges iff p > 1
What happens when integration limits extend to infinity or the integrand is unbounded? Some improper integrals converge to finite values, others diverge. The convergence behavior often mirrors that of infinite series.
Key insight: Improper integrals are defined as limits of proper integrals. The comparison test for integrals parallels the comparison test for series, linking the two convergence theories.
Spot a mistake or have an idea?