In short

The Sandwich Theorem (also called the Squeeze Theorem) says: if a function is trapped between two other functions that both tend to the same limit, then the trapped function must tend to that limit too. It is the main tool for evaluating limits of functions that oscillate or are otherwise hard to handle directly — most famously, \lim_{x \to 0}\frac{\sin x}{x} = 1.

Here is a function that seems impossible to pin down: f(x) = x^2 \sin\!\left(\frac{1}{x}\right).

Try to find \lim_{x \to 0} f(x) by plugging in values. At x = 0.1, the sine part is \sin(10), which is about -0.544, so f(0.1) \approx 0.01 \times (-0.544) = -0.00544. At x = 0.01, the sine part is \sin(100) \approx -0.506, so f(0.01) \approx 0.0001 \times (-0.506) = -0.0000506. At x = 0.001, \sin(1000) \approx 0.827, so f(0.001) \approx 0.000000827.

The outputs are jumping between positive and negative, and the sine factor is oscillating wildly — \sin(1/x) swings between -1 and 1 faster and faster as x gets closer to zero. And yet the outputs are shrinking. They seem to be heading toward 0. But how do you prove that, when the function keeps changing sign and you cannot predict which way \sin(1/x) will point at any given instant?

You trap it. The sine function, no matter what its argument, always satisfies -1 \leq \sin(\text{anything}) \leq 1. So

-x^2 \leq x^2\sin\!\left(\frac{1}{x}\right) \leq x^2

The left side -x^2 tends to 0 as x \to 0. The right side x^2 also tends to 0. The function in the middle is squeezed between two functions that are both heading to the same place. It has no choice — it must tend to 0 as well.

That is the Sandwich Theorem. You do not need to know where the middle function is at any specific point. You just need to know that it is trapped between two walls that are closing in on the same value.

Think of it this way. You are walking down a corridor, and the corridor is getting narrower. The walls on your left and right are both closing in toward the same point. You do not know exactly where you are in the corridor at any instant — maybe you are zigzagging between the two walls — but it does not matter. The walls are forcing you toward that point regardless of your path. That is the geometry of the Sandwich Theorem: two converging bounds force whatever is between them to converge as well.

The name "Sandwich" is used in most Indian textbooks. Internationally, it is also called the Squeeze Theorem (because the middle function is squeezed) or the Pinching Theorem. The idea is the same under all three names.

The picture

The red curve is $y = x^2\sin(1/x)$, which oscillates faster and faster near the origin. The two dashed curves are $y = x^2$ and $y = -x^2$. No matter how wildly the red curve oscillates, it can never escape the envelope formed by the two parabolas — and both parabolas converge to 0 at the origin. The red curve is sandwiched, so it must also tend to 0.

The picture makes the theorem feel obvious. The oscillating red curve is trapped inside a closing vice. As the jaws of the vice come together, whatever is between them is forced to the same point.

The formal statement

Sandwich Theorem (Squeeze Theorem)

Let g(x) \leq f(x) \leq h(x) for all x in some open interval around a (except possibly at a itself). If

\lim_{x \to a} g(x) = L \qquad \text{and} \qquad \lim_{x \to a} h(x) = L

then

\lim_{x \to a} f(x) = L

The same statement holds for one-sided limits and for limits at infinity (x \to \infty or x \to -\infty).

Reading the definition. Three things are required: (1) the middle function is trapped between two outer functions, (2) the two outer functions have the same limit, and (3) the trapping holds in some neighbourhood of the limit point. The conclusion is forced: the middle function shares that limit.

Notice the phrase "except possibly at a itself." The theorem does not require any of the three functions to be defined at a. It is a statement about behaviour near a, not at a.

Proof

Take any \varepsilon > 0. Since \lim_{x \to a} g(x) = L, there exists \delta_1 > 0 such that 0 < |x - a| < \delta_1 implies |g(x) - L| < \varepsilon, which means L - \varepsilon < g(x).

Since \lim_{x \to a} h(x) = L, there exists \delta_2 > 0 such that 0 < |x - a| < \delta_2 implies |h(x) - L| < \varepsilon, which means h(x) < L + \varepsilon.

Let \delta = \min(\delta_1, \delta_2). Then for 0 < |x - a| < \delta:

L - \varepsilon < g(x) \leq f(x) \leq h(x) < L + \varepsilon

So |f(x) - L| < \varepsilon. Since \varepsilon was arbitrary, \lim_{x \to a} f(x) = L. \blacksquare

Why: the proof takes the two \delta-guarantees from the outer functions and combines them. The minimum of the two \delta's ensures that both guarantees hold simultaneously. Then the chain of inequalities L - \varepsilon < g \leq f \leq h < L + \varepsilon forces f into the \varepsilon-band around L.

The most important application: \lim_{x \to 0}\frac{\sin x}{x} = 1

