6. What a limit is — and isn't

📖 Reading · 13 min
💡 Every code box below is live — edit it and hit Run.

Every idea in calculus is built on this one. Derivatives are limits, integrals are limits, continuity is a statement about limits, and infinite series are limits. So before proving anything else, we answer the basic question properly.

The short version: a limit describes where a function is heading, and it deliberately ignores where the function actually is. That separation is not a technicality. It's the entire point.

The intuition

Take f(x) = x^2 and the point a = 2. The question is not what f does at 2. It's what f does as x closes in on 2.

Creep up from below — 1.5, 1.9, 1.97, 1.999 — and f(x) does the same thing: 2.25, 3.61, 3.88, 3.996. It sneaks up on 4. We write

\lim_{x \to 2^-} f(x) = 4

That little minus sign is doing real work: it means we only ever approach from below, and never land on 2.

Come back the other way — 2.8, 2.1, 2.001 — and f(x) settles onto 4 from above:

\lim_{x \to 2^+} f(x) = 4

Both one-sided approaches agree, so the two-sided limit exists and equals their common value:

\lim_{x\to2} x^2 = 4

The rule, in full: \lim_{x\to a} f(x) = L exactly when both one-sided limits exist and are equal to L. If the two sides disagree, the limit does not exist — not "is ambiguous", not "is both". It does not exist.

The part that matters: the limit ignores f(a)

So far the limit was just f(2) and this all looks like an elaborate way to substitute. Here's the case that shows why it isn't.

g(x) = \frac{x^2 - 4}{x - 2}

At x = 2 this is \frac{0}{0} — undefined. The function has a hole there; 2 isn't in its domain at all.

But everywhere else, factor:

g(x) = \frac{(x-2)(x+2)}{x-2} = x + 2 \qquad (x \neq 2)

The cancellation is legal exactly because x \neq 2, which is guaranteed by the limit process itself — we never let x be 2. So g is the line y = x+2 with a single point punched out, and

\lim_{x\to2} g(x) = 4

The limit is 4 even though g(2) doesn't exist. The limit is about the neighbourhood, not the point.

Push it further. Define

h(x) = \begin{cases} x + 2 & x \neq 2\\ 100 & x = 2\end{cases}

Now h(2) = 100, a perfectly well-defined value, and still \lim_{x\to2}h(x) = 4. Moving one point does not move the limit, because the limit never looks at that point.

Three functions — x+2, g, h — with three different situations at x = 2 (value 4, no value, value 100) and one identical limit. That's the whole idea in one picture.

Why we need this and not just substitution

This is not a curiosity. Look at what the derivative asks for:

\lim_{h \to 0}\frac{f(x+h) - f(x)}{h}

At h = 0 this expression is \frac{0}{0} — undefined, always, for every function. The one point we care about is exactly the point where the formula breaks. If limits couldn't ignore the value at the point, calculus would have nothing to say.

Every derivative you compute for the rest of this course is a hole being filled in.

When a limit doesn't exist

Two-sided disagreement is the common case. For f(x) = \frac{|x|}{x}: to the right of 0 it's +1, to the left it's -1. Both one-sided limits exist and they differ, so \lim_{x\to0}\frac{|x|}{x} does not exist.

Worse is possible. Consider

f(x) = \sin\!\left(\frac{1}{x}\right)

As x \to 0, 1/x races to infinity and the sine oscillates faster and faster, hitting +1 and -1 infinitely often in any interval around 0 — no matter how small. There is no value it settles on, from either side. The limit doesn't exist, and here not even the one-sided limits do.

Notice this can't be detected by sampling. Whatever finite table of x-values you print, the function has done infinitely many full oscillations between consecutive rows. Numerical evidence is a hint, never a proof — a lesson that recurs throughout this course.

The precise definition

"Heads toward" is intuition, not mathematics. Here is the sentence that made calculus rigorous, roughly 150 years after Newton and Leibniz were already using it to predict planetary orbits:

\lim_{x\to a} f(x) = L means: for every \varepsilon > 0 there is a \delta > 0 such that 0 < |x - a| < \delta implies |f(x) - L| < \varepsilon.

Read it as a challenge and a response. A skeptic names a tolerance \varepsilon — "get within 0.001 of L". You must produce a radius \delta — "stay within \delta of a and I promise you will". If you can answer every challenge, the limit is L.

The clause doing the quiet work is 0 < |x - a|. That strict inequality excludes x = a itself, which is exactly how the definition encodes "ignore the value at the point". Without it, g above would have no limit at 2 and derivatives would be undefined.

We'll actually run this machinery in §1.9. For now, notice that it turns a vague verb into a finite, checkable claim.

Doing it in Python

Approach 2 from both sides and watch the hole:

def g(x):
    return (x * x - 4) / (x - 2)

print("from the left:")
for x in (1.9, 1.99, 1.999, 1.9999):
    print(f"  x={x:<8} g(x)={g(x):.6f}")

print("from the right:")
for x in (2.1, 2.01, 2.001, 2.0001):
    print(f"  x={x:<8} g(x)={g(x):.6f}")

try:
    g(2)
