Integration

Mon, Feb 23, 2026

Look ahead

We’re striking out in a new direction today to review integration. We’ll soon apply the language of integration to help us understand probability theory.

What is calculus?

On our second day of class, we said that one way to think of calculus is as a particular bag of tools that depend on the idea of the limit. Maybe even more betterly, we might say that

Description

Calculus is the study of problems that are amenable to a particular type of solution, namely:

approximate and then take a limit.

The next such tool, after continuity and differentiation, is integration.

Calc comparison chart

Question and approximation

From a geometric perspective, the fundamental question motivating integration may be expressed in terms of signed area. In the graph below, the area of the blue region over the \(x\)-axis minus the area of the red region under the \(x\)axis is exactly the value of \[ \int_a^b f(x)\,dx. \]

Definition

The definite integral is defined in a manner reminiscent of the derivative - i.e. we approximate and then take a limit. For the integral, the approximation takes the form

\[\int_a^b f(x) \, dx \approx \sum_{i=1}^N f(x_i) \, \Delta x,\]

\[\text{where } \Delta x = \frac{b-a}{N} \text{ and } x_i = a+i\Delta x.\]

We then take the limit as \(N\to\infty\) to get the actual value of the integral.

Picture

Just as with the derivative, there’s an image that makes this approximation step more clear:

The FTC Shortcut

Continuing the analogy with differentiation, there’s an algebraic shortcut that makes computing the integral more efficient, at least in some cases. That shortcut is called the Fundamental Theorem of Calculus, or FTC:

Theorem

If \(f:[a,b]\to\mathbb R\) and \(F'(x) = f(x)\) for all \(x\in[a,b]\), then \[\int_a^b f(x) \, dx = F(b)-F(a).\]

Example

\[\begin{aligned} \int_{-1}^1 (1-x^2) \, dx &= 2\int_0^1 (1-x^2) \, dx \\ &= 2\left(x-\frac{1}{3}x^3\right)\bigg\rvert_0^1 \\ &= 2\left(1\frac{1}{3}\right) = 2\times\frac{2}{3} = \frac{4}{3}. \end{aligned}\]

Note that we’ve used the symmetry of the function to simplify the integral in the first step.

We have also used proper notation.

Geometric interpretation

Our geometric interpretation of the fact that \[ \int_{-1}^1 (1-x^2) = \frac{4}{3} \] is that the shaded area below is \(4/3\).

\(u\)-substitution

We will not get too heavily into integration in this class. Our most heavy application of integration will be to help us understand probability distributions. In turns out that \(u\)-substitution is particularly useful in that situation.

As an example, suppose we wish to evaluate

\[\int_0^2 x\sqrt{4-x^2} \, dx.\]

Note that the expression \(4-x^2\) is nested inside the square root function and that its derivative (up to a constant multiple) is sitting outside. This suggests that we might try setting \(u=4-x^2\).

Example (cont.)

If \(u=4-x^2\), then \(\frac{du}{dx} = -2x\) so that \(x\,dx = -\frac{1}{2}du\). Thus,

\[\begin{aligned} \int_0^2 x\sqrt{4-x^2} \, dx &= \int_0^2 \sqrt{4-x^2} \, x\, dx = \int_4^0 \sqrt{u} \, \left(-\frac{1}{2}\right)\,du \\ &= \frac{1}{2} \int_0^4 u^{1/2} \, du = \frac{1}{2}\frac{2}{3} u^{3/2}\bigg\rvert_0^4 = \frac{1}{3}4^{3/2} = \frac{8}{3}. \end{aligned}\]

Note that

  • We’ve changed the bounds of integration by plugging \(x=0\) and \(x=2\) into \(u=4-x^2\).
  • We switched the order of integration after the translation, which simply changes the sign of the integral.

Numerical integration

The FTC shortcut doesn’t always work. That is, there are perfectly good examples of function without an easily expressed anti-derivative.

A standard example is \(f(x) = e^{-x^2}\).
We can ask SageMath for an anti-derivative but no luck.

I wonder what erf is anyway?

So…?

Even if we can’t find an anti-derivative, we can generally estimate definite integral to any desired precision. The art and science of doing so is called numerical integration.

The most basic form of numerical integration is based on the fact that \[\int_a^b f(x) \, dx \approx \sum_{i=1}^N f(x_i) \, \Delta x\] Thus, the value of a definite integral can be approximated by simply doing arithmetic.

It’s a lot of arithmetic so we typically do this on a computer.

Example (numeric integration)

Suppose we wish to evaluate \[ \int_{-1}^1 e^{-x^2} \, dx. \] We could ask SageMath for an estimate or even do it on Desmos:

Improper integration

We will often be interested in definite integrals involving \(\infty\) like \[ \int_{-\infty}^{\infty} e^{-x^2} \, dx. \] This could be interpreted as the total area lying between the graph of the function and the \(x\)-axis and computed as \[ \lim_{b\to\infty}\int_{-b}^{b} e^{-x^2} \, dx. \]

Improper computation

Numerical integration works for improper integrals as well. We can again ask SageMath or do it on Desmos: