Cheatsheet: Integration and the fundamental theorem
The definite integral
Section titled “The definite integral”∫_a^b f(x) dx = lim (n->infinity) sum of f(x_i)·Δx Δx = (b-a)/nThe 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.
The fundamental theorem of calculus
Section titled “The fundamental theorem of calculus”∫_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”| Integrand | Antiderivative |
|---|---|
x^n (n != -1) | x^(n+1)/(n+1) + C |
1/x (the n=-1 case) | `ln |
e^x | e^x + C |
sin x | -cos x + C |
cos x | sin x + C |
Check any of them by differentiating back.
Worked examples
Section titled “Worked examples”| Integral | Antiderivative | Result |
|---|---|---|
∫_0^1 x^2 dx | [x^3/3]_0^1 | 1/3 |
∫_0^1 e^x dx | [e^x]_0^1 | e - 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) |
Indefinite vs definite
Section titled “Indefinite vs definite”- Definite
∫_a^b f dx: has limits, gives a number (the accumulated total). - Indefinite
∫ f dx: no limits, gives a functionF(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.
Why it matters for AI
Section titled “Why it matters for AI”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.
Pitfalls to dodge
Section titled “Pitfalls to dodge”- Summing rectangles by hand. Use the FTC:
F(b) - F(a). The Riemann sum is the definition, not the method. - Dropping
+ Con an indefinite integral. - Mishandling
n = -1.∫ 1/x dx = ln|x| + C, not a power. - Confusing definite (number) with indefinite (function).
The one-line version
Section titled “The one-line version”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.