TExcelTAD
Home › Calculus in Depth › Proofs of Theorems

Proofs of Theorems

This appendix lesson proves a few theorems that the rest of the course uses constantly: the Squeeze Theorem, the limit sin⁡θ/θ→1\sin\theta / \theta \to 1, the Chain Rule (in the careful form that survives Δu=0\Delta u = 0) and a sketch of Clairaut's Theorem on mixed partial derivatives. Each proof is followed by a numerical or symbolic sanity check, because a check never replaces a proof but often catches a misread statement.

How to read a limit proof

Every proof below uses the precise definition from The Precise Definition of a Limit:

lim⁡x→af(x)=Lmeans: for every ε>0 there is a δ>0 such that0<∣x−a∣<δ  ⟹  ∣f(x)−L∣<ε\begin{aligned} \lim_{x \to a} f(x) = L \quad \text{means: } &\text{for every } \varepsilon > 0 \text{ there is a } \delta > 0 \text{ such that} \\ &0 < \lvert x - a \rvert < \delta \implies \lvert f(x) - L \rvert < \varepsilon \end{aligned}

The pattern is always the same: someone hands you an ε\varepsilon, and you must produce a δ\delta that works. The tools are the inequality rules and the triangle inequality from Numbers, Inequalities and Absolute Values.

Theorem 1: the Squeeze Theorem

Statement. If g(x)≤f(x)≤h(x)g(x) \le f(x) \le h(x) for all x≠ax \ne a near aa, and lim⁡g=lim⁡h=L\lim g = \lim h = L as x→ax \to a, then lim⁡f=L\lim f = L.

Proof. Let ε>0\varepsilon > 0. Because g→Lg \to L, there is δ1\delta_1 with L−ε<g(x)<L+εL - \varepsilon < g(x) < L + \varepsilon whenever 0<∣x−a∣<δ10 < \lvert x - a \rvert < \delta_1. Because h→Lh \to L, there is δ2\delta_2 with L−ε<h(x)<L+εL - \varepsilon < h(x) < L + \varepsilon whenever 0<∣x−a∣<δ20 < \lvert x - a \rvert < \delta_2. The inequality g≤f≤hg \le f \le h holds for 0<∣x−a∣<δ30 < \lvert x - a \rvert < \delta_3. Take δ=min⁡(δ1,δ2,δ3)\delta = \min(\delta_1, \delta_2, \delta_3). For 0<∣x−a∣<δ0 < \lvert x - a \rvert < \delta all three facts hold, so

L−ε<g(x)≤f(x)≤h(x)<L+ε,i.e.∣f(x)−L∣<ε.■L - \varepsilon < g(x) \le f(x) \le h(x) < L + \varepsilon, \quad \text{i.e.} \quad \lvert f(x) - L \rvert < \varepsilon. \qquad \blacksquare

Theorem 2: sin⁡θ/θ→1\sin \theta / \theta \to 1

Statement. lim⁡θ→0sin⁡θθ=1\lim_{\theta \to 0} \frac{\sin\theta}{\theta} = 1 (θ\theta in radians).

Proof. Take 0<θ<π/20 < \theta < \pi/2 and the unit circle with O=(0,0)O = (0, 0), A=(1,0)A = (1, 0), P=(cos⁡θ,sin⁡θ)P = (\cos\theta, \sin\theta), and T=(1,tan⁡θ)T = (1, \tan\theta) where the line OPOP meets the tangent line x=1x = 1. Compare three areas:

triangle OAP⊂sector OAP⊂triangle OAT12⋅sin⁡θ≤12⋅θ≤12⋅tan⁡θ\begin{array}{ccccc} \text{triangle } OAP & \subset & \text{sector } OAP & \subset & \text{triangle } OAT \\ \tfrac{1}{2} \cdot \sin\theta & \le & \tfrac{1}{2} \cdot \theta & \le & \tfrac{1}{2} \cdot \tan\theta \end{array}

(The sector area 12r2θ\frac{1}{2}r^2\theta is where radians enter.) Divide by 12sin⁡θ>0\frac{1}{2}\sin\theta > 0 and take reciprocals, which flips the inequalities:

1≤θsin⁡θ≤1cos⁡θ  ⟹  cos⁡θ≤sin⁡θθ≤11 \le \frac{\theta}{\sin\theta} \le \frac{1}{\cos\theta} \qquad \implies \qquad \cos\theta \le \frac{\sin\theta}{\theta} \le 1

