Skip to content
Henry, founder and creator of Calculus Solver

Henry

Founder & Creator of Calculus Solver

About Henry

Hi, I'm Henry, the founder and creator of Calculus Solver. I'm passionate about mathematics, technology, and building educational tools that make complex mathematical concepts easier to understand.

Through Calculus Solver, my goal is to help students, teachers, and independent learners solve calculus problems with clear, step-by-step explanations. I focus on creating simple, reliable, and accessible tools that make learning mathematics easier and more effective.

I believe every complex problem becomes easier when you understand it one step at a time.

My Expertise

  • Website Development & Technology
  • Online Calculator Development
  • Educational Tools & Resources
  • User Experience & Interface Design

My Mission

My mission is to make mathematics easier to understand through accessible online tools, clear explanations, and step-by-step learning experiences.

My Philosophy

Learn step by step. Understand every rule. Solve with confidence.

Search Calculus Solver

Calculators

TutorialLimits

Squeeze Theorem Explained With Examples (Sandwich Theorem)

Some limits cannot be found by substitution, factoring or L'Hôpital's rule, usually because a factor such as sin(1/x) keeps oscillating forever. The squeeze theorem handles these by trapping the function between two simpler functions that share the same limit. This guide explains the theorem, gives a step-by-step method for finding the bounds, and works through seven examples.

By Calculus Solver teamPublished 9 min read
Worked examples verified
h(x)g(x)L
On this page
  1. What the squeeze theorem says
  2. When should you use the squeeze theorem?
  3. How to use the squeeze theorem, step by step
  4. The absolute value shortcut
  5. The most famous squeeze: sin(x)/x as x → 0
  6. Common mistakes to avoid
  7. Worked examples
  8. Questions about this topic
An oscillating curve trapped between an upper and a lower curve that meet at a single point, illustrating the squeeze theorem
The wavy function is trapped between two bounds that meet at one point, so as x approaches that point it is squeezed to the same limit.

What the squeeze theorem says

Suppose three functions g, f and h satisfy g(x) ≤ f(x) ≤ h(x) for every x near a (except possibly at a itself). If g and h have the same limit L at a, then f is forced to have that limit too:

g(x)≤f(x)≤h(x)  near aandlim⁡x→ag(x)=lim⁡x→ah(x)=L⟹lim⁡x→af(x)=Lg(x) \le f(x) \le h(x) \ \text{ near } a \quad\text{and}\quad \lim_{x \to a} g(x) = \lim_{x \to a} h(x) = L \quad\Longrightarrow\quad \lim_{x \to a} f(x) = L

The idea is simple: f is sandwiched between g and h. As x approaches a, the lower function g and the upper function h both close in on L, so f, which is always between them, has nowhere else to go. That is why the result is also called the sandwich theorem or the pinching theorem.

The theorem works the same way for one-sided limits (x → a⁺ or x → a⁻) and for limits at infinity (x → ∞ or x → −∞). In each case the inequality only needs to hold on the side, or far enough out, that the limit looks at.

Note: The two outer limits must be equal. If they differ, the squeeze theorem gives no information about the middle function.

When should you use the squeeze theorem?

Reach for the squeeze theorem when the usual methods fail and the expression contains a factor that is bounded but has no limit. Typical signs:

  • A sine or cosine of something that blows up, such as sin(1/x) as x → 0 or cos(x) as x → ∞. These oscillate between −1 and 1 forever, so they have no limit.
  • That bounded factor is multiplied by something that goes to 0, such as x², √x or e^(−x).
  • Substitution gives an undefined expression, and L'Hôpital's rule does not apply or makes things worse.

The product rule for limits, lim(f·g) = lim f · lim g, cannot be used here, because one of the two limits does not exist. The squeeze theorem gets around that by never needing the limit of the oscillating factor, only its bounds.

If the limit is a 0/0 or ∞/∞ fraction of smooth functions with no oscillating factor, L'Hôpital's rule is usually faster. Learn when it applies in L'Hôpital's Rule Explained With Examples.

How to use the squeeze theorem, step by step

  • Step 1: Find the bounded part. Write down an inequality you already know, most often −1 ≤ sin(anything) ≤ 1 or −1 ≤ cos(anything) ≤ 1.
  • Step 2: Build up to f(x). Multiply, divide or add to every part of the inequality until the middle is exactly f(x). Multiplying by a positive quantity keeps the inequality signs; multiplying by a negative one flips them.
  • Step 3: Find the limits of the two outer functions. They should be easy limits, found by substitution.
  • Step 4: Check that the two outer limits are equal. If they are, f has that same limit. If they differ, the bounds are too loose and the theorem says nothing.

Step 2 is where care is needed. In x² sin(1/x), the factor x² is never negative, so multiplying −1 ≤ sin(1/x) ≤ 1 by x² is safe. In x sin(1/x), x can be negative, so use absolute values instead (see the next section).

