8. When a limit fails: jumps, blow-ups, and oscillation
"The limit does not exist" is a diagnosis, not a description. There are exactly three ways it can happen, they look nothing alike, and each one tells you something different about the function.
Knowing which failure you're looking at matters practically: one of the three is repairable, one has a name and a notation of its own, and one defeats every numerical method you will ever write.
Failure 1: the jump
Both one-sided limits exist. They disagree.
f(x) = \frac{|x|}{x} \implies \lim_{x\to0^-}f(x) = -1, \quad \lim_{x\to0^+}f(x) = +1
Nothing is misbehaving — each side is perfectly well-behaved on its own, and each approaches a finite value calmly. The function simply arrives at two different places depending on which direction you come from.
Jumps are what piecewise definitions produce, and they're everywhere in practice: tax brackets, shipping tiers, the floor function, a step in a control signal. \lfloor x \rfloor jumps at every integer.
A jump is unrepairable. You cannot redefine f(0) to fix it, because the problem isn't the value at the point — it's that the two sides want different things. Contrast the removable hole from §1.0, where both sides agreed and only the point itself was missing or misplaced.
Failure 2: the blow-up
The function grows without bound.
\lim_{x\to0}\frac{1}{x^2} = \infty
Strictly, this limit does not exist — \infty is not a real number, and "f approaches \infty" is shorthand. But it's informative shorthand, and it has its own precise definition:
\lim_{x\to a}f(x) = \infty means: for every M > 0 there is a \delta > 0 such that 0 < |x-a| < \delta implies f(x) > M.
Same challenge-and-response as before, with "get within \varepsilon of L" replaced by "get above M".
The two sides can behave differently, and you must check both:
\lim_{x\to0^-}\frac{1}{x} = -\infty, \qquad \lim_{x\to0^+}\frac{1}{x} = +\infty
so \lim_{x\to0}\frac1x can't even be described as \infty — it's just gone. Whereas \frac{1}{x^2} blows up positively from both sides, so \infty is a fair description.
Finding the sign. For a rational function near a zero of the denominator, you don't need to think hard — just track signs of each factor:
\lim_{x\to3^-}\frac{x+1}{x-3}
Near 3, the numerator is \approx 4 (positive). Approaching from the left, x - 3 is a small negative number. Positive over small-negative is a large negative, so the limit is -\infty. From the right, x-3 is small positive, so +\infty.
A vertical asymptote at x = a is exactly this behaviour, and §1.6 pairs it with horizontal asymptotes.
Failure 3: the oscillation
The function neither settles nor grows. It keeps changing its mind, forever.
f(x) = \sin\!\left(\frac1x\right)
As x \to 0^+, the input 1/x runs to infinity, so \sin(1/x) completes infinitely many full cycles in any interval (0, \delta), however small. It takes every value in [-1,1] infinitely often, arbitrarily close to 0. Neither one-sided limit exists.
This failure mode is invisible to sampling, and that's the important part. Choose x_k = \frac{1}{k\pi} and every sample is exactly 0 — a table that looks like it's converging beautifully to 0. Choose x_k = \frac{1}{\pi/2 + 2k\pi} and every sample is exactly 1. Both sequences run to 0. Both tables look convincing. They disagree.
No finite amount of numerical evidence can distinguish "converges to 0" from "oscillates through 0 forever". Any plotting library, any numerical limit routine, any machine-learning model fitted to samples is subject to exactly this blindness. Numerics suggest; proofs decide. This is the lesson to carry through the whole course.
The extreme case
The Dirichlet function fails at every point:
D(x) = \begin{cases}1 & x \text{ rational}\\ 0 & x \text{ irrational}\end{cases}
Any interval, however tiny, contains both rationals and irrationals, so near any a the function takes both values 0 and 1 at points arbitrarily close to a. No limit exists anywhere.
It's not a curiosity for its own sake — it's the standard counterexample that motivates Lebesgue integration, and it's why §15 needs a criterion for Riemann-integrability that D visibly fails.
Repairable or not
| Failure | One-sided limits | Fixable by redefining f(a)? |
|---|---|---|
| Removable hole | both exist, agree | yes — set f(a) to the common value |
| Jump | both exist, disagree | no |
| Blow-up | at least one is infinite | no |
| Oscillation | neither exists | no |
Only the first row is repairable, and that's exactly the situation every derivative lives in: \frac{f(x+h)-f(x)}{h} has a removable hole at h=0, and differentiating is the act of filling it.
Doing it in Python
The jump:
from math import floor
print(f"{'x':>8} {'floor(x)':>10}")
for x in (1.9, 1.99, 1.999, 2.0, 2.001, 2.01, 2.1):
print(f"{x:>8} {floor(x):>10}")
print("\nleft limit 1, right limit 2, value 2 -- an unrepairable jump")
The blow-up, with signs tracked:
def f(x):
return (x + 1) / (x - 3)
print("approaching 3 from the left:")
for x in (2.9, 2.99, 2.999, 2.9999):
print(f" x={x:<8} f(x)={f(x):>14.2f}")
print("approaching 3 from the right:")
for x in (3.1, 3.01, 3.001, 3.0001):
print(f" x={x:<8} f(x)={f(x):>14.2f}")
print("\n-inf from the left, +inf from the right: a vertical asymptote at x=3")
The oscillation, and why tables lie:
from math import sin, pi
def f(x):
return sin(1 / x)
print("sampled one way -- looks like it converges to 0:")
for k in (10, 100, 1000, 10000):
x = 1 / (k * pi)
print(f" x={x:.10f} f(x)={f(x):+.6f}")
print("\nsampled another way -- looks like it converges to 1:")
for k in (10, 100, 1000, 10000):
x = 1 / (pi / 2 + 2 * k * pi)
print(f" x={x:.10f} f(x)={f(x):+.6f}")
print("\nboth sample sets run to x=0. no numerical method can settle this.")
Damping the oscillation makes the limit exist — the subject of the next lesson:
from math import sin
def wild(x):
return sin(1 / x)
def tamed(x):
return x * sin(1 / x)
print(f"{'x':>12} {'sin(1/x)':>12} {'x sin(1/x)':>14} {'|x| bound':>12}")
for k in range(2, 9):
x = 10.0 ** -k
print(f"{x:>12.0e} {wild(x):>12.6f} {tamed(x):>14.3e} {x:>12.0e}")
print("\nthe factor of x crushes the oscillation: |x sin(1/x)| <= |x| -> 0")
Worked example
Classify the behaviour of f(x) = \dfrac{x-2}{x^2-4} at x = 2 and at x = -2.
Factor the denominator: x^2 - 4 = (x-2)(x+2), so
f(x) = \frac{x-2}{(x-2)(x+2)} = \frac{1}{x+2} \qquad (x \neq 2)
At x = 2: the offending factor cancelled. The reduced form \frac{1}{x+2} is perfectly happy at 2, giving \frac14. Both sides agree; the function simply isn't defined at 2. This is a removable hole at (2, \frac14), and defining f(2) = \frac14 repairs it completely.
At x = -2: nothing cancelled. The numerator is -4 (nonzero) and the denominator vanishes. From the left, x + 2 is small negative, so \frac{1}{x+2} \to -\infty; from the right, +\infty. A vertical asymptote, unrepairable.
The general rule this illustrates: for a rational function, factor everything. A zero of the denominator that cancels gives a hole; one that survives gives an asymptote. Both look like \frac00 or \frac{c}{0} before you factor, which is why you always factor first.
Your turn
1. Classify the failure of f(x) = \dfrac{x^2-1}{x-1} at x=1.
2. Find \lim_{x\to1^-}\dfrac{2}{x-1} and \lim_{x\to1^+}\dfrac{2}{x-1}.
3. Does \lim_{x\to0}\cos\!\left(\frac1x\right) exist? Does \lim_{x\to0}x^2\cos\!\left(\frac1x\right)?
Solutions
1. Factor: \frac{(x-1)(x+1)}{x-1} = x+1 for x\neq1. The factor cancels, so both one-sided limits are 2 and they agree — a removable hole at (1,2). Defining f(1) = 2 makes the function continuous.
2. The numerator is a constant 2, so the sign is entirely the denominator's.
From the left, x < 1 makes x - 1 a small negative number, so \lim_{x\to1^-} = -\infty.
From the right, x - 1 is small positive, so \lim_{x\to1^+} = +\infty.
The two-sided limit doesn't exist, and can't even be summarised as \infty.
3. \cos(1/x) does not have a limit. Same argument as \sin(1/x): as x \to 0 the argument runs to infinity and the cosine cycles forever through [-1,1]. Take x = \frac{1}{2k\pi} to get all 1s; take x = \frac{1}{\pi + 2k\pi} to get all -1s.
x^2\cos(1/x) does, and equals 0. The cosine stays bounded in [-1,1] whatever it's doing, so
-x^2 \le x^2\cos\!\left(\frac1x\right) \le x^2
and both bounds go to 0. The oscillation never stops, but its amplitude is crushed to nothing. This is the squeeze theorem, formally the next lesson, and it's the standard way to handle a bounded factor multiplying a vanishing one.
Check yourself in code
Write a classifier that decides how a limit fails at x = 0.
Sample each function at x = \pm 10^{-k} for k = 2 \ldots 7. Then:
- if any sampled |f| > 10^6, report
infinite; - else if each side settles (its last two samples differ by less than 10^{-6})
but the two sides differ by more than 10^{-6}, report
jump; - else if both sides settle and agree, report
exists; - otherwise report
oscillates.
Print exactly this:
1/x infinite
1/x**2 infinite
abs(x)/x jump
sin(1/x) oscillates
x*sin(1/x) exists
from math import sin
funcs = [
("1/x", lambda x: 1 / x),
("1/x**2", lambda x: 1 / x ** 2),
("abs(x)/x", lambda x: abs(x) / x),
("sin(1/x)", lambda x: sin(1 / x)),
("x*sin(1/x)", lambda x: x * sin(1 / x)),
]
KS = range(2, 8)
for name, f in funcs:
right = [f(10.0 ** -k) for k in KS]
left = [f(-(10.0 ** -k)) for k in KS]
# classify: infinite / jump / exists / oscillates
print(f"{name:<14} ...")
from math import sin
funcs = [
("1/x", lambda x: 1 / x),
("1/x**2", lambda x: 1 / x ** 2),
("abs(x)/x", lambda x: abs(x) / x),
("sin(1/x)", lambda x: sin(1 / x)),
("x*sin(1/x)", lambda x: x * sin(1 / x)),
]
KS = range(2, 8)
TOL = 1e-6
for name, f in funcs:
right = [f(10.0 ** -k) for k in KS]
left = [f(-(10.0 ** -k)) for k in KS]
if max(abs(v) for v in right + left) > 1e6:
verdict = "infinite"
else:
settles_r = abs(right[-1] - right[-2]) < TOL
settles_l = abs(left[-1] - left[-2]) < TOL
if settles_r and settles_l:
verdict = "exists" if abs(right[-1] - left[-1]) < TOL else "jump"
else:
verdict = "oscillates"
print(f"{name:<14} {verdict}")
Three failure modes, three signatures. A jump has two good one-sided limits that disagree, and no redefinition can save it. A blow-up is unbounded, gets its own \infty notation, and needs its sign checked side by side. An oscillation never settles and is undetectable by sampling — the reason numerical evidence is a hint and never a proof. Only the removable hole is repairable, and that's the one derivatives live in.
Next: how to compute a limit you can't reach directly, by trapping it between two you can.