Limits at Infinity and Horizontal Asymptotes
A limit at infinity describes the long-run behaviour of as grows without bound. It gives horizontal asymptotes, the end behaviour of rational and root functions, and the precise language behind "this algorithm's cost grows like ".
The survey lesson Limit Laws and Limits at Infinity shows the common shortcuts. Here we define the notion precisely, prove the basic limit , and handle the cases where the shortcuts need care: square roots, signs at , and .
Definitions
means can be made as close to as we like by taking large enough. Precisely: for every there is a number such that
For replace by . The line is a horizontal asymptote of if as or as . A graph may cross its horizontal asymptote, even infinitely often: crosses at every multiple of .
Infinite limits at infinity: as means for every there is with . Examples: , , , .
The basic limit
Theorem. If is rational, then as . (If is defined for negative , also as .)
Proof. Given , let . For we get , so . ∎
The limit laws from Calculating Limits Using the Limit Laws still hold with replaced by , so this one theorem handles every rational function.
Rational functions: divide by the highest power
Divide numerator and denominator by the highest power of in the denominator, then apply :
| Degrees (top , bottom ) | Limit as | Asymptote |
|---|---|---|
| ratio of leading coefficients | ||
| (sign from leading terms) | none horizontal; slant if |
Roots and signs at
Square roots need care because , which is when .
So this function has two horizontal asymptotes, and .
and the conjugate
looks like , which is indeterminate. Multiply by the conjugate:
import sympy as sp
x = sp.symbols('x')
f = sp.sqrt(9*x**2 + 1)/(2*x - 5)
print("rational:", sp.limit((4*x**3 - x + 2)/(2*x**3 + 5*x**2), x, sp.oo))
print("root, +oo:", sp.limit(f, x, sp.oo), " root, -oo:", sp.limit(f, x, -sp.oo))
print("conjugate:", sp.limit(sp.sqrt(x**2 + 6*x) - x, x, sp.oo))
print("exp/arctan:", sp.limit(sp.exp(-x), x, sp.oo), sp.limit(sp.atan(x), x, -sp.oo))
for v in [1e3, 1e6, 1e9]:
print(f"x={v:g}: float formula {(v*v + 6*v)**0.5 - v:.6f} rewritten {6*v/((v*v + 6*v)**0.5 + v):.6f}")rational: 2
root, +oo: 3/2 root, -oo: -3/2
conjugate: 3
exp/arctan: 0 -pi/2
x=1000: float formula 2.995513 rewritten 2.995513
x=1e+06: float formula 2.999995 rewritten 2.999996
x=1e+09: float formula 3.000000 rewritten 3.000000
The conjugate is not just algebra: for very large the direct formula subtracts two nearly equal floats, while the rewritten one never does.
Comparing growth rates
At infinity, every positive power of beats every power of , and every exponential with beats every power of :
These are proved with l'Hospital's rule in Indeterminate Forms and l'Hospital's Rule. Here is the numerical picture:
import math
print(f"{'n':>6} {'ln n':>8} {'sqrt n':>8} {'n^2':>12} {'2^n':>14}")
for n in [10, 20, 40, 80]:
print(f"{n:>6} {math.log(n):8.3f} {math.sqrt(n):8.3f} {n**2:12d} {2**n:14.3e}")
print("n^10 / 2^n at n = 100:", 100**10 / 2**100) n ln n sqrt n n^2 2^n
10 2.303 3.162 100 1.024e+03
20 2.996 4.472 400 1.049e+06
40 3.689 6.325 1600 1.100e+12
80 4.382 8.944 6400 1.209e+24
n^10 / 2^n at n = 100: 7.888609052210118e-11
In software
- Big-O. means stays bounded as ; means . The degree table above is why is (Data Structures & Algorithms).
- Saturating functions. The sigmoid has asymptotes and ; has . Their flat tails are why large inputs give tiny gradients ("vanishing gradients") in neural networks.
- Easing and smoothing. Exponential smoothing approaches the target as a horizontal asymptote, the standard trick for camera follow and UI animations that settle without overshoot.
Exercises
Exercise 1: Rational limit
Find as .
Answer
Solution
Exercise 2: Two asymptotes
Find all horizontal asymptotes of .
Answer
(as ) and (as ).
Solution
Exercise 3: - proof
Prove as , and find for .
Answer
; for , .
Solution
Exercise 4: Conjugate in code
Compute as by hand, then confirm with SymPy.
Answer
Solution
import sympy as sp
x = sp.symbols('x')
print(sp.limit(x - sp.sqrt(x**2 - 4*x), x, sp.oo))2
Test yourself
What is as ?
Why does need care when ?
- is undefined for negative
- for
- for all
- Square roots have no limits at
Can a graph cross its horizontal asymptote?
- Never
- Only once
- Yes, even infinitely many times
- Only for rational functions