---
title: The precise definition of a limit
heading: Any tolerance you ask for, I can meet
eyebrow: A5 · Lesson 7 · The precise definition
xp: 40
---

::: hook
An engineer asks: how accurately must I set the input so the output lands within 1 mV of target? That question, turned around and made exact, is the definition mathematicians use for a limit. "The limit of $f$ at $a$ is $L$" means: whatever tolerance $\varepsilon$ you demand on the output, there's a tolerance $\delta$ on the input that guarantees it. It's tolerance analysis, done for every possible tolerance at once.
:::

::: play
- The curve is $f(x) = x^2$ near $x = 2$, where it approaches 4. The horizontal band is $4 \pm \varepsilon$; the vertical band is $2 \pm \delta$.
- Shrink $\varepsilon$. Then find the largest $\delta$ that keeps the curve inside the horizontal band across the whole vertical band.
- Read the formula's suggested $\delta$ in the strip. Is it safe?
:::
:::

```sim plot
view: graph
x: x = 1..3
y: y = 1..9
slider: eps = 0.05..2 step 0.05 = 1
slider: d = 0.01..0.5 step 0.005 = 0.2
plot: x^2 | label: f(x) = x²
plot: 4 + eps | dashed | color: ch2 | label: 4 ± ε
plot: 4 - eps | dashed | color: ch2
marker: x = 2 - d
marker: x = 2 + d
readout: worst |f − 4| in the δ band = (2 + d)^2 - 4 | digits: 4
readout: safe δ, min(1, ε/5) = (eps/5 + 1 - abs(eps/5 - 1))/2 | digits: 4
```

::: predict
## For $f(x) = 3x + 1$ near $x = 2$ (where $f \to 7$), how close must $x$ be to 2 to guarantee $|f(x) - 7| < 0.03$?

- [ ] Within 0.03
- [x] Within 0.01
- [ ] Within 0.09
- [ ] Within 0.3

::: reveal
Within 0.01. $|f(x) - 7| = |3x - 6| = 3|x - 2|$, so the output error is three times the input error. Keeping it below 0.03 needs $|x - 2| < 0.01$. The steeper the function, the tighter the input tolerance has to be: here $\delta = \varepsilon/3$.
:::
:::

::: nameit
## The definition

$\displaystyle\lim_{x \to a} f(x) = L$ means:

> for every $\varepsilon > 0$ there is a $\delta > 0$ such that $0 < |x - a| < \delta$ implies $|f(x) - L| < \varepsilon$.

Read it as a game. Your opponent names a tolerance $\varepsilon$ on the output, as small as they like. You must answer with a tolerance $\delta$ on the input that guarantees it. If you can always answer, the limit is $L$. The $0 < |x - a|$ part says the value at $a$ itself never counts.

## Finding δ

**Linear functions.** For $f(x) = mx + b$, $|f(x) - f(a)| = |m||x - a|$, so $\delta = \varepsilon/|m|$ works.

**Nonlinear functions.** Bound the extra factor near the point. For $f(x) = x^2$ near $a$:

$$|x^2 - a^2| = |x - a|\,|x + a|$$

If we first insist $|x - a| < 1$, then $|x + a| \le 2|a| + 1$, so

$$\delta = \min\left(1,\ \frac{\varepsilon}{2|a| + 1}\right)$$

works for every $\varepsilon$. The "min" keeps both promises: close enough that the bound on $|x + a|$ holds, and close enough to meet the tolerance. Near $a = 2$ that's $\min(1, \varepsilon/5)$.

## Why bother

For most limits, the rules of lessons 3 and 5 give the answer faster. The definition matters because it's what those rules are proved from, and because it's the template for every "how precisely must the input be controlled" question in engineering: a calibrated instrument, an ADC's resolution, a tolerance stack-up. The sensitivity $|f'(a)|$ (coming in lesson 22) sets the ratio of output tolerance to input tolerance near a point.
:::

::: example
## Using the definition, find a δ that guarantees $|5x - 2 - 8| < 0.01$ near $x = 2$.

::: solution
1. **Simplify the error.**
   $$\begin{aligned} |5x - 2 - 8| &= |5x - 10| \\ &= 5|x - 2| \end{aligned}$$
