TExcelTAD
Home › Calculus in Depth › The Fundamental Theorem of Calculus

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 F(b)−F(a)F(b) - F(a). 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 ff be continuous on [a,b][a, b]. Define

g(x)=∫axf(t) dt,a≤x≤bg(x) = \int_a^x f(t)\,dt, \qquad a \le x \le b

g(x)g(x) is the net area under ff from aa up to the moving right edge xx. Note the dummy variable tt: xx is now a limit of integration.

Part 1: the derivative of an accumulation

FTC, Part 1. If ff is continuous on [a,b][a, b], then g(x)=∫axf(t) dtg(x) = \int_a^x f(t)\,dt is continuous on [a,b][a, b], differentiable on (a,b)(a, b), and g′(x)=f(x)g'(x) = f(x).

Proof sketch. For h>0h > 0 (the case h<0h < 0 is similar), additivity gives

g(x+h)−g(x)=∫xx+hf(t) dtg(x + h) - g(x) = \int_x^{x+h} f(t)\,dt

ff is continuous on [x,x+h][x, x + h], so by the Extreme Value Theorem it has a minimum f(u)f(u) and a maximum f(v)f(v) there, with u,vu, v in [x,x+h][x, x + h]. The bounds property of the definite integral gives

f(u)⋅h≤∫xx+hf(t) dt≤f(v)⋅hf(u)≤g(x+h)−g(x)h≤f(v)\begin{aligned} f(u) \cdot h &\le \int_x^{x+h} f(t)\,dt \le f(v) \cdot h \\ f(u) &\le \frac{g(x + h) - g(x)}{h} \le f(v) \end{aligned}

As h→0h \to 0, both uu and vv are squeezed to xx, and by continuity f(u)→f(x)f(u) \to f(x) and f(v)→f(x)f(v) \to f(x). The Squeeze Theorem gives g′(x)=f(x)g'(x) = f(x). ∎

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 ∫0xe−t2 dt\int_0^x e^{-t^2}\,dt.

python · try it yourself
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, erf⁡(x)=2π∫0xe−t2 dt\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}\,dt, 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 u(x)u(x), then ddx∫au(x)f(t) dt=f(u(x))⋅u′(x)\frac{d}{dx}\int_a^{u(x)} f(t)\,dt = f(u(x)) \cdot u'(x). And a variable lower limit flips the sign:

python · try it yourself
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 ff is continuous on [a,b][a, b] and FF is any antiderivative of ff (F′=fF' = f), then

∫abf(x) dx=F(b)−F(a)\int_a^b f(x)\,dx = F(b) - F(a), written [F(x)]ab\big[F(x)\big]_a^b.

Proof. By Part 1, g(x)=∫axf(t) dtg(x) = \int_a^x f(t)\,dt is an antiderivative of ff. Two antiderivatives on an interval differ by a constant (Mean Value Theorem), so F=g+CF = g + C. Then

F(b)−F(a)=(g(b)+C)−(g(a)+C)=g(b)−g(a)=∫abf−0■F(b) - F(a) = (g(b) + C) - (g(a) + C) = g(b) - g(a) = \int_a^b f - 0 \qquad \blacksquare

The constant cancels, which is why any antiderivative will do. Revisiting the previous lesson:

∫03(2x−x2) dx=[x2−x33]03=(9−9)−0=0∫02(x2+1) dx=[x33+x]02=83+2=143\begin{aligned} \int_0^3 (2x - x^2)\,dx &= \left[x^2 - \frac{x^3}{3}\right]_0^3 = (9 - 9) - 0 = 0 \\ \int_0^2 (x^2 + 1)\,dx &= \left[\frac{x^3}{3} + x\right]_0^2 = \frac{8}{3} + 2 = \frac{14}{3} \end{aligned}

Two limits of Riemann sums, each a page of algebra, now take one line.

Note: The hypotheses matter. ∫−11dxx2\int_{-1}^{1} \frac{dx}{x^2} "equals" [−1x]−11=−2\left[-\frac{1}{x}\right]_{-1}^{1} = -2 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

ddx∫axf(t) dt=f(x)(integrate, then differentiate: back to f)∫abF′(x) dx=F(b)−F(a)(differentiate, then integrate: back to F, up to a constant)\begin{aligned} \frac{d}{dx}\int_a^x f(t)\,dt &= f(x) && \text{(integrate, then differentiate: back to } f\text{)} \\ \int_a^b F'(x)\,dx &= F(b) - F(a) && \text{(differentiate, then integrate: back to } F\text{, up to a constant)} \end{aligned}

In software

  • Prefix sums are the discrete FTC. With S[k] = a[0] + … + a[k−1], the range sum a[i] + … + a[j−1] = S[j] − S[i], and the difference S[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. erf⁡\operatorname{erf}, 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 dydt=f(y,t)\frac{dy}{dt} = f(y, t) over time is accumulation; adjoint methods for training neural ODEs differentiate through it with Part 1.

Exercises

Exercise 1: Part 2

Evaluate ∫14(3x−2x2)dx\int_1^4 \left(3\sqrt{x} - \frac{2}{x^2}\right) dx.

Answer

25/2=12.525/2 = 12.5.

Solution
F(x)=2x3/2+2xF(4)−F(1)=(16+12)−(2+2)=12.5\begin{aligned} F(x) &= 2x^{3/2} + \frac{2}{x} \\ F(4) - F(1) &= \left(16 + \tfrac{1}{2}\right) - (2 + 2) = 12.5 \end{aligned}

Exercise 2: Part 1 with the chain rule

Find ddx∫xx2ln⁡(1+t2) dt\frac{d}{dx}\int_x^{x^2} \ln(1 + t^2)\,dt.

Answer

2xln⁡(1+x4)−ln⁡(1+x2)2x \ln(1 + x^4) - \ln(1 + x^2).

Solution

Split at 0: ∫0x2−∫0x\int_0^{x^2} - \int_0^x. Differentiate each with Part 1 and the chain rule: ln⁡(1+x4)⋅2x−ln⁡(1+x2)\ln(1 + x^4) \cdot 2x - \ln(1 + x^2).

python · try it yourself
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 g(x)=∫0x(4−t2) dtg(x) = \int_0^x (4 - t^2)\,dt on [0,4][0, 4], where does gg have its maximum?

Answer

At x=2x = 2, with g(2)=16/3g(2) = 16/3.

Solution

g′(x)=4−x2g'(x) = 4 - x^2 (Part 1) is positive for x<2x < 2 and negative after, so gg peaks at 2: g(2)=[4t−t33]02=8−83=163g(2) = \left[4t - \frac{t^3}{3}\right]_0^2 = 8 - \frac{8}{3} = \frac{16}{3}. (g(4)=16−643<0g(4) = 16 - \frac{64}{3} < 0.)

Exercise 4: Spot the error

Explain why ∫0πsec⁡2x dx=[tan⁡x]0π=0\int_0^{\pi} \sec^2 x\,dx = \big[\tan x\big]_0^{\pi} = 0 is wrong.

Answer

sec⁡2x\sec^2 x is not continuous on [0,π][0, \pi] (it blows up at π/2\pi/2); the integral diverges.

Solution

Part 2 needs ff continuous on the whole interval. Near π/2\pi/2, sec⁡2x→∞\sec^2 x \to \infty, and ∫0π/2sec⁡2x dx=lim⁡tan⁡x=∞\int_0^{\pi/2} \sec^2 x\,dx = \lim \tan x = \infty, so the improper integral diverges. A positive integrand can never have integral 0.

Test yourself

If g(x)=∫2x1+t3 dtg(x) = \int_2^x \sqrt{1 + t^3}\,dt, what is g′(2)g'(2)?

  1. 0
  2. 9−1\sqrt{9} - \sqrt{1}
  3. 3
  4. Undefined

Why can any antiderivative FF be used in ∫abf=F(b)−F(a)\int_a^b f = F(b) - F(a)?

  1. All antiderivatives are equal
  2. The constant CC cancels in F(b)−F(a)F(b) - F(a)
  3. F(a)F(a) is always 0
  4. Only the one with C=0C = 0 works

Which tool does the proof of FTC Part 1 use to bound ∫xx+hf\int_x^{x+h} f?

  1. l'Hospital's Rule
  2. Integration by parts
  3. Taylor series
  4. The Extreme Value Theorem (min and max of ff on the small interval)