MA1521 Calculus for Computing
Lecture 2
Wong Yan Loi
National University of Singapore
January 14, 2022
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 1 / 42
Calculus - study of rate of change
Differential Calculus and Integral Calculus
Isaac Newton (1642–1727)
Gottfried Wilhelm Leibniz (1646-1716) Weierstrass
Eudoxus of Cnidus (408-355 BC) - Method of Exhaustion
Archimedes (287 - 212 BC)
Wilhelm Weierstrass (1815 -1897) - Limit
Newton Leibniz Eudoxus Archimedes
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 2 / 42
Table of Contents
1 Limits
2 Continuity
3 Evaluation of limits
4 Limits at infinity
5 More on Limits
6 Squeeze (Sandwich) Theorem
7 Intermediate Value Theorem
8 The Precise Definition of the Limit of a Function
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 3 / 42
Chapter 1: Limits and Continuity
Read Thomas’ Calculus, Chapter 2.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 4 / 42
Limits
Limits
Let f be a real-valued function defined on some interval I (e.g.
(a, b), or (a, b] or (a, ∞)). Let c be a point in I.
lim f (x) is the value that f (x) approaches when x
x→c −
approaches c from the left.
lim f (x) is the value that f (x) approaches when x
x→c +
approaches c from the right.
Let c be an interior point (i.e. not an end point). If
lim f (x) = lim+ f (x) = L ∈ R, we say that lim f (x) exist and
x→c − x→c x→c
has value L.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 5 / 42
Limits
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 6 / 42
Limits
Left Limit Right Limit Limit
c lim f (x) lim+ f (x) lim f (x) f (x)
x→c − x→c x→c
0
2
4
-3
6
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 7 / 42
Limits
Left Limit Right Limit Limit
c lim f (x) lim f (x) lim f (x) f (x)
x→c − x→c + x→c
0 0 0 0 0
2 2 2 2 0
4 3 DNE DNE 3
−3 DNE 3 DNE undefined
6 0 DNE DNE 0
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 8 / 42
Continuity
Let f be a real-valued function defined on some interval I (e.g.
(a, b), or (a, b] or (a, ∞)). Let c be a point in I.
Continuity at a point
Case 1 c is an interior point
• f is continuous at x = c if
(i) lim f (x) exists,
x→c
(ii) lim f (x) = f (c).
x→c
Case 2 c is the left end-point
• f is continuous at x = c if
(i) lim+ f (x) exists,
x→c
(ii) lim+ f (x) = f (c).
x→c
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 9 / 42
Continuity
Case 3 c is the right end-point
• f is continuous at x = c if
(i) lim f (x) exists,
x→c −
(ii) lim f (x) = f (c).
x→c −
Continuity on an interval
• f is continuous on an interval if f is continuous at x = c for all
points c in I.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 10 / 42
Continuity
Results
If f and g are continuous at x = c, then for any constant k and any
positive constant n, each of the following functions is continuous
at x = c.
(i) f + g, (ii) f n , (iii) kf , (iv) fg, (v) f /g provided g(c) 6= 0.
If g is continuous at x = c and f is continuous at x = g(c), then
the composite function f ◦ g is continuous at x = c.
(Note (f ◦ g)(x) = f (g(x))).
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 11 / 42
Continuity
Example
Find the points of discontinuity of the function f whose graph on (−3, 6]
is given below.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 12 / 42
Continuity
Solution.
Point of discontinuity Reason
x =2 lim f (x) 6= f (2)
x→2
x =4 lim f (x) does not exist
x→4
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 13 / 42
Evaluation of limits
Results (Law of limits)
The following results are true provided all the limits involved exist. The
limit could be one-sided or two-sided. The number k is a constant.
1. lim (f (x) ± g(x)) = lim f (x) ± lim g(x)
x→c x→c x→c
2. lim kf (x) = k lim f (x)
x→c x→c
3. lim (f (x)g(x)) = ( lim f (x))( lim g(x))
x→c x→c x→c
f (x) lim f (x)
x→c
4. lim =
x→c g(x) lim g(x)
x→c
5. If g is continuous at the point b and lim f (x) = b, then
x→c
lim g(f (x)) = g(b) = g( lim f (x))).
x→c x→c
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 14 / 42
Evaluation of limits
Result. The following functions are continuous on any interval
contained in their maximal domain.
1. Polynomials
2. Trigonometric Functions
3. Exponential Functions
4. Logarithmic Functions
5. A combination of any of the above on the domain it is defined.
For example, a rational function P(x)/Q(x) is continuous at all points x
where Q(x) 6= 0.
Since lim f (x) = f (c) when f is continuous at x = c, finding the limit at
x→c
x = c of any of the above functions is a matter of evaluating f at x = c.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 15 / 42
Evaluation of limits
Example
x + ln(x + 3)
Evaluate lim √ .
x→−2 x +6
x+ln(x+3)
Solution. The function √
x+6
is continuous at x = −2. Thus
x + ln(x + 3) −2 + ln(−2 + 3)
lim √ = √ = −1.
x→−2 x +6 −2 + 6
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 16 / 42
Evaluation of limits
Exercise
Evaluate lim tan3 (sin x).
x→0
Ans: 0.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 17 / 42
Limits at infinity
Let f be defined on R.
lim f (x) is the value f (x) approaches as x tends to positive
x→∞
infinity.
lim f (x) is the value f (x) approaches as x tends to negative
x→−∞
infinity.
Graphically, if lim f (x) = c ∈ R or lim f (x) = c, then the line y =
x→∞ x→−∞
c is a horizontal asymptote of the graph of f (x).
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 18 / 42
Limits at infinity
1 1
For any positive integer n, lim = 0 and lim = 0.
x→∞ xn x→−∞ xn
1
For example, lim 2 − = 2, and y = 2 is a horizontal asymptote of
x→∞ x
the graph of y = 2 − x1 .
1
Also lim 2 − = 2.
x→−∞ x
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 19 / 42
Limits at infinity
Example
2
3 p
Evaluate lim + 4 − e−x .
x→∞ 2x
Solution.
2
√
3 p
lim + 4 − e−x = (0 + 4)2 = 4.
x→∞ 2x
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 20 / 42
Limits at infinity
Exercise
4
Evaluate lim ln 3 − 2 sin .
x→−∞ x
Ans: ln 3.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 21 / 42
More on Limits
Indeterminate forms.
f (x)
(a) A limit of the form lim where f (x) → 0 and g(x) → 0 as
g(x)
x→c
x → c is called an indeterminate form of the type 00 .
f (x)
(b) A limit of the form lim where f (x) → ∞ and g(x) → ∞
x→c g(x)
as x → c is called an indeterminate form of the type ∞ ∞.
Replacement rule. Let I be an open interval containing the point
x = c. Suppose f (x) = g(x) for all x ∈ I, except possibly at x = c.
Then lim f (x) = lim g(x).
x→c x→c
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 22 / 42
More on Limits
Example
x 2 − 7x + 6
Evaluate lim .
x→6 36 − x 2
Solution.
x 2 − 7x + 6 (x − 1)(x − 6) x −1 5
lim 2
= lim = lim =− .
x→6 36 − x x→6 −(6 + x)(x − 6) x→6 −(6 + x) 12
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 23 / 42
More on Limits
Exercise
√ √
x + 12 − 6 − x
Evaluate lim .
x→−3 18 − 2x 2
1
Ans: 36 .
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 24 / 42
More on Limits
P(x)
Result. Limits of the form lim , where P(x) and Q(x) are
x→±∞ Q(x)
polynomials in x.
leading term
z}|{ 0 if α < β
Ax α A
P(x) +···
B if α = β
lim = lim =
x→±∞ Q(x) x→±∞ Bx β +··· ∞
| {z ∞} if α > β.
or −
|{z}
leading term depends on the question
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 25 / 42
More on Limits
Example
√
(18x 2 + 5x − 1)(2 x − 1)3
Evaluate lim .
x→∞ (3x − 1)4
√ 7
(18x 2 + 5x − 1)(2 x − 1)3 144x 2 + · · ·
Solution. lim = lim = 0.
x→∞ (3x − 1)4 x→∞ 81x 4 + · · ·
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 26 / 42
More on Limits
Exercise
(1 + 2x)3
Evaluate lim √ .
x→−∞ 16x 6 + 9x − 1
Ans: −2.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 27 / 42
More on Limits
Useful results.
If lim g(x) = 0, then
x→c
sin(g(x)) g(x)
lim = lim = 1,
x→c g(x) x→c sin(g(x))
tan(g(x)) g(x)
lim = lim = 1.
x→c g(x) x→c tan(g(x))
In particular, when c = 0 and g(x) = x,
sin x x
lim = lim = 1,
x→0 x x→0 sin x
tan x x
lim = lim = 1.
x→0 x x→0 tan x
sin 3x ln x sin(e−x )
For example, lim = 1, lim = 1, lim = 1.
x→0 3x x→1 tan(ln x) x→∞ e−x
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 28 / 42
More on Limits
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 29 / 42
More on Limits
Example
x tan(2x) + sin2 x
Evaluate lim .
x→0 sin(3x 2 ) + x tan(2x)
Solution. 2
x tan(2x) + sin2 x 2x 2 tan(2x)
2x + x 2 sinx 2 x
lim = lim
x→0 sin(3x 2 ) + x tan(2x)
2
x→0 3x 2 sin(3x ) + 2x 2 tan(2x)
2 3x 2x
2
2 tan(2x)
2x + sinx 2 x 2+1 3
= lim 2
= = .
x→0 3 sin(3x ) + 2 tan(2x) 3+2 5
3x 2 2x
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 30 / 42
More on Limits
Exercise
√
Evaluate lim+ x 2 cot(2x) csc2 (3 x) .
x→0
1
Ans: 18 .
Exercise
√
tan( x − 2)
Evaluate lim .
x→4 sin(16 − x 2 )
1
Ans: − 32 .
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 31 / 42
Squeeze (Sandwich) Theorem
Squeeze Theorem I. Suppose g(x) ≤ f (x) ≤ h(x) for all x in some
open interval containing a point c, except possibly at x = c. If
lim g(x) = lim h(x) = L, then lim f (x) = L.
x→c x→c x→c
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 32 / 42
Squeeze (Sandwich) Theorem
Example
It is given that 3 − x 2 ≤ f (x) ≤ 1 + 2ex for all x. Find lim f (x).
x→0
Solution. As lim 3 − x 2 = 3 and lim 1 + 2ex = 3, we have by
x→0 x→0
squeeze theorem I that lim f (x) = 3.
x→0
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 33 / 42
Squeeze (Sandwich) Theorem
Exercise
Use Squeeze theorem to show that lim |f (x)| = 0 ⇒ lim f (x) = 0.
x→c x→c
Remark. The converse of the above result, namely
lim f (x) = 0 ⇒ lim |f (x)| = 0 is true.
x→c x→c
Hence, we have
Result. lim f (x) = 0 ⇔ lim |f (x)| = 0.
x→c x→c
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 34 / 42
Squeeze (Sandwich) Theorem
Squeeze Theorem II. If lim g(x) = 0, then for any function h,
x→c
lim g(x) sin(h(x)) = 0 and lim g(x) cos(h(x)) = 0.
x→c x→c
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 35 / 42
Squeeze (Sandwich) Theorem
Example
2
Evaluate lim x 3 cos( ) .
x→0 sin x
Solution. Since lim x 3 = 0, we have by squeeze theorem II,
x→0
3 2
lim x cos( ) = 0.
x→0 sin x
Exercise
1 1
Evaluate lim sin(2 ln x) + 2x sin( ) .
x→∞ ln x x
Ans: 2.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 36 / 42
Intermediate Value Theorem
Theorem. (Intermediate Value Theorem) If f is continuous on [a, b]
and k is a number between f (a) and f (b), then f (c) = k for some
c ∈ [a, b].
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 37 / 42
Intermediate Value Theorem
Example
Show that the equation x 3 ex = 10 has a root between 1 and 1.5.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 38 / 42
Intermediate Value Theorem
Solution. Let f (x) = x 3 ex . f is continuous on R.
We have f (1) = e = 2.718 and f (1.5) = 1.53 e1.5 = 15.126.
Thus f (1) < 10 < f (1.5).
By Intermediate Value Theorem, there is a root to f (x) = 10 between 1
and 1.5.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 39 / 42
Intermediate Value Theorem
Exercise
Show that the equation 10 = x + 2 tan(2x) has a root between 3 and 4.
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 40 / 42
The Precise Definition of the Limit of a Function
Let f (x) be defined on an open interval containing the point c, except
possibly at c itself. We say that the limit of f (x) as x approaches c is the
number L, and write
lim f (x) = L,
x→c
if, for every number > 0, there exists a corresponding number δ > 0
such that for all x,
0 < |x − c| < δ ⇒ |f (x) − L| < .
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 41 / 42
The Precise Definition of the Limit of a Function
Example
Prove from definition that lim 5x − 3 = 2.
x→1
Solution. Note that |(5x − 3) − 2| = 5|x − 1|. Given > 0, we choose
δ = /5. Then for all x,
0 < |x − 1| < δ ⇒ 5|x − 1| < 5δ ⇒ |(5x − 3) − 2| < .
Exercise
x
Prove from definition that lim + 3 = 1.
x→−6 3
Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 2 January 14, 2022 42 / 42