← Math|24 of 100
Calculus

Limits and Continuity

Master limits, continuity, epsilon-delta definitions, limit laws, L'Hôpital's rule, and their role in derivatives, integrals, and AI/ML optimization.

📂 Foundations📖 Lesson 24 of 100🎓 Free Course

Advertisement

Limits and Continuity

ℹ️ Why It Matters

Limits are the foundation of calculus. Every derivative, integral, and convergence proof rests on the concept of a limit. In machine learning, limits explain why gradient descent converges, why loss functions stabilize, and why certain approximations work. Without limits, you cannot understand the mathematics behind modern AI — from the backpropagation algorithm to the asymptotic analysis of training complexity.


What is a Limit?

DfLimit (Intuitive Definition)

The limit of f(x)f(x) as xx approaches aa is the value f(x)f(x) gets closer and closer to as xx gets arbitrarily close to aa (from either side), but not equal to aa. The function does not need to be defined at aa — only near aa.

Limit Notation

limxaf(x)=L\lim_{x \to a} f(x) = L

Here,

  • f(x)f(x)=The function being evaluated
  • aa=The point x approaches
  • LL=The limit value (the value f(x) approaches)

DfLimit (Epsilon-Delta Definition)

The limit of f(x)f(x) as xx approaches aa equals LL if for every ϵ>0\epsilon > 0, there exists a δ>0\delta > 0 such that whenever 0<xa<δ0 < |x - a| < \delta, it follows that f(x)L<ϵ|f(x) - L| < \epsilon. Symbolically:

Epsilon-Delta Definition

ϵ>0,  δ>0 such that 0<xa<δ    f(x)L<ϵ\forall\, \epsilon > 0,\; \exists\, \delta > 0 \text{ such that } 0 < |x - a| < \delta \implies |f(x) - L| < \epsilon

Here,

  • ϵ\epsilon=An arbitrarily small positive tolerance around L
  • δ\delta=The corresponding tolerance around a
  • LL=The claimed limit value

💡 How to think about epsilon-delta

Think of it as a challenge-response game: your opponent picks any tolerance ϵ\epsilon around LL, and you must find a neighborhood δ\delta around aa so that every xx in that neighborhood maps within ϵ\epsilon of LL. If you can always win, the limit exists.

📝Example: Proving a Limit with Epsilon-Delta

Prove that limx2(3x+1)=7\lim_{x \to 2}(3x + 1) = 7.

We need: given ϵ>0\epsilon > 0, find δ>0\delta > 0 such that 0<x2<δ    (3x+1)7<ϵ0 < |x - 2| < \delta \implies |(3x+1) - 7| < \epsilon.

Simplify: 3x+17=3x6=3x2|3x + 1 - 7| = |3x - 6| = 3|x - 2|. So we need 3x2<ϵ3|x - 2| < \epsilon, i.e., x2<ϵ/3|x - 2| < \epsilon/3.

Choose δ=ϵ/3\delta = \epsilon/3. Then 0<x2<δ    3x2<3δ=ϵ0 < |x - 2| < \delta \implies 3|x-2| < 3\delta = \epsilon. QED.


Limit Laws

ThLimit Laws (Algebraic Properties)

Assume limxaf(x)=L\lim_{x \to a} f(x) = L and limxag(x)=M\lim_{x \to a} g(x) = M exist. Then:

  1. Sum Law: limxa[f(x)+g(x)]=L+M\lim_{x \to a}[f(x) + g(x)] = L + M
  2. Difference Law: limxa[f(x)g(x)]=LM\lim_{x \to a}[f(x) - g(x)] = L - M
  3. Product Law: limxa[f(x)g(x)]=LM\lim_{x \to a}[f(x) \cdot g(x)] = L \cdot M
  4. Quotient Law: limxaf(x)g(x)=LM\lim_{x \to a}\frac{f(x)}{g(x)} = \frac{L}{M}, provided M0M \neq 0
  5. Constant Multiple Law: limxa[cf(x)]=cL\lim_{x \to a}[c \cdot f(x)] = c \cdot L for any constant cc
  6. Power Law: limxa[f(x)]n=Ln\lim_{x \to a}[f(x)]^n = L^n for any positive integer nn
  7. Root Law: limxaf(x)n=Ln\lim_{x \to a}\sqrt[n]{f(x)} = \sqrt[n]{L} when nn is odd or L>0L > 0
  8. Composite Law: If limxag(x)=L\lim_{x \to a} g(x) = L and ff is continuous at LL, then limxaf(g(x))=f(L)\lim_{x \to a} f(g(x)) = f(L)