except ZeroDivisionError:
    print("\nat x=2 exactly: undefined -- and the limit is 4 regardless")

The jump that has no two-sided limit:

def f(x):
    return abs(x) / x

print(f"{'x':>10} {'|x|/x':>8}")
for x in (-0.1, -0.01, -0.001, 0.001, 0.01, 0.1):
    print(f"{x:>10} {f(x):>8.1f}")

print("\nleft limit -1, right limit +1: they disagree, so the limit does not exist")

And the oscillation that defeats sampling:

from math import sin, pi

def f(x):
    return sin(1 / x)

print("a 'well-behaved' table -- every value is exactly 0:")
for k in (1, 2, 3, 4, 5):
    x = 1 / (k * pi)
    print(f"  x={x:.8f}  f(x)={f(x):+.6f}")

print("\nthe same neighbourhood, sampled differently -- every value is exactly 1:")
for k in (0, 1, 2, 3, 4):
    x = 1 / (pi / 2 + 2 * k * pi)
    print(f"  x={x:.8f}  f(x)={f(x):+.6f}")

print("\nboth sequences run to 0. no single value is being approached.")

Worked example

Find \lim_{x\to3} \dfrac{x^2 - 9}{x - 3}, and state f(3).

Substituting gives \frac{0}{0}, which tells you nothing — it is the signal to do algebra, not the answer.

Factor the numerator as a difference of squares:

\frac{x^2-9}{x-3} = \frac{(x-3)(x+3)}{x-3} = x + 3 \qquad \text{for } x \neq 3

The restriction is not optional bookkeeping — it's what licenses the cancellation. And it costs nothing, because the limit already refuses to evaluate at 3.

Now x + 3 is an ordinary polynomial with no trouble at 3, so

\lim_{x\to3}\frac{x^2-9}{x-3} = 3 + 3 = \boxed{6}

And f(3) does not exist — 3 isn't in the domain. The function has a removable discontinuity: a single missing point at (3, 6) that you could fill in by hand, which is precisely what "removable" means.

Your turn

1. Evaluate \lim_{x\to1}\dfrac{x^2 - 1}{x-1} and say what happens at x = 1.

2. For f(x) = \begin{cases}x^2 & x < 1\\ 3 & x = 1 \\ 2x & x > 1\end{cases}, find the two one-sided limits at 1, the two-sided limit, and f(1).

3. Does \lim_{x\to0}\dfrac{1}{x^2} exist?

Solutions

1. Factor: \frac{(x-1)(x+1)}{x-1} = x+1 for x \neq 1, so the limit is \boxed{2}. At x=1 the function is undefined — \frac{0}{0} — a removable hole at (1,2).

2. From the left, f is x^2, so \lim_{x\to1^-}f(x) = 1.

From the right, f is 2x, so \lim_{x\to1^+}f(x) = 2.

The one-sided limits disagree, so \boxed{\lim_{x\to1}f(x) \text{ does not exist}}.

And f(1) = 3, which is a third value entirely, and irrelevant to all of the above. This is a jump discontinuity, and no redefinition of f(1) can repair it — the failure is in the two sides, not the point.

3. No. As x \to 0 the denominator shrinks to 0 through positive values from both sides, so \frac{1}{x^2} grows without bound:

\lim_{x\to0}\frac{1}{x^2} = \infty

Writing \infty is a description of how the limit fails, not a value. It says something more specific than "does not exist" — it says the function increases beyond every bound rather than jumping or oscillating — but \infty is not a real number and the limit does not exist in the strict sense.

Contrast \frac{1}{x}, where the two sides run to -\infty and +\infty respectively, so you can't even say that much.

Check yourself in code

Show that g(x) = \dfrac{x^2-4}{x-2} approaches 4 from both sides while being undefined at 2.

Print g at x = 1.9, 1.99, 1.999 then 2.001, 2.01, 2.1, each to 6 decimals, then confirm g(2) raises. Detect it with try/except ZeroDivisionError.

Print exactly this:

x=1.9     g=3.900000
x=1.99    g=3.990000
x=1.999   g=3.999000
x=2.001   g=4.001000
x=2.01    g=4.010000
x=2.1     g=4.100000
g(2) undefined, limit 4
def g(x):
    return (x * x - 4) / (x - 2)

for x in (1.9, 1.99, 1.999, 2.001, 2.01, 2.1):
    print(f"x={x:<7} g={g(x):.6f}")

# Now show that g(2) itself is undefined, without crashing.
def g(x):
    return (x * x - 4) / (x - 2)

for x in (1.9, 1.99, 1.999, 2.001, 2.01, 2.1):
    print(f"x={x:<7} g={g(x):.6f}")

try:
    g(2)
    print("g(2) defined")
except ZeroDivisionError:
    print("g(2) undefined, limit 4")

A limit is the value a function approaches near a point, and it is deliberately blind to the value at that point. Two-sided limits exist only when both sides agree. And the \varepsilon\delta definition makes "approaches" checkable by turning it into a challenge-and-response about tolerances.

Next: the algebra that turns \frac{0}{0} into an answer — factoring, conjugates, and the limit laws that let you take a limit apart.