---
title: The Fundamental Theorem of Calculus
module: Integrals
moduleNumber: 4
lessonNumber: 2
order: 402
summary: >
  Differentiation and integration are inverse operations. Part 1 says the
  derivative of an area-accumulation function is the integrand; Part 2 says a
  definite integral equals the change in any antiderivative across the interval.
  Together they replace limits of Riemann sums with antiderivative lookups, define
  the indefinite integral, and give the Net Change Theorem for rates.
topics: [Integrals]
sources:
  - book: Stewart
    ref: "Ch. 4 — Integrals; §4.3 The Fundamental Theorem of Calculus"
  - book: Stewart
    ref: "Ch. 4; §4.4 Indefinite Integrals and the Net Change Theorem"
draft: false
---

The [definite integral](/calculus/integrals/area-and-the-definite-integral) was
built as a limit of Riemann sums, and evaluating even $\int_0^1 x^2\,\d x$ that way
took a summation identity and a page of algebra. The
[derivative](/calculus/derivatives/the-derivative-and-rates-of-change) came from a
seemingly unrelated question — the slope of a tangent. The Fundamental Theorem of
Calculus states that these two constructions are inverse to each other, and that
single fact converts most integral evaluations into antiderivative lookups. Isaac
Barrow saw the inverse relationship; Newton and Leibniz turned it into a method.

The theorem has two parts. Part 1 differentiates an integral and recovers the
integrand. Part 2 evaluates an integral by subtracting the values of an
antiderivative. Both hinge on a single object: the function that accumulates area
as its upper limit moves.

## The area accumulation function

Fix a continuous $f$ on $[a, b]$ and define a new function by letting the upper
limit of integration vary:

$$
g(x) = \int_a^x f(t)\,\d t, \qquad a \le x \le b.
$$

For each fixed $x$ this is a definite integral, hence a number; letting $x$ move
makes $g$ a function of $x$. The dummy variable is written $t$ so it is not
confused with the limit $x$. When $f \ge 0$, the value $g(x)$ is the area under the
graph from $a$ out to $x$ — the "area so far."

$$
% caption: The accumulation function $g(x) = \int_a^x f(t)\,dt$ is the shaded area
% under $f$ from the fixed left edge $a$ out to the moving right edge $x$.
\begin{tikzpicture}[scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.2,0) -- (8.6,0) node[right, black!70] {$t$};
\draw[->, black] (0,-0.2) -- (0,3.4) node[above, black!70] {$y$};
\fill[acc!14, domain=1:5, samples=80, smooth]
  plot (\x, {1.5 + 0.8*sin((\x-1)*40 - 10)}) -- (5,0) -- (1,0) -- cycle;
\draw[black, very thick, domain=0.4:8, samples=100, smooth]
  plot (\x, {1.5 + 0.8*sin((\x-1)*40 - 10)});
\draw[acc, thick] (1,0) -- (1,{1.5 + 0.8*sin(-10)});
\draw[acc, thick] (5,0) -- (5,{1.5 + 0.8*sin((4)*40 - 10)});
\draw[black] (1,0.08) -- (1,-0.08) node[below, black!70, font=\footnotesize] {$a$};
\draw[black] (5,0.08) -- (5,-0.08) node[below, black!70, font=\footnotesize] {$x$};
\node[acc, font=\footnotesize] at (3,0.85) {$g(x)$};
\node[black, anchor=south west, font=\footnotesize] at (5.8,2.1) {$y = f(t)$};
\end{tikzpicture}
$$

Compute $g$ for a concrete case, $f(t) = t$ and $a = 0$. The region under $y = t$
from $0$ to $x$ is a triangle of base and height $x$, so

$$
g(x) = \int_0^x t\,\d t = \frac{x^2}{2},
\qquad\text{and thus}\qquad
g'(x) = x = f(x).
$$

The derivative of the accumulation function returned the integrand — a fact that
holds for every continuous $f$.

## Part 1: differentiating an integral

