Notes for Calculus

Chapter 2 : Limits

Author: Kenneth, S.K. Cheng

Table of Contents

2.1 Limit of Functions

In this chapter, we will be looking at the concept of limits. The concept of limits is important in calculus as it helps us to understand the behavior of functions as they approach a certain value. We will be looking at the definition of limits, the properties of limits, and the different types of limits.

One may wonder why we have to learn about limits. It actually comes from the problem of investigating the behavior of functions as they approach a certain value. For example, consider the function f(x)=x21x1f(x) = \frac{x^2 - 1}{x - 1}. If we substitute x=1x = 1 into the function, we get 12111=00\frac{1^2 - 1}{1 - 1} = \frac{0}{0}. This is known as the function does not define at x=1x = 1. However, one may still want to know the behavior of the function as it approaches x=1x = 1. This is where the concept of limits comes in.

For another function, consider the function f(x)=x2x+2f(x) = x^2 - x +2 which is defined for all xRx \in \mathbb{R}. Suppose we want to investigate the behavior of the function as xx approaches 22, then we may have the following table of value of f(x)f(x) as xx approaches 22:

xx f(x)f(x)
1.9 3.61
1.99 3.9801
1.999 3.998001

While from the right side of x=2x = 2, we have the following table of value of f(x)f(x) as xx approaches 22:

xx f(x)f(x)
2.1 4.31
2.01 4.0399
2.001 4.004001

From the tables, we can see that as xx approaches 22, the value of f(x)f(x) approaches 44. This is known as the limit of the function f(x)f(x) as xx approaches 22 is 44. We denote this as limx2f(x)=4\lim_{x \to 2} f(x) = 4.

For a more general case, we have

Definition (Intuitive Definition): Let f(x)f(x) be a function defined on an open interval containing x=ax = a except possibly at x=ax = a. We say that the limit of f(x)f(x) as xx approaches aa is LL, denoted by limxaf(x)=L\lim_{x \to a} f(x) = L, if we can make the values of f(x)f(x) arbitrarily close to LL by taking xx sufficiently close to aa but not equal to aa.

Roughly speaking, this says that the value of f(x)f(x) can be made arbitrarily close to LL by taking xx sufficiently close to aa but not equal to aa.

Example: Let f(x)=x21f(x) = x^2 - 1 be a function defined for all xRx \in \mathbb{R}. Then, limx1f(x)=0\lim_{x \to 1} f(x) = 0.

Example: Let f(x)=1xf(x) = \frac{1}{x} be a function defined for all xR{0}x \in \mathbb{R} \setminus \{0\}. Then guess the value of limx0f(x)\lim_{x \to 0} f(x).

2.2 One-Sided Limits

In the previous section, we have defined the limit of a function as xx approaches a certain value. However, we may also want to investigate the behavior of the function as xx approaches the value from the left side or the right side. This is where the concept of one-sided limits comes in.

Definition (One-Sided Limits): Let f(x)f(x) be a function defined on an open interval containing x=ax = a except possibly at x=ax = a. We say that the limit of f(x)f(x) as xx approaches aa from the left is LL, denoted by limxaf(x)=L\lim_{x \to a^-} f(x) = L, if we can make the values of f(x)f(x) arbitrarily close to LL by taking xx sufficiently close to aa but not equal to aa and x<ax < a.

Similarly, we say that the limit of f(x)f(x) as xx approaches aa from the right is LL, denoted by limxa+f(x)=L\lim_{x \to a^+} f(x) = L, if we can make the values of f(x)f(x) arbitrarily close to LL by taking xx sufficiently close to aa but not equal to aa and x>ax > a.

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

Example: Discuss whether limx01x2\lim_{x \to 0} \frac{1}{x^2} exists.

Definition (Infinite Limits): Let f(x)f(x) be a function defined on an open interval containing x=ax = a except possibly at x=ax = a. We say that the limit of f(x)f(x) as xx approaches aa is \infty, denoted by limxaf(x)=\lim_{x \to a} f(x) = \infty, if we can make the values of f(x)f(x) arbitrarily large by taking xx sufficiently close to aa but not equal to aa.

Similarly, we say that the limit of f(x)f(x) as xx approaches aa is -\infty, denoted by limxaf(x)=\lim_{x \to a} f(x) = -\infty, if we can make the values of f(x)f(x) arbitrarily large negative by taking xx sufficiently close to aa but not equal to aa.

2.3 Calculating Limits

In this section, we will be looking at the methods of calculating limits. There are several methods to calculate limits, such as direct substitution, factoring, rationalizing, and using the squeeze theorem.

But first, we shall provide the properties of limits.

