Skip to content

Cheatsheet: Integration and the fundamental theorem

∫_a^b f(x) dx = lim (n->infinity) sum of f(x_i)·Δx Δx = (b-a)/n

The area under f from a to b, as a limit of thin rectangles (a Riemann sum). is an elongated S for “sum”; dx is the strip width shrinking to zero.

∫_a^b f(x) dx = F(b) - F(a) where F'(x) = f(x)

To accumulate f, find an antiderivative F (a function whose rate of change is f), evaluate at the endpoints, subtract. Differentiation and integration are inverse operations.

Antiderivatives = derivative rules reversed

Section titled “Antiderivatives = derivative rules reversed”
IntegrandAntiderivative
x^n (n != -1)x^(n+1)/(n+1) + C
1/x (the n=-1 case)`ln
e^xe^x + C
sin x-cos x + C
cos xsin x + C

Check any of them by differentiating back.

IntegralAntiderivativeResult
∫_0^1 x^2 dx[x^3/3]_0^11/3
∫_0^1 e^x dx[e^x]_0^1e - 1 ≈ 1.718
∫_0^π sin x dx[-cos x]_0^π1 + 1 = 2
∫_0^R 2πr dr[πr^2]_0^RπR^2 (closes Lesson 1)
  • Definite ∫_a^b f dx: has limits, gives a number (the accumulated total).
  • Indefinite ∫ f dx: no limits, gives a function F(x) + C (the family of antiderivatives).

The + C exists because a constant’s derivative is 0, so f has infinitely many antiderivatives differing by a constant. In a definite integral the C cancels.

Integration is the math of continuous probability:

  • density integrates to 1: ∫ f dx = 1; P(a <= X <= b) = ∫_a^b f dx
  • expected value E[X] = ∫ x·f(x) dx
  • entropy / KL divergence are integrals over distributions (loss functions of generative models)
  • continuous-time models (neural ODEs, diffusion) solve integrals in the forward pass

Usually computed numerically (Monte Carlo, quadrature), but the FTC underwrites the theory.

  • Summing rectangles by hand. Use the FTC: F(b) - F(a). The Riemann sum is the definition, not the method.
  • Dropping + C on an indefinite integral.
  • Mishandling n = -1. ∫ 1/x dx = ln|x| + C, not a power.
  • Confusing definite (number) with indefinite (function).

The integral is the area under a curve (a limit of thin rectangles), and the fundamental theorem computes it by reversing differentiation: find an antiderivative and subtract its endpoint values.