Why should $g'(x) = f(x)$ in general? Increase the upper limit by a small $h$. The
difference $g(x + h) - g(x)$ is the area of the thin sliver under $f$ between $x$ and
$x + h$. For small $h$ that sliver is nearly a rectangle of width $h$ and height
$f(x)$, so

$$
g(x + h) - g(x) \approx h\,f(x),
\qquad\text{hence}\qquad
\frac{g(x + h) - g(x)}{h} \approx f(x).
$$

$$
% caption: Part 1's engine — the increment $g(x+h) - g(x)$ is the area of the
% strip from $x$ to $x + h$, which for small $h$ is almost the rectangle of height
% $f(x)$ and width $h$.
\begin{tikzpicture}[scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.2,0) -- (8.2,0) node[right, black!70] {$t$};
\draw[->, black] (0,-0.2) -- (0,3.4) node[above, black!70] {$y$};
% accumulated area up to x, light
\fill[black, domain=0.6:5, samples=80, smooth]
  plot (\x, {1.6 + 0.55*sin((\x-0.6)*30)}) -- (5,0) -- (0.6,0) -- cycle;
% strip from x to x+h, accent
\fill[acc!16, domain=5:6, samples=30, smooth]
  plot (\x, {1.6 + 0.55*sin((\x-0.6)*30)}) -- (6,0) -- (5,0) -- cycle;
\draw[black, very thick, domain=0.6:7.8, samples=100, smooth]
  plot (\x, {1.6 + 0.55*sin((\x-0.6)*30)});
\pgfmathsetmacro{\fx}{1.6 + 0.55*sin((5-0.6)*30)}
\draw[acc, thick] (5,0) -- (5,\fx);
\draw[acc, thick] (6,0) -- (6,{1.6 + 0.55*sin((6-0.6)*30)});
\draw[acc, dashed] (5,\fx) -- (6,\fx);
\draw[black] (5,0.08) -- (5,-0.08) node[below, black!70, font=\footnotesize] {$x$};
\draw[black] (6,0.08) -- (6,-0.08) node[below, black!70, font=\footnotesize] {$x{+}h$};
\node[black, font=\footnotesize] at (2.6,0.75) {$g(x)$};
\node[acc, anchor=west, font=\footnotesize] at (6.05,{\fx*0.55}) {area $h\,f(x)$};
\end{tikzpicture}
$$

Made rigorous, the approximation becomes an equality in the limit. On $[x, x+h]$ the
Extreme Value Theorem gives points $u, v$ where $f$ attains its minimum $m = f(u)$
and maximum $M = f(v)$; the bounding property of integrals then sandwiches the
difference quotient,

$$
f(u) \le \frac{g(x+h) - g(x)}{h} \le f(v).
$$

As $h \to 0$ both $u$ and $v$ are squeezed toward $x$, and continuity forces
$f(u) \to f(x)$ and $f(v) \to f(x)$. By the
[Squeeze Theorem](/calculus/limits-and-continuity/limit-laws-and-the-precise-definition)
the middle term has the same limit.

> **Theorem (Fundamental Theorem of Calculus, Part 1).** If $f$ is continuous on
> $[a, b]$, then $g(x) = \int_a^x f(t)\,\d t$ is continuous on $[a, b]$ and
> differentiable on $(a, b)$, with
> $$
> g'(x) = \frac{\d}{\d x}\int_a^x f(t)\,\d t = f(x).
> $$

In words: differentiating a definite integral with respect to its upper limit
returns the integrand evaluated at that limit. Every continuous function therefore
_has_ an antiderivative, namely its own accumulation function — even when no
formula for it exists in elementary terms.

### Reading Part 1

Two consequences of Part 1 are worth stating on their own.

- **Antiderivatives always exist.** Many integrals cannot be expressed with
  elementary functions. The Fresnel function $S(x) = \int_0^x \sin(t^2/2)\,\d t$ has
  no closed form, yet Part 1 gives its derivative immediately: $S'(x) = \sin(x^2/2)$.
