The Fundamental Theorem of Calculus
Differentiation measures rates; integration accumulates. The Fundamental Theorem of Calculus (FTC) says these are inverse processes, and it turns the limit of Riemann sums into a subtraction . This lesson states both parts precisely, proves them (Part 1 from the Extreme Value Theorem, Part 2 from Part 1 and the Mean Value Theorem), and shows functions that are defined by integrals, like the error function used throughout statistics.
The accumulation function
Let be continuous on . Define
is the net area under from up to the moving right edge . Note the dummy variable : is now a limit of integration.
Part 1: the derivative of an accumulation
FTC, Part 1. If is continuous on , then is continuous on , differentiable on , and .
Proof sketch. For (the case is similar), additivity gives
is continuous on , so by the Extreme Value Theorem it has a minimum and a maximum there, with in . The bounds property of the definite integral gives
As , both and are squeezed to , and by continuity and . The Squeeze Theorem gives . ∎
In words: the rate at which area accumulates equals the height of the curve at the edge. Every continuous function therefore has an antiderivative, even one with no formula, like .
import math
from scipy.integrate import quad
f = lambda t: math.exp(-t * t)
g = lambda x: quad(f, 0, x)[0] # accumulation function, computed numerically
for x in (0.0, 0.5, 1.0, 2.0):
h = 1e-5
slope = (g(x + h) - g(x - h)) / (2 * h)
print(f"x = {x}: g(x) = {g(x):.6f} g'(x) ≈ {slope:.6f} f(x) = {f(x):.6f}")
print("erf check: (2/√π)·g(1) =", round(2 / math.sqrt(math.pi) * g(1.0), 6), " math.erf(1) =", round(math.erf(1.0), 6))x = 0.0: g(x) = 0.000000 g'(x) ≈ 1.000000 f(x) = 1.000000
x = 0.5: g(x) = 0.461281 g'(x) ≈ 0.778801 f(x) = 0.778801
x = 1.0: g(x) = 0.746824 g'(x) ≈ 0.367879 f(x) = 0.367879
x = 2.0: g(x) = 0.882081 g'(x) ≈ 0.018316 f(x) = 0.018316
erf check: (2/√π)·g(1) = 0.842701 math.erf(1) = 0.842701
The last line shows the error function, , which is exactly this accumulation function rescaled. It has no elementary formula, yet math.erf evaluates it in nanoseconds, and normal-distribution probabilities are computed from it.
With the chain rule
If the upper limit is a function , then . And a variable lower limit flips the sign:
import sympy as sp
x, t = sp.symbols('x t', real=True)
G = sp.Integral(sp.cos(t**2), (t, 0, x**3))
print("d/dx ∫_0^{x^3} cos(t^2) dt =", sp.diff(G, x))
H = sp.Integral(sp.sqrt(1 + t**4), (t, sp.sin(x), 2))
print("d/dx ∫_{sin x}^2 √(1+t^4) dt =", sp.diff(H, x))d/dx ∫_0^{x^3} cos(t^2) dt = 3*x**2*cos(x**6)
d/dx ∫_{sin x}^2 √(1+t^4) dt = -sqrt(sin(x)**4 + 1)*cos(x)
Part 2: evaluating integrals
FTC, Part 2. If is continuous on and is any antiderivative of (), then
, written .
Proof. By Part 1, is an antiderivative of . Two antiderivatives on an interval differ by a constant (Mean Value Theorem), so . Then
The constant cancels, which is why any antiderivative will do. Revisiting the previous lesson:
Two limits of Riemann sums, each a page of algebra, now take one line.
Note: The hypotheses matter. "equals" by a careless use of Part 2, a negative answer for a positive integrand. The integrand is not continuous (not even defined) at 0, so the theorem does not apply; this is an improper integral, and it diverges.
Differentiation and integration undo each other
In software
- Prefix sums are the discrete FTC. With
S[k] = a[0] + … + a[k−1], the range suma[i] + … + a[j−1] = S[j] − S[i], and the differenceS[k+1] − S[k] = a[k]recovers the data. Summed-area tables (integral images) use the 2-D version for O(1) box filters in image processing and the Viola–Jones face detector. - Special functions. , the normal CDF, the Fresnel integrals (used for clothoid road and railway curves) and the logarithmic integral are defined as accumulation functions. Libraries compute them with series and rational approximations, but their derivatives come straight from Part 1.
- Neural ODEs and physics. Integrating a learned or physical rate over time is accumulation; adjoint methods for training neural ODEs differentiate through it with Part 1.
Exercises
Exercise 1: Part 2
Evaluate .
Answer
.
Solution
Exercise 2: Part 1 with the chain rule
Find .
Answer
.
Solution
Split at 0: . Differentiate each with Part 1 and the chain rule: .
import sympy as sp
x, t = sp.symbols('x t', real=True)
print(sp.diff(sp.Integral(sp.log(1 + t**2), (t, x, x**2)), x))2*x*log(x**4 + 1) - log(x**2 + 1)
Exercise 3: Where is the accumulation largest?
For on , where does have its maximum?
Answer
At , with .
Solution
(Part 1) is positive for and negative after, so peaks at 2: . (.)
Exercise 4: Spot the error
Explain why is wrong.
Answer
is not continuous on (it blows up at ); the integral diverges.
Solution
Part 2 needs continuous on the whole interval. Near , , and , so the improper integral diverges. A positive integrand can never have integral 0.
Test yourself
If , what is ?
- 0
- 3
- Undefined
Why can any antiderivative be used in ?
- All antiderivatives are equal
- The constant cancels in
- is always 0
- Only the one with works
Which tool does the proof of FTC Part 1 use to bound ?
- l'Hospital's Rule
- Integration by parts
- Taylor series
- The Extreme Value Theorem (min and max of on the small interval)