ThSqueeze Theorem (Sandwich Theorem)

If g(x)f(x)h(x)g(x) \leq f(x) \leq h(x) for all xx in an open interval containing aa (except possibly at aa), and if limxag(x)=limxah(x)=L\lim_{x \to a} g(x) = \lim_{x \to a} h(x) = L, then limxaf(x)=L\lim_{x \to a} f(x) = L.

📝Example: Using the Squeeze Theorem

Find limx0x2sin ⁣(1x)\lim_{x \to 0} x^2 \sin\!\left(\frac{1}{x}\right).

Since 1sin(1/x)1-1 \leq \sin(1/x) \leq 1, we have x2x2sin(1/x)x2-x^2 \leq x^2 \sin(1/x) \leq x^2.

Both x20-x^2 \to 0 and x20x^2 \to 0 as x0x \to 0, so by the Squeeze Theorem, limx0x2sin(1/x)=0\lim_{x \to 0} x^2 \sin(1/x) = 0.


One-Sided Limits

DfLeft-Hand Limit

The left-hand limit of f(x)f(x) as xx approaches aa is the value f(x)f(x) approaches as xx approaches aa from below (values less than aa):

Left-Hand Limit

limxaf(x)=L\lim_{x \to a^-} f(x) = L

Here,

  • xax \to a^-=x approaches a from the left (x < a)
  • LL=The left-hand limit value

DfRight-Hand Limit

The right-hand limit of f(x)f(x) as xx approaches aa is the value f(x)f(x) approaches as xx approaches aa from above (values greater than aa):

Right-Hand Limit

limxa+f(x)=L\lim_{x \to a^+} f(x) = L

Here,

  • xa+x \to a^+=x approaches a from the right (x > a)
  • LL=The right-hand limit value

ThTwo-Sided Limit Exists iff Both One-Sided Limits Exist and Are Equal

limxaf(x)=L\lim_{x \to a} f(x) = L if and only if limxaf(x)=limxa+f(x)=L\lim_{x \to a^-} f(x) = \lim_{x \to a^+} f(x) = L.

📝Example: One-Sided Limits with the Sign Function

