TExcelTAD
Home › Calculus in Depth › The Precise Definition of a Limit

The Precise Definition of a Limit

"As close as we like" and "sufficiently close" are not mathematics until we say how close. The ε\varepsilon-δ\delta definition turns them into a precise challenge-and-response game, and it is the foundation on which every limit law and every derivative rule is proved.

The survey course sketches the idea at the end of Limits. Here we use it: writing proofs, finding δ\delta numerically, proving that a limit does not exist, and proving the product law.

The definition

Let ff be defined on an open interval around aa, except possibly at aa. Then

lim⁡x→af(x)=L\lim_{x \to a} f(x) = L

means: for every ε>0\varepsilon > 0 there is a δ>0\delta > 0 such that

0<∣x−a∣<δ  ⟹  ∣f(x)−L∣<ε0 < \lvert x - a \rvert < \delta \implies \lvert f(x) - L \rvert < \varepsilon

Read it as a game. A skeptic picks an output tolerance ε\varepsilon (a horizontal band L−ε<y<L+εL - \varepsilon < y < L + \varepsilon). You must answer with an input radius δ\delta (a vertical strip a−δ<x<a+δa - \delta < x < a + \delta, minus the point aa) such that the graph over the strip stays inside the band. The limit is LL if you can win for every ε\varepsilon, however small. δ\delta may depend on ε\varepsilon (and usually does); it must not depend on xx.

The condition 0<∣x−a∣0 < \lvert x - a \rvert excludes x=ax = a, which is why f(a)f(a) is irrelevant to the limit.

A linear example

Claim: lim⁡(4x−3)=5\lim (4x - 3) = 5 as x→2x \to 2.

Scratch work (find δ\delta): ∣f(x)−5∣=∣4x−8∣=4∣x−2∣\lvert f(x) - 5 \rvert = \lvert 4x - 8 \rvert = 4\lvert x - 2 \rvert. We want 4∣x−2∣<ε4\lvert x - 2 \rvert < \varepsilon, so ∣x−2∣<ε/4\lvert x - 2 \rvert < \varepsilon/4 suffices.

Proof. Given ε>0\varepsilon > 0, let δ=ε/4\delta = \varepsilon/4. If 0<∣x−2∣<δ0 < \lvert x - 2 \rvert < \delta, then ∣(4x−3)−5∣=4∣x−2∣<4δ=ε\lvert (4x - 3) - 5 \rvert = 4\lvert x - 2 \rvert < 4\delta = \varepsilon. ∎

For a linear function with slope m≠0m \ne 0, δ=ε/∣m∣\delta = \varepsilon/\lvert m \rvert always works and is the largest possible choice.

A quadratic example

Claim: lim⁡x2=9\lim x^2 = 9 as x→3x \to 3.

Scratch work: ∣x2−9∣=∣x−3∣⋅∣x+3∣\lvert x^2 - 9 \rvert = \lvert x - 3 \rvert \cdot \lvert x + 3 \rvert. The factor ∣x+3∣\lvert x + 3 \rvert is not constant, so first bound it. If we insist ∣x−3∣<1\lvert x - 3 \rvert < 1, then 2<x<42 < x < 4 and ∣x+3∣<7\lvert x + 3 \rvert < 7. Then ∣x2−9∣<7∣x−3∣\lvert x^2 - 9 \rvert < 7\lvert x - 3 \rvert, which is <ε< \varepsilon when ∣x−3∣<ε/7\lvert x - 3 \rvert < \varepsilon/7.

Proof. Given ε>0\varepsilon > 0, let δ=min⁡(1,ε/7)\delta = \min(1, \varepsilon/7). If 0<∣x−3∣<δ0 < \lvert x - 3 \rvert < \delta, then ∣x−3∣<1\lvert x - 3 \rvert < 1, so ∣x+3∣<7\lvert x + 3 \rvert < 7, and also ∣x−3∣<ε/7\lvert x - 3 \rvert < \varepsilon/7. Hence ∣x2−9∣<7⋅ε/7=ε\lvert x^2 - 9 \rvert < 7 \cdot \varepsilon/7 = \varepsilon. ∎

The min⁡(1,…)\min(1, \ldots) trick, bounding a nuisance factor on a fixed neighbourhood first, handles most polynomial and rational limits.

A numeric δ\delta-finder

The proof gives a δ\delta that works. A computer can search for the largest δ\delta that works (up to sampling), which is a good way to test your scratch work. The function below bisects on δ\delta: a candidate passes if ∣f(x)−L∣<ε\lvert f(x) - L \rvert < \varepsilon at many sample points in 0<∣x−a∣<δ0 < \lvert x - a \rvert < \delta.

python · try it yourself
import numpy as np

def works(f, a, L, eps, delta, n=20001):
    xs = a + delta * np.linspace(-1, 1, n)[1:-1]      # open interval
    xs = xs[xs != a]                                   # exclude x = a
    return bool(np.all(np.abs(f(xs) - L) < eps))

def find_delta(f, a, L, eps, hi=1.0, iters=50):
    lo = 0.0
    if works(f, a, L, eps, hi):
        return hi
    for _ in range(iters):                             # bisection
        mid = (lo + hi) / 2
        lo, hi = (mid, hi) if works(f, a, L, eps, mid) else (lo, mid)
    return lo

f = lambda x: x**2
for eps in [1.0, 0.1, 0.01, 0.001]:
    d = find_delta(f, 3, 9, eps)
    exact = min(np.sqrt(9 + eps) - 3, 3 - np.sqrt(9 - eps))
    print(f"eps={eps:<6} numeric delta={d:.6f}  exact={exact:.6f}  proof's min(1, eps/7)={min(1, eps/7):.6f}")
eps=1.0    numeric delta=0.162294  exact=0.162278  proof's min(1, eps/7)=0.142857
eps=0.1    numeric delta=0.016622  exact=0.016621  proof's min(1, eps/7)=0.014286
eps=0.01   numeric delta=0.001666  exact=0.001666  proof's min(1, eps/7)=0.001429
eps=0.001  numeric delta=0.000167  exact=0.000167  proof's min(1, eps/7)=0.000143

At ε=1\varepsilon = 1 the numeric δ\delta (0.1622940.162294) slightly overshoots the exact one (0.1622780.162278): no sample point falls in the thin sliver where the band is exceeded, the sampling caveat from the note below in action. The proof's δ\delta is always a little smaller than the best possible one, which is fine: the definition only asks for some δ\delta. Both shrink in proportion to ε\varepsilon, with ratio near 1/6=1/f′(3)1/6 = 1/f'(3), a hint of the derivative to come. The "exact" column comes from solving x2=9±εx^2 = 9 \pm \varepsilon; the closer side, 9+ε−3\sqrt{9 + \varepsilon} - 3, limits δ\delta.

Note: The numeric finder samples finitely many points, so it can be fooled by a function that misbehaves between samples. It tests a proof; it does not replace one.

Proving that a limit does not exist

Negate the definition: lim⁡f(x)≠L\lim f(x) \ne L means there is some ε>0\varepsilon > 0 such that every δ>0\delta > 0 admits an xx with 0<∣x−a∣<δ0 < \lvert x - a \rvert < \delta but ∣f(x)−L∣≥ε\lvert f(x) - L \rvert \ge \varepsilon.

Take the step function H(x)=0H(x) = 0 for x<0x < 0, H(x)=1H(x) = 1 for x≥0x \ge 0. Suppose lim⁡H(x)=L\lim H(x) = L at 00. Use ε=1/2\varepsilon = 1/2. For any δ\delta, the strip contains x1=−δ/2x_1 = -\delta/2 with H=0H = 0 and x2=δ/2x_2 = \delta/2 with H=1H = 1. Both must lie within 1/21/2 of LL, so 1=∣H(x2)−H(x1)∣≤∣1−L∣+∣L−0∣<1/2+1/2=11 = \lvert H(x_2) - H(x_1) \rvert \le \lvert 1 - L \rvert + \lvert L - 0 \rvert < 1/2 + 1/2 = 1, a contradiction. No LL works.

Proof of the product law

Assume f→Lf \to L and g→Mg \to M as x→ax \to a. Write

f(x)g(x)−LM=f(x)(g(x)−M)+M(f(x)−L)f(x)g(x) - LM = f(x)(g(x) - M) + M(f(x) - L)

Choose δ1\delta_1 so that ∣f(x)−L∣<1\lvert f(x) - L \rvert < 1 (hence ∣f(x)∣<∣L∣+1\lvert f(x) \rvert < \lvert L \rvert + 1) on 0<∣x−a∣<δ10 < \lvert x - a \rvert < \delta_1. Choose δ2\delta_2 so that ∣g(x)−M∣<ε/(2(∣L∣+1))\lvert g(x) - M \rvert < \varepsilon / (2(\lvert L \rvert + 1)), and δ3\delta_3 so that ∣f(x)−L∣<ε/(2(∣M∣+1))\lvert f(x) - L \rvert < \varepsilon / (2(\lvert M \rvert + 1)). With δ=min⁡(δ1,δ2,δ3)\delta = \min(\delta_1, \delta_2, \delta_3):

∣fg−LM∣≤∣f∣⋅∣g−M∣+∣M∣⋅∣f−L∣<(∣L∣+1)⋅ε2(∣L∣+1)+∣M∣⋅ε2(∣M∣+1)<ε/2+ε/2=ε■\begin{aligned} \lvert fg - LM \rvert &\le \lvert f \rvert \cdot \lvert g - M \rvert + \lvert M \rvert \cdot \lvert f - L \rvert \\ &< (\lvert L \rvert + 1) \cdot \frac{\varepsilon}{2(\lvert L \rvert + 1)} + \lvert M \rvert \cdot \frac{\varepsilon}{2(\lvert M \rvert + 1)} \\ &< \varepsilon/2 + \varepsilon/2 = \varepsilon && \blacksquare \end{aligned}

Other precise definitions

Statement Meaning
lim⁡f(x)=L\lim f(x) = L as x→a+x \to a^+ ∀ε>0 ∃δ>0: a<x<a+δ  ⟹  ∣f(x)−L∣<ε\forall \varepsilon > 0\ \exists \delta > 0{:}\ a < x < a + \delta \implies \lvert f(x) - L \rvert < \varepsilon
lim⁡f(x)=L\lim f(x) = L as x→a−x \to a^- ∀ε>0 ∃δ>0: a−δ<x<a  ⟹  ∣f(x)−L∣<ε\forall \varepsilon > 0\ \exists \delta > 0{:}\ a - \delta < x < a \implies \lvert f(x) - L \rvert < \varepsilon
lim⁡f(x)=∞\lim f(x) = \infty as x→ax \to a ∀M>0 ∃δ>0: 0<∣x−a∣<δ  ⟹  f(x)>M\forall M > 0\ \exists \delta > 0{:}\ 0 < \lvert x - a \rvert < \delta \implies f(x) > M
lim⁡f(x)=−∞\lim f(x) = -\infty as x→ax \to a ∀N<0 ∃δ>0: 0<∣x−a∣<δ  ⟹  f(x)<N\forall N < 0\ \exists \delta > 0{:}\ 0 < \lvert x - a \rvert < \delta \implies f(x) < N

For example, 1/x2→∞1/x^2 \to \infty at 00: given MM, take δ=1/M\delta = 1/\sqrt{M}; then 0<∣x∣<δ0 < \lvert x \rvert < \delta gives x2<1/Mx^2 < 1/M, so 1/x2>M1/x^2 > M.

In software

  • Tolerances are ε\varepsilon's. A test like assert abs(result − expected) < 1e-9 is an ε\varepsilon-band. Choosing how precise the inputs (or the step size hh, or the number of iterations) must be to pass it is choosing a δ\delta.
  • Error propagation. "How accurately must I measure xx so that f(x)f(x) is accurate to ε\varepsilon?" is the δ\delta question. For smooth ff, δ≈ε/∣f′(a)∣\delta \approx \varepsilon/\lvert f'(a) \rvert, which is exactly the ratio seen in the table above; it is the basis of sensitivity analysis and condition numbers in numerical code.
  • Quantifier order (∀ε ∃δ\forall \varepsilon\ \exists \delta) is the same distinction programmers meet between "for every input there is a valid output" and "there is one output valid for every input". Swapping the order changes the meaning completely.

Exercises

Exercise 1: Linear δ\delta

Prove lim⁡(7−2x)=1\lim (7 - 2x) = 1 as x→3x \to 3. What δ\delta works for ε=0.01\varepsilon = 0.01?

Answer

δ=ε/2\delta = \varepsilon/2; for ε=0.01\varepsilon = 0.01, δ=0.005\delta = 0.005.

Solution
∣(7−2x)−1∣=∣6−2x∣=2∣x−3∣given ε>0, let δ=ε/20<∣x−3∣<δ  ⟹  2∣x−3∣<2δ=ε■ε=0.01 ⇒ δ=0.005\begin{aligned} &\lvert (7 - 2x) - 1 \rvert = \lvert 6 - 2x \rvert = 2\lvert x - 3 \rvert \\ &\text{given } \varepsilon > 0, \text{ let } \delta = \varepsilon/2 \\ &0 < \lvert x - 3 \rvert < \delta \implies 2\lvert x - 3 \rvert < 2\delta = \varepsilon && \blacksquare \\ &\varepsilon = 0.01 \ \Rightarrow\ \delta = 0.005 \end{aligned}

Exercise 2: Quadratic δ\delta

Prove lim⁡(x2+x)=6\lim (x^2 + x) = 6 as x→2x \to 2 using the min⁡(1,…)\min(1, \ldots) trick.

Answer

δ=min⁡(1,ε/6)\delta = \min(1, \varepsilon/6) works.

Solution
x2+x−6=(x−2)(x+3)if ∣x−2∣<1 then 1<x<3, so ∣x+3∣<6take δ=min⁡(1,ε/6); then ∣x2+x−6∣<6⋅ε/6=ε■\begin{aligned} &x^2 + x - 6 = (x - 2)(x + 3) \\ &\text{if } \lvert x - 2 \rvert < 1 \text{ then } 1 < x < 3, \text{ so } \lvert x + 3 \rvert < 6 \\ &\text{take } \delta = \min(1, \varepsilon/6); \text{ then } \lvert x^2 + x - 6 \rvert < 6 \cdot \varepsilon/6 = \varepsilon && \blacksquare \end{aligned}

Exercise 3: Infinite limit

Prove lim⁡1/(x−4)2=∞\lim 1/(x - 4)^2 = \infty as x→4x \to 4. Which δ\delta works for M=10 000M = 10\,000?

Answer

δ=1/M\delta = 1/\sqrt{M}; for M=10 000M = 10\,000, δ=0.01\delta = 0.01.

Solution
1/(x−4)2>M  ⟺  (x−4)2<1/M  ⟺  ∣x−4∣<1/Mgiven M>0 let δ=1/M; then 0<∣x−4∣<δ  ⟹  1/(x−4)2>M■\begin{aligned} &1/(x - 4)^2 > M \iff (x - 4)^2 < 1/M \iff \lvert x - 4 \rvert < 1/\sqrt{M} \\ &\text{given } M > 0 \text{ let } \delta = 1/\sqrt{M}; \text{ then } 0 < \lvert x - 4 \rvert < \delta \implies 1/(x - 4)^2 > M && \blacksquare \end{aligned}

Exercise 4: Test your δ\delta numerically

Use the δ\delta-finder idea to compare the best δ\delta for lim⁡x=2\lim \sqrt{x} = 2 as x→4x \to 4 with ε=0.1\varepsilon = 0.1 against the guess δ=2ε\delta = 2\varepsilon. (Hint: ∣x−2∣=∣x−4∣/(x+2)≤∣x−4∣/2\lvert \sqrt{x} - 2 \rvert = \lvert x - 4 \rvert/(\sqrt{x} + 2) \le \lvert x - 4 \rvert/2.)

Answer

The best δ\delta is 0.390.39 (set by the left side, 4−1.92=0.394 - 1.9^2 = 0.39); the proof's δ=2ε=0.2\delta = 2\varepsilon = 0.2 is smaller, so it works.

Solution

The exact best δ\delta comes from solving x=2±0.1\sqrt{x} = 2 \pm 0.1: x=3.61x = 3.61 or x=4.41x = 4.41, distances 0.390.39 and 0.410.41, so the best δ\delta is 0.390.39.

python · try it yourself
import numpy as np

def works(f, a, L, eps, delta, n=20001):
    xs = a + delta * np.linspace(-1, 1, n)[1:-1]
    return bool(np.all(np.abs(f(xs[xs != a]) - L) < eps))

lo, hi = 0.0, 1.0
for _ in range(50):
    mid = (lo + hi) / 2
    lo, hi = (mid, hi) if works(np.sqrt, 4, 2, 0.1, mid) else (lo, mid)
print(f"best delta ≈ {lo:.4f}, proof delta = {2 * 0.1:.4f}")
best delta ≈ 0.3900, proof delta = 0.2000

Test yourself

In the ε\varepsilon-δ\delta definition, which quantity may depend on which?

  1. ε\varepsilon may depend on δ\delta
  2. δ\delta may depend on ε\varepsilon (and on aa), but not on xx
  3. δ\delta may depend on xx
  4. Neither may depend on anything

For lim⁡5x=10\lim 5x = 10 as x→2x \to 2, which δ\delta works for every ε>0\varepsilon > 0?

  1. δ=5ε\delta = 5\varepsilon
  2. δ=ε+5\delta = \varepsilon + 5
  3. δ=ε/5\delta = \varepsilon/5
  4. δ=1\delta = 1

To show lim⁡f(x)≠L\lim f(x) \ne L, what must you exhibit?

  1. One ε>0\varepsilon > 0 such that every δ>0\delta > 0 admits an xx within δ\delta of aa with ∣f(x)−L∣≥ε\lvert f(x) - L \rvert \ge \varepsilon
  2. One δ\delta that fails for every ε\varepsilon
  3. A single xx with f(x)≠Lf(x) \ne L
  4. That f(a)≠Lf(a) \ne L