- **A moving limit needs the Chain Rule.** When the upper limit is itself a function
  $u = u(x)$, compose. For $\frac{\d}{\d x}\int_1^{x^4}\sec t\,\d t$, set $u = x^4$; then
  by Part 1 and the
  [Chain Rule](/calculus/derivatives/differentiation-rules-and-the-chain-rule),
  $$
  \frac{\d}{\d x}\int_1^{x^4}\sec t\,\d t = \sec(u)\,\frac{\d u}{\d x} = \sec(x^4)\cdot 4x^3.
  $$

Several functions of applied mathematics are defined by exactly this kind of
integral, their integrands having no elementary antiderivative. Part 1
differentiates each at sight:

| Function | Definition | Derivative by Part 1 |
| --- | --- | --- |
| Error function | $\operatorname{erf}(x) = \dfrac{2}{\sqrt\pi}\displaystyle\int_0^x e^{-t^2}\,\d t$ | $\dfrac{2}{\sqrt\pi}\,e^{-x^2}$ |
| Fresnel sine | $S(x) = \displaystyle\int_0^x \sin(t^2/2)\,\d t$ | $\sin(x^2/2)$ |
| Fresnel cosine | $C(x) = \displaystyle\int_0^x \cos(t^2/2)\,\d t$ | $\cos(x^2/2)$ |
| Sine integral | $\operatorname{Si}(x) = \displaystyle\int_0^x \dfrac{\sin t}{t}\,\d t$ | $\dfrac{\sin x}{x}$ |

Each accumulation function inherits its shape from the sign of its integrand: it
rises where the integrand is positive, falls where the integrand is negative, and
turns at the integrand's zeros.

