Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Motivation

What is the behavior of a function as its argument approaches a certain value? For example, what happens to a function near boundaries of its domain? Near “holes”? Under “extreme” cases, such as when something gets very small?

Some functions have limits. For example:

f(x)=x21x1f(x) = \frac{x^2 - 1}{x - 1}

is not defined when x=1x=1. What happens to it near 1? First, let’s factor and simplify:

f(x)=(x+1)(x1)x1=x+1,x1f(x) = \frac{(x+1)(x-1)}{x-1} = x+1, \quad x \neq 1

So, we expect that f should be well-behaved and have a value that approaches 2 as x approaches 1! Let’s verify numerically:

xxff
0.91.9
0.991.99
0.9991.999
1.0012.001
1.012.01
1.12.1

and also looking at a graph

Limit Exists

However, some functions do not have limits. For example:

f(x)=1xf(x) = \frac{1}{x}

is not defined at x=0x = 0. As x approaches zero from the positive or negative side, the function “blows up” to ±\pm\infty. The sign depends on whether x is positive or negative.

xxf(x)f(x)
0.110
0.01100
-0.01-100
-0.1-10

This divergence is clear on a plot:

No Limit Exists

We say that such a limit does not exist.

Formal definition

ϵ\epsilon is a tolerance setting how close f needs to be to L. Given any ϵ\epsilon, we need to find a “window” of x values within δ\delta of x0x_0 so that f stays within ϵ\epsilon of L. For example, consider the following:

Limit Graph

Based on this plot, if ϵ=1\epsilon = 1, 3<f<53 < f < 5 if 3<x<53 < x < 5 (i.e., δ=1\delta = 1). For a general ϵ\epsilon, 4ϵ<f<4+ϵ4 - \epsilon < f < 4 + \epsilon if 4δ<x<4+δ4 - \delta < x < 4 + \delta or equivalently, x4<ϵ|x-4| < \epsilon. We hence identify δ=ϵ\delta = \epsilon and have proven that

limx4f=4\lim_{x \to 4} f = 4

However, such a δ\delta cannot always be found for all ϵ\epsilon for certain functions! There, the limit does not exist. For example, consider

f(x)={x,x<4x2,x4f(x) = \begin{cases} x,& x < 4 \\ x-2,& x \ge 4 \end{cases}
Limit Graph 2

Does the limit

limx4f(x)=3\lim_{x \to 4} f(x) = 3

exist? If \epsilon = 0.5, there is no δ\delta that contains f around x0=4x_0 = 4. Therefore, this limit does not exsit

This math formalism is powerful, but clunky to apply. We will now move onto using rules (limit laws) that have been proven using them!

Limit laws

There are some simple limits and rules for combining them that are convenient to know because they can be used to evaluate limits of more complicated functions:

Taking limits

“Nice” functions can be evaluated directly

limx1x3+4x23=(1)3+4(1)23=1+43=0\begin{align} \lim_{x \to -1} x^3 + 4x^2 -3 &= (-1)^3 + 4(-1)^2 -3 \\ &= -1 + 4 -3 \\ &= 0 \end{align}

This works even if they are complicated

limx4(x2+9x+1)1/2=(42+94+1)1/2=(255)1/2=5\begin{align} \lim_{x \to 4} \left(\frac{x^2 + 9}{x + 1} \right)^{1/2} &= \left(\frac{4^2 + 9}{4 + 1} \right)^{1/2} \\ &= \left(\frac{25}{5}\right)^{1/2} \\ &= \sqrt{5} \end{align}

Limits are most useful when functions have “holes” (function is not defined at x0x_0)

limx1x2+x2x2x=limx1(x+2)(x+1)x(x+1)=limx1x+2x=3\begin{align} \lim_{x \to 1} \frac{x^2 + x -2}{x^2 - x} &= \lim_{x \to 1} \frac{(x+2)(x+1)}{x(x+1)} \\ &= \lim_{x \to 1} \frac{x+2}{x} \\ &= 3 \end{align}

Note that this function had a “hole” at x=1x = 1 that we removed by factoring. This works even if the factors are “ugly”:

limx44xx22x=limx4x(4x)2x=limx4x(2+x)(2x)2x=limx4x(2+x)=4(2+4)=16\begin{align} \lim_{x \to 4} \frac{4x - x^2}{2 - \sqrt{x}} &= \lim_{x \to 4} \frac{x(4 - x)}{2 - \sqrt{x}} \\ &= \lim_{x \to 4} \frac{x(2 + \sqrt{x})(2 - \sqrt{x})}{2 - \sqrt{x}} \\ &= \lim_{x \to 4} x(2 + \sqrt{x}) \\ &= 4(2 + \sqrt{4}) \\ &= 16 \end{align}

Here, we made use of the difference of squares identity:

a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b)