Both sides are even functions of θ\theta, so the same holds for −π/2<θ<0-\pi/2 < \theta < 0. As θ→0\theta \to 0, cos⁡θ→1\cos\theta \to 1, and the Squeeze Theorem gives the limit 1. ∎

This limit is exactly what makes (sin⁡x)′=cos⁡x(\sin x)' = \cos x; see Derivatives of Trigonometric Functions.

python · try it yourself
import math

print(f"{'theta':>8} {'cos':>12} {'sin/theta':>12}  squeezed?")
for theta in [0.5, 0.1, 0.01, -0.01, 0.001]:
    ratio = math.sin(theta) / theta
    print(f"{theta:8} {math.cos(theta):12.9f} {ratio:12.9f}  {math.cos(theta) <= ratio <= 1}")
deg = math.radians(1)
print("in degrees, sin(x°)/x ->", round(math.sin(deg) / 1, 6), "= pi/180 =", round(math.pi / 180, 6))
   theta          cos    sin/theta  squeezed?
     0.5  0.877582562  0.958851077  True
     0.1  0.995004165  0.998334166  True
    0.01  0.999950000  0.999983333  True
   -0.01  0.999950000  0.999983333  True
   0.001  0.999999500  0.999999833  True
in degrees, sin(x°)/x -> 0.017452 = pi/180 = 0.017453

The last line shows why calculus uses radians: in degrees the limit is π/180\pi/180, not 1.

Theorem 3: the Chain Rule

Statement. If gg is differentiable at aa and ff is differentiable at b=g(a)b = g(a), then F=f∘gF = f \circ g is differentiable at aa and F′(a)=f′(b)⋅g′(a)F'(a) = f'(b) \cdot g'(a).

The tempting proof and its gap. Write Δu=g(a+Δx)−g(a)\Delta u = g(a + \Delta x) - g(a) and Δy=f(b+Δu)−f(b)\Delta y = f(b + \Delta u) - f(b). It is tempting to write ΔyΔx=ΔyΔu⋅ΔuΔx\frac{\Delta y}{\Delta x} = \frac{\Delta y}{\Delta u} \cdot \frac{\Delta u}{\Delta x}, but Δu\Delta u can be 0 for nonzero Δx\Delta x (even for infinitely many Δx\Delta x near 0, as with g(x)=x2sin⁡(1/x)g(x) = x^2 \sin(1/x)), and then Δy/Δu\Delta y/\Delta u is meaningless.

The careful proof. Define the error of the difference quotient of ff:

ε(Δu)=f(b+Δu)−f(b)Δu−f′(b)for Δu≠0,ε(0)=0\varepsilon(\Delta u) = \frac{f(b + \Delta u) - f(b)}{\Delta u} - f'(b) \quad \text{for } \Delta u \ne 0, \qquad \varepsilon(0) = 0

Since ff is differentiable at bb, ε(Δu)→0\varepsilon(\Delta u) \to 0 as Δu→0\Delta u \to 0, so ε\varepsilon is continuous at 0. The definition was chosen so that

Δy=(f′(b)+ε(Δu))⋅Δufor EVERY Δu, including Δu=0 (both sides are 0)\Delta y = (f'(b) + \varepsilon(\Delta u)) \cdot \Delta u \qquad \text{for EVERY } \Delta u, \text{ including } \Delta u = 0 \text{ (both sides are 0)}

Now divide by Δx≠0\Delta x \ne 0:

ΔyΔx=(f′(b)+ε(Δu))⋅ΔuΔx\frac{\Delta y}{\Delta x} = (f'(b) + \varepsilon(\Delta u)) \cdot \frac{\Delta u}{\Delta x}

As Δx→0\Delta x \to 0: Δu/Δx→g′(a)\Delta u/\Delta x \to g'(a); Δu→0\Delta u \to 0 because a differentiable gg is continuous; therefore ε(Δu)→ε(0)=0\varepsilon(\Delta u) \to \varepsilon(0) = 0. The limit of the right side is f′(b)⋅g′(a)f'(b) \cdot g'(a). ∎

python · try it yourself
import sympy as sp

x = sp.symbols('x')
g = x**3 + 2*x
f = lambda u: sp.exp(sp.sin(u))
F = f(g)
by_rule = sp.exp(sp.sin(g)) * sp.cos(g) * sp.diff(g, x)      # f'(g(x)) * g'(x)
print("difference:", sp.simplify(sp.diff(F, x) - by_rule))

a, h = 0.7, 1e-6
Fn = sp.lambdify(x, F)
print("central difference:", round((Fn(a + h) - Fn(a - h)) / (2 * h), 6))
print("chain rule        :", round(float(by_rule.subs(x, a)), 6))
difference: 0
central difference: -1.592555
chain rule        : -1.592555

The gentle introduction is The Chain Rule; the full lesson is The Chain Rule.

Theorem 4: Clairaut's Theorem (sketch)

Statement. If fxyf_{xy} and fyxf_{yx} are both continuous on a disc around (a,b)(a, b), then fxy(a,b)=fyx(a,b)f_{xy}(a, b) = f_{yx}(a, b).

Sketch. Look at the "mixed second difference"

Δ(h,k)=f(a+h,b+k)−f(a+h,b)−f(a,b+k)+f(a,b)\Delta(h, k) = f(a+h, b+k) - f(a+h, b) - f(a, b+k) + f(a, b)

Group it as G(a+h)−G(a)G(a + h) - G(a) with G(x)=f(x,b+k)−f(x,b)G(x) = f(x, b + k) - f(x, b). The Mean Value Theorem gives a cc between aa and a+ha + h with Δ=h⋅G′(c)=h⋅[fx(c,b+k)−fx(c,b)]\Delta = h \cdot G'(c) = h \cdot [f_x(c, b + k) - f_x(c, b)]. Apply the MVT again, now in yy, to fx(c,⋅)f_x(c, \cdot): Δ=hk⋅fxy(c,d)\Delta = hk \cdot f_{xy}(c, d) for some dd between bb and b+kb + k. Grouping the four terms the other way (yy first) gives Δ=hk⋅fyx(c′,d′)\Delta = hk \cdot f_{yx}(c', d'). So fxy(c,d)=fyx(c′,d′)f_{xy}(c, d) = f_{yx}(c', d'), and letting h,k→0h, k \to 0, both points tend to (a,b)(a, b); continuity finishes it. ∎

The continuity hypothesis is needed. The classic counterexample f=xy(x2−y2)x2+y2f = \frac{xy(x^2 - y^2)}{x^2 + y^2}, f(0,0)=0f(0, 0) = 0, has fxy(0,0)=−1f_{xy}(0, 0) = -1 but fyx(0,0)=1f_{yx}(0, 0) = 1. You can see it numerically from the definitions, using fx(0,y)=−yf_x(0, y) = -y and fy(x,0)=xf_y(x, 0) = x:

python · try it yourself
def f(x, y):
    return 0.0 if x == y == 0 else x * y * (x*x - y*y) / (x*x + y*y)

def fx(x, y, h=1e-7):
    return (f(x + h, y) - f(x - h, y)) / (2 * h)

def fy(x, y, h=1e-7):
    return (f(x, y + h) - f(x, y - h)) / (2 * h)

k = 1e-3
print("f_xy(0,0) ≈ d/dy f_x =", round((fx(0, k) - fx(0, -k)) / (2 * k), 4))
print("f_yx(0,0) ≈ d/dx f_y =", round((fy(k, 0) - fy(-k, 0)) / (2 * k), 4))
f_xy(0,0) ≈ d/dy f_x = -1.0
f_yx(0,0) ≈ d/dx f_y = 1.0

Mixed partials are covered in Partial Derivatives.

In software

Proofs explain why tools work. The careful chain-rule proof is exactly what automatic differentiation implements: local derivatives multiplied along a computation graph, with no division by Δu\Delta u. Clairaut's theorem is why a Hessian matrix is symmetric, so optimizers store only half of it. The sin⁡θ/θ\sin\theta / \theta limit appears in code as the sinc function, which libraries special-case at 0 to avoid 0/00/0.

Exercises

Exercise 1: Squeeze

Prove that lim⁡x→0x2⋅cos⁡(1/x)=0\lim_{x \to 0} x^2 \cdot \cos(1/x) = 0.

Answer

The limit is 0, by squeezing between −x2-x^2 and x2x^2.

Solution
−1≤cos⁡(1/x)≤1  ⟹  −x2≤x2cos⁡(1/x)≤x2(x≠0, since x2≥0)lim⁡(−x2)=lim⁡x2=0  ⟹  the middle tends to 0 by the Squeeze Theorem\begin{aligned} &-1 \le \cos(1/x) \le 1 \implies -x^2 \le x^2 \cos(1/x) \le x^2 && (x \ne 0,\ \text{since } x^2 \ge 0) \\ &\lim (-x^2) = \lim x^2 = 0 \implies \text{the middle tends to 0 by the Squeeze Theorem} \end{aligned}

Exercise 2: Use the sine limit

Find lim⁡θ→0sin⁡(5θ)3θ\lim_{\theta \to 0} \frac{\sin(5\theta)}{3\theta} and lim⁡θ→01−cos⁡θθ\lim_{\theta \to 0} \frac{1 - \cos\theta}{\theta}.

Answer

53\frac{5}{3} and 0.

Solution
sin⁡(5θ)3θ=53⋅sin⁡(5θ)5θ→53⋅11−cos⁡θθ=1−cos⁡2θθ(1+cos⁡θ)=sin⁡θθ⋅sin⁡θ1+cos⁡θ→1⋅02=0\begin{aligned} \frac{\sin(5\theta)}{3\theta} &= \frac{5}{3} \cdot \frac{\sin(5\theta)}{5\theta} \to \frac{5}{3} \cdot 1 \\ \frac{1 - \cos\theta}{\theta} &= \frac{1 - \cos^2\theta}{\theta(1 + \cos\theta)} = \frac{\sin\theta}{\theta} \cdot \frac{\sin\theta}{1 + \cos\theta} \to 1 \cdot \frac{0}{2} = 0 \end{aligned}

Exercise 3: A δ\delta for the squeeze

For f(x)=x2cos⁡(1/x)f(x) = x^2 \cos(1/x) and ε=10−4\varepsilon = 10^{-4}, give a δ\delta that guarantees ∣f(x)∣<ε\lvert f(x) \rvert < \varepsilon, and test it in code on random xx.

Answer

δ=ε=0.01\delta = \sqrt{\varepsilon} = 0.01 works, since ∣f(x)∣≤x2<δ2=ε\lvert f(x) \rvert \le x^2 < \delta^2 = \varepsilon.

Solution
python · try it yourself
import numpy as np

eps = 1e-4
delta = eps ** 0.5
x = np.random.default_rng(3).uniform(-delta, delta, 100_000)
x = x[x != 0]
print(delta, bool(np.all(np.abs(x**2 * np.cos(1 / x)) < eps)))
0.01 True

Exercise 4: Clairaut on a smooth function

Check with SymPy that fxy=fyxf_{xy} = f_{yx} for f(x,y)=x3⋅e2y+sin⁡(xy)f(x, y) = x^3 \cdot e^{2y} + \sin(xy).

Answer

Both equal 6x2e2y+cos⁡(xy)−xy⋅sin⁡(xy)6x^2e^{2y} + \cos(xy) - xy \cdot \sin(xy).

Solution

fx=3x2e2y+ycos⁡(xy)f_x = 3x^2e^{2y} + y\cos(xy); differentiate in yy: 6x2e2y+cos⁡(xy)−xysin⁡(xy)6x^2e^{2y} + \cos(xy) - xy\sin(xy). The other order gives the same, as Clairaut predicts for this smooth ff.

python · try it yourself
import sympy as sp
x, y = sp.symbols('x y')
f = x**3 * sp.exp(2*y) + sp.sin(x*y)
fxy, fyx = sp.diff(f, x, y), sp.diff(f, y, x)
print(fxy)
print(sp.simplify(fxy - fyx))
6*x**2*exp(2*y) - x*y*sin(x*y) + cos(x*y)
0

Test yourself

In the proof that sin⁡θ/θ→1\sin\theta/\theta \to 1, which inequality is squeezed?

  1. sin⁡θ≤θ≤1\sin\theta \le \theta \le 1
  2. 0≤sin⁡θ/θ≤θ0 \le \sin\theta/\theta \le \theta
  3. cos⁡θ≤sin⁡θ/θ≤1\cos\theta \le \sin\theta/\theta \le 1
  4. 1≤sin⁡θ/θ≤tan⁡θ1 \le \sin\theta/\theta \le \tan\theta

Why does the naive chain-rule proof ΔyΔx=ΔyΔu⋅ΔuΔx\frac{\Delta y}{\Delta x} = \frac{\Delta y}{\Delta u} \cdot \frac{\Delta u}{\Delta x} fail?

  1. Δx\Delta x might be negative
  2. Δu\Delta u can be 0 for nonzero Δx\Delta x
  3. ff might not be continuous
  4. The product of limits does not exist

Which hypothesis does Clairaut's Theorem need?

  1. ff is a polynomial
  2. ff is bounded
  3. f(0,0)=0f(0, 0) = 0
  4. fxyf_{xy} and fyxf_{yx} are continuous near the point