$$
% caption: An accumulation function $g$ rises where its integrand $f$ is positive
% and falls where $f$ is negative, turning exactly at the zeros of $f$.
\begin{tikzpicture}[scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\definecolor{neg}{HTML}{B5651D}
% ---- top: integrand f ----
\begin{scope}
  \draw[->, black] (-0.2,0) -- (7.0,0) node[right, black!70] {$t$};
  \draw[->, black] (0,-1.4) -- (0,1.7) node[above, black!70] {$y$};
  \draw[black, very thick, domain=0.4:6.6, samples=100, smooth]
    plot (\x, {1.15*cos((\x-0.5)*60)});
  \draw[acc, dashed] (2,0) -- (2,1.55);
  \draw[acc, dashed] (5,-1.35) -- (5,0);
  \node[acc, font=\footnotesize] at (1.1,0.5) {$f>0$};
  \node[neg, font=\footnotesize] at (3.5,-0.55) {$f<0$};
  \node[black, anchor=south west, font=\footnotesize] at (5.35,1.42) {$y=f(t)$};
\end{scope}
% ---- bottom: accumulation g ----
\begin{scope}[yshift=-4.6cm]
  \draw[->, black] (-0.2,0) -- (7.0,0) node[right, black!70] {$x$};
  \draw[->, black] (0,-0.2) -- (0,2.9) node[above, black!70] {$y$};
  \draw[black, very thick, domain=0.4:6.6, samples=100, smooth]
    plot (\x, {1.4 + 1.0*sin((\x-0.5)*60)});
  \draw[acc, dashed] (2,0) -- (2,2.4);
  \draw[acc, dashed] (5,0) -- (5,0.4);
  \fill[acc] (2,2.4) circle (1.4pt);
  \fill[acc] (5,0.4) circle (1.4pt);
  \node[acc, anchor=south, font=\footnotesize] at (2,2.44) {max};
  \node[acc, anchor=west, font=\footnotesize] at (5.12,0.28) {min};
  \node[black, anchor=south west, font=\footnotesize] at (5.2,1.95) {$y=g(x)$};
\end{scope}
\end{tikzpicture}
$$

> **Worked example.** Differentiate $g(x) = \displaystyle\int_0^{x^2}\cos(t^2)\,\d t$.
>
> The upper limit is $u = x^2$, not $x$, so write $g(x) = G(x^2)$ with
> $G(u) = \int_0^u \cos(t^2)\,\d t$. Part 1 gives $G'(u) = \cos(u^2)$, and the Chain
> Rule multiplies by $\d u/\d x = 2x$:
> $$
> g'(x) = \cos\bigl((x^2)^2\bigr)\cdot 2x = 2x\cos(x^4).
> $$

> **Worked example.** Differentiate $h(x) = \displaystyle\int_{x}^{x^2}\frac{1}{1+t^2}\,\d t$,
> where both limits move.
>
> Split at any constant $c$ using additivity, then differentiate each piece:
> $$
> h(x) = \int_c^{x^2}\frac{\d t}{1+t^2} - \int_c^{x}\frac{\d t}{1+t^2}.
> $$
> The first piece has upper limit $x^2$ (Chain Rule), the second upper limit $x$:
> $$
> h'(x) = \frac{1}{1+(x^2)^2}\cdot 2x - \frac{1}{1+x^2} = \frac{2x}{1+x^4} - \frac{1}{1+x^2}.
> $$

## Part 2: evaluating an integral

Part 1 makes $g(x) = \int_a^x f(t)\,\d t$ an antiderivative of $f$. Any other
antiderivative $F$ differs from $g$ by a constant, because two functions with the
same derivative on an interval differ by a constant. Writing $F(x) = g(x) + C$ and
evaluating at the endpoints, the constant cancels in the difference:

$$
F(b) - F(a) = \bigl[g(b) + C\bigr] - \bigl[g(a) + C\bigr] = g(b) - g(a) = \int_a^b f(t)\,\d t,
$$

since $g(a) = 0$ and $g(b) = \int_a^b f$. That is the second part.

> **Theorem (Fundamental Theorem of Calculus, Part 2).** If $f$ is continuous on
> $[a, b]$ and $F$ is _any_ antiderivative of $f$ (so $F' = f$), then
> $$
> \int_a^b f(x)\,\d x = F(b) - F(a).
> $$

The definite integral, defined through all the values of $f$ on $[a, b]$, is found
from the values of one antiderivative at just the two endpoints. The standard
notation for the difference is a bracket:

$$
\int_a^b f(x)\,\d x = \Bigl[\,F(x)\,\Bigr]_a^b = F(b) - F(a).
$$

$$
% caption: Part 2 as bracket evaluation: the integral equals the net rise of an
% antiderivative $F$ across $[a,b]$, read off as $F(b) - F(a)$.
\begin{tikzpicture}[scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.2,0) -- (7.6,0) node[right, black!70] {$x$};
\draw[->, black] (0,-0.2) -- (0,3.8) node[above, black!70] {$y$};
% antiderivative curve, increasing
\draw[black, very thick, domain=0.6:6.6, samples=80, smooth]
  plot (\x, {0.7 + 0.35*\x + 0.35*sin((\x-0.6)*40)});
\pgfmathsetmacro{\Fa}{0.7 + 0.35*1.4 + 0.35*sin((1.4-0.6)*40)}
\pgfmathsetmacro{\Fb}{0.7 + 0.35*5.6 + 0.35*sin((5.6-0.6)*40)}
\draw[acc, dashed] (1.4,\Fa) -- (1.4,0);
\draw[acc, dashed] (5.6,\Fb) -- (5.6,0);
\draw[acc, dashed] (1.4,\Fa) -- (5.6,\Fa);
\draw[acc, <->, thick] (5.6,\Fa) -- (5.6,\Fb);
\fill[acc] (1.4,\Fa) circle (1.6pt);
\fill[acc] (5.6,\Fb) circle (1.6pt);
\node[acc, anchor=west, font=\footnotesize] at (5.65,{(\Fa+\Fb)/2}) {$F(b)$ - $F(a)$};
\node[black!70, anchor=north, font=\footnotesize] at (1.4,-0.08) {$a$};
\node[black!70, anchor=north, font=\footnotesize] at (5.6,-0.08) {$b$};
\node[black, anchor=south east, font=\footnotesize] at (6.6,3.0) {$y = F(x)$};
\end{tikzpicture}
$$

Return to $\int_0^1 x^2\,\d x$, which cost a summation identity before. An
antiderivative of $x^2$ is $F(x) = \tfrac13 x^3$, so

$$
\int_0^1 x^2\,\d x = \Bigl[\tfrac13 x^3\Bigr]_0^1 = \tfrac13(1)^3 - \tfrac13(0)^3 = \frac13.
$$

The choice of antiderivative does not matter, since any two differ by a constant
that cancels; use the simplest, dropping "$+ C$" entirely.

> **Worked example.** Evaluate $\int_{-2}^{1} x^3\,\d x$.
>
> An antiderivative of $x^3$ is $F(x) = \tfrac14 x^4$, continuous on $[-2, 1]$, so
> $$
> \int_{-2}^{1} x^3\,\d x = \Bigl[\tfrac14 x^4\Bigr]_{-2}^{1} = \tfrac14(1)^4 - \tfrac14(-2)^4 = \tfrac14 - 4 = -\frac{15}{4}.
> $$

> **Worked example.** Find the area under $y = \cos x$ from $0$ to $\pi/2$.
>
> An antiderivative of $\cos x$ is $\sin x$, so the area is
> $$
> \int_0^{\pi/2}\cos x\,\d x = \bigl[\sin x\bigr]_0^{\pi/2} = \sin\tfrac\pi2 - \sin 0 = 1.
> $$

> **Worked example.** Evaluate $\displaystyle\int_1^9 \frac{2t^2 + t^2\sqrt{t} - 1}{t^2}\,\d t$.
>
> The integrand is not in the table, but dividing through by $t^2$ turns it into a
> sum of powers:
> $$
> \frac{2t^2 + t^2\sqrt{t} - 1}{t^2} = 2 + t^{1/2} - t^{-2}.
> $$
> Integrating term by term and applying Part 2,
> $$
> \int_1^9 \bigl(2 + t^{1/2} - t^{-2}\bigr)\,\d t
>   = \Bigl[2t + \tfrac23 t^{3/2} + t^{-1}\Bigr]_1^9
>   = \bigl(18 + 18 + \tfrac19\bigr) - \bigl(2 + \tfrac23 + 1\bigr) = \frac{292}{9}.
> $$

One caution: Part 2
requires $f$ continuous on all of $[a, b]$. Applying it blindly across a
discontinuity produces nonsense, such as the false $\int_{-1}^3 x^{-2}\,\d x = -\tfrac43$
for an integrand that is positive everywhere it is defined and in fact has an
infinite discontinuity at $x = 0$, so the integral does not exist as an ordinary one.

## The two parts together

Stated side by side, the two parts express one relationship.

| | Statement | What it does |
| --- | --- | --- |
| Part 1 | $\dfrac{\d}{\d x}\displaystyle\int_a^x f(t)\,\d t = f(x)$ | integrate, then differentiate — recover $f$ |
| Part 2 | $\displaystyle\int_a^b F'(x)\,\d x = F(b) - F(a)$ | differentiate, then integrate — recover $F$'s net change |

Each undoes the other. Integrating $f$ and differentiating the result gives $f$
back; differentiating $F$ and integrating the result gives back the change in $F$.
Differentiation and integration are inverse processes, and the challenging area,
volume, and length problems that occupied mathematicians from Archimedes to Fermat
become routine once an antiderivative is in hand.

## Indefinite integrals

Because Part 2 turns evaluation into antidifferentiation, antiderivatives deserve a
notation of their own. The symbol $\int f(x)\,\d x$ without limits denotes the general
antiderivative — a whole family of functions differing by a constant.

> **Definition (Indefinite integral).** $\displaystyle\int f(x)\,\d x = F(x) + C$ means
> $F'(x) = f(x)$. It is a _function_ (a family, one for each $C$), unlike the
> definite integral $\int_a^b f(x)\,\d x$, which is a _number_.

The connection is Part 2: if $F$ is an antiderivative,
$\int_a^b f(x)\,\d x = \bigl[\int f(x)\,\d x\bigr]_a^b$. Every differentiation rule,
read backwards, is an antidifferentiation formula. The basic table:

| Indefinite integral | Indefinite integral |
| --- | --- |
| $\displaystyle\int k\,\d x = kx + C$ | $\displaystyle\int x^n\,\d x = \frac{x^{n+1}}{n+1} + C \ \ (n \ne -1)$ |
| $\displaystyle\int \sin x\,\d x = -\cos x + C$ | $\displaystyle\int \cos x\,\d x = \sin x + C$ |
| $\displaystyle\int \sec^2 x\,\d x = \tan x + C$ | $\displaystyle\int \csc^2 x\,\d x = -\cot x + C$ |
| $\displaystyle\int \sec x \tan x\,\d x = \sec x + C$ | $\displaystyle\int \csc x \cot x\,\d x = -\csc x + C$ |

Each entry is checked by differentiating the right side. Sums and constant multiples
distribute across the integral sign exactly as they do for definite integrals, so
polynomials integrate term by term. For a general indefinite integral,

$$
\int (10 x^4 - 2\sec^2 x)\,\d x = 10\cdot\frac{x^5}{5} - 2\tan x + C = 2x^5 - 2\tan x + C.
$$

A definite version, applying Part 2 to a polynomial:

$$
\int_0^3 (x^3 - 6x)\,\d x = \Bigl[\tfrac14 x^4 - 3x^2\Bigr]_0^3 = \parens{\tfrac{81}{4} - 27} - 0 = -6.75,
$$

which matches the Riemann-sum value computed the long way from the definition.
The table is deliberately short; it grows as new derivatives are learned, and the
[exponential and logarithmic functions](/calculus/exponential-logarithmic-and-inverse-functions/inverse-functions-logarithms-and-exponentials)
add the entries for $e^x$ and $1/x$. Antiderivatives that are not in the table need a
technique, beginning with the
[Substitution Rule](/calculus/integrals/the-substitution-rule).

## The Net Change Theorem

Rewriting Part 2 with $F' = f$ named as a rate produces a statement with a direct
physical reading. Since $F'(x)$ is the rate of change of $F$, and $F(b) - F(a)$ is
the total change of $F$ across the interval:

> **Net Change Theorem.** The integral of a rate of change is the net change:
> $$
> \int_a^b F'(x)\,\d x = F(b) - F(a).
> $$

$$
% caption: The Net Change Theorem read as area: integrating a rate $r = F'$ over
% $[a,b]$ accumulates to the total change $F(b) - F(a)$, the shaded area under the
% rate curve.
\begin{tikzpicture}[scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.2,0) -- (7.6,0) node[right, black!70] {$t$};
\draw[->, black] (0,-0.2) -- (0,3.2) node[above, black!70] {rate};
\fill[acc!13, domain=1:6, samples=80, smooth]
  plot (\x, {1.3 + 0.7*sin((\x-1)*40) + 0.12*\x}) -- (6,0) -- (1,0) -- cycle;
\draw[black, very thick, domain=0.3:7.0, samples=90, smooth]
  plot (\x, {1.3 + 0.7*sin((\x-1)*40) + 0.12*\x});
\draw[black] (1,0.08) -- (1,-0.08) node[below, black!70, font=\footnotesize] {$a$};
\draw[black] (6,0.08) -- (6,-0.08) node[below, black!70, font=\footnotesize] {$b$};
\node[acc, font=\footnotesize] at (3.4,0.95) {area = net change};
\node[black, anchor=south west, font=\footnotesize] at (5.2,2.85) {$y = r(t)$};
\end{tikzpicture}
$$

Whatever $F$ measures, integrating its rate over $[a, b]$ recovers how much $F$
changed. A few instances:

- **Volume from flow.** If $V'(t)$ is the rate water flows into a reservoir, then
  $\int_{t_1}^{t_2} V'(t)\,\d t = V(t_2) - V(t_1)$ is the change in stored water.
- **Population from growth rate.** $\int_{t_1}^{t_2} n'(t)\,\d t = n(t_2) - n(t_1)$, the
  net change in population, births and deaths both folded in.
- **Cost from marginal cost.** $\int_{x_1}^{x_2} C'(x)\,\d x = C(x_2) - C(x_1)$, the
  added cost of raising production from $x_1$ to $x_2$ units.
- **Mass from density.** For a rod of linear density $\rho(x) = m'(x)$,
  $\int_a^b \rho(x)\,\d x = m(b) - m(a)$ is the mass of the segment.

The unit of $\int_a^b f(x)\,\d x$ is the product of the unit of $f$ and the unit of
$x$. Integrating megawatts against hours gives megawatt-hours of energy;
integrating a density in kg/m against meters gives kilograms.

## Displacement versus distance

Motion along a line makes the sign convention concrete. If $v(t) = s'(t)$ is
velocity, the Net Change Theorem gives **displacement**,

$$
\int_{t_1}^{t_2} v(t)\,\d t = s(t_2) - s(t_1),
$$

the net change in position — with leftward motion ($v < 0$) subtracting. Total
**distance traveled** counts every stretch as positive, so it integrates the speed
$|v(t)|$:

$$
\text{distance} = \int_{t_1}^{t_2} |v(t)|\,\d t.
$$

$$
% caption: Displacement is signed area $A_1 - A_2 + A_3$; distance is total area
% $A_1 + A_2 + A_3$. The interval where $v < 0$ subtracts from displacement but
% adds to distance.
\begin{tikzpicture}[scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\definecolor{neg}{HTML}{B5651D}
\draw[->, black] (-0.2,0) -- (8.6,0) node[right, black!70] {$t$};
\draw[->, black] (0,-1.5) -- (0,2.3) node[above, black!70] {$v$};
% v(t) = 1.5*sin((3.0 - t)*75): zeros at t = 0.6, 3.0, 5.4, 7.8
\begin{scope}
  \clip (0.6,0) rectangle (3.0,2.1);
  \fill[acc!14, domain=0.6:7.8, samples=120, smooth]
    plot (\x, {1.5*sin((3.0-\x)*75)}) -- (7.8,0) -- (0.6,0) -- cycle;
\end{scope}
\begin{scope}
  \clip (3.0,-1.5) rectangle (5.4,0);
  \fill[neg!16, domain=0.6:7.8, samples=120, smooth]
    plot (\x, {1.5*sin((3.0-\x)*75)}) -- (7.8,0) -- (0.6,0) -- cycle;
\end{scope}
\begin{scope}
  \clip (5.4,0) rectangle (7.8,2.1);
  \fill[acc!14, domain=0.6:7.8, samples=120, smooth]
    plot (\x, {1.5*sin((3.0-\x)*75)}) -- (7.8,0) -- (0.6,0) -- cycle;
\end{scope}
\draw[black, very thick, domain=0.6:7.8, samples=140, smooth]
  plot (\x, {1.5*sin((3.0-\x)*75)});
\node[acc, font=\footnotesize] at (1.8,0.7) {$A_1$};
\node[neg, font=\footnotesize] at (4.2,-0.7) {$A_2$};
\node[acc, font=\footnotesize] at (6.6,0.7) {$A_3$};
\node[black, anchor=south, font=\footnotesize] at (5.0,1.55) {$v = v(t)$};
\end{tikzpicture}
$$

> **Worked example.** A particle has velocity $v(t) = t^2 - t - 6$ m/s on
> $1 \le t \le 4$. Find its displacement and the distance it travels.
>
> Displacement integrates the velocity directly:
> $$
> \int_1^4 (t^2 - t - 6)\,\d t = \Bigl[\tfrac13 t^3 - \tfrac12 t^2 - 6t\Bigr]_1^4 = -\frac{9}{2},
> $$
> a net move of $4.5$ m to the left. Distance integrates the speed $|v|$. Since
> $v(t) = (t-3)(t+2)$ is negative on $[1, 3]$ and positive on $[3, 4]$, split at
> $t = 3$:
> $$
> \int_1^4 |v(t)|\,\d t = \int_1^3 -(t^2 - t - 6)\,\d t + \int_3^4 (t^2 - t - 6)\,\d t = \frac{61}{6} \approx 10.17\ \text{m}.
> $$
> The particle covered $10.17$ m of ground while ending $4.5$ m to the left of its
> start.