Another useful trick is to multiply by a factor of “1” that makes a difference of squares (multiply by conjugate)

limx03x+11x=limx0(3x+11)(3x+1+1)x(3x+1+1)=limx0(3x+1)212x(3x+1+1)=limx03x+11x(3x+1+1)=limx033x+1+1=32\begin{align} \lim_{x \to 0} \frac{\sqrt{3x + 1} - 1}{x} &= \lim_{x \to 0} \frac{(\sqrt{3x + 1} - 1)(\sqrt{3x + 1} + 1)}{x(\sqrt{3x + 1} + 1)} \\ &= \lim_{x \to 0} \frac{(\sqrt{3x + 1})^2 - 1^2}{x(\sqrt{3x + 1} + 1)} \\ &= \lim_{x \to 0} \frac{3x + 1 - 1}{x(\sqrt{3x + 1} + 1)} \\ &= \lim_{x \to 0} \frac{3}{\sqrt{3x + 1} + 1} \\ &= \frac{3}{2} \end{align}

Limits at infinity

How do functions behave when x gets “big”? For example, if the independent variable is time, the behavior after waiting a long time may be a “steady state”.

Population dynamics
Population carrying capacity

This may represent, for example, a population with limited resources.

Proportional-integral control
Controller response

This may represent, for example, the response of a servo or valve over time.

i.e., f gets close to L when x is “big”.

Some important limits at infinity:

Other limit laws (sum, quotient, etc.) also hold at infinity! If function is already in a convenient form, use known limits to evaluate unknown ones. For example,

limx5+1x=limx5+limx1x=5+0=5\lim_{x \to \infty} 5 + \frac{1}{x} = \lim_{x \to \infty} 5 + \lim_{x \to \infty} \frac{1}{x} = 5 + 0 = 5

For rational functions f(x)=p(x)/q(x)f(x) = p(x) / q(x), divide by largest power of x in denominator:

limx11x+22x31=limx11xx3+2x32x3x3+1x3=0+020=0\lim_{x \to -\infty} \frac{11x + 2}{2x^3-1} = \lim_{x \to -\infty} \frac{ \dfrac{11x}{x^3} + \dfrac{2}{x^3} }{ \dfrac{2x^3}{x^3} + \dfrac{1}{x^3}} = \frac{0 + 0}{2 - 0} = 0
limx5x2+8x33x2+4=limx5+8x3x23+2x2=5+0030=53\lim_{x \to \infty} \frac{5x^2+8x-3}{3x^2+4} = \lim_{x \to \infty} \frac{ 5 + \dfrac{8}{x} - \dfrac{3}{x^2} }{ 3 + \dfrac{2}{x^2} } = \frac{5+0-0}{3 - 0} = \frac{5}{3}

Not all functions have limits at infinity. Some “blow up”!

limx2x237x+4=limx2x3x7+4x\lim_{x \to \infty} \frac{2x^2-3}{7x+4} = \lim_{x \to \infty} \frac{ 2x - \frac{3}{x} }{ 7 + \frac{4}{x} }

This limit does not exist. A helpful shortcut for rational polynomials: check coefficients of highest powers in numerator and denominator!

One-sided limits

How do functions behave as you approach a point x0x_0 from a direction? One physical example of this is an old question in statistical mechanics: when you have vapor-liquid phase coexistence, does the density change stepwise or continuously at the interface?

If the density as a function of distance from the interface is ρ(z)\rho(z), the liquid density can be denoted as limz0ρ(z)\lim_{z \to 0^-} \rho(z), while the vapor density can be denoted as limz0+ρ(z)\lim_{z \to 0^+} \rho(z).

For example, if

