Fundamental Theorem of Calculus

lean4-proofcalculusvisualization
abf(x)dx=f(b)f(a)\int_a^b f'(x)\,dx = f(b) - f(a)

Statement

Part I (Antiderivative): If ff is continuous on [a,b][a, b] and F(x)=axf(t)dtF(x) = \int_a^x f(t)\,dt, then FF is differentiable on (a,b)(a, b) with F(x)=f(x)F'(x) = f(x).

Part II (Evaluation): If ff' is integrable on [a,b][a, b] and ff has derivative ff' at every point in (a,b)(a, b), then:

abf(x)dx=f(b)f(a)\int_a^b f'(x)\,dx = f(b) - f(a)

This is the central theorem connecting the two branches of calculus.

Visualization

Approximate 132xdx\int_1^3 2x\,dx (exact answer: f(3)f(1)=91=8f(3)-f(1) = 9-1 = 8) using the trapezoid rule with n=4n = 4 strips of width Δx=0.5\Delta x = 0.5:

Strip [xi,xi+1][x_i, x_{i+1}]f(xi)f'(x_i)f(xi+1)f'(x_{i+1})Trapezoid area
[1.0,  1.5][1.0,\; 1.5]2.03.01.25
[1.5,  2.0][1.5,\; 2.0]3.04.01.75
[2.0,  2.5][2.0,\; 2.5]4.05.02.25
[2.5,  3.0][2.5,\; 3.0]5.06.02.75
Total8.00

The trapezoid sum converges to f(3)f(1)=8f(3)-f(1) = 8 as Δx0\Delta x \to 0, illustrating Part II.

f'(x) = 2x
  6 |              *
    |           /
  4 |        *
    |  area=8  (exact)
  2 |  *
    +--+---+---+--
       1   2   3

Proof Sketch

Part II:

  1. Partition: Subdivide [a,b][a, b] into subintervals [xi1,xi][x_{i-1}, x_i].
  2. Apply MVT on each strip: By the Mean Value TheoremMean Value Theoremc(a,b)  :  f(c)=f(b)f(a)ba\exists\, c \in (a,b)\;:\; f'(c) = \frac{f(b)-f(a)}{b-a}There exists a point where the instantaneous rate of change equals the average rate of changeRead more →, for each ii there exists ci(xi1,xi)c_i \in (x_{i-1}, x_i) with f(xi)f(xi1)=f(ci)Δxif(x_i) - f(x_{i-1}) = f'(c_i) \Delta x_i.
  3. Telescope: Sum over all strips — the left side telescopes to f(b)f(a)f(b) - f(a).
  4. Take limit: As the mesh Δ0\|\Delta\| \to 0, the right side converges to abf(x)dx\int_a^b f'(x)\,dx by definition of the Riemann integral.

Connections

  • Mean Value TheoremMean Value Theoremc(a,b)  :  f(c)=f(b)f(a)ba\exists\, c \in (a,b)\;:\; f'(c) = \frac{f(b)-f(a)}{b-a}There exists a point where the instantaneous rate of change equals the average rate of changeRead more → — the key lemma applied subinterval-by-subinterval in the proof
  • Chain RuleChain Ruleddx[f(g(x))]=f(g(x))g(x)\frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x)Differentiate composite functions by peeling layersRead more → — generalises FTC to compositions: ddxag(x)f(t)dt=f(g(x))g(x)\frac{d}{dx}\int_a^{g(x)} f(t)\,dt = f(g(x)) \cdot g'(x)
  • Taylor's TheoremTaylor's Theoremf(x)=k=0nf(k)(x0)k!(xx0)k+Rn(x)f(x) = \sum_{k=0}^{n} \frac{f^{(k)}(x_0)}{k!}(x-x_0)^k + R_n(x)Approximate smooth functions by polynomials with explicit error boundsRead more → — Taylor's theorem can be derived by applying FTC repeatedly (n+1n+1 times)
  • L’Hôpital's Rule — evaluation of many limits uses FTC to identify derivative values
  • Intermediate Value TheoremIntermediate Value Theoremf(a)yf(b)c[a,b]:  f(c)=yf(a) \le y \le f(b) \Rightarrow \exists\, c \in [a,b]:\; f(c) = yA continuous function on a closed interval hits every value between its endpointsRead more → — continuity of ff (required by Part I) is also the hypothesis of IVT

Lean4 Proof

import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus

open MeasureTheory intervalIntegral

/-- Fundamental Theorem of Calculus Part II: the integral of `f'` over `[a, b]`
    equals `f b - f a`. Wraps Mathlib's `integral_eq_sub_of_hasDerivAt`. -/
theorem ftc {f f' :   } {a b : }
    (hderiv :  x  Set.uIcc a b, HasDerivAt f (f' x) x)
    (hint : IntervalIntegrable f' MeasureTheory.volume a b) :
    ∫ x in a..b, f' x = f b - f a :=
  integral_eq_sub_of_hasDerivAt hderiv hint