Integrals

A tutorial-style introduction to (definite) integration: what problem integrals solve, how the Riemann sum builds the rigorous definition, how the Fundamental Theorem of Calculus connects integration to differentiation, and the standard techniques for actually evaluating integrals by hand.

The problem: accumulating a changing quantity

Derivatives answer the question “how fast is changing when changes?” Integrals answer the reverse question: given the rate of change, how much total accumulation happened?

The canonical example: suppose a car’s speed at time is (km/h). What is the total distance driven between and ?

  • If were constant, the answer would be trivial: distance speed time, i.e. — the area of a rectangle.
  • But varies. The trick of calculus is to split the interval into many tiny pieces, pretend the speed is constant on each piece, sum the little rectangles, and refine the partition forever.

That “sum of rectangles” process is the integral, before any notation.

Riemann sums

Partition into subintervals of width with points . Pick a sample point in the -th subinterval (left end, right end, or anywhere). The sum

is a Riemann sum: the total area of rectangles, where the -th rectangle has height and width .

Each term is “rate tiny time” — a tiny amount of accumulated quantity. For , the whole sum is literally a rectangle-approximation of the area under the curve.

The definite integral is defined as the limit of these sums:

provided the limit exists and does not depend on how the sample points are chosen. (It exists for all continuous functions, and for many more.)

A first sanity check you can do by hand: on , right endpoints, .

So , which matches the geometry: the region is a triangle with base and height , area .

Notation, decoded

  • — “integrate from to ”; and are the limits of integration.
  • — the integrand, the function being integrated (the “rate”).
  • — the infinitesimal width of each rectangle; it also tells you the variable of integration.

If somewhere, that region contributes negative area, so is the signed area between the curve and the -axis.

Antiderivatives and the Fundamental Theorem

Evaluating a limit of sums like the one above works, but is painful. The great shortcut is the Fundamental Theorem of Calculus (FTC), which links integration to differentiation.

Antiderivative. A function such that on . Antiderivatives are never unique: if works, so does for any constant , since constants differentiate to zero. The family of all antiderivatives of is the indefinite integral, written

FTC (Part 1). If is continuous, the function

is differentiable, and . In words: the accumulation function is an antiderivative of the rate. This is why integration is “the inverse of differentiation.”

FTC (Part 2), the workhorse. If , then

Reading an integral “backward” — evaluating an antiderivative at the endpoints and subtracting — is by far the most common way integrals get computed. The Riemann-sum limit is never actually taken.

Worked example with units, to fix the intuition: m/s, distance over s. An antiderivative is (check: ). Then

Note would give the same answer — the constant always cancels in a definite integral, which is why only appears in indefinite integrals.

A small toolbox of standard integrals

Since integration inverts differentiation, every differentiation rule produces an integration rule:

If the derivative is…Then the integral is…

Linearity carries over from the Riemann sum: for constants ,

plus two structural identities you’ll use constantly:

(You can even split at a point outside .)

The two workhorse techniques

Most integrals you meet are not in the table directly; they get transformed until they are.

1. -substitution (inverting the chain rule)

Since , we get

Recipe: (1) spot an inner function whose derivative also appears (up to a constant factor); (2) substitute ; (3) change the limits too for definite integrals: becomes the new lower limit, the new upper.

Example: . Let , ; limits: , .

The tell-tale sign of “use substitution”: the integrand contains a function and something proportional to its derivative.

2. Integration by parts (inverting the product rule)

Since , rearranging and integrating gives

Recipe: choose (to differentiate) and (to integrate) so that is simpler than the original. The classic heuristic is LIATE — prefer in the order Logarithms, Inverses, Algebraic, Trigonometric, Exponentials.

Example: . Take (algebraic), , so , :

Parts often has to be applied repeatedly (e.g. , where two applications close a loop you solve algebraically), and some integrals are only solvable this way.

Why it matters beyond area

The integral is the general language of “total of a rate,” so it shows up anywhere accumulation occurs:

  • Physics: work ; volume of a solid of revolution (disk method) .
  • Probability: if is a density (non-negative, integrates to 1), then .
  • ML: the loss of a softmax classifier is a sum over a finite batch — but expectations over continuous distributions are integrals, e.g. , and entropy is defined as an integral (the discrete version is the sum you see in cross-entropy implementations).
  • Numerics: when the integral has no closed form, you go back to the Riemann idea and compute a refined sum numerically — trapezoidal rule, Simpson’s rule, quadrature — or, in high dimensions, Monte Carlo integration, the basis of variational inference and MCMC.

Common pitfalls

  • Dropping or inventing the in indefinite integrals (it must cancel in definite ones, so it’s harmless there).
  • Forgetting to change the limits when doing -substitution on a definite integral — or, equivalently, forgetting to substitute the original limits back when you keep the answer in .
  • Missing the log’s absolute value: , needed when the interval crosses or lies below zero.
  • Confusing with : that case is the exceptional one giving (take the limit of as and you can see why they’re cousins).
  • Treating as “no area”: it means the signed positive and negative areas exactly cancel.

See also