Properties of Limits:

  1. Sum Rule: limxa[f(x)+g(x)]=limxaf(x)+limxag(x)\lim_{x \to a} [f(x) + g(x)] = \lim_{x \to a} f(x) + \lim_{x \to a} g(x).
  2. Difference Rule: limxa[f(x)g(x)]=limxaf(x)limxag(x)\lim_{x \to a} [f(x) - g(x)] = \lim_{x \to a} f(x) - \lim_{x \to a} g(x).
  3. Product Rule: limxa[f(x)g(x)]=limxaf(x)limxag(x)\lim_{x \to a} [f(x) \cdot g(x)] = \lim_{x \to a} f(x) \cdot \lim_{x \to a} g(x).
  4. Quotient Rule: limxaf(x)g(x)=limxaf(x)limxag(x)\lim_{x \to a} \frac{f(x)}{g(x)} = \frac{\lim_{x \to a} f(x)}{\lim_{x \to a} g(x)} if limxag(x)0\lim_{x \to a} g(x) \neq 0.
  5. Scalar Rule: limxacf(x)=climxaf(x)\lim_{x \to a} c \cdot f(x) = c \cdot \lim_{x \to a} f(x).
  6. Power Rule: limxa[f(x)]n=[limxaf(x)]n\lim_{x \to a} [f(x)]^n = [\lim_{x \to a} f(x)]^n.

Example: Calculate limx2(x21)\lim_{x \to 2} (x^2 - 1).

Example: Calculate limx0(2x23x+1)\lim_{x \to 0} (2x^2 - 3x + 1).

Direct Substitution: If ff is a polynomial or a rational function and aa is in the domain of ff, then limxaf(x)=f(a)\lim_{x \to a} f(x) = f(a).

Example: Calculate limx1x21x1\lim_{x \to 1} \frac{x^2-1}{x-1}.

Factoring: If f(x)f(x) is a rational function and f(a)f(a) is undefined, then we can try to factorize f(x)f(x) and simplify the expression.

2.4 Analysis of Limits

Even though we have the intuition of limits, we may still want to investigate the behavior of functions as they approach a certain value. In this section, we will be providing a more rigorous definition of limits. (I just want you to learn more only, it should be contained in your undergraduate course)

Definition (Epsilon-Delta Definition): Let f(x)f(x) be a function defined on an open interval containing x=ax = a except possibly at x=ax = a. We say that the limit of f(x)f(x) as xx approaches aa is LL, denoted by limxaf(x)=L\lim_{x \to a} f(x) = L, if for every ϵ>0\epsilon > 0, there exists a δ>0\delta > 0 such that if 0<xa<δ0 < |x - a| < \delta, then f(x)L<ϵ|f(x) - L| < \epsilon.

Example: Use the Epsilon-Delta Definition to prove that limx1x2=1\lim_{x \to 1} x^2 = 1.

Proof: Since x21=x1x+1|x^2 - 1| = |x - 1||x + 1|, we want to find a δ\delta such that if 0<x1<δ0 < |x - 1| < \delta, then x+1<ϵ|x + 1| < \epsilon. Let δ=min{1,ϵ2}\delta = \min\left\{1, \frac{\epsilon}{2}\right\}. Then, if 0<x1<δ0 < |x - 1| < \delta, we have x+1<2|x + 1| < 2 and x1<1|x - 1| < 1. Hence, x21=x1x+1<2x1<2δ=ϵ|x^2 - 1| = |x - 1||x + 1| < 2|x - 1| < 2\delta = \epsilon. Hence, limx1x2=1\lim_{x \to 1} x^2 = 1.

2.5 Continuity

In this section, we will be looking at the concept of continuity. The concept of continuity is an extension of the concept of limits. We know from secondary school that a function is continuous if we can draw the graph of the function without lifting the pen. In this section, we will be providing a more rigorous definition of continuity.

Definition (Continuity): Let f(x)f(x) be a function defined on an open interval containing x=ax = a. We say that f(x)f(x) is continuous at x=ax = a if limxaf(x)=f(a)\lim_{x \to a} f(x) = f(a).

Definition (Continuity on an Interval): Let f(x)f(x) be a function defined on an interval II. We say that f(x)f(x) is continuous on II if f(x)f(x) is continuous at every point in II.

Example: Prove that the function f(x)=x2f(x) = x^2 is continuous for all xRx \in \mathbb{R}.

Proof: Let aRa \in \mathbb{R}. Then, limxax2=a2=f(a)\lim_{x \to a} x^2 = a^2 = f(a). Hence, f(x)=x2f(x) = x^2 is continuous for all xRx \in \mathbb{R}.

Example: Prove that the function f(x)=1xf(x) = \frac{1}{x} is continuous for all xR{0}x \in \mathbb{R} \setminus \{0\}.

Proof: Let aR{0}a \in \mathbb{R} \setminus \{0\}. Then, limxa1x=1a=f(a)\lim_{x \to a} \frac{1}{x} = \frac{1}{a} = f(a). Hence, f(x)=1xf(x) = \frac{1}{x} is continuous for all xR{0}x \in \mathbb{R} \setminus \{0\}.