This limit appears everywhere — in the derivative of \sin x, in Fourier series, in signal processing, in physics. It is probably the single most-used limit in calculus. And its proof is a textbook application of the Sandwich Theorem.

Setting up the sandwich

Consider the unit circle (radius 1), and draw a small positive angle x (in radians) at the centre. Three regions appear:

  1. A triangle OAB inscribed inside the sector, with area \frac{1}{2}\sin x.
  2. The circular sector OAB itself, with area \frac{1}{2}x (area of a sector is \frac{1}{2}r^2\theta, and here r = 1, \theta = x).
  3. A larger triangle OAC formed by extending the radius to the tangent line, with area \frac{1}{2}\tan x.

These three regions are nested: the inscribed triangle fits inside the sector, and the sector fits inside the outer triangle. So their areas are ordered:

\frac{1}{2}\sin x \leq \frac{1}{2}x \leq \frac{1}{2}\tan x

Why? The triangle OAB lies entirely inside the circular sector (the sector includes the curved region the triangle misses). And the sector lies entirely inside the triangle OAC (the outer triangle extends past the arc to the tangent line). Nesting of regions implies ordering of areas.

Three nested regions for the sin x over x proof A unit circle centred at the origin with a small angle x drawn. Three regions are shown: the inscribed triangle (smallest, shaded light), the circular sector (medium), and the outer triangle reaching the tangent line (largest, shaded darker). Their areas are ordered: half sin x, half x, half tan x. O B A C sin x 1 tan x x
The unit circle with angle $x$. The inscribed triangle $OAB$ (light shading) has area $\frac{1}{2}\sin x$. The sector (medium shading) has area $\frac{1}{2}x$. The outer triangle $OAC$ (dashed outline) has area $\frac{1}{2}\tan x$. The ordering of areas gives the key inequality.

Extracting the limit

Start from the area inequality for 0 < x < \frac{\pi}{2}:

\sin x \leq x \leq \tan x

Divide everything by \sin x (which is positive for 0 < x < \pi/2):

1 \leq \frac{x}{\sin x} \leq \frac{1}{\cos x}

Take reciprocals (which reverses inequalities):

\cos x \leq \frac{\sin x}{x} \leq 1

This is a sandwich. The left bread is \cos x and the right bread is 1. As x \to 0^+:

\lim_{x \to 0^+}\cos x = 1 \qquad \text{and} \qquad \lim_{x \to 0^+} 1 = 1

By the Sandwich Theorem:

\lim_{x \to 0^+}\frac{\sin x}{x} = 1

For x \to 0^-, note that \frac{\sin x}{x} = \frac{\sin(-x)}{-x} = \frac{\sin x}{x} is an even function (since \sin(-x) = -\sin x), so the left-hand limit equals the right-hand limit.

\therefore\quad \lim_{x \to 0}\frac{\sin x}{x} = 1 \qquad \blacksquare
The graph of $y = \frac{\sin x}{x}$ (red), squeezed between $y = \cos x$ (dashed) and $y = 1$ (dashed) near the origin. Both bounds tend to 1 as $x \to 0$, forcing $\frac{\sin x}{x}$ to tend to 1 as well. Away from the origin the sandwich no longer holds — but the theorem only needs it to hold near the limit point.

Why this matters: the derivative of \sin x at x = 0 is \lim_{h \to 0}\frac{\sin(0+h) - \sin 0}{h} = \lim_{h \to 0}\frac{\sin h}{h} = 1. So (\sin x)' = \cos x rests on this one geometric argument. The Sandwich Theorem is the tool that turns a geometric picture into a rigorous limit.

The companion limit: \lim_{x \to 0}\frac{1 - \cos x}{x^2} = \frac{1}{2}

This limit follows quickly from the \sin x / x result. Use the identity 1 - \cos x = 2\sin^2\!\left(\frac{x}{2}\right):

\frac{1 - \cos x}{x^2} = \frac{2\sin^2(x/2)}{x^2} = 2 \cdot \frac{\sin^2(x/2)}{(x/2)^2} \cdot \frac{(x/2)^2}{x^2} = 2 \cdot \left(\frac{\sin(x/2)}{x/2}\right)^2 \cdot \frac{1}{4}

As x \to 0, x/2 \to 0 as well, so \frac{\sin(x/2)}{x/2} \to 1 by the result just proved. The expression tends to 2 \cdot 1^2 \cdot \frac{1}{4} = \frac{1}{2}.

Walk through each factor to see why the split works. The 2 comes from the double-angle identity. The \left(\frac{\sin(x/2)}{x/2}\right)^2 is a squared version of the standard limit, which tends to 1^2 = 1. The \frac{1}{4} comes from \frac{(x/2)^2}{x^2} = \frac{x^2/4}{x^2} = \frac{1}{4}. Each factor has a definite limit, and the product of the limits is the limit of the product.