Tip: Most squeeze problems start from −1 ≤ sin(…) ≤ 1 or −1 ≤ cos(…) ≤ 1. Find the bounded factor first, then build the rest of the function around it.

The absolute value shortcut

When the limit you expect is 0, there is a quicker form of the theorem that avoids sign problems:

lim⁡x→a∣f(x)∣=0⟹lim⁡x→af(x)=0\lim_{x \to a} |f(x)| = 0 \quad\Longrightarrow\quad \lim_{x \to a} f(x) = 0

This follows from the squeeze theorem, because −|f(x)| ≤ f(x) ≤ |f(x)| and both outer functions go to 0. In practice it means you can bound |f(x)| instead of f(x). For example, |x sin(1/x)| = |x|·|sin(1/x)| ≤ |x|, and |x| → 0, so x sin(1/x) → 0 as x → 0, whether x is positive or negative.

The most famous squeeze: sin(x)/x as x → 0

The limit of sin(x)/x as x → 0 is the reason the derivative of sin x is cos x, and it is usually proved with the squeeze theorem. Comparing the areas of two triangles and a circular sector in the unit circle gives, for small x ≠ 0:

cos⁡x≤sin⁡xx≤1\cos x \le \frac{\sin x}{x} \le 1

As x → 0, cos x → 1 and the constant 1 stays at 1. Both bounds have the same limit, so the squeeze theorem gives the result:

lim⁡x→0sin⁡xx=1\lim_{x \to 0} \frac{\sin x}{x} = 1

Note that x must be in radians. In degrees, the same limit equals π/180.

This limit, used inside the limit definition of the derivative, is what gives d/dx[sin x] = cos x. To see how the definition turns into the everyday differentiation rules, read How to Find the Derivative of a Function.

Note: This limit only equals 1 when x is measured in radians, which is why calculus always uses radians.

Common mistakes to avoid

  • Using bounds with different limits. From −x² − 1 ≤ f(x) ≤ x² + 1 near 0, the limits are −1 and 1, which tells you nothing about f.
  • Forgetting to flip the inequalities when multiplying by a negative number. Multiplying −1 ≤ sin(1/x) ≤ 1 by x is only safe for x > 0; use |x| or the absolute value shortcut instead.
  • Writing lim sin(1/x) = 0 or treating lim x sin(1/x) as (lim x)(lim sin(1/x)). The limit of sin(1/x) as x → 0 does not exist, so the product rule for limits cannot be used.
  • Checking the inequality only at the point. It must hold for all x near a, not just at x = a, where f may not even be defined.
  • Squeezing when it isn't needed. If substitution, factoring or L'Hôpital's rule works, use it; the squeeze theorem is for the cases they cannot handle.

Practice

Worked examples

Each example is checked automatically against the solver. Try it by hand first, then compare.

Example 1

The classic: x² sin(1/x)

lim⁡x→0x2sin⁡ ⁣(1x)\lim_{x \to 0} x^{2}\sin\!\left(\frac{1}{x}\right)
  1. sin(1/x) has no limit at 0, but it is always between −1 and 1:

    −1≤sin⁡ ⁣(1x)≤1-1 \le \sin\!\left(\frac{1}{x}\right) \le 1
  2. Multiply every part by x², which is never negative, so the inequalities keep their direction:

    −x2≤x2sin⁡ ⁣(1x)≤x2-x^{2} \le x^{2}\sin\!\left(\frac{1}{x}\right) \le x^{2}
  3. Both −x² and x² approach 0 as x → 0, so the middle function does too.

Answer

00

Example 2

Using absolute values: x sin(1/x)

lim⁡x→0xsin⁡ ⁣(1x)\lim_{x \to 0} x\sin\!\left(\frac{1}{x}\right)
  1. x can be negative, so multiplying by x could flip the signs. Bound the absolute value instead:

    ∣xsin⁡ ⁣(1x)∣=∣x∣∣sin⁡ ⁣(1x)∣≤∣x∣\left|x\sin\!\left(\frac{1}{x}\right)\right| = |x|\left|\sin\!\left(\frac{1}{x}\right)\right| \le |x|
  2. So −|x| ≤ x sin(1/x) ≤ |x|, and |x| → 0 as x → 0.

Answer

00

Example 3

A one-sided limit

lim⁡x→0+x esin⁡(π/x)\lim_{x \to 0^{+}} \sqrt{x}\,e^{\sin(\pi/x)}
  1. Since −1 ≤ sin(π/x) ≤ 1 and eᵗ is increasing, the exponential factor is bounded:

    e−1≤esin⁡(π/x)≤ee^{-1} \le e^{\sin(\pi/x)} \le e
  2. For x > 0, √x is positive. Multiply through:

    xe≤x esin⁡(π/x)≤ex\frac{\sqrt{x}}{e} \le \sqrt{x}\,e^{\sin(\pi/x)} \le e\sqrt{x}
  3. Both bounds approach 0 as x → 0⁺. The limit is one-sided because √x is only defined for x ≥ 0.

