Squeeze theorem (also called the sandwich or pinching theorem). If, for all \( x \) near \( c \),
$$g(x) \le f(x) \le h(x)$$
and \( \lim_{x\to c}g(x) = \lim_{x\to c}h(x) = L \), then
$$\lim_{x\to c}f(x) = L$$
If the outer functions both approach the same value, the function trapped between them has no choice but to go there too. It also works for \( x \to \pm\infty \).
This guide explains why the theorem is true, gives a short proof, walks through six examples from routine to exam-level, and lists the mistakes that make a squeeze argument fall apart.
Why it works: the picture
Draw the graphs of \( g \) and \( h \) near \( x = c \). Both curves funnel into the single point \( (c, L) \), like two walls of a narrowing corridor. The graph of \( f \) lives inside that corridor. However wildly \( f \) wiggles, the corridor gets thinner as \( x \) approaches \( c \), so \( f \) is forced into the same point.
A common way to remember it: two police officers walking someone between them. Wherever the officers end up, the person between them ends up too.
The key requirement is that the corridor closes. If the walls approach different heights, \( f \) has room to keep moving, and nothing can be concluded.
A short proof
Let \( \varepsilon > 0 \) be any tolerance. Because \( g(x) \to L \) and \( h(x) \to L \), there is a distance \( \delta \) such that, whenever \( 0 < |x - c| < \delta \), both functions are within \( \varepsilon \) of \( L \):
$$L - \varepsilon < g(x) \quad\text{and}\quad h(x) < L + \varepsilon$$
For those same \( x \), the trapping inequality gives
$$L - \varepsilon < g(x) \le f(x) \le h(x) < L + \varepsilon$$
So \( f(x) \) is within \( \varepsilon \) of \( L \) too. Since \( \varepsilon \) was arbitrary, that is exactly the definition of \( \lim_{x\to c}f(x) = L \).
When to use it
When a limit involves something that oscillates but is bounded, typically \( \sin \) or \( \cos \) of something that blows up, multiplied by something that goes to zero. Algebra and L’Hôpital’s rule can’t handle these, because the oscillating part has no limit of its own.
The standard technique
- Start from a known bound, usually \( -1 \le \sin(\text{anything}) \le 1 \).
- Multiply through by the other factor (carefully with signs).
- Show both outer limits are equal.
A handy shortcut is the absolute value version: if \( |f(x)| \le h(x) \) and \( h(x) \to 0 \), then \( f(x) \to 0 \). That is the squeeze theorem with \( g = -h \).
Example 1: x² sin(1/x) as x → 0
\( \sin\frac1x \) oscillates wildly near 0, so direct substitution fails. But
$$-1 \le \sin\frac1x \le 1 \quad\Longrightarrow\quad -x^2 \le x^2\sin\frac1x \le x^2$$
(multiplying by \( x^2 \ge 0 \) keeps the inequalities). Both \( -x^2 \) and \( x^2 \) go to 0, so
$$\lim_{x\to0}x^2\sin\frac1x = 0$$
Example 2: x sin(1/x) as x → 0
Here \( x \) can be negative, so use absolute values: \( \left|x\sin\frac1x\right| \le |x| \), i.e. \( -|x| \le x\sin\frac1x \le |x| \). Both sides go to 0, so the limit is 0.
Example 3: cos(x)/x as x → ∞
For \( x > 0 \): \( -\frac1x \le \frac{\cos x}{x} \le \frac1x \). Both bounds go to 0, so the limit is 0. This is also why \( y = 0 \) is a horizontal asymptote of \( \frac{\cos x}{x} \), a typical limit at infinity.
Example 4: the famous one
The most important application is proving
$$\lim_{x\to0}\frac{\sin x}{x} = 1$$
using \( \cos x \le \frac{\sin x}{x} \le 1 \). The full geometric argument is in limit of sin x / x. That one limit is what makes the derivative of \( \sin x \) equal \( \cos x \), and from there every trig derivative, including the derivative of tan x.
Example 5: a bounded wiggle added to a line
Find \( \lim_{x\to\infty}\frac{2x + \sin x}{x} \).
The \( \sin x \) term never settles, but it stays between \( -1 \) and \( 1 \). Add \( 2x \) to every part, then divide by \( x > 0 \), which keeps the inequalities pointing the same way:
$$\frac{2x - 1}{x} \le \frac{2x + \sin x}{x} \le \frac{2x + 1}{x}$$
Both outer fractions equal \( 2 \mp \frac1x \), which go to 2. So the limit is 2. The lesson: a bounded wiggle becomes negligible next to something that grows.
Example 6 (exam-level): x² e^(sin(1/x)) as x → 0
This time the oscillating part is inside an exponential. Build the bound in stages:
- Start with \( -1 \le \sin\frac1x \le 1 \).
- The exponential is increasing, so applying it keeps the order: \( e^{-1} \le e^{\sin(1/x)} \le e \).
- Multiply by \( x^2 \ge 0 \):
$$\frac{x^2}{e} \le x^2e^{\sin(1/x)} \le e\,x^2$$
Both bounds go to 0, so the limit is 0. Applying an increasing function to an inequality preserves it; applying a decreasing one reverses it.
How to write it up on an exam
Graders look for three things: the inequality, the two outer limits, and the conclusion naming the theorem. A model answer for Example 1 reads:
- For all \( x \ne 0 \), \( -1 \le \sin\frac1x \le 1 \).
- Since \( x^2 > 0 \) for \( x \ne 0 \), multiplying gives \( -x^2 \le x^2\sin\frac1x \le x^2 \).
- Both \( \lim_{x\to0}(-x^2) \) and \( \lim_{x\to0}x^2 \) equal 0.
- Therefore, by the squeeze theorem, \( \lim_{x\to0}x^2\sin\frac1x = 0 \).
Each line justifies the next. Skipping line 2’s reason for keeping the inequality direction is the most common way to lose a point, so always state why the multiplier is nonnegative.
Common mistakes
- Bounds that don’t meet. \( -1 \le \sin\frac1x \le 1 \) alone proves nothing, since \( -1 \ne 1 \). You need the shrinking factor.
- Sign errors. Multiplying an inequality by a negative number flips it; that’s why Example 2 uses \( |x| \).
- Forgetting the conclusion. State that both bounds share the limit \( L \), then conclude.
- Bounds valid on only one side. \( \sqrt{x}\sin\frac1x \) is only defined for \( x > 0 \), so its squeeze gives a right-hand limit. Say so explicitly.
- Splitting the product. Writing the limit of \( x^2\sin\frac1x \) as the limit of \( x^2 \) times the limit of \( \sin\frac1x \) is invalid, because the second limit does not exist. The squeeze theorem is precisely the tool that avoids this step.
Where it’s used
Beyond oscillating limits, the squeeze idea runs through calculus. Upper and lower Riemann sums trap the area under a curve, and the definite integral is the value both are squeezed toward. The proof of the fundamental theorem of calculus squeezes an average value between a function’s minimum and maximum on a tiny interval. The comparison tests for series and improper integrals follow the same logic of bounding something unknown by something known.
See it on a graph
In the visual lab, \( x\sin(1/x) \) wiggles faster and faster near the origin but stays trapped inside the lines \( y = \pm x \):
2D Visual Lab·Live coordinate sandbox
See derivatives and integrals take shape
Plot any function, slide a tangent line along the curve, shade the signed area under it, and watch Riemann rectangles converge to the exact integral.
To confirm an answer numerically, type the function into the limit calculator, or use the one-sided limit calculator when the bounds only hold on one side.
Practice problems
Try these before checking the answers.
- \( \lim_{x\to0}x^4\cos\frac{2}{x} \)
- \( \lim_{x\to\infty}\frac{\sin(x^2)}{x} \)
- \( \lim_{x\to0}\sqrt{x}\,\sin\frac1x\ (x > 0) \)
- \( \lim_{x\to\infty}\frac{3x^2 + \cos x}{x^2} \)
- \( \lim_{x\to\infty}\frac{\sin x}{e^x} \)
- \( \lim_{x\to0}x^3\sin\frac1x \)
Answers: (1) \( 0 \); (2) \( 0 \); (3) \( 0 \); (4) \( 3 \), from bounds \( 3 \pm \frac{1}{x^2} \); (5) \( 0 \), from bounds \( \pm e^{-x} \); (6) \( 0 \), from bounds \( \pm|x|^3 \).
FAQ
Is the squeeze theorem the same as the sandwich theorem?
Yes, same theorem, different names.
Does f have to be between g and h everywhere?
Only near the point \( c \) (or for large enough \( x \) when \( x \to \infty \)), not at \( c \) itself.
Can the squeeze theorem show a limit does not exist?
No. It only proves that a limit exists and finds its value. If your bounds approach different numbers, the test simply gives no information.
Does the squeeze theorem work for sequences?
Yes. If \( a_n \le b_n \le c_n \) for all large \( n \) and the outer sequences share a limit, so does \( b_n \). For example, \( \frac{\cos n}{n} \to 0 \).
How do I choose the bounding functions?
Isolate the bounded piece, usually a sine, cosine or other function with known limits, and write its bounds. Then rebuild the original expression around that inequality step by step, watching signs.
Further reading
- Computing Limits (Paul’s Online Math Notes) — the squeeze theorem statement with a graph and a worked \( x^2\cos \) example, alongside other limit techniques.
- Squeeze theorem (Wikipedia) — the formal statement, a proof, and versions for sequences and several variables.
Calculators for this topic
Keep learning
Limits at Infinity: Rules, Asymptotes and Examples
How to evaluate limits as x → ∞: divide by the highest power, the three degree rules for rational functions, growth rates, and radical examples.
L’Hôpital’s Rule: When and How to Use It (with Examples)
L’Hôpital’s rule evaluates 0/0 and ∞/∞ limits by differentiating top and bottom. Conditions, 6 worked examples, other indeterminate forms and common errors.