2. **Solve for the distance from 2.** To make this less than 0.01, take
   $$\begin{aligned} |x - 2| &< \frac{0.01}{5} \\ &= 0.002 \end{aligned}$$

**Answer:** $\delta = 0.002$ works, and so does any smaller $\delta$.
:::
:::

::: example
## A sensor's output is $v = 0.1T^2$ volts near $T = 10$. How precisely must $T$ be controlled to keep $v$ within 0.05 V of its value at 10?

::: solution
1. **Factor the error.**
   $$|0.1T^2 - 10| = 0.1|T - 10||T + 10|$$
2. **Bound the second factor.** If $|T - 10| < 1$, then $|T + 10| < 21$, so the error is below $2.1|T - 10|$.
3. **Solve for 0.05 V.**
   $$\begin{aligned} |T - 10| &< \frac{0.05}{2.1} \\ &= 0.0238 \end{aligned}$$
4. **Pick $\delta$.**
   $$\begin{aligned} \delta &= \min(1, 0.0238) \\ &= 0.0238 \end{aligned}$$
   degrees works.
5. **Check against the slope.** Near $T = 10$ the slope is 2 V/°, so the tight answer is close to $0.05/2 = 0.025$; the bound gives a little less, which is still safe.

**Answer:** holding $T$ within 0.0238 degrees of 10 keeps $v$ within 0.05 V.
:::
:::

::: example
## Find a $\delta$ that keeps $|x^2 - 4| < 0.01$ whenever $|x - 2| < \delta$.

::: solution
1. **Factor.**
   $$|x^2 - 4| = |x - 2|\,|x + 2|$$
2. **Bound the second factor.** It depends on $x$, so first restrict to $|x - 2| < 1$, where $x$ is between 1 and 3 and $|x + 2| < 5$.
3. **Solve for the distance from 2.** Then $|x^2 - 4| < 5|x - 2|$, which is below 0.01 when
   $$|x - 2| < 0.002$$
4. **Pick $\delta$.**
   $$\begin{aligned} \delta &= \min(1, 0.002) \\ &= 0.002 \end{aligned}$$
   It isn't the largest possible $\delta$, but any $\delta$ that works is enough.

**Answer:** $\delta = 0.002$ works.
:::
:::

::: check
given: m = 2 | 4 | 5 | 10; eps = 0.01 | 0.05 | 0.1
answer: eps/m
tolerance: 0.5%

## For $f(x) = \given{m}x - 3$, what is the largest $\delta$ that guarantees $|f(x) - f(1)| < \given{eps}$ whenever $|x - 1| < \delta$?

::: right
Right. $|f(x) - f(1)| = \given{m}|x - 1|$, so $\delta = \varepsilon/\given{m}$ = {answer}.
:::

::: misses
- [eps] The output changes {m} times as fast as the input. Divide by {m}.
- [eps*m] The input tolerance has to be tighter, not looser: divide by the slope.
- [any] Not yet. Write $|f(x) - f(1)|$ in terms of $|x - 1|$.
:::
:::

::: check
given: a = 1 | 2 | 3; eps = 0.1 | 0.5
answer: eps/(2*a + 1)
tolerance: 0.5%

## For $f(x) = x^2$ near $a$ = {a}, using $\delta = \min\left(1, \frac{\varepsilon}{2|a| + 1}\right)$, what $\delta$ goes with $\varepsilon$ = {eps}?

::: right
Right. $\varepsilon/(2 \times \given{a} + 1)$ = {answer}, which is less than 1, so it's the minimum.
:::

::: misses
- [eps/(2*a)] Use $2|a| + 1$: the 1 comes from allowing $x$ to stray up to 1 from $a$.
- [1] That's the cap. With this small an $\varepsilon$, the other term is smaller.
- [any] Not yet. Compute $\varepsilon/(2|a| + 1)$ and compare it with 1.
:::
:::

::: check
kind: choice

## In "for every ε there is a δ", who picks first, and why does the order matter?

- [x] ε is picked first, and δ may depend on it; the limit must hold however small ε is
- [ ] δ is picked first, and then ε must work for it
- [ ] They're picked together, independently
- [ ] Neither: both are fixed by the function

::: right
Right. The challenger names the output tolerance first, and you answer with an input tolerance that may depend on it. A single δ that works for every ε would be a much stronger (and usually false) claim.
:::

::: misses
- [any] Read the definition again: "for every ε, there is a δ".
:::
:::

::: check
given: g = 10 | 50 | 100; tol = 1 | 5
answer: tol/g
unit: mV

## An amplifier with a gain of {g} must keep its output within ±{tol} mV of target. How precisely, in mV, must its input be held?

::: right
Right. The output error is {g} times the input error, so the input must be within $\pm\given{tol}/\given{g}$ mV.
:::

::: misses
- [tol*g] A gain makes the output error bigger, so the input tolerance must be smaller.
- [tol] Divide by the gain.
- [any] Not yet. Input tolerance = output tolerance ÷ gain.
:::
:::

::: check
kind: parts
given: k = 2 | 3; eps = 0.01 | 0.001

## Make $|\given{k}x^3 - \given{k}| < \varepsilon$ with $\varepsilon$ = {eps}, by choosing how close $x$ must be to 1.

::: part
answer: 7
tolerance: 0.5%

### $|x^3 - 1| = |x - 1|\,|x^2 + x + 1|$. If $|x - 1| < 1$, what is the largest $|x^2 + x + 1|$ can be?

::: misses
- [3] That's its value at $x = 1$. With $x$ up to 2, it's larger.
- [any] Put in the largest $x$ allowed, $x = 2$.
:::
:::

::: part
answer: eps/(7*k)
tolerance: 0.5%

### What $\delta$ does that bound give?

::: misses
- [eps/7] Include the factor {k}.
- [any] $\given{k} \cdot 7|x - 1| < \varepsilon$.
:::
:::

::: part
answer: (1 + eps/k)^(1/3) - 1
tolerance: 0.5%

### What is the largest $x - 1$ (above 1) that actually works? Solve $\given{k}(x^3 - 1) = \varepsilon$.

::: misses
- [any] $x = \sqrt[3]{1 + \varepsilon/\given{k}}$.
:::
:::
:::

::: check
kind: derivation
vars: a = 1..9, x = 0.5..12, eps = 0.001..0.1

## Find a $\delta$ that makes $|\sqrt{x} - \sqrt{a}| < \varepsilon$ whenever $|x - a| < \delta$.

::: step
answer: (x - a)/(sqrt(x) + sqrt(a))

### Rationalize: write $\sqrt{x} - \sqrt{a}$ as a fraction with $x - a$ on top.
:::

::: step
answer: eps*sqrt(a)

### The denominator is at least $\sqrt{a}$. What $\delta$ makes $|x - a|/\sqrt{a} < \varepsilon$?
:::

::: right
Right. $\delta = \varepsilon\sqrt{a}$ works for every $x \ge 0$.
:::
:::

::: explain
## Explain, using the ε–δ idea, why a steeper function needs a smaller δ for the same ε.

::: model
δ is how far the input may stray while keeping the output within ε of its limit. A steep function changes a lot for a small change in input, so it leaves the ε band after only a short distance; the input has to be held more tightly. Near a point, the output error is roughly the slope times the input error, so δ is roughly ε divided by the slope: double the steepness, halve the allowed δ.
:::
:::

::: practice

::: check
given: m = 3 | 8 | 20; eps = 0.03 | 0.2
answer: eps/m
tolerance: 0.5%

## For $f(x) = \given{m}x + 4$, what is the largest δ with $|f(x) - f(0)| < \given{eps}$ when $|x| < \delta$?

::: misses
- [eps] Divide by the slope.
- [any] $\delta = \varepsilon/|m|$.
:::
:::

::: check
given: a = 2 | 4; eps = 0.2 | 0.9
answer: eps/(2*a + 1)
tolerance: 0.5%

## For $x^2$ near {a}, what is $\min\left(1, \frac{\varepsilon}{2a + 1}\right)$ with $\varepsilon$ = {eps}?

::: misses
- [1] Compare: the other term is smaller.
- [any] Compute both and take the smaller.
:::
:::
:::
