Limits are the foundation on which derivatives and integrals are built. A limit
describes the value a function approaches as its input approaches a point — the
function need not be defined at that point. Continuity asks whether the
function actually attains that value, or whether something fails at the point.
Definition of a limit
Consider:
$f(x) = (x^2 - 1) / (x - 1)$
At x = 1 the expression is undefined (0/0). Evaluating near x = 1 — at
x = 0.99, 0.999, 1.001, 1.01 — the outputs approach 2. The limit is 2,
even though f(1) does not exist.
Three standard approaches to evaluating a limit:
- Graphically — inspect whether both sides converge to the same value.
- Numerically — tabulate f(x) for inputs approaching a and observe the trend.
- Algebraically — simplify using limit laws.
1 | import numpy as np |
Formal definition
$\lim_{x \to a} f(x) = L$ means f(x) can be made arbitrarily close to L by
taking x sufficiently close to a, without requiring x = a.
The epsilon-delta formulation makes this precise — see the worked proof below.
One-sided limits
- $\lim_{x \to a^-} f(x)$ — the left-hand limit, approaching a from below.
- $\lim_{x \to a^+} f(x)$ — the right-hand limit, approaching a from above.
The two-sided limit exists if and only if both one-sided limits exist and are equal.
Limit laws
When the individual limits exist, they obey the following rules:
- Sum: $\lim(f+g) = \lim f + \lim g$
- Difference: $\lim(f-g) = \lim f - \lim g$
- Product: $\lim(fg) = (\lim f)(\lim g)$
- Quotient: $\lim(f/g) = (\lim f)/(\lim g)$ — provided the denominator limit is nonzero
- Power: $\lim(f^n) = (\lim f)^n$
- Composition: if f is continuous at L, then $\lim f(g(x)) = f(\lim g(x))$
Indeterminate forms
Indeterminate forms such as $0/0$ or $\infty/\infty$ have no immediately
obvious value. Standard resolution techniques:
- Factor and cancel
- Multiply by the conjugate
- Apply trigonometric identities
- Use series expansions
Factor and cancel:
$\lim_{x \to 1} (x^2 - 1)/(x - 1)$
Since $x^2 - 1 = (x - 1)(x + 1)$, for $x \ne 1$ the expression reduces to $x + 1$.
$\lim_{x \to 1} x + 1 = 2$
Continuity
A function f is continuous at x = a if and only if:
- f(a) is defined
- $\lim_{x \to a} f(x)$ exists
- $\lim_{x \to a} f(x) = f(a)$
If any condition fails, f is discontinuous at a. Discontinuities are classified as:
- Removable — the limit exists, but the function value is absent or incorrect
- Jump — left and right limits are finite but unequal
- Infinite — the function diverges near the point
- Oscillating — the function does not converge to any value (e.g. $\sin(1/x)$ near 0)
Removable discontinuity
$f(x) = (x^2 - 1)/(x - 1)$ reduces to $x + 1$ for $x \ne 1$, but f(1) is
undefined. There is a removable discontinuity (hole) at (1, 2).
1 | import numpy as np |
Jump discontinuity
$$
g(x)=\begin{cases}
-1, & x < 0 \\
1, & x \ge 0
\end{cases}
$$
The left-hand limit at 0 is -1 and the right-hand limit is 1. Since the
one-sided limits are unequal, the two-sided limit does not exist.
1 | import numpy as np |
Vertical asymptotes
When f(x) diverges without bound near a point, we write:
$\lim_{x \to a} f(x) = \infty$
For $f(x) = 1/(x - 2)$, the function diverges to $\pm\infty$ near x = 2, with
the sign determined by the direction of approach.
1 | import numpy as np |
Squeeze theorem
If $h(x) \le f(x) \le k(x)$ near a, and $\lim_{x \to a} h(x) = \lim_{x \to a} k(x) = L$,
then $\lim_{x \to a} f(x) = L$.
A standard application is $\lim_{x \to 0} \sin(x)/x = 1$, established via the
bounds $\cos(x) \le \sin(x)/x \le 1$ for $x$ near 0. Both bounds converge to 1,
so $\sin(x)/x$ is squeezed to 1 as well.
1 | import numpy as np |
Intermediate Value Theorem
If f is continuous on $[a, b]$ and N lies strictly between f(a) and f(b), then
there exists $c \in (a, b)$ such that $f(c) = N$.
Continuous functions cannot skip over intermediate values. This is the
theoretical basis for bisection and related root-finding algorithms.
Common errors
- Cancelling a factor without verifying it is nonzero at the limit point
- Assuming $\lim_{x \to a} f(x) = f(a)$ without establishing continuity
- Overlooking one-sided limits in piecewise-defined functions
- Assuming a function must be defined at a point for the limit to exist there
Epsilon-delta proof
Claim: $\lim_{x \to 2} (3x - 1) = 5$
Definition: for every $\varepsilon > 0$, there must exist $\delta > 0$ such
that $0 < |x - 2| < \delta$ implies $|(3x - 1) - 5| < \varepsilon$.
Bound the expression:
$|(3x - 1) - 5| = |3x - 6| = 3|x - 2|$
Choice of $\delta$: the condition $3|x - 2| < \varepsilon$ is satisfied
when $|x - 2| < \varepsilon/3$.
Conclusion: set $\delta = \varepsilon/3$. Then:
$|(3x - 1) - 5| = 3|x - 2| < 3 \cdot \frac{\varepsilon}{3} = \varepsilon \qquad \square$
Worked examples
Example 1: $\lim_{x \to 3} (x^2 - 9)/(x - 3)$
Factor: $x^2 - 9 = (x - 3)(x + 3)$.
For $x \ne 3$, cancel the common factor: $\lim_{x \to 3} (x + 3) = 6$.
Example 2: $\lim_{x \to 0} (\sqrt{x + 4} - 2) / x$
Multiply numerator and denominator by $\sqrt{x + 4} + 2$:
$$
\frac{\sqrt{x + 4} - 2}{x} \cdot \frac{\sqrt{x + 4} + 2}{\sqrt{x + 4} + 2}
$$
The numerator simplifies to $(x + 4) - 4 = x$. Cancelling x:
$\lim_{x \to 0} \frac{1}{\sqrt{x + 4} + 2} = \frac{1}{4}$
Example 3: piecewise function
$$
f(x)=\begin{cases}
x^2, & x < 1 \\
2x + 1, & x \ge 1
\end{cases}
$$
Left-hand limit: $\lim_{x \to 1^-} x^2 = 1$
Right-hand limit: $\lim_{x \to 1^+} (2x + 1) = 3$
Since the one-sided limits are unequal, the two-sided limit at x = 1 does not exist.
Example 4: $\lim_{x \to 0} 1/x^2$
From both sides, $1/x^2$ diverges. The limit is $\infty$, and x = 0 is a
vertical asymptote.