Answer

00

Example 4

A limit at infinity: sin(x)/x

lim⁡x→∞sin⁡xx\lim_{x \to \infty} \frac{\sin x}{x}
  1. For x > 0, divide −1 ≤ sin x ≤ 1 by x:

    −1x≤sin⁡xx≤1x-\frac{1}{x} \le \frac{\sin x}{x} \le \frac{1}{x}
  2. Both −1/x and 1/x approach 0 as x → ∞. Compare this with x → 0, where the same expression has limit 1.

Answer

00

Example 5

Bounds that are not symmetric

lim⁡x→∞2+cos⁡xx2\lim_{x \to \infty} \frac{2 + \cos x}{x^{2}}
  1. Since −1 ≤ cos x ≤ 1, the numerator is between 1 and 3:

    1≤2+cos⁡x≤31 \le 2 + \cos x \le 3
  2. Divide by x², which is positive:

    1x2≤2+cos⁡xx2≤3x2\frac{1}{x^{2}} \le \frac{2 + \cos x}{x^{2}} \le \frac{3}{x^{2}}
  3. Both bounds approach 0 as x → ∞. The bounds do not need to be mirror images; they only need the same limit.

Answer

00

Example 6

A squeeze to a nonzero limit

lim⁡x→∞x+sin⁡xx\lim_{x \to \infty} \frac{x + \sin x}{x}
  1. Split the fraction:

    x+sin⁡xx=1+sin⁡xx\frac{x + \sin x}{x} = 1 + \frac{\sin x}{x}
  2. For x > 0, −1/x ≤ sin(x)/x ≤ 1/x. Add 1 to every part:

    1−1x≤x+sin⁡xx≤1+1x1 - \frac{1}{x} \le \frac{x + \sin x}{x} \le 1 + \frac{1}{x}
  3. Both bounds approach 1. L'Hôpital's rule would fail here: it gives (1 + cos x)/1, which has no limit.

Answer

11

Example 7

The fundamental trig limit

lim⁡x→0sin⁡xx\lim_{x \to 0} \frac{\sin x}{x}
  1. From the unit-circle area argument, for small x ≠ 0:

    cos⁡x≤sin⁡xx≤1\cos x \le \frac{\sin x}{x} \le 1
  2. As x → 0, cos x → cos 0 = 1, and the upper bound is the constant 1. Both bounds approach 1.

Answer

11

Put it into practice

About the author

Calculus Solver team

We build free, private calculus tools that show every step. Our articles are written to be read alongside the calculators, and every worked example in them is checked automatically against the solver before it is published.

About Calculus SolverHow answers are verified

FAQ

Questions about this topic

Is the squeeze theorem the same as the sandwich theorem?

Yes. Squeeze theorem, sandwich theorem and pinching theorem are three names for the same result. Some books also call it the sandwich rule or the two policemen theorem.

How do I find the bounding functions?

Start from a bound you already know, usually −1 ≤ sin(…) ≤ 1 or −1 ≤ cos(…) ≤ 1, then multiply, divide or add to every part until the middle matches your function. Keep track of signs: multiplying by a negative number flips the inequalities.

Does the squeeze theorem work for limits at infinity?

Yes. The inequality g(x) ≤ f(x) ≤ h(x) only needs to hold for all large enough x, and if g and h have the same limit as x → ∞, so does f. sin(x)/x → 0 is a standard example.

Why can't I just use L'Hôpital's rule?

L'Hôpital's rule needs a 0/0 or ∞/∞ form and needs the new limit to exist. For limits like x² sin(1/x) there is no such quotient, and for (x + sin x)/x the derivative quotient (1 + cos x)/1 has no limit, so the rule gives no answer.

What if the upper and lower limits are different?

Then the squeeze theorem tells you nothing. f might still have a limit, but you need tighter bounds or a different method to find it.

Keep reading

  • xⁿf · gf / gf ∘ gddx

    Study guideDerivatives

    Derivative Rules: A Complete Guide with Examples

    Learn every core derivative rule with clear explanations, a reference table, and worked examples, plus a step-by-step strategy for differentiating any function.

    4 min read
  • ∫u-substitutionby partstrig identitiespartial fractions

    Study guideIntegrals

    Integration Techniques: How to Choose the Right Method

    A practical guide to choosing an integration technique: basic forms, u-substitution, integration by parts, trig identities and partial fractions, with worked examples.

    4 min read

All study guides All blog posts

Practice what you learned

Try the worked examples above in the calculator and compare each step with your own. You can also use the main Calculus Solver for every operation in one place.

Check any limit with the Limit Calculator