calculus30 min

The Fundamental Theorem of Calculus

The theorem that connects differentiation and integration, showing they are inverse operations

0/9Not Started

Why This Matters

The Fundamental Theorem of Calculus (FTC) is arguably the most important theorem in all of mathematics. It reveals that differentiation and integration -- two operations that seem completely different -- are actually inverse processes. This connection transformed calculus from a collection of clever tricks into a unified, powerful system.

Part 1 of the FTC says that if you integrate a continuous function from a to x, the resulting function has a derivative equal to the original function. In other words, integration followed by differentiation gives you back what you started with. The integral "accumulates" the function, and the derivative measures the rate of accumulation -- which is the function itself.

Part 2 of the FTC is the practical powerhouse. It says that the definite integral from a to b equals F(b) - F(a), where F is any antiderivative of the integrand. Instead of computing limits of Riemann sums (which could take thousands of rectangles), you just find an antiderivative and evaluate it at the endpoints. This single theorem turns a hard problem (area computation) into a much easier one (antidifferentiation).

Define Terms

Visual Model

f(x) continuousThe original function
Integrate from a to xAccumulate area
A(x) = integral a to xAccumulation function
Differentiate A(x)Rate of accumulation
A prime(x) = f(x)FTC Part 1
Find Antiderivative FF prime = f
F(b) - F(a)FTC Part 2

The full process at a glance. Click Start tour to walk through each step.

The Fundamental Theorem connects integration and differentiation: Part 1 says d/dx of the integral is f(x), Part 2 says the integral equals F(b) - F(a).

Code Example

Code
// FTC Verification: compare Riemann sum with antiderivative evaluation

function trapezoidalRule(f, a, b, n) {
  const dx = (b - a) / n;
  let sum = f(a) + f(b);
  for (let i = 1; i < n; i++) {
    sum += 2 * f(a + i * dx);
  }
  return (dx / 2) * sum;
}

// Example 1: integral of x^2 from 0 to 3
// Antiderivative: F(x) = x^3/3
// FTC: F(3) - F(0) = 27/3 - 0 = 9
const riemannResult = trapezoidalRule(x => x * x, 0, 3, 10000);
const ftcResult = Math.pow(3, 3) / 3 - Math.pow(0, 3) / 3;
console.log("Integral of x^2 from 0 to 3:");
console.log(`  Riemann (n=10000): ${riemannResult.toFixed(8)}`);
console.log(`  FTC (F(3)-F(0)):   ${ftcResult.toFixed(8)}`);
console.log(`  Match: ${Math.abs(riemannResult - ftcResult) < 0.001}\n`);

// Example 2: integral of cos(x) from 0 to pi/2
// Antiderivative: F(x) = sin(x)
// FTC: sin(pi/2) - sin(0) = 1 - 0 = 1
const riemannCos = trapezoidalRule(Math.cos, 0, Math.PI / 2, 10000);
const ftcCos = Math.sin(Math.PI / 2) - Math.sin(0);
console.log("Integral of cos(x) from 0 to pi/2:");
console.log(`  Riemann (n=10000): ${riemannCos.toFixed(8)}`);
console.log(`  FTC (sin(pi/2)-sin(0)): ${ftcCos.toFixed(8)}\n`);

// FTC Part 1: d/dx[integral from 0 to x of t^2 dt] = x^2
function accumFunction(f, a, x, n = 1000) {
  return trapezoidalRule(f, a, x, n);
}

function numericalDeriv(g, x, h = 0.0001) {
  return (g(x + h) - g(x - h)) / (2 * h);
}

console.log("FTC Part 1: d/dx[integral of t^2 from 0 to x] = x^2");
for (const x of [1, 2, 3, 4]) {
  const derivOfAccum = numericalDeriv(t => accumFunction(t2 => t2 * t2, 0, t), x);
  console.log(`  x=${x}: d/dx[A(x)] = ${derivOfAccum.toFixed(4)}, f(x) = x^2 = ${x * x}`);
}

Interactive Experiment

Try these exercises:

  • Verify the FTC for the integral of sin(x) from 0 to pi. The antiderivative is -cos(x), so the answer is -cos(pi) - (-cos(0)) = 1 + 1 = 2.
  • Try the integral of e^x from 0 to 1 using both methods. Compare the number of operations: FTC is just two evaluations.
  • For FTC Part 1: compute A(x) = integral from 0 to x of (t^3) dt for several x values. Verify that A prime(x) = x^3.
  • What happens when you use the FTC to evaluate the integral from a to a (same bounds)? Why is F(a) - F(a) = 0 meaningful?
  • Compute integral from 0 to 1 of e^(-x^2) dx using Riemann sums. Can you find an antiderivative? (You cannot -- this is the famous Gaussian integral.)

Quick Quiz

Coding Challenge

Verify FTC: Riemann Sum vs Antiderivative

Write a function called `verifyFTC` that takes a function f, its antiderivative F, and bounds a and b. Compute: (1) the Riemann sum approximation using the trapezoidal rule with n = 10000, and (2) F(b) - F(a). Return true if they agree within a tolerance of 0.01, false otherwise.

Loading editor...

Real-World Usage

The Fundamental Theorem of Calculus is used constantly, often without being named:

  • Physics: Every time you compute distance from velocity (or velocity from acceleration) by "taking the antiderivative," you are using the FTC.
  • Engineering: The FTC converts differential equations into integral equations and back, which is the core technique for solving many engineering problems.
  • Probability: The relationship between PDF and CDF is exactly the FTC: the CDF is the integral of the PDF, and the PDF is the derivative of the CDF.
  • Computer science: Amortized analysis uses the "potential method" which is essentially the FTC applied to costs over time.
  • Economics: The total surplus in a market is computed by integrating supply and demand functions -- a direct application of FTC Part 2.

Connections