f(x)=xx={1,x<01,x>0f(x) = \frac{|x|}{x} = \begin{cases} -1, & x<0\\ 1, & x>0 \end{cases}

We see that limx0+f(x)=1\lim_{x \to 0^+} f(x) = 1 (the value from the right), while limx0f(x)=1\lim_{x \to 0^-} f(x) = -1 (the value from the left). Thus, limx0f(x)\lim_{x \to 0} f(x) does not exist.

Normal limit laws also still apply to one-sided limits:

limx2+(xx+1)(2x+5x2+x)=(22+1)(4+542)=1\lim_{x \to -2^+} \left( \frac{x}{x+1} \right) \left( \frac{2x + 5}{x^2 + x} \right) = \left( \frac{-2}{-2 + 1} \right) \left( \frac{-4 + 5}{4 - 2} \right) = 1

However, be careful about which piece of the function applies:

limx2(x+3)x+2x+2=(limx2x+3)(limx2x+2x+2)=(2+3)(1)=1\begin{align} \lim_{x \to -2^-} (x + 3) \frac{|x + 2|}{x + 2} &= \left( \lim_{x \to -2^-} x + 3 \right) \left( \lim_{x \to -2^-} \frac{|x + 2|}{x + 2} \right) \\ &= (-2 + 3)(-1) = -1 \end{align}

where we used the limit we already found of f(x)=x/xf(x) = |x|/x above to evaluate the second limit.

One-sided limit challenge

Using

One-sided limit function

Find the limits at x=1x = 1 and x=2x = 2.

Solution

From the graph, limx1f(x)=0\lim_{x \to 1^-} f(x) = 0 and limx1+f(x)=1\lim_{x \to 1^+} f(x) = 1, so limx1f(x)\lim_{x \to 1} f(x) does not exist. However, limx2f(x)=1\lim_{x \to 2^-} f(x) = 1 and limx2+f(x)=1\lim_{x \to 2^+} f(x) = 1, so limx2f(x)=1\lim_{x \to 2} f(x) = 1, even though f(2)=2f(2) = 2.

Infinite limits

Some functions tend to ±\pm\infty at a value, even if they do not have a limit.

f(x)=1/x2f(x) = 1/x^2
Infinite limit exists

Limit exists and is ++\infty.

g(x)=1/xg(x) = 1/x
Infinite limit does not exist

Limit does not exist.

This behavior can be used to define a vertical asymptote of a function:

L’Hôpital’s Rule

L’Hôpital’s rule is a method that allows you to calculate limits of certain indeterminate forms using derivatives.

Let’s work some examples:

limx0sinxx\displaystyle \lim_{x\to 0} \frac{\sin x}{x}

The limits of the numerator and denominator are both zero, so:

limx0sinxx=limx0cosx1=1\lim_{x\to 0} \frac{\sin x}{x} = \lim_{x\to 0} \frac{\cos x}{1} = 1

limx0xsinxx3\displaystyle \lim_{x\to 0} \frac{x-\sin x}{x^3}

The limits of the numerator and denominator are both zero, so:

limx0xsinxx3=limx01cosx3x2=limx0sinx6x=16limx0sinxx=16\begin{align} \lim_{x\to 0} \frac{x-\sin x}{x^3} &= \lim_{x\to 0} \frac{1-\cos x}{3x^2} \\ &= \lim_{x\to 0} \frac{\sin x}{6x} \\ &= \frac{1}{6} \lim_{x\to 0} \frac{\sin x}{x} = \frac{1}{6} \end{align}

where we used L’Hôpital’s rule twice, then used the result from the first example.

limxln(x)2x\displaystyle \lim_{x\to \infty} \frac{\ln(x)}{2\sqrt{x}}

The limits of the numerator and denominator are both \infty, so:

limxlnx2x=limx1/x1/x=limx1x=0\begin{align} \lim_{x\to \infty} \frac{\ln x}{2\sqrt{x}} &= \lim_{x\to \infty} \frac{1/x}{1/\sqrt{x}} \\ &= \lim_{x\to \infty} \frac{1}{\sqrt{x}} = 0 \end{align}

where the last limit is obtained by simplification.

limxexx2\displaystyle \lim_{x\to \infty} \frac{e^x}{x^2}

The limits of the numerator and denominator are both \infty, so:

limxexx2=limxex2x=limxex2=\begin{align} \lim_{x\to \infty} \frac{e^x}{x^2} &= \lim_{x\to \infty} \frac{e^x}{2x} \\ &= \lim_{x\to \infty} \frac{e^x}{2} = \infty \end{align}

Here, we used L’Hôpital’s rule twice, but then ultimately found that the limit does not exist.

limxxsin(1/x)\displaystyle \lim_{x\to \infty} x\sin(1/x)

This limit is not in a form that’s immediately suitable for L’Hôpital’s rule, but it can be made so.

limxxsin(1/x)=limxsin(1/x)1/x=limxcos(1/x)(1/x2)1/x2=limxcos(1/x)=1\begin{align} \lim_{x\to \infty} x\sin(1/x) &= \lim_{x\to \infty} \frac{\sin(1/x)}{1/x} \\ &= \lim_{x\to \infty} \frac{\cos(1/x)(-1/x^2)}{-1/x^2} \\ &= \lim_{x\to \infty} \cos(1/x) = 1 \end{align}

Another option in this case would be to substitute in y=1/xy = 1/x, then note that y0y \to 0 as xx \to \infty so we have

limy0sinyy=1\lim_{y\to 0} \frac{\sin y}{y} = 1

which we already solved!