The companion limit: \lim_{x \to 0}\frac{1 - \cos x}{x} = 0

This one is simpler but also useful. Multiply and divide by (1 + \cos x):

\frac{1 - \cos x}{x} = \frac{(1 - \cos x)(1 + \cos x)}{x(1 + \cos x)} = \frac{\sin^2 x}{x(1 + \cos x)} = \frac{\sin x}{x} \cdot \frac{\sin x}{1 + \cos x}

As x \to 0: \frac{\sin x}{x} \to 1 and \frac{\sin x}{1 + \cos x} \to \frac{0}{2} = 0. So the product tends to 1 \cdot 0 = 0.

Worked examples

Example 1: An oscillating function

Evaluate \displaystyle\lim_{x \to 0}\; x\cos\!\left(\frac{1}{x}\right).

Step 1. Observe that \cos\!\left(\frac{1}{x}\right) oscillates between -1 and 1 as x \to 0, so you cannot evaluate it directly. But you can bound it.

-1 \leq \cos\!\left(\frac{1}{x}\right) \leq 1

Why: the cosine function is bounded between -1 and 1 regardless of its argument. This is the starting point for every sandwich involving trigonometric oscillation.

Step 2. Multiply through by |x| (which is non-negative).

-|x| \leq x\cos\!\left(\frac{1}{x}\right) \leq |x|

Why: when multiplying an inequality by a non-negative quantity, the direction of the inequality is preserved. Using |x| instead of x handles both the case x > 0 and x < 0 simultaneously.

Step 3. Identify the outer limits.

\lim_{x \to 0}(-|x|) = 0 \qquad \text{and} \qquad \lim_{x \to 0}|x| = 0

Why: both |x| and -|x| tend to 0 as x \to 0. The two slices of bread are converging to the same value.

Step 4. Apply the Sandwich Theorem.

\lim_{x \to 0}\; x\cos\!\left(\frac{1}{x}\right) = 0

Result: 0.

The function $y = x\cos(1/x)$ (red) oscillates wildly near the origin, but it stays between the lines $y = x$ and $y = -x$ (dashed). Both lines pass through the origin, so the oscillating function is squeezed to 0.

The graph makes the squeeze visible. Near the origin, the red curve bounces between the two dashed lines, and those lines both pass through (0,0). There is no escape.

Notice the difference between this function and \sin(1/x) on its own. The function \sin(1/x) oscillates between -1 and 1 near the origin — it has no limit at x = 0. But x\cos(1/x) does have a limit, because the factor x is shrinking fast enough to kill the oscillation. The Sandwich Theorem captures this precisely: the amplitude of the oscillation is bounded by |x|, and |x| \to 0.

Example 2: The floor function

Evaluate \displaystyle\lim_{x \to \infty}\frac{\lfloor x \rfloor}{x}, where \lfloor x \rfloor denotes the greatest integer less than or equal to x (the floor function).

Step 1. Use the defining property of the floor function.

x - 1 < \lfloor x \rfloor \leq x

Why: \lfloor x \rfloor is the largest integer \leq x, so it is at most x. And it is strictly greater than x - 1, because x - 1 is less than the next integer down.

Step 2. Divide through by x (which is positive for x \to +\infty).

\frac{x - 1}{x} < \frac{\lfloor x \rfloor}{x} \leq \frac{x}{x}
1 - \frac{1}{x} < \frac{\lfloor x \rfloor}{x} \leq 1

Why: dividing by a positive number preserves inequality directions. The right side simplifies to 1.

Step 3. Identify the outer limits.

\lim_{x \to \infty}\left(1 - \frac{1}{x}\right) = 1 \qquad \text{and} \qquad \lim_{x \to \infty} 1 = 1

Why: \frac{1}{x} \to 0 as x \to \infty, so the left bound approaches 1 from below.

Step 4. Apply the Sandwich Theorem.

\lim_{x \to \infty}\frac{\lfloor x \rfloor}{x} = 1

Result: 1.

The ratio $\frac{\lfloor x \rfloor}{x}$ at integer points, together with the bounds $1 - \frac{1}{x}$ and $1$. The staircase nature of $\lfloor x \rfloor$ creates saw-tooth behaviour, but the bounds squeeze the ratio toward 1 as $x$ grows.

The floor function strips away the fractional part of x. When x is large, the fractional part (which is at most 1) becomes negligible compared to x itself. The Sandwich Theorem turns this intuition into a proof.

This example also illustrates a useful technique: when a function involves the floor (or ceiling, or fractional part), the defining inequality of the floor function is almost always the right starting point for a sandwich. \lfloor x \rfloor is hard to work with analytically, but the inequality x - 1 < \lfloor x \rfloor \leq x is clean and immediately useful.

Common confusions

Going deeper

