Learning Objectives
By the end of this section, you will be able to:
- State the Squeeze Theorem and explain why it works from the definition of a limit.
- Recognise when a function is a candidate for the squeeze — oscillations, signed chaos, or products of bounded and vanishing pieces.
- Construct two bounding functions g(x) and h(x) that trap a wild function and both converge to the same value.
- Prove and — the two flagship examples.
- Verify the squeeze numerically in Python and use PyTorch to see what does — and does not — transfer to the derivative.
The Problem: A Function Too Wild to Evaluate
"Some functions are so chaotic near a point that you cannot compute their limit directly. The squeeze theorem is the detective tool — you never touch the wild function itself; you trap it."
Consider . As the inner quantity explodes, and oscillates between and infinitely many times in any neighbourhood of 0. Plugging in is illegal (division by zero). All of our earlier tricks — factoring, limit laws, substitution — fail, because has no limit at 0.
The key observation
We don't actually need to know what is doing. We only know it stays between and . Multiply by and we get a trap:
Both bounds go to 0. The function is pinned between them. It has no choice.
Intuition: Sandwiched Between Two Bounds
Imagine three people walking along a number line — Low, Middle, and High — with these rules:
- Low and High are always moving so that .
- As , Low and High both arrive at the same destination L.
Middle has absolutely no freedom: it is penned in between two walls that are converging on the same point. By the end it must also be standing at L. It does not matter how wildly Middle zigzagged along the way — the only escape would be to cross one of the walls, and the rules forbid that.
Why this works from ε–δ
Given any , pick δ so small that both Low and High are within of L. Any x inside this δ-window forces Middle into an interval — which is exactly what the ε–δ definition of a limit demands. The squeeze theorem is not magic; it is a direct, tiny corollary of the ε–δ definition from Section 2.5.
The Squeeze Theorem
Squeeze Theorem
Suppose for every x in some open interval containing (possibly except at itself). If
then exists and equals .
| Ingredient | What it means | Where we get it |
|---|---|---|
| g(x) ≤ f(x) ≤ h(x) | Two bounds trap f on some interval near c. | Produced by hand — usually from known inequalities like |sin| ≤ 1. |
| limit of g = limit of h = L | Both walls march to the same destination. | Proved with earlier limit laws or direct computation. |
| limit of f = L | f is forced to land at L too. | The conclusion — no independent calculation needed. |
You never evaluate the wild function
This is the whole point. The theorem's power is that can be arbitrarily badly behaved — oscillate, jitter, switch sign infinitely often — and we still nail its limit just by finding two polite functions that sandwich it.
Interactive: Watch the Squeeze Collapse
The picture is worth a thousand proofs. Pick a preset, then drag the Zoom window slider toward 0. The rose and emerald curves represent the lower and upper bounds. Watch how the blue trapped curve has no choice but to collapse onto the meeting point.
Try the following experiment loop:
- Start with x² sin(1/x) at wide zoom. Notice the blue curve oscillates so fast it looks like a filled region.
- Shrink the zoom window. The rose and emerald envelopes pinch toward (0, 0). The blue curve's amplitude has to shrink with them.
- Switch to x² cos(50/x). Even this far more violent oscillator is helpless — the envelope wins.
- Switch to x · sin(1/x). The bounds are now ±|x|, linear instead of quadratic. The squeeze still works, but the convergence is slower.
- Switch to Smooth squeeze at x = 1. The bounds here are smooth polynomials, and the meeting point is (1, 2). Same theorem, different shape.
The Strategy for Using It
Almost every squeeze-theorem argument follows the same three moves. When you see a problem, recognise these patterns and you are done:
- Identify the bounded piece. Usually something like , , or a fractional part — a quantity you know lives in a fixed interval like or .
- Multiply by the vanishing piece. The bounded piece is multiplied by a factor that goes to 0 (or to some other tame limit). The product cannot grow beyond the bounded interval times the vanishing factor.
- Write the inequality and take limits. Both envelope limits are tame; compute them with the limit laws. The trapped function is done for.
| Pattern | Bounded piece | Vanishing piece | Envelope |
|---|---|---|---|
| x² sin(1/x) | sin(1/x) ∈ [−1, 1] | x² → 0 | [−x², x²] |
| x cos(1/x³) | cos(1/x³) ∈ [−1, 1] | x → 0 | [−|x|, |x|] |
| (sin x) / x | sin x (but normalised) | — (special) | [cos x, 1] near 0 |
| e^{-1/x²} · sin(1/x) | sin(1/x) | e^{-1/x²} → 0 fast | [−e^{-1/x²}, +e^{-1/x²}] |
Worked Example: lim x² sin(1/x) = 0
Let's prove step by step, the way you would on an exam.
📝 Step-by-step numerical walkthrough — try it yourself first
Step 1 — Find a bound you know cold. The sine function never escapes , whatever its argument. So for every ,
Step 2 — Multiply by a non-negative vanishing factor. is always ≥ 0, so multiplying preserves the direction of the inequalities:
Why x² (and not x)?
If we had multiplied by instead, we would have to split into cases and because multiplying an inequality by a negative number flips it. is non-negative on both sides of 0 — life is easier.
Step 3 — Take limits of the bounds. and . Both envelopes march to the same destination.
Step 4 — Invoke the theorem. Since and both outer expressions have limit 0,
Step 5 — Plug in a number to feel it. At :
The middle value lives comfortably between the two envelopes, and both envelopes are already under . Shrink x by another factor of 10 and everything shrinks by 100 — the squeeze is a converging vice.
The Most Famous Squeeze: sin x / x → 1
No limit in calculus is more pivotal than
It is the reason , and it shows up whenever you linearise a rotation, compute a Fourier integral, or take a derivative of any trigonometric function. Plugging in gives the indeterminate form — so we need a trick. The squeeze theorem, combined with a geometric insight, seals the deal.
Why sin x ≤ x ≤ tan x — The Geometric Argument
Draw a unit circle. Pick an angle . Look at three regions:
- The rose triangle with vertices O, , Q = (1, 0). Its area is .
- The violet circular sector from Q to P, with area (the unit-circle sector formula).
- The emerald triangle with vertices O, Q, . Its area is .
The rose triangle is inside the violet sector, and the violet sector is inside the emerald triangle. Comparing areas gives
Divide by and flip reciprocals (carefully — flipping reverses the inequality direction):
Both outer quantities head to 1 as . is trapped between them, so it too goes to 1. The same argument with follows by the even-parity of : . Both one-sided limits are 1, so the two-sided limit is 1.
Drag the θ slider. As θ shrinks, all three areas collapse, but the ratio of the rose to the emerald — which is — sprints to 1. The violet sector, with area equal to , is squeezed to match. The geometry is the proof.
Seeing the Squeeze as a Plot
Here are the three curves — (lower), (trapped), (upper) — plotted simultaneously across . Slide the probe toward and watch the numerical readouts converge.
A useful numerical fingerprint
At : , , and . The band from cos to 1 has width , and the trapped value sits comfortably inside. Halve x and the band width drops by a factor of four (by the Taylor series ).
Python: Verifying a Squeeze Numerically
A computer cannot prove an ∀x statement, but it can flood the interval with samples and verify the bound holds at every single one. Below we check that holds across 1001 sample points and then print the shrinking envelope as x marches to 0.
What you should see in the output
A 0-violation summary confirms the inequality holds on every sample. The follow-up table then shows the envelope values shrinking by a factor of 10⁻¹⁰ across six orders of magnitude — the trapped function has to follow. Notice it does so while still flipping sign: pinned, not smooth.
PyTorch: Autograd Through a Pinched Function
The squeeze theorem tells us . A subtle trap lives in its corollary that you might assume: does the derivative also go to 0? No! PyTorch's autograd makes this concrete in just a few lines. We evaluate the trapped function and its pointwise derivative on the same x samples and print both.
The lesson the derivative table teaches
as , but oscillates between roughly . The term has no envelope to squeeze it. So although the function is continuous (and even differentiable) at 0 — with computed from the limit definition — the derivative is discontinuous there. A function can be squeezed to a limit without its derivative following suit.
Common Pitfalls
Pitfall 1 — Using unequal bound limits
The squeeze theorem requires . If the bounds go to different values, the theorem says nothing — the trapped function could end up anywhere in between, or might not have a limit at all.
Pitfall 2 — Bounds that only hold on one side
The inequalities must hold on some interval around c (except maybe at c itself), on both sides. If your bound is only valid for x > 0, you can conclude the right-hand limit only, and you must give an independent argument for the left side.
Pitfall 3 — Multiplying by a variable-sign factor
From , multiplying by is dangerous because x changes sign around 0. Multiplying an inequality by a negative number flips it. Use or to stay safe.
Pitfall 4 — Assuming the derivative is also squeezed
A squeeze on does not squeeze . The PyTorch demo above showed the derivative keeps oscillating. If you need the derivative's limit, you need a separate squeeze on the derivative itself.
Why the Squeeze Theorem Matters
The entire chain — , — rests on , which rests on the squeeze.
Every integral of the form — the heart of Fourier transforms — traces back to .
Stochastic gradient descent proofs routinely bound noisy iterates by two vanishing sequences — the squeeze pins the iterate to the optimum.
Truncation errors are bounded by vanishing envelopes. Saying "the error issqueezed between two expressions that go to 0" is often easier than computing the error exactly.
Summary
The squeeze theorem is the detective tool of limits. You corner the wild function between two tame ones, prove the tame ones converge to a common point, and collect the conclusion for free.
| Move | What to look for | What you produce |
|---|---|---|
| Spot the bounded piece | sin(…), cos(…), fractional part, anything in [a, b] | An inequality −1 ≤ bounded ≤ 1 (or similar). |
| Identify the vanishing factor | x, x², e^{-1/x²}, anything with a known tame limit | Multiply bounded × vanishing to produce the envelope. |
| Check bound validity | Are both sides of c covered? Is the multiplier non-negative? | A legitimate two-sided sandwich g ≤ f ≤ h. |
| Compute envelope limits | Use limit laws on g and h | Both go to the same L. |
| Invoke the theorem | All three ingredients present | lim f = L, no direct evaluation of f required. |
Key Takeaways
- The squeeze theorem converts wild limits into tame ones by finding two bounds that share a limit.
- The flagship examples are and .
- The sine limit is the reason derivatives of trigonometric functions have the form they do — a central link between geometry and calculus.
- The theorem is a direct corollary of the ε–δ definition: squeeze both bounds inside an ε-window, and the trapped function is stuck with them.
- A squeeze on does not squeeze . Derivatives need their own argument.
Coming Next: Section 2.8 takes the two iconic limits we just squeezed — and the companion limit — and turns them into the foundation for derivatives of trigonometric and exponential functions.