TExcelTAD
Home › Calculus in Depth › Limits at Infinity and Horizontal Asymptotes

Limits at Infinity and Horizontal Asymptotes

A limit at infinity describes the long-run behaviour of f(x)f(x) as xx 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 n2n^2".

The survey lesson Limit Laws and Limits at Infinity shows the common shortcuts. Here we define the notion precisely, prove the basic limit 1/xr→01/x^r \to 0, and handle the cases where the shortcuts need care: square roots, signs at −∞-\infty, and ∞−∞\infty - \infty.

Definitions

lim⁡x→∞f(x)=L\lim_{x \to \infty} f(x) = L

means f(x)f(x) can be made as close to LL as we like by taking xx large enough. Precisely: for every ε>0\varepsilon > 0 there is a number NN such that

x>N  ⟹  ∣f(x)−L∣<εx > N \quad\implies\quad \lvert f(x) - L \rvert < \varepsilon

For x→−∞x \to -\infty replace x>Nx > N by x<Nx < N. The line y=Ly = L is a horizontal asymptote of y=f(x)y = f(x) if f(x)→Lf(x) \to L as x→∞x \to \infty or as x→−∞x \to -\infty. A graph may cross its horizontal asymptote, even infinitely often: sin⁡(x)/x\sin(x)/x crosses y=0y = 0 at every multiple of π\pi.

Infinite limits at infinity: lim⁡f(x)=∞\lim f(x) = \infty as x→∞x \to \infty means for every MM there is NN with x>N  ⟹  f(x)>Mx > N \implies f(x) > M. Examples: x3x^3, exe^x, ln⁡x\ln x, x\sqrt{x}.

The basic limit

Theorem. If r>0r > 0 is rational, then 1/xr→01/x^r \to 0 as x→∞x \to \infty. (If xrx^r is defined for negative xx, also as x→−∞x \to -\infty.)

Proof. Given ε>0\varepsilon > 0, let N=ε−1/rN = \varepsilon^{-1/r}. For x>Nx > N we get xr>Nr=1/εx^r > N^r = 1/\varepsilon, so 0<1/xr<ε0 < 1/x^r < \varepsilon. ∎

The limit laws from Calculating Limits Using the Limit Laws still hold with aa replaced by ±∞\pm\infty, so this one theorem handles every rational function.

Rational functions: divide by the highest power

Divide numerator and denominator by the highest power of xx in the denominator, then apply 1/xr→01/x^r \to 0:

4x3−x+22x3+5x2=4−1/x2+2/x32+5/x→42=2\frac{4x^3 - x + 2}{2x^3 + 5x^2} = \frac{4 - 1/x^2 + 2/x^3}{2 + 5/x} \to \frac{4}{2} = 2
Degrees (top pp, bottom qq) Limit as x→±∞x \to \pm\infty Asymptote
p<qp < q 00 y=0y = 0
p=qp = q ratio of leading coefficients y=ap/bqy = a_p/b_q
p>qp > q ±∞\pm\infty (sign from leading terms) none horizontal; slant if p=q+1p = q + 1

Roots and signs at −∞-\infty

Square roots need care because x2=∣x∣\sqrt{x^2} = \lvert x \rvert, which is −x-x when x<0x < 0.

f(x)=9x2+12x−5x→∞:divide by x=x2:9+1/x22−5/x→32x→−∞:divide by x=−x2:−9+1/x22−5/x→−32\begin{aligned} &f(x) = \frac{\sqrt{9x^2 + 1}}{2x - 5} \\ &x \to \infty{:}\quad \text{divide by } x = \sqrt{x^2}{:} \quad \frac{\sqrt{9 + 1/x^2}}{2 - 5/x} \to \frac{3}{2} \\ &x \to -\infty{:}\quad \text{divide by } x = -\sqrt{x^2}{:} \quad -\frac{\sqrt{9 + 1/x^2}}{2 - 5/x} \to -\frac{3}{2} \end{aligned}

So this function has two horizontal asymptotes, y=32y = \frac{3}{2} and y=−32y = -\frac{3}{2}.

∞−∞\infty - \infty and the conjugate

x2+6x−x\sqrt{x^2 + 6x} - x looks like ∞−∞\infty - \infty, which is indeterminate. Multiply by the conjugate:

x2+6x−x=x2+6x−x2x2+6x+x=6xx2+6x+x=61+6/x+1→62=3(x→∞)\begin{aligned} \sqrt{x^2 + 6x} - x &= \frac{x^2 + 6x - x^2}{\sqrt{x^2 + 6x} + x} = \frac{6x}{\sqrt{x^2 + 6x} + x} \\ &= \frac{6}{\sqrt{1 + 6/x} + 1} \to \frac{6}{2} = 3 && (x \to \infty) \end{aligned}
python · try it yourself
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 xx the direct formula subtracts two nearly equal floats, while the rewritten one never does.

Comparing growth rates

At infinity, every positive power of xx beats every power of ln⁡x\ln x, and every exponential bxb^x with b>1b > 1 beats every power of xx:

lim⁡ln⁡xxp=0,lim⁡xpex=0(p>0, x→∞)\lim \frac{\ln x}{x^p} = 0, \qquad \lim \frac{x^p}{e^x} = 0 \qquad (p > 0,\ x \to \infty)

These are proved with l'Hospital's rule in Indeterminate Forms and l'Hospital's Rule. Here is the numerical picture:

python · try it yourself
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. f(n)=O(g(n))f(n) = O(g(n)) means f(n)/g(n)f(n)/g(n) stays bounded as n→∞n \to \infty; f=o(g)f = o(g) means f(n)/g(n)→0f(n)/g(n) \to 0. The degree table above is why 3n2+100n3n^2 + 100n is O(n2)O(n^2) (Data Structures & Algorithms).
  • Saturating functions. The sigmoid 11+e−x\frac{1}{1 + e^{-x}} has asymptotes y=0y = 0 and y=1y = 1; tanh⁡\tanh has y=±1y = \pm 1. Their flat tails are why large inputs give tiny gradients ("vanishing gradients") in neural networks.
  • Easing and smoothing. Exponential smoothing x←x+k(target−x)x \leftarrow x + k(\text{target} - x) 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 lim⁡5x2−3x1−2x2\lim \frac{5x^2 - 3x}{1 - 2x^2} as x→−∞x \to -\infty.

Answer

−52-\frac{5}{2}

Solution
divide by x2:5−3/x1/x2−2→5−2=−52(the sign of x does not matter because x2>0)\begin{aligned} &\text{divide by } x^2{:} \quad \frac{5 - 3/x}{1/x^2 - 2} \to \frac{5}{-2} = -\frac{5}{2} \\ &(\text{the sign of } x \text{ does not matter because } x^2 > 0) \end{aligned}

Exercise 2: Two asymptotes

Find all horizontal asymptotes of y=4x+1x2+3y = \frac{4x + 1}{\sqrt{x^2 + 3}}.

Answer

y=4y = 4 (as x→∞x \to \infty) and y=−4y = -4 (as x→−∞x \to -\infty).

Solution
x>0: x2+3=x1+3/x2, so y=4+1/x1+3/x2→4x<0: x2+3=−x1+3/x2, so y=−4+1/x1+3/x2→−4\begin{aligned} &x > 0{:}\ \sqrt{x^2 + 3} = x\sqrt{1 + 3/x^2}, \text{ so } y = \frac{4 + 1/x}{\sqrt{1 + 3/x^2}} \to 4 \\ &x < 0{:}\ \sqrt{x^2 + 3} = -x\sqrt{1 + 3/x^2}, \text{ so } y = -\frac{4 + 1/x}{\sqrt{1 + 3/x^2}} \to -4 \end{aligned}

Exercise 3: ε\varepsilon-NN proof

Prove lim⁡2x+1x=2\lim \frac{2x + 1}{x} = 2 as x→∞x \to \infty, and find NN for ε=0.001\varepsilon = 0.001.

Answer

N=1/εN = 1/\varepsilon; for ε=0.001\varepsilon = 0.001, N=1000N = 1000.

Solution
∣2x+1x−2∣=∣1x∣=1xfor x>0given ε>0, let N=1/ε; then x>N  ⟹  1/x<ε■\begin{aligned} &\left\lvert \frac{2x + 1}{x} - 2 \right\rvert = \left\lvert \frac{1}{x} \right\rvert = \frac{1}{x} \quad \text{for } x > 0 \\ &\text{given } \varepsilon > 0, \text{ let } N = 1/\varepsilon; \text{ then } x > N \implies 1/x < \varepsilon && \blacksquare \end{aligned}

Exercise 4: Conjugate in code

Compute lim⁡(x−x2−4x)\lim \left(x - \sqrt{x^2 - 4x}\right) as x→∞x \to \infty by hand, then confirm with SymPy.

Answer

22

Solution
x−x2−4x=x2−(x2−4x)x+x2−4x=4xx+x2−4x=41+1−4/x→42=2\begin{aligned} x - \sqrt{x^2 - 4x} &= \frac{x^2 - (x^2 - 4x)}{x + \sqrt{x^2 - 4x}} = \frac{4x}{x + \sqrt{x^2 - 4x}} \\ &= \frac{4}{1 + \sqrt{1 - 4/x}} \to \frac{4}{2} = 2 \end{aligned}
python · try it yourself
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 lim⁡7x4+x3x5−2\lim \frac{7x^4 + x}{3x^5 - 2} as x→∞x \to \infty?

  1. 73\frac{7}{3}
  2. ∞\infty
  3. 00
  4. −2-2

Why does x2\sqrt{x^2} need care when x→−∞x \to -\infty?

  1. x2\sqrt{x^2} is undefined for negative xx
  2. x2=∣x∣=−x\sqrt{x^2} = \lvert x \rvert = -x for x<0x < 0
  3. x2=x\sqrt{x^2} = x for all xx
  4. Square roots have no limits at −∞-\infty

Can a graph cross its horizontal asymptote?

  1. Never
  2. Only once
  3. Yes, even infinitely many times
  4. Only for rational functions