Consider f(x)=sgn(x)={1x<00x=01x>0f(x) = \text{sgn}(x) = \begin{cases} -1 & x < 0 \\ 0 & x = 0 \\ 1 & x > 0 \end{cases}.

  • limx0sgn(x)=1\lim_{x \to 0^-} \text{sgn}(x) = -1
  • limx0+sgn(x)=1\lim_{x \to 0^+} \text{sgn}(x) = 1

Since 11-1 \neq 1, the two-sided limit limx0sgn(x)\lim_{x \to 0} \text{sgn}(x) does not exist.


Infinite Limits and Limits at Infinity

DfInfinite Limit

We write limxaf(x)=\lim_{x \to a} f(x) = \infty if f(x)f(x) grows without bound as xx approaches aa. This does not mean the limit exists in the traditional sense — it is a way of describing the behavior of unbounded growth.

DfLimit at Infinity

We write limxf(x)=L\lim_{x \to \infty} f(x) = L if f(x)f(x) approaches a finite value LL as xx grows without bound. This means ff has a horizontal asymptote y=Ly = L.

Limits at Infinity for Rational Functions

limxanxn+bmxm+={0if n<manbmif n=m±if n>m\lim_{x \to \infty} \frac{a_n x^n + \cdots}{b_m x^m + \cdots} = \begin{cases} 0 & \text{if } n < m \\ \frac{a_n}{b_m} & \text{if } n = m \\ \pm\infty & \text{if } n > m \end{cases}

Here,

  • nn=Degree of the numerator
  • mm=Degree of the denominator
  • an,bma_n, b_m=Leading coefficients

💡 Horizontal Asymptotes

To find horizontal asymptotes, compute limxf(x)\lim_{x \to \infty} f(x) and limxf(x)\lim_{x \to -\infty} f(x). If either limit is finite, that value defines a horizontal asymptote.


Common Limits

LimitValueContext
limx0sinxx\lim_{x \to 0}\frac{\sin x}{x}11Fundamental trigonometric limit
limx01cosxx\lim_{x \to 0}\frac{1 - \cos x}{x}00Follows from sin2+cos2=1\sin^2 + \cos^2 = 1
limx0ex1x\lim_{x \to 0}\frac{e^x - 1}{x}11Definition of exe^x derivative at 0
limx0ln(1+x)x\lim_{x \to 0}\frac{\ln(1+x)}{x}11Definition of ln\ln derivative at 0
limx0(1+x)r1x\lim_{x \to 0}\frac{(1+x)^r - 1}{x}rrGeneralized binomial limit
limn(1+1n)n\lim_{n \to \infty}\left(1 + \frac{1}{n}\right)^neeDefinition of Euler's number
limn(1+kn)n\lim_{n \to \infty}\left(1 + \frac{k}{n}\right)^neke^kGeneralized exponential limit
limx0tanxx\lim_{x \to 0}\frac{\tan x}{x}11Since tanx=sinx/cosx\tan x = \sin x / \cos x
limx0arcsinxx\lim_{x \to 0}\frac{\arcsin x}{x}11Inverse trigonometric limit
limx0arctanxx\lim_{x \to 0}\frac{\arctan x}{x}11Inverse trigonometric limit
limx(1+1x)x\lim_{x \to \infty}\left(1 + \frac{1}{x}\right)^xeeContinuous compounding
limx0ax1x\lim_{x \to 0}\frac{a^x - 1}{x}lna\ln aGeneral exponential limit

Squeeze Theorem

ThSqueeze Theorem (Formal Statement)

Let ff, gg, and hh be functions defined on an open interval containing aa, except possibly at aa itself. If g(x)f(x)h(x)g(x) \leq f(x) \leq h(x) for all xx in the interval and

Squeeze Theorem Condition

limxag(x)=limxah(x)=L\lim_{x \to a} g(x) = \lim_{x \to a} h(x) = L

Here,

  • g(x)g(x)=Lower bound function
  • h(x)h(x)=Upper bound function
  • f(x)f(x)=The function sandwiched between them
  • LL=The common limit of the bounding functions

then limxaf(x)=L\lim_{x \to a} f(x) = L.

📝Example: Squeeze Theorem Application

Find limx0sin(x2)x\lim_{x \to 0} \frac{\sin(x^2)}{x}.

Multiply top and bottom by xx: sin(x2)x=xsin(x2)x2\frac{\sin(x^2)}{x} = x \cdot \frac{\sin(x^2)}{x^2}.

As x0x \to 0, we have x20x^2 \to 0, so sin(x2)x21\frac{\sin(x^2)}{x^2} \to 1.

Therefore limx0sin(x2)x=01=0\lim_{x \to 0} \frac{\sin(x^2)}{x} = 0 \cdot 1 = 0.


L'Hôpital's Rule

ThL'Hôpital's Rule

If limxaf(x)=limxag(x)=0\lim_{x \to a} f(x) = \lim_{x \to a} g(x) = 0 (both approach 0) or both approach ±\pm\infty, and if limxaf(x)g(x)\lim_{x \to a} \frac{f'(x)}{g'(x)} exists (or equals ±\pm\infty), then:

L'Hôpital's Rule

limxaf(x)g(x)=limxaf(x)g(x)\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}

Here,

  • f(x)f(x)=Numerator (approaches 0 or ±∞)
  • g(x)g(x)=Denominator (approaches 0 or ±∞)
  • f(x)f'(x)=Derivative of numerator
  • g(x)g'(x)=Derivative of denominator

⚠️ When NOT to use L'Hôpital's Rule

L'Hôpital's Rule only applies to indeterminate forms 00\frac{0}{0} or ±±\frac{\pm\infty}{\pm\infty}. If substituting x=ax = a gives a form like 05\frac{0}{5} or 30\frac{3}{0}, do not use L'Hôpital's Rule — evaluate directly.

📝Example: L'Hôpital's Rule

Compute limx0ex1xx2\lim_{x \to 0}\frac{e^x - 1 - x}{x^2}.

Substituting x=0x = 0: e0100=00\frac{e^0 - 1 - 0}{0} = \frac{0}{0} — indeterminate.

Apply L'Hôpital: limx0ex12x=00\lim_{x \to 0}\frac{e^x - 1}{2x} = \frac{0}{0} again.

Apply L'Hôpital again: limx0ex2=12\lim_{x \to 0}\frac{e^x}{2} = \frac{1}{2}.

📝Example: L'Hôpital's Rule — Infinite Form

Compute limxx2ex\lim_{x \to \infty}\frac{x^2}{e^x}.

Substituting x=x = \infty: \frac{\infty}{\infty} — indeterminate.

Apply L'Hôpital: limx2xex=\lim_{x \to \infty}\frac{2x}{e^x} = \frac{\infty}{\infty}.

Apply L'Hôpital again: limx2ex=0\lim_{x \to \infty}\frac{2}{e^x} = 0.

This shows that exponentials grow faster than polynomials.


Continuity

DfContinuity at a Point

A function ff is continuous at x=ax = a if and only if all three conditions hold:

  1. f(a)f(a) is defined (the function exists at aa)
  2. limxaf(x)\lim_{x \to a} f(x) exists (the left and right limits are equal)
  3. limxaf(x)=f(a)\lim_{x \to a} f(x) = f(a) (the limit equals the function value)

DfContinuity on an Interval

A function is continuous on an interval if it is continuous at every point in the interval. Continuous functions have no breaks, jumps, or holes.

DfTypes of Discontinuities

Removable Discontinuity: The limit exists but f(a)f(a) is either undefined or not equal to the limit. You can "fix" it by redefining f(a)f(a).

Jump Discontinuity: The left and right limits both exist but are not equal. The function "jumps" from one value to another.

Infinite Discontinuity: At least one of the one-sided limits is ±\pm\infty. The function has a vertical asymptote.

Oscillating Discontinuity: The function oscillates infinitely (e.g., sin(1/x)\sin(1/x) near x=0x = 0), so the limit does not exist.

TypeConditionExampleFixable?
Removablelimxaf(x)=L\lim_{x \to a} f(x) = L but f(a)Lf(a) \neq L or f(a)f(a) undefinedf(x)=x21x1f(x) = \frac{x^2 - 1}{x - 1} at x=1x=1Yes (redefine f(a)f(a))
Jumplimxaf(x)limxa+f(x)\lim_{x \to a^-} f(x) \neq \lim_{x \to a^+} f(x)f(x)=xf(x) = \lfloor x \rfloor at integersNo
Infinitelimxaf(x)=±\lim_{x \to a} f(x) = \pm\inftyf(x)=1xf(x) = \frac{1}{x} at x=0x=0No
OscillatingLimit does not exist due to oscillationf(x)=sin(1/x)f(x) = \sin(1/x) at x=0x=0No

Intermediate Value Theorem

ThIntermediate Value Theorem (IVT)

If ff is continuous on the closed interval [a,b][a, b] and NN is any number between f(a)f(a) and f(b)f(b), then there exists at least one c(a,b)c \in (a, b) such that f(c)=Nf(c) = N.

ℹ️ Intuition

A continuous function cannot "skip" values. If you draw it without lifting your pen, and it goes from f(a)=2f(a) = 2 to f(b)=5f(b) = 5, it must pass through every value between 2 and 5.

📝Example: Applying the IVT

Show that f(x)=x3x1f(x) = x^3 - x - 1 has a root in [1,2][1, 2].

  • f(1)=111=1<0f(1) = 1 - 1 - 1 = -1 < 0
  • f(2)=821=5>0f(2) = 8 - 2 - 1 = 5 > 0

Since ff is continuous (polynomial) and 00 is between f(1)f(1) and f(2)f(2), by IVT there exists c(1,2)c \in (1, 2) such that f(c)=0f(c) = 0.


Limits and Derivatives

DfThe Derivative as a Limit

The derivative of ff at xx is defined as a limit of the difference quotient:

Derivative Definition via Limits

f(x)=limh0f(x+h)f(x)hf'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}

Here,

  • f(x)f'(x)=The derivative (instantaneous rate of change)
  • hh=The increment (approaches 0)
  • f(x+h)f(x)h\frac{f(x+h) - f(x)}{h}=The difference quotient (average rate of change)

💡 Key Connection

The entire theory of derivatives rests on limits. Without limits, the concept of an "instantaneous rate of change" is undefined. This is why limits are taught before derivatives — they are the rigorous foundation beneath calculus.


Python Implementation: Numerical Verification of Limits

import numpy as np

def verify_limit(func, a, expected, approach='both', tol=1e-8):
    """Numerically verify that lim_{x -> a} f(x) = expected."""
    results = {}

    if approach in ('both', 'left'):
        x_left = a - np.array([1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6])
        x_left = x_left[x_left != a]  # exclude a itself
        vals_left = [func(x) for x in x_left]
        results['left'] = vals_left

    if approach in ('both', 'right'):
        x_right = a + np.array([1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6])
        vals_right = [func(x) for x in x_right]
        results['right'] = vals_right

    if approach == 'both':
        final = (np.mean(vals_left[-2:]) + np.mean(vals_right[-2:])) / 2
    elif approach == 'left':
        final = np.mean(vals_left[-2:])
    else:
        final = np.mean(vals_right[-2:])

    return final, abs(final - expected) < tol


# Example 1: sin(x)/x -> 1
val, ok = verify_limit(lambda x: np.sin(x) / x if x != 0 else 1.0, a=0, expected=1.0)
print(f"lim x->0 sin(x)/x = {val:.10f}  (expected 1.0)  {'PASS' if ok else 'FAIL'}")

# Example 2: (e^x - 1)/x -> 1
val, ok = verify_limit(lambda x: (np.exp(x) - 1) / x if x != 0 else 1.0, a=0, expected=1.0)
print(f"lim x->0 (e^x-1)/x = {val:.10f}  (expected 1.0)  {'PASS' if ok else 'FAIL'}")

# Example 3: (1 + 1/n)^n -> e
def compound(n):
    return (1 + 1/n) ** n if n != 0 else np.e

val, ok = verify_limit(compound, a=10000, expected=np.e, approach='right')
print(f"lim n->inf (1+1/n)^n = {val:.10f}  (expected {np.e:.10f})  {'PASS' if ok else 'FAIL'}")

# Example 4: Numerical derivative (limit definition)
def f(x):
    return x**2

h_values = np.array([1e-1, 1e-2, 1e-3, 1e-4, 1e-5])
numerical_derivs = [(f(1 + h) - f(1)) / h for h in h_values]
print(f"\nNumerical derivative of x^2 at x=1:")
for h, d in zip(h_values, numerical_derivs):
    print(f"  h={h:.0e}: {d:.10f}")
print(f"  Expected: 2.0")

# Example 5: Squeeze theorem verification — x^2 sin(1/x)
def squeeze_func(x):
    return x**2 * np.sin(1/x) if x != 0 else 0.0

val, ok = verify_limit(squeeze_func, a=0, expected=0.0)
print(f"\nlim x->0 x^2*sin(1/x) = {val:.10f}  (expected 0.0)  {'PASS' if ok else 'FAIL'}")

Applications in AI/ML

Gradient Descent Convergence

ℹ️ Limits in Optimization

When we say gradient descent "converges," we mean limkL(θk)=0\lim_{k \to \infty} \nabla L(\theta_k) = 0. The learning rate η\eta must satisfy η0\eta \to 0 or follow specific schedules so that the limit exists. Without limits, we cannot prove convergence guarantees.

Asymptotic Analysis

Limits allow us to compare algorithm complexity:

  • O(n)O(n) vs O(nlogn)O(n \log n): we evaluate limnnlognn=limnlogn=\lim_{n \to \infty} \frac{n \log n}{n} = \lim_{n \to \infty} \log n = \infty, confirming nlognn \log n is asymptotically larger.
  • Training time for large models: limNFLOPSN\lim_{N \to \infty} \frac{\text{FLOPS}}{N} determines cost scaling.

Convergence of Loss Functions

Convergence Condition

limtL(θt)=L\lim_{t \to \infty} \mathcal{L}(\theta_t) = \mathcal{L}^*

Here,

  • L(θt)\mathcal{L}(\theta_t)=Loss at training step t
  • L\mathcal{L}^*=Optimal (minimum) loss

Probability and Statistics

  • Law of Large Numbers: limnXˉn=μ\lim_{n \to \infty} \bar{X}_n = \mu (sample mean converges to population mean)
  • Central Limit Theorem: Distributional limits underpin confidence intervals
  • Bayesian posterior: limnP(θx1,,xn)=δθ\lim_{n \to \infty} P(\theta | x_1, \ldots, x_n) = \delta_{\theta^*} (posterior concentrates at true parameter)

Neural Network Expressiveness

💡 Universal Approximation

The Universal Approximation Theorem states that for any continuous function ff on [0,1]n[0,1]^n and any ϵ>0\epsilon > 0, there exists a neural network gg such that supxf(x)g(x)<ϵ\sup_{x} |f(x) - g(x)| < \epsilon. This is fundamentally an epsilon-type statement about the limit of approximation quality as network width grows.


Common Mistakes

MistakeWhy It's WrongCorrect Approach
Assuming limxaf(x)=f(a)\lim_{x \to a} f(x) = f(a) alwaysOnly true for continuous functionsCheck all three continuity conditions
Applying L'Hôpital to non-indeterminate forms50\frac{5}{0} is not 00\frac{0}{0}Evaluate directly; only use L'Hôpital for 00\frac{0}{0} or \frac{\infty}{\infty}
Thinking \infty is a number\infty is a concept, not a valueUse limits to describe unbounded behavior rigorously
Confusing limit existence with limit valueThe limit can exist and equal a finite value, or not existCheck both sides: left = right?
Forgetting to check δ\delta exists for all ϵ\epsilonEpsilon-delta requires universal quantificationVerify for every ϵ>0\epsilon > 0, not just small ones
Assuming limf(x)g(x)=limf(x)limg(x)\lim f(x) \cdot g(x) = \lim f(x) \cdot \lim g(x) alwaysOnly valid when both limits exist (finite)Check existence first; 0\infty \cdot 0 is indeterminate
Canceling xx in xx2\frac{x}{x^2} without careMust account for domain (x0x \neq 0)Factor and cancel before taking the limit

Interview Questions

Q1: What is the epsilon-delta definition of a limit, and why is it needed?

A: The epsilon-delta definition provides a rigorous foundation for limits. It eliminates ambiguity by formalizing "approaches" with precise tolerances. Intuitive notions of limits fail for pathological functions (like sin(1/x)\sin(1/x) near 0). The epsilon-delta definition is needed to prove limit laws, establish the correctness of L'Hôpital's Rule, and build calculus on solid logical foundations.


Q2: When does limxaf(x)g(x)\lim_{x \to a} \frac{f(x)}{g(x)} exist even though direct substitution fails?

A: When both f(a)=0f(a) = 0 and g(a)=0g(a) = 0 (or both ±\pm\infty), we have an indeterminate form. The limit may still exist. Techniques include:

  • Factor and cancel common factors
  • Apply L'Hôpital's Rule (differentiate top and bottom)
  • Use series expansion (Taylor series)
  • Use the Squeeze Theorem

Q3: Explain the relationship between one-sided limits and continuity.

A: A function is continuous at aa if and only if:

  1. The left-hand limit limxaf(x)\lim_{x \to a^-} f(x) exists
  2. The right-hand limit limxa+f(x)\lim_{x \to a^+} f(x) exists
  3. Both are equal to f(a)f(a)

If the one-sided limits exist but differ, there is a jump discontinuity. If one or both don't exist, continuity fails.


Q4: Why can't we just use L'Hôpital's Rule for every limit problem?

A: L'Hôpital's Rule only applies to indeterminate forms (00\frac{0}{0} or \frac{\infty}{\infty}). Applying it to non-indeterminate forms gives incorrect results. For example, limx1x+1x=21=2\lim_{x \to 1} \frac{x + 1}{x} = \frac{2}{1} = 2, but applying L'Hôpital gives 11=1\frac{1}{1} = 1, which is wrong. Additionally, L'Hôpital requires the derivatives to exist and the limit of the ratio of derivatives to exist.


Q5: How does the Squeeze Theorem help in machine learning?

A: The Squeeze Theorem is used to:

  • Prove convergence of algorithms when direct evaluation is difficult
  • Establish bounds on error terms in numerical methods
  • Show that noise terms vanish: if you can bound the noise between two functions that both go to 0, the noise itself vanishes
  • Prove that regularized loss functions converge to their unregularized counterparts as the regularization parameter goes to 0

Q6: What happens when you take the limit of a sequence of functions? Is it always continuous?

A: No. The limit of continuous functions can be discontinuous. Consider fn(x)=xnf_n(x) = x^n on [0,1][0, 1]: each fnf_n is continuous, but limnfn(x)\lim_{n \to \infty} f_n(x) equals 0 for x<1x < 1 and 1 at x=1x = 1, which is discontinuous. Uniform convergence (a stronger condition than pointwise convergence) preserves continuity.


Practice Problems

📝Problem 1: Compute the Limit

Evaluate limx01+x1x\lim_{x \to 0}\frac{\sqrt{1 + x} - 1}{x}.

💡Solution

Multiply by the conjugate:

1+x1x1+x+11+x+1=(1+x)1x(1+x+1)=xx(1+x+1)=11+x+1\frac{\sqrt{1+x} - 1}{x} \cdot \frac{\sqrt{1+x} + 1}{\sqrt{1+x} + 1} = \frac{(1+x) - 1}{x(\sqrt{1+x} + 1)} = \frac{x}{x(\sqrt{1+x}+1)} = \frac{1}{\sqrt{1+x}+1}
limx011+x+1=11+1=12\lim_{x \to 0} \frac{1}{\sqrt{1+x}+1} = \frac{1}{\sqrt{1}+1} = \frac{1}{2}

📝Problem 2: Continuity Analysis

Determine where f(x)=x24x25x+6f(x) = \frac{x^2 - 4}{x^2 - 5x + 6} is discontinuous and classify each.

💡Solution

Factor: f(x)=(x2)(x+2)(x2)(x3)f(x) = \frac{(x-2)(x+2)}{(x-2)(x-3)}.

  • At x=2x = 2: removable discontinuity. limx2f(x)=x+2x3x=2=41=4\lim_{x \to 2} f(x) = \frac{x+2}{x-3}\Big|_{x=2} = \frac{4}{-1} = -4. Redefine f(2)=4f(2) = -4 to fix.
  • At x=3x = 3: infinite discontinuity. limx3f(x)=50=±\lim_{x \to 3} f(x) = \frac{5}{0} = \pm\infty. Vertical asymptote at x=3x = 3.

📝Problem 3: L'Hôpital's Rule

Evaluate limx0sinxxx3\lim_{x \to 0}\frac{\sin x - x}{x^3}.

💡Solution

Substituting gives 00\frac{0}{0}. Apply L'Hôpital three times:

  1. limx0cosx13x2=00\lim_{x \to 0}\frac{\cos x - 1}{3x^2} = \frac{0}{0}
  2. limx0sinx6x=00\lim_{x \to 0}\frac{-\sin x}{6x} = \frac{0}{0}
  3. limx0cosx6=16\lim_{x \to 0}\frac{-\cos x}{6} = \frac{-1}{6}

Answer: 16-\frac{1}{6}.


📝Problem 4: Using the Squeeze Theorem

Prove that limx0xcos ⁣(1x)=0\lim_{x \to 0} x \cos\!\left(\frac{1}{x}\right) = 0.

💡Solution

Since 1cos(1/x)1-1 \leq \cos(1/x) \leq 1, we have xxcos(1/x)x-|x| \leq x \cos(1/x) \leq |x|.

As x0x \to 0: limx0(x)=0\lim_{x \to 0}(-|x|) = 0 and limx0x=0\lim_{x \to 0}|x| = 0.

By the Squeeze Theorem, limx0xcos(1/x)=0\lim_{x \to 0} x \cos(1/x) = 0.


📝Problem 5: Limit at Infinity

Evaluate limx3x2+2x5x21\lim_{x \to \infty}\frac{3x^2 + 2x}{5x^2 - 1}.

💡Solution

Divide numerator and denominator by x2x^2:

limx3+2x51x2=3+050=35\lim_{x \to \infty}\frac{3 + \frac{2}{x}}{5 - \frac{1}{x^2}} = \frac{3 + 0}{5 - 0} = \frac{3}{5}

Since the degrees of numerator and denominator are equal, the limit is the ratio of leading coefficients: 35\frac{3}{5}.


Quick Reference

ConceptFormula / RuleKey Point
Limit Definitionlimxaf(x)=L\lim_{x \to a} f(x) = Lf(x)Lf(x) \to L as xax \to a
Epsilon-Deltaϵ>0,δ>0:0<xa<δf(x)L<ϵ\forall \epsilon>0, \exists \delta>0: 0<|x-a|<\delta \Rightarrow |f(x)-L|<\epsilonRigorous definition
Sum Lawlim[f+g]=limf+limg\lim[f+g] = \lim f + \lim gRequires both limits exist
Product Lawlim[fg]=limflimg\lim[fg] = \lim f \cdot \lim gRequires both limits exist
Quotient Lawlim[f/g]=limf/limg\lim[f/g] = \lim f / \lim gDenominator limit 0\neq 0
Squeeze Theoremgfhg \leq f \leq h, limg=limh=L\lim g = \lim h = L \Rightarrow limf=L\lim f = LSandwich ff between bounds
L'Hôpital's Rulelimfg=limfg\lim \frac{f}{g} = \lim \frac{f'}{g'}Only for 00\frac{0}{0} or \frac{\infty}{\infty}
Continuitylimxaf(x)=f(a)\lim_{x \to a} f(x) = f(a)No breaks, jumps, or holes
IVTff continuous on [a,b][a,b], NN between f(a),f(b)f(a),f(b) \Rightarrow c:f(c)=N\exists c: f(c)=NContinuous functions don't skip values
Derivativef(x)=limh0f(x+h)f(x)hf'(x) = \lim_{h \to 0} \frac{f(x+h)-f(x)}{h}Derivative is a limit
limx0sinxx=1\lim_{x \to 0}\frac{\sin x}{x} = 1Fundamental trig limitFoundation for derivatives of trig functions
limn(1+1/n)n=e\lim_{n \to \infty}(1+1/n)^n = eDefinition of eeCompound interest, exponential growth

Cross-References

Lesson Progress24 / 100