If you came here for the standard applications and the proof, you have them — you can stop here. What follows explores some subtler uses and the version for sequences.

The Sandwich Theorem for sequences

The theorem has a version for sequences that is identical in spirit. If g_n \leq a_n \leq h_n for all n beyond some point, and \lim_{n \to \infty} g_n = \lim_{n \to \infty} h_n = L, then \lim_{n \to \infty} a_n = L.

A classic application: show that \lim_{n \to \infty}\frac{n!}{n^n} = 0.

Each factor in n! is at most n, so n! \leq n^n. But more precisely, n! = 1 \cdot 2 \cdot 3 \cdots n. The first factor is 1, and every other factor is at most n. So n! \leq 1 \cdot n \cdot n \cdots n = n^{n-1}. Then

0 \leq \frac{n!}{n^n} \leq \frac{n^{n-1}}{n^n} = \frac{1}{n}

Since \frac{1}{n} \to 0, the Sandwich Theorem gives \frac{n!}{n^n} \to 0.

Using the Sandwich Theorem to evaluate \lim_{x \to 0}\frac{\tan x}{x}

Since \tan x = \frac{\sin x}{\cos x}:

\frac{\tan x}{x} = \frac{\sin x}{x} \cdot \frac{1}{\cos x}

As x \to 0, \frac{\sin x}{x} \to 1 and \frac{1}{\cos x} \to \frac{1}{1} = 1. So \frac{\tan x}{x} \to 1.

This is not directly a sandwich argument, but it depends on the \sin x / x limit that was proved by sandwich. Many limits "downstream" of the Sandwich Theorem rely on it indirectly.

Why the angle must be in radians

The limit \lim_{x \to 0}\frac{\sin x}{x} = 1 is true only if x is measured in radians. If x were in degrees, the area of the sector would be \frac{1}{2}r^2 \cdot \frac{\pi x}{180}, not \frac{1}{2}r^2 x, and the limit would become \frac{\pi}{180} \approx 0.01745 instead of 1. The beauty of radian measure is that it makes this limit — and therefore the derivative of \sin x — come out cleanly. This is one of the deep reasons why radians are the "natural" unit for angles in calculus.

Constructing a sandwich: the general strategy

When you need to apply the Sandwich Theorem, the process is:

  1. Identify the troublesome piece. What part of the expression prevents direct evaluation? Usually it is an oscillating factor like \sin(1/x) or a discontinuous factor like \lfloor x \rfloor.

  2. Bound the troublesome piece. Replace it with its maximum and minimum values. For \sin(\cdot) and \cos(\cdot), the bounds are [-1, 1]. For \lfloor x \rfloor, the bound is x - 1 < \lfloor x \rfloor \leq x.

  3. Multiply or compose with the well-behaved piece. This creates two outer functions. Make sure the multiplication preserves the inequality direction (check the sign).

  4. Evaluate the outer limits. If they agree, the Sandwich Theorem closes the argument.

The hardest part is usually step 2 — finding a bound that is tight enough. A bound like |\sin(1/x)| \leq 1{,}000{,}000 is technically true but useless. The tighter your bound, the more information the sandwich provides.

A sequence example: \lim_{n \to \infty}\frac{\sin n}{n} = 0

The sequence a_n = \frac{\sin n}{n} oscillates — \sin n is positive for some n and negative for others, and there is no clean pattern. But |\sin n| \leq 1 for all n, so

-\frac{1}{n} \leq \frac{\sin n}{n} \leq \frac{1}{n}

Both \frac{1}{n} and -\frac{1}{n} tend to 0, so by the Sandwich Theorem, \frac{\sin n}{n} \to 0.

This is a good example of the theorem's power: the middle sequence is erratic and unpredictable, but the outer bounds are simple and converge. The theorem lets you ignore the chaos and focus on the envelope.

When the Sandwich Theorem does not apply

The Sandwich Theorem is silent when the two outer limits are different. Consider f(x) = \sin(1/x) near x = 0. You can bound it: -1 \leq \sin(1/x) \leq 1. But the left bound tends to -1 and the right bound tends to 1 — different values. The sandwich is too wide to conclude anything, and indeed \sin(1/x) has no limit as x \to 0: it keeps oscillating between -1 and 1 forever, never settling.

The failure here is not the theorem's fault — it is a genuine mathematical fact that \sin(1/x) has no limit at 0. The Sandwich Theorem correctly declines to give you an answer, because there is no answer to give.

The graph of $y = \sin(1/x)$. Unlike $x^2\sin(1/x)$ or $x\cos(1/x)$, this function has no limit at $x = 0$. It oscillates between $-1$ and $1$ infinitely often near the origin, never settling. There is no damping factor to compress the oscillation, so no sandwich can close.

Where this leads next

The Sandwich Theorem is a basic tool in the limit toolkit. From here: