Squeeze Theorem Calculator

Verify the sandwich numerically, squeeze the bounds together, and watch oscillations get crushed.

Squeeze Theorem Calculator

What Is the Squeeze Theorem?

Some limits resist every direct technique: the function oscillates too wildly to substitute, and no algebra tames it. The squeeze theorem (sandwich theorem) wins by geometry instead: if g(x) ≤ f(x) ≤ h(x) near a point a, and the two bounds converge to the same limit L there, then f, trapped between converging walls, has no choice:

lim g = lim h = L and g ≤ f ≤ h ⟹ lim f = L

The theorem's power is that f's own formula never needs to be evaluated at the limit, only bounded. It is the standard weapon against oscillating factors like sin(1/x): unmanageable alone, harmless once multiplied by something shrinking, because bounded × vanishing = vanishing, and the squeeze makes that slogan rigorous.

How to Use This Calculator

Enter the lower bound g, the target function f, the upper bound h, and the approach point a. The calculator verifies the sandwich numerically, 800 sample points on both sides of a checking g ≤ f ≤ h, then computes the limits of both bounds and applies the theorem, reporting the squeezed limit when the bounds meet, or diagnosing exactly what failed when they don't. The plot shows the drama: f in indigo oscillating inside the dashed teal jaws closing at the point (a, L).

Worked Example

The classic: limx→0 x²·sin(1/x). Direct substitution is hopeless, sin(1/x) has no limit at 0, oscillating infinitely often between −1 and 1. But bounded is all we need: −1 ≤ sin(1/x) ≤ 1 for every x ≠ 0, so multiplying through by x² (positive, order-preserving):

−x² ≤ x²·sin(1/x) ≤ x²

Both walls → 0 as x → 0, so the squeeze forces lim = 0. The graph makes it visceral: infinitely many oscillations, every one crushed inside the parabolic envelope. Note the fourth chip's cautionary tale: the same sin(1/x) with the constant bounds ±1 satisfies a perfectly valid sandwich, that never closes. Valid inequality, useless squeeze: the theorem needs the walls to meet.

The Most Famous Squeeze: sin(x)/x

The third chip runs the theorem's greatest hit. The geometric argument, comparing the areas of two triangles and a circular sector wedged between them, produces cos(x) ≤ sin(x)/x ≤ 1 near 0, and since cos(x) → 1, the squeeze delivers limx→0 sin(x)/x = 1. This single limit is the seed of all trigonometric calculus: the derivative of sine is this limit in disguise (sin′(0) = lim sin(h)/h), and every derivative formula for sin, cos, and tan descends from it. It cannot be computed by L'Hôpital's rule without circularity, L'Hôpital needs sin′, which needs this limit, so the squeeze isn't just one method among several here; it is the honest foundation.

Common Mistakes to Avoid

  • Bounds that don't converge together. −1 ≤ sin(1/x) ≤ 1 is true and proves nothing: the walls stay 2 apart forever. The conclusion needs lim g = lim h, check it before celebrating.
  • An inequality that fails near the point. The sandwich must hold on a neighborhood of a (except possibly at a itself). An inequality valid only far away is irrelevant; this calculator's 800-point check guards exactly this.
  • Flipping inequalities when multiplying by negatives. Building bounds by multiplying −1 ≤ sin(·) ≤ 1 by x (rather than x² or |x|) breaks the ordering for x < 0, the second chip's ±|x| bounds are the correct repair.
  • Concluding f has no limit because it oscillates. Oscillation inside a shrinking envelope is precisely when limits do exist, infinitely many wiggles, all dying. The envelope, not the wiggle count, decides.

Real-World Applications

Squeeze-style reasoning, control a hard quantity by two computable ones, is a workhorse across quantitative fields. Numerical analysts bound a method's error between explicit envelopes to prove convergence rates; signal engineers bound a modulated waveform inside its amplitude envelope (AM radio is literally a carrier squeezed by the message signal, and this page's default plot is an AM waveform's portrait); physicists bound damped oscillations inside decaying exponentials to certify that transients die.

In probability and algorithms, the pattern is everywhere: a random quantity trapped between bounds that converge forces convergence in the middle (the proof skeleton of laws of large numbers), and an algorithm's running time wedged between matching upper and lower bounds is what "Θ" means in complexity analysis. Wherever a difficult object is pinched between two tractable ones, the sandwich logic, this page's logic, is doing the certifying.

Frequently Asked Questions

Where does the inequality itself come from?

From boundedness facts (|sin| ≤ 1, |cos| ≤ 1, multiply by whatever accompanies them), from geometry (the area comparison behind sin x/x), or from known monotonicity. Finding bounds is the creative step; the theorem's application afterward is mechanical, as the calculator shows.

Must f be defined at the point a?

No, and usually it isn't (x²sin(1/x) is undefined at 0). Limits never care about the point itself, only the approach; the squeeze inherits that indifference. The inequality is required only for x ≠ a nearby.

Does the squeeze work for limits at infinity?

Identically: sin(x)/x → 0 as x → ∞ because −1/x ≤ sin(x)/x ≤ 1/x and both walls → 0. It also works for sequences, the sequence limit of cos(n)/n dies by the same pinch.

Why can't L'Hôpital replace the squeeze?

L'Hôpital needs differentiability and a 0/0 or ∞/∞ form; x²sin(1/x) at 0 is neither (it's bounded-times-vanishing, not a quotient of vanishing terms), and for sin x/x the rule is circular. The squeeze has no such prerequisites, it's the more primitive, more robust tool.

Is there a one-sided squeeze?

Yes, the same statement with one-sided limits and the inequality on one side of a. It's how limits at domain boundaries (like √x·sin(1/x) as x → 0⁺) are handled, where only the right approach exists.

What does it mean if the calculator says the sandwich fails?

f escapes between your walls somewhere near a, the bounds are simply not true bounds there. Fix the inequality (often the |x| repair from the second chip) rather than doubting the theorem: a failed check is a wrong sandwich, never a wrong squeeze.