20. Adv: rigorous ε–δ — proving the limit laws and the derivative rules

📖 Reading · 10 min
💡 Every code box below is live — edit it and hit Run.

§1.9 introduced the \varepsilon-\delta definition and practiced it on individual limits. Every limit law used casually since then — "the limit of a sum is the sum of the limits" (§1.1), the product rule (§2.3), and every other rule built on them — was assumed, not proven. This lesson proves the two foundational limit laws rigorously, then shows the derivative rules are direct, almost immediate consequences.

The sum law, proven

If \lim_{x\to a}f(x)=L and \lim_{x\to a}g(x)=M, then \lim_{x\to a}\big[f(x)+g(x)\big]=L+M.

Proof. Let \varepsilon>0 be given. Since f\to L, there is \delta_1>0 such that |f(x)-L|<\frac\varepsilon2 whenever 0<|x-a|<\delta_1. Since g\to M, there is \delta_2>0 such that |g(x)-M|<\frac\varepsilon2 whenever 0<|x-a|<\delta_2. Let \delta=\min(\delta_1,\delta_2). Then for 0<|x-a|<\delta, both conditions hold simultaneously, and by the triangle inequality:

\big|(f(x)+g(x))-(L+M)\big|=\big|(f(x)-L)+(g(x)-M)\big|\le|f(x)-L|+|g(x)-M|<\frac\varepsilon2+\frac\varepsilon2=\varepsilon

\blacksquare

The key trick, worth naming explicitly: split the target tolerance \varepsilon into two halves, one for each piece, then take the smaller of the two resulting \delta's so both halves' guarantees hold at once. This "split \varepsilon in half, take the minimum \delta" pattern reappears in essentially every limit-law proof.

The product law, proven

If \lim_{x\to a}f(x)=L and \lim_{x\to a}g(x)=M, then \lim_{x\to a}\big[f(x)g(x)\big]=LM.

Proof sketch. Write f(x)g(x)-LM=f(x)\big(g(x)-M\big)+M\big(f(x)-L\big) (add and subtract f(x)M — a standard algebraic trick). Since f\to L, f is bounded near a (choose \delta_0 so |f(x)-L|<1, forcing |f(x)|<|L|+1 throughout). Using this bound and the triangle inequality:

|f(x)g(x)-LM|\le|f(x)||g(x)-M|+|M||f(x)-L|<(|L|+1)|g(x)-M|+|M||f(x)-L|

Choosing \delta small enough (again splitting \varepsilon, this time weighted by the constants |L|+1 and |M| rather than evenly) makes both terms small, and their sum less than \varepsilon. \blacksquare

The boundedness step is the genuinely new ingredient beyond the sum law's proof — a convergent function can't blow up near the point it's converging at, and that fact is exactly what tames the extra factor of f(x) multiplying the g-error term.

The derivative rules, as direct consequences

§2.3's sum rule, (f+g)'=f'+g', follows immediately: the difference quotient of f+g is \frac{(f+g)(x+h)-(f+g)(x)}h=\frac{f(x+h)-f(x)}h+\frac{g(x+h)-g(x)}h, and taking h\to0 applies the limit sum law just proven, term by term.

§2.3's product rule takes slightly more work but follows the identical "add and subtract" trick from the product law's proof, applied to the difference quotient \frac{f(x+h)g(x+h)-f(x)g(x)}h=f(x+h)\frac{g(x+h)-g(x)}h+g(x)\frac{f(x+h)-f(x)}h, using continuity of f (itself a consequence of differentiability, §1.7) to handle the f(x+h)\to f(x) piece. Every derivative rule in Module 2 ultimately traces back to these two limit laws — nothing beyond \varepsilon-\delta and careful algebra was ever needed.

Doing it in Python

Constructing an explicit \delta for the sum law, for f(x)=x^2, g(x)=3x-1 at a=2, and confirming numerically that it genuinely keeps the sum within \varepsilon:

import random

def f(x): return x**2
def g(x): return 3*x - 1

a = 2
L, M = f(a), g(a)
epsilon = 0.1

# delta_f: restrict |x-2|<1 (so |x+2|<5), need 5|x-2| < eps/2
delta_f = min(1, (epsilon/2) / 5)
# delta_g: |3x-6| = 3|x-2| < eps/2
delta_g = (epsilon/2) / 3
delta = min(delta_f, delta_g)

print(f"delta_f = {delta_f}, delta_g = {delta_g}, delta = {delta}")

random.seed(0)
max_error = 0
for _ in range(5000):
    x = a + delta * (2*random.random() - 1)
    if x == a:
        continue
    error = abs((f(x) + g(x)) - (L + M))
    max_error = max(max_error, error)

print(f"max |sum - (L+M)| for |x-2| < delta: {max_error:.6f}  (should be < {epsilon})")

Confirming the product-law bound numerically — checking that f really is bounded near the point, as the proof's key step requires:

def f(x): return x**2   # converges to 4 at x=2

a, L = 2, 4
delta_0 = 1   # the radius where |f(x)-L| < 1 is guaranteed to hold

max_f_value = max(abs(f(a + t)) for t in [-delta_0, -delta_0/2, 0, delta_0/2, delta_0])
print(f"max |f(x)| for |x-2| <= {delta_0}: {max_f_value}")
print(f"bound |L|+1 = {abs(L)+1}: holds = {max_f_value <= abs(L)+1}")

Confirming the derivative sum rule directly from the limit sum law, using a difference quotient computed at shrinking h:

def f(x): return x**2
def g(x): return 3*x

def difference_quotient(func, x, h):
    return (func(x+h) - func(x)) / h

x = 2
for h in (0.1, 0.01, 0.001):
    dq_sum = difference_quotient(lambda t: f(t)+g(t), x, h)
    dq_f_plus_dq_g = difference_quotient(f, x, h) + difference_quotient(g, x, h)
    print(f"h={h}: DQ of (f+g) = {dq_sum:.6f}, DQ(f)+DQ(g) = {dq_f_plus_dq_g:.6f}")

Worked example

Given f(x)=x^2, g(x)=3x-1, a=2, and \varepsilon=0.1, construct an explicit \delta that proves \lim_{x\to2}[f(x)+g(x)]=9 via the sum law's proof.

L=f(2)=4, M=g(2)=5, target sum L+M=9.

Finding \delta_f (for |f(x)-L|<\frac\varepsilon2=0.05): factor |x^2-4|=|x-2||x+2|. Restrict attention to |x-2|<1 first, which forces 1<x<3, so |x+2|<5. Then |x^2-4|<5|x-2|, and requiring 5|x-2|<0.05 gives |x-2|<0.01.

\delta_f=\min(1,0.01)=0.01

Finding \delta_g (for |g(x)-M|<0.05): |(3x-1)-5|=|3x-6|=3|x-2|, so 3|x-2|<0.05\Rightarrow|x-2|<\frac{0.05}3\approx0.01667.

\delta_g\approx0.01667

Combine:

\boxed{\delta=\min(\delta_f,\delta_g)=\min(0.01,0.01667)=0.01}

Sanity check. Whenever 0<|x-2|<0.01, both individual bounds hold simultaneously (since 0.01\le\delta_f and 0.01\le\delta_g), so by the triangle inequality argument in the proof, |(f(x)+g(x))-9|<0.05+0.05=0.1=\varepsilon exactly as required. The "Doing it in Python" section confirmed this numerically — sampling thousands of x-values within \delta=0.01 of 2 and finding the worst-case error stayed comfortably under \varepsilon=0.1. ✓

Your turn

1. Using the sum-law proof pattern, explain in words why splitting \varepsilon into two equal halves (rather than, say, giving f \frac{3\varepsilon}4 and g only \frac\varepsilon4) is a valid choice — is the even split required by the proof, or just convenient?

2. For f(x)=x^2 at a=3 (so L=9), find a \delta (following the pattern in the concept section: restrict |x-3|<1 first) that guarantees |f(x)-9|<0.02.

3. True or false: the product law's proof needs f to be bounded specifically because an unbounded f could make the term f(x)(g(x)-M) arbitrarily large even while g(x)-M shrinks to zero.

Solutions

1. The even split is convenient, not required. Any split \varepsilon=\varepsilon_1+\varepsilon_2 with both \varepsilon_1,\varepsilon_2>0 works identically — find \delta_1 making |f-L|<\varepsilon_1, find \delta_2 making |g-M|<\varepsilon_2, take \delta=\min(\delta_1,\delta_2), and the triangle inequality gives |(f+g)-(L+M)|<\varepsilon_1+\varepsilon_2=\varepsilon regardless of how the split was chosen. The even split is simply the easiest choice to write down.

2. Restrict |x-3|<1 first, so 2<x<4, giving |x+3|<7. Then |x^2-9|=|x-3||x+3|<7|x-3|. Requiring 7|x-3|<0.02 gives |x-3|<\frac{0.02}7\approx0.00286.

\boxed{\delta=\min(1,0.00286)=0.00286}

3. True. If f could grow without bound as x\to a (which convergence to a finite L specifically rules out), then even a tiny error |g(x)-M| multiplied by an enormous |f(x)| could still produce a large product — exactly why the proof's first step is establishing f stays bounded (specifically |f(x)|<|L|+1) near a, before that boundedness is used to control the size of f(x)(g(x)-M).

Check yourself in code

For f(x)=x^2, g(x)=3x-1 at a=2 with \varepsilon=0.1, compute the \delta_f, \delta_g, and combined \delta from the sum law's proof.

Print exactly this:

delta_f = 0.01
delta_g = 0.016666666666666666
delta = 0.01
epsilon = 0.1

delta_f = min(1, (epsilon/2) / 5)
print("delta_f = ...")

delta_g = (epsilon/2) / 3
print("delta_g = ...")

delta = min(delta_f, delta_g)
print("delta = ...")
epsilon = 0.1

delta_f = min(1, (epsilon/2) / 5)
print(f"delta_f = {delta_f}")

delta_g = (epsilon/2) / 3
print(f"delta_g = {delta_g}")

delta = min(delta_f, delta_g)
print(f"delta = {delta}")

The limit sum law and product law, proven directly from §1.9's \varepsilon-\delta definition, both follow the "split the tolerance, take the minimum \delta" pattern, with the product law needing one extra ingredient — a convergent function is automatically bounded nearby, which tames the cross term that would otherwise let a small error blow up when multiplied by something unbounded. Every derivative rule from Module 2 is a direct consequence, since a derivative is itself a limit of a difference quotient, and the rules for combining derivatives fall straight out of the rules for combining limits.

Next: a stronger form of continuity — uniform continuity — where a single \delta must work for an entire interval at once, not just near one point.