---
title: The fundamental theorem of calculus
heading: Accumulating a rate, and the rate of an accumulation
eyebrow: A5 · Lesson 43 · The fundamental theorem
xp: 40
---

::: hook
Summing thousands of thin rectangles to find an area is slow. There's a shortcut so powerful that it has a grand name: if you can find a function whose slope is the curve you're integrating, the area is just the difference of two of its values. It ties the two halves of calculus, slopes and areas, into one idea.

::: play
- The yellow curve is a rate, $f(x) = \cos x + 0.5$. The shaded area from 0 to $x_0$ is its accumulation so far.
- The blue curve, $F(x)$, records that area as $x_0$ moves. The dashed line is $F$'s tangent at $x_0$.
- Compare the tangent's slope with the height of the yellow curve at $x_0$ (both in the strip). What do you notice?
- Where the yellow curve dips below zero, what does the blue curve do?
:::
:::

```sim plot
view: graph
x: x = 0..9
y: y = -1..5
slider: x0 = 0..9 step 0.05 = 2
plot: cos(x) + 0.5 | fill: 0..x0 | label: f(x)
plot: sin(x) + 0.5*x | color: ch2 | label: F(x) = area from 0
plot: sin(x0) + 0.5*x0 + (cos(x0) + 0.5)*(x - x0) | dashed | color: ch3
point: x0, sin(x0) + 0.5*x0 | color: ch2
readout: f(x0) = cos(x0) + 0.5
readout: slope of F at x0 = cos(x0) + 0.5
```

::: predict
## The accumulated area $F(x)$ grows as $x$ moves right. How fast does it grow at $x_0$?

- [ ] At a rate equal to the area so far
- [x] At a rate equal to $f(x_0)$, the height of the curve there
- [ ] At a constant rate
- [ ] It depends on where you started counting

::: reveal
At a rate equal to $f(x_0)$. Move $x_0$ a tiny step $dx$ and the area gains a thin sliver of height $f(x_0)$ and width $dx$, so $dF = f(x_0)\,dx$, and $F$'s slope is $f(x_0)$. Where $f$ is negative, the area shrinks and $F$ slopes down. Accumulating and taking the rate are opposite operations: each undoes the other.
:::
:::

::: nameit
## The fundamental theorem

**Part 1: the rate of an accumulation is the original function.** If $F(x) = \int_a^x f(t)\,dt$, then

$$F'(x) = f(x)$$

**Part 2: areas from antiderivatives.** A function whose derivative is $f$ is called an **antiderivative** of $f$. If $F$ is any antiderivative,

$$\int_a^b f(x)\,dx = F(b) - F(a)$$

often written $\big[F(x)\big]_a^b$. Instead of adding up rectangles, you undo a derivative.

**Antiderivatives** come from reading the derivative table backward. Each is fixed only up to an added constant $C$, since constants have slope zero:

| $f(x)$ | an antiderivative |
|---|---|
| $x^{n}$, $n \neq -1$ | $\dfrac{x^{n+1}}{n + 1}$ |
| $1/x$ | $\ln\lvert x\rvert$ |
| $e^{kx}$ | $\dfrac{1}{k}e^{kx}$ |
| $\cos(\omega x)$ | $\dfrac{1}{\omega}\sin(\omega x)$ |
| $\sin(\omega x)$ | $-\dfrac{1}{\omega}\cos(\omega x)$ |

**Example:** $\int_0^2 3x^2\,dx = \big[x^3\big]_0^2 = 8 - 0 = 8$.

**In circuits.** Integrating $i = C\,dv/dt$ gives the capacitor's voltage from its current:

$$v(t) = v(0) + \frac{1}{C}\int_0^t i\,dt$$

The constant of integration is the starting voltage. And the charge from lesson 41 now takes one line: $\int_0^T I_0e^{-t/\tau}\,dt = \big[-I_0\tau e^{-t/\tau}\big]_0^T = I_0\tau(1 - e^{-T/\tau})$, which approaches $I_0\tau$ as $T$ grows.
:::