Properties of Continuous Functions: If f(x)f(x) and g(x)g(x) are continuous at x=ax = a, and if cc is a constant, then

  1. f(x)+g(x)f(x) + g(x) is continuous at x=ax = a.
  2. f(x)g(x)f(x) - g(x) is continuous at x=ax = a.
  3. f(x)g(x)f(x) \cdot g(x) is continuous at x=ax = a.
  4. f(x)g(x)\frac{f(x)}{g(x)} is continuous at x=ax = a if g(a)0g(a) \neq 0.
  5. cf(x)c \cdot f(x) is continuous at x=ax = a.
  6. f(x)nf(x)^n is continuous at x=ax = a.
  7. f(g(x))f(g(x)) is continuous at x=ax = a if g(x)g(x) is continuous at x=ax = a and f(x)f(x) is continuous at g(a)g(a).
  8. f(x)\sqrt{f(x)} is continuous at x=ax = a if f(x)0f(x) \geq 0 for all xx in a neighborhood of aa.
  9. f(x)|f(x)| is continuous at x=ax = a.

Example: Find the limit limx2x3+2x2153x\lim_{x \to -2} \frac{x^3+2x^2-1}{5-3x} and determine whether the function is continuous at x=2x = -2.

There is an important theorem that states that if f(x)f(x) is continuous on [a,b][a,b], and let NN be a number between f(a)f(a) and f(b)f(b), then there exists a number cc in [a,b][a,b] such that f(c)=Nf(c) = N. This is known as the Intermediate Value Theorem.

Intermediate Value Theorem: Let f(x)f(x) be a function defined on a closed interval [a,b][a,b]. If f(x)f(x) is continuous on [a,b][a,b], and if NN is a number between f(a)f(a) and f(b)f(b), then there exists a number cc in [a,b][a,b] such that f(c)=Nf(c) = N.

Example: Prove that the equation x33x+1=0x^3 - 3x + 1 = 0 has a solution in the interval [0,1][0,1].

Proof: Let f(x)=x33x+1f(x) = x^3 - 3x + 1. Then, f(0)=1f(0) = 1 and f(1)=1f(1) = -1. Since f(x)f(x) is continuous on [0,1][0,1], and 00 is between f(0)f(0) and f(1)f(1), by the Intermediate Value Theorem, there exists a number cc in [0,1][0,1] such that f(c)=0f(c) = 0. Hence, the equation x33x+1=0x^3 - 3x + 1 = 0 has a solution in the interval [0,1][0,1].

2.6 Solving Limits Problem with Python

In this section, we will be looking at how to solve limits problem with Python. We will be using the sympy library to solve limits problem.

Example: Find the limit limx1x21x1\lim_{x \to 1} \frac{x^2-1}{x-1}.

import sympy as sp

x = sp.symbols('x')
f = (x**2 - 1)/(x - 1) # We use ** for exponentiation
limit = sp.limit(f, x, 1) # the first argument is the function, the second argument is the variable, and the third argument is the value the variable approaches
print(limit)

Example: Find the limit limx0sin(x)x\lim_{x \to 0} \frac{\sin(x)}{x}.

import sympy as sp

x = sp.symbols('x')
f = sp.sin(x)/x
limit = sp.limit(f, x, 0)
print(limit)

The result of the first example is 22 and the result of the second example is 11. The first example is quite obvious, but the latter one is not. We can use Python to verify the result.

2.7 Exercises

  1. Find the limit of the following and determine whether the function is continuous at the given value:
    1. limx0cos(x+sinx)\lim_{x \to 0} \cos(x+\sin x)
    2. limx3x29x2+2x3\lim_{x \to -3} \frac{x^2-9}{x^2+2x-3}
    3. limx3x29x2+2x3\lim_{x \to 3} \frac{x^2-9}{x^2+2x-3}
    4. limr9r3r9\lim_{r \to 9} \frac{\sqrt{r}-3}{r-9}
    5. limt+x+x+x+1x\lim_{t \to +\infty} \frac{\sqrt{x+\sqrt{x+\sqrt{x+1}}}}{\sqrt{x}}
    6. limx+x+x+xx\lim_{x \to +\infty} \sqrt{x+\sqrt{x+\sqrt{x}}} - \sqrt{x}
  2. Use the epsilon-delta definition to prove the following:
    1. limx2(145x)=4\lim_{x \to 2} (14-5x) = 4
    2. limx3(x29)=0\lim_{x \to 3} (x^2-9) = 0
  3. Use the Intermediate Value Theorem to prove the following equations with a solution in the given interval:
    1. x5x3+3x5=0x^5 - x^3 + 3x - 5 = 0 for x[1,2]x \in [1,2]
    2. 2sinx=32x2\sin x = 3 - 2x for x[0,1]x \in [0,1]