::: example
## Evaluate $\int_1^3 (2x + 1)\,dx$.

::: solution
1. **Find an antiderivative.** An antiderivative of $2x + 1$ is $x^2 + x$.
2. **Evaluate at the limits.**
   $$\begin{aligned} \int_1^3 (2x + 1)\,dx &= (9 + 3) - (1 + 1) \\ &= 10 \end{aligned}$$

**Answer:** the integral is 10.
:::
:::

::: example
## What is $\frac{d}{dx}\int_0^x \sin(t^2)\,dt$?

::: solution
1. **Apply the fundamental theorem.** The rate at which the accumulated area grows is the height of the curve at the moving end:
   $$\frac{d}{dx}\int_0^x \sin(t^2)\,dt = \sin(x^2)$$
2. **No antiderivative needed.** No antiderivative of $\sin(t^2)$ is needed (there isn't one in elementary functions).

**Answer:** $\sin(x^2)$.
:::
:::

::: example
## Find $\dfrac{d}{dx}\displaystyle\int_0^{x^2}\cos t\,dt$.

::: solution
1. **Name an antiderivative.** If $F$ is an antiderivative of $\cos$, the integral is $F(x^2) - F(0)$.
2. **Chain rule.** Its derivative is
   $$F'(x^2) \cdot 2x = 2x\cos(x^2)$$
3. **Check by integrating first.**
   $$\int_0^{x^2}\cos t\,dt = \sin(x^2)$$
   whose derivative is $2x\cos(x^2)$.

**Answer:** $2x\cos(x^2)$.
:::
:::

::: check
kind: expression
given: a = 2..9 int; b = 2..9 int
answer: a*x^3/3 + b*x
vars: x = -2..2

## Find an antiderivative of $\given{a}x^2 + \given{b}$. Take the constant of integration as zero.

::: right
Right. Raise each power by one and divide by the new power: $\given{a}x^3/3 + \given{b}x$. Check it by differentiating.
:::

::: misses
- [2*a*x] That's the derivative. The antiderivative goes the other way: raise the power.
- [a*x^3 + b*x] Divide by the new power, 3.
- [a*x^3/3 + b] The constant {b} integrates to $\given{b}x$.
- [any] Not yet. Use $\int x^n dx = x^{n+1}/(n + 1)$ on each term.
:::
:::

::: check
given: n = 2..5 int; b = 2 | 7
answer: b^(n + 1)/(n + 1)
tolerance: 0.5%

## Evaluate $\int_0^{\given{b}} x^{\given{n}}\,dx$.

::: right
Right. $\big[x^{n+1}/(n + 1)\big]_0^{\given{b}}$ = {answer}.
:::

::: misses
- [b^n] Integrate first: raise the power and divide.
- [n*b^(n - 1)] That's the derivative at {b}, not the area.
- [any] Not yet. Find the antiderivative, then subtract its value at 0 from its value at {b}.
:::
:::

::: check
given: I = 1..10 int; C = 1µ..100µ E6 F; t = 1..9 int
answer: I/1000*t/1000/C
unit: V
tolerance: 1%

## A constant {I} mA flows into an uncharged {C} capacitor for {t} ms. What voltage does it reach?

::: right
Right. $v = \frac1C\int i\,dt = \frac{It}{C}$ = {answer}.
:::

::: misses
- [I/1000*t/1000*C] Divide by C: $v = q/C$.
- [I*t/C] Check the prefixes: milliamps and milliseconds.
- [any] Not yet. The charge is $It$; the voltage is $q/C$.
:::
:::

::: check
kind: choice

## What is $\int_0^{\pi}\sin x\,dx$?

- [ ] 0
- [x] 2
- [ ] 1
- [ ] π

::: right
Right. An antiderivative is $-\cos x$: $(-\cos\pi) - (-\cos 0) = 1 + 1 = 2$.
:::

::: misses
- [1] Over 0 to π the sine is never negative, so the area is positive. Zero is for a full period.
- [3] Evaluate $-\cos x$ at both ends: the two contributions add.
- [4] The area is $[-\cos x]_0^\pi$, which comes out as a whole number.
:::
:::

::: check
kind: parts
given: a = 1 | 2; b = 3 | 4

## Use the fundamental theorem.

::: part
answer: b^3 - a^3
tolerance: 0.5%

### $\displaystyle\int_{\given{a}}^{\given{b}} 3x^2\,dx$

::: misses
- [3*(b^3 - a^3)] An antiderivative of $3x^2$ is $x^3$.
- [any] Evaluate $x^3$ at the ends.
:::
:::

::: part
answer: exp(a^2)
tolerance: 0.5%

### $\dfrac{d}{dx}\displaystyle\int_0^x e^{t^2}\,dt$ at $x$ = {a}

::: misses
- [any] The derivative of an accumulation is the integrand at the upper limit.
:::
:::

::: part
answer: 2*b*sin(b^2)
tolerance: 0.5%

### $\dfrac{d}{dx}\displaystyle\int_0^{x^2}\sin t\,dt$ at $x$ = {b}

::: misses
- [sin(b^2)] The upper limit is $x^2$, so the chain rule brings in $2x$.
- [any] $f(g(x))\,g'(x)$ with $g(x) = x^2$.
:::
:::
:::

::: check
kind: derivation
vars: x = -2..2

## Differentiate $G(x) = \displaystyle\int_0^{x^3}\cos t\,dt$.

::: step
answer: sin(x^3)

### First evaluate the integral.
:::

::: step
answer: 3*x^2*cos(x^3)

### Now differentiate it.
:::

::: right
Right. $G'(x) = \cos(x^3) \cdot 3x^2$: the integrand at the upper limit, times the limit's derivative.
:::
:::

::: explain
## In your own words, why does the derivative of the accumulated area under $f$ equal $f$?

::: model
Moving the right end of the area a tiny distance to the right adds a thin sliver to it. The sliver is as tall as the curve at that point and as wide as the step, so the area grows by about $f(x)$ times the step. The rate of growth, area added per unit of $x$, is therefore $f(x)$: the slope of the accumulated area is the height of the curve.
:::
:::

::: practice

::: check
kind: expression
given: k = 2..9 int
answer: -cos(k*x)/k
vars: x = -2..2

## Find an antiderivative of $\sin(\given{k}x)$ (constant zero).

::: misses
- [cos(k*x)/k] The antiderivative of sin is −cos.
- [-cos(k*x)] Divide by {k}: differentiating $\cos(kx)$ brings out a factor of k.
- [any] $\int\sin(kx)dx = -\cos(kx)/k$.
:::
:::

::: check
given: I0 = 1..20 int; tau = 2..9 int; T = 1..9 int
answer: I0*tau*(1 - exp(-T/tau))
unit: µC
tolerance: 1%

## Current $\given{I0}e^{-t/\given{tau}}$ mA ($t$ in ms) flows from 0 to {T} ms. How much charge, in µC?

::: misses
- [I0*tau] That's the total for all time. Stop at {T} ms.
- [any] $\int_0^T I_0e^{-t/\tau}dt = I_0\tau(1 - e^{-T/\tau})$.
:::
:::

::: check
given: a = 1..5 int; b = 6..9 int
answer: (b^2 - a^2)/2
tolerance: 0.5%

## Evaluate $\int_{\given{a}}^{\given{b}} x\,dx$.

::: misses
- [b^2/2] Subtract the antiderivative's value at the lower limit too.
- [any] $[x^2/2]_a^b$.
:::
:::

::: check
given: k = 0.5 | 1; T = 1 | 2 | 3
answer: (exp(k*T) - 1)/k
tolerance: 0.5%

## Evaluate $\int_0^{\given{T}} e^{\given{k}t}\,dt$.

::: misses
- [exp(k*T)] Divide by {k}, and subtract the value at 0.
- [exp(k*T)/k] Subtract the antiderivative at 0, which is $1/k$.
- [any] $\int e^{kt}dt = e^{kt}/k$; evaluate between the limits.
:::
:::
:::
