SMA 2101: CALCULUS I
c
⃝Francis O. Ochieng
francokech@gmail.com
YouTube: Prof. Francis Oketch∗
Department of Pure and Applied Mathematics
Jomo Kenyatta University of Agriculture and Technology
Course content
• Functions: definition, domain, range, codomain, composition (or composite), inverse.
• Limits, continuity and differentiability of a function.
• Differentiation by first principle and by rule for xn (integral and fractional n).
• Other techniques of differentiation, i.e., sums, products, quotients, chain rule; their applications
to algebraic, trigonometric, logarithmic, exponential, and inverse trigonometric functions all of
a single variable.
• Implicit and parametric differentiation.
• Applications of differentiation to: rates of change, small changes, stationary points, equations of
tangents and normal lines, kinematics, and economics and financial models (cost, revenue and
profit).
• Introduction to integration and its applications to area and volume.
References
[1] Calculus: Early Transcendentals (8th Edition) by James Stewart
[2] Calculus with Analytic Geometry by Roland E. Larson, Robert P. Hostetler and Bruce H. Edwards;
5th edition
[3] Calculus and Analytical Geometry (9th edition) by George B. Thomas and Ross L. Finney
[4] Advanced Engineering Mathematics (10th ed.) by Erwin Kreyszig
[5] Calculus by Larson Hostellem
Lecture 1
1 Functions
To understand the word function, we consider the following scenario and definitions. For example,
the growth of a sidling is an instance of a functional relation, since the growth may be affected by
variations in temperature, moisture, sunlight, etc. If all these factors remain constant, then the growth
is a function of time.
∗
https://www.youtube.com/channel/UC7wd3x6 08GNoUbLxmaC4vA
1
c
⃝Francis Oketch
Definition 1.1 (Variables). A variable is an object, event, time period, or any other type of category
you are trying to measure.
Consider the formula used for calculating the volume of a sphere of radius r.
V =
4
3
πr3
(1)
Then,
i) V and r vary with different spheres. Hence, they are called variables.
ii) π and
4
3
are constants, irrespective of the size of the sphere.
There are two types of variables, i.e., independent and dependent variables.
Definition 1.2 (Independent and dependent variables). Independent variable refers to the input value
while dependent variable refers to the output value.
For example from formula (1), the volume, V , depends on the value of the radius, r, of the sphere.
In this case, r is called the independent variable while V is called the dependent variable since it is
affected by the variation of r. Similarly, for the function y = ax2 + bx + c, a, b and c are constants, x
is the independent variable and y is the dependent variable.
Definition 1.3 (Function). A function is a rule that assigns/associates each element in the
independent set, say X, to a unique element in the dependent set, say Y .
Examples of functions are
i) Linear functions e.g., y = x + 5
ii) Quadratic functions e.g., y = x2 − 2x + 5
iii) Cubic functions e.g., y = x3 − 1
iv) Quartic functions e.g., y = 2x4 + x3 − 1
v) Trigonometric functions e.g., y = sin(2x + 5)
vi) Logarithmic functions (log to base 10) e.g., y = log(3x + 1)
vii) Natural logarithmic functions (log to base e ≈ 2.71828) e.g., y = ln(5x + 1)
viii) Inverse of trigonometric functions e.g., y = tan−1(2x + 1)
ix) Exponential functions e.g., y = e2x+1
x) Absolute value functions e.g., y = |x|. This function is defined as
y = |x| =
{
−x, if x < 0
x, if x ≥ 0
→ Note: in the above examples, the variable y depends on the variable x. Thus, we say that the
dependent variable y is a function of the independent variable x. Using function notation, we write
y = f(x), where f is a function. The function f(x) is read as f of x, meaning that f depends on x.
2
1.1 Domain, Range and Codomain c
⃝Francis Oketch
1.1 Domain, Range and Codomain
Definition 1.4 (Domain). A domain consists of all the elements in the independent set (i.e., the set
of inputs), X, for which the function is defined.
Definition 1.5 (Range). A range refers to a set of all the images of the elements in the domain.
Definition 1.6 (Codomain). A codomain consists of all the elements in the dependent set (i.e., the
set of outputs), Y .
For example, consider the diagram below
Example(s):
1. Find the domain and range of the following functions.
(a) f(x) = (x − 4)2 + 5
Solution
 Since f(x) is defined (or is a real number) for any real number x, the domain of f is
the interval (−∞, ∞).
 Let y = (x − 4)2 + 5. Making x the subject, we have x = 4 ±
√
y − 5. This function is
defined if y − 5 ≥ 0 or y ≥ 5. Therefore, the range is the interval [5, ∞).
(b) f(x) = 2x2 − 5x + 1
Solution
 Since f(x) is defined (or is a real number) for any real number x, the domain of f is
the interval (−∞, ∞).
 Let y = 2x2 − 5x + 1 or 2x2 − 5x + (1 − y) = 0. Making x the subject (use quadratic
formula), we have x =
5 ±
√
25 − 8(1 − y)
4
. This function is defined if 25−8(1−y) ≥ 0
or y ≥ −
17
8
. Therefore, the range is the interval
[
−17
8 , ∞
)
.
(c) f(x) =
4
x2 − 5x + 6
Solution
→ Note: 4/0 = ∞ (infinity), i.e., a very very large value, undefined, or indeterminate.
 The function f(x) is defined when the denominator is nonzero, i.e., if x2 − 5x + 6 ̸= 0.
Solving yields x ̸= 2 and x ̸= 3. Therefore, the domain of f includes all the real numbers
of x except x = 2 and x = 3, i.e., the set (−∞, ∞){2, 3} or (−∞, 2) ∪ (2, 3) ∪ (3, ∞).
 Let y =
4
x2 − 5x + 6
or x2 − 5x +
(
6 − 4
y
)
= 0. Making x the subject (use quadratic
formula), we have
x =
5 ±
√
25 − 4
(
6 − 4
y
)
2
This function is defined if 25 − 4
(
6 − 4
y
)
≥ 0 or y ≥ −16 and y ̸= 0. Therefore, the
range is the interval [−16, 0) ∪ (0, ∞).
3
1.2 Evaluation of functions c
⃝Francis Oketch
(d) f(x) =
√
x − 1
Solution
 Since f(x) is defined (or is a real number) if x − 1 ≥ 0 or x ≥ 1, the domain of f is the
interval [1, ∞).
 Let y =
√
x − 1. Making x the subject, we have x = y2 + 1. This function is defined
for any real number y. Therefore, the range is the interval [0, ∞).
(e) f(x) = 2|x − 3| + 4
Solution
 Since f(x) is defined for all real numbers, the domain of f is the interval (−∞, ∞).
 Since for all |x − 3| ≥ 0, the function f(x) = 2|x − 3| + 4 ≥ 4. Therefore, the range is
all the values of y for which y ≥ 4 or the interval [4, ∞).
Exercise:
1. Find the domain and range of the following functions.
(a) f(x) = 6 − x2. [ans: domain (−∞, ∞), range (−∞, 6]]
(b) f(x) =
6 + 3x
1 − 2x
. [ans: domain (−∞, 0.5) ∪ (0.5, ∞), range (−∞, −1.5) ∪ (−1.5, ∞)]
(c) f(x) =
x + 5
x − 2
. [ans: domain (−∞, 2) ∪ (2, ∞), range (−∞, 1) ∪ (1, ∞)]
(d) f(x) =
√
4 − 2x + 5. [ans: domain (−∞, 2], range [5, ∞)]
(e) f(x) =
1
√
x + 1
− 3. [ans: domain (−1, ∞), range (−3, ∞)]
(f) f(x) =
√
x2 − 16
x2 − 2x − 24
. [ans: domain (−∞, −4) ∪ (−4, 4] ∪ (6, ∞), range
[
0, 2
√
5
)
∪
(
2
√
5
, 1
)
∪ (1, ∞)]
(g) f(x) =
√
x + 2
x − 2
. [ans: domain [−2, 2) ∪ (2, ∞), range (−∞, ∞)]
(h) f(x) = 2x + 3. [ans: domain (−∞, ∞), range (3, ∞)]
1.2 Evaluation of functions
This involves replacing x in the function by the suggested value and retaining the rule of the function.
Example(s):
1. Given f(x) = 2x + 1. Find: (i) f(0), (ii) f(1), (iii) f(x + 2), and (iv)
f(x + h) − f(x)
h
for h ̸= 0.
Solution
i) f(0) = 2(0) + 1 = 0 + 1 = 1
ii) f(1) = 2(1) + 1 = 2 + 1 = 3
iii) f(x + 2) = 2(x + 2) + 1 = 2x + 4 + 1 = 2x + 5
iv)
f(x + h) − f(x)
h
=
[2(x + h) + 1] − [2x + 1]
h
=
2x + 2h + 1 − 2x − 1
h
=
2h
h
= 2.
2. Given f(x) = 3x2 − 2x + 4. Find: (i) f(0), (ii) f(−1), (iii) f(x + 2), and (iv)
f(x + h) − f(x)
h
for h ̸= 0.
Solution
4
1.2 Evaluation of functions c
⃝Francis Oketch
i) f(0) = 3(0)2 − 2(0) + 4 = 0 + 0 + 4 = 4
ii) f(−1) = 3(−1)2 − 2(−1) + 4 = 3 + 2 + 4 = 9
iii) f(x + 2) = 3(x + 2)2 − 2(x + 2) + 4 = 3(x2 + 4x + 4) − 2x − 4 + 4 = 3x2 + 10x + 12
iv)
f(x + h) − f(x)
h
=
[
3(x + h)2 − 2(x + h) + 4
]
−
[
3x2 − 2x + 4
]
h
=
(
3x2 + 6hx + 3h2 − 2x − 2h + 4
)
−
(
3x2 − 2x + 4
)
h
=
6hx + 3h2 − 2h
h
= 6x + 3h − 2
3. Given f(x) = x2 − 4x + 3. Find: (i) f(1), (ii) f(2), (iii) f(a), and (iv) f(a + h).
Solution
i) f(x) = x2 − 4x + 3 ⇒ f(1) = 12 − 4(1) + 3 = 0
ii) f(x) = x2 − 4x + 3 ⇒ f(2) = 22 − 4(2) + 3 = −1
iii) f(x) = x2 − 4x + 3 ⇒ f(a) = a2 − 4a + 3
iv) f(x) = x2 − 4x + 3 ⇒ f(a + h) = (a + h)2 − 4(a + h) + 3
4. Given ϕ(θ) = 2 sin θ. Find: (i) ϕ(π
2 ), (ii) ϕ(0), and (iii) ϕ(π
3 ).
Solution
i) ϕ(θ) = 2 sin θ ⇒ ϕ(π
2 ) = 2 sin
(π
2
)
= 2
ii) ϕ(θ) = 2 sin θ ⇒ ϕ(0) = 2 sin (0) = 0
iii) ϕ(θ) = 2 sin θ ⇒ ϕ(π
3 ) = 2 sin
(π
3
)
= 2 ×
√
3
2
=
√
3
Exercise:
(a) Given f(x) = x3 + 2x + 1, find: (i) f(0), (ii) f(−a), (iii) f(x + 2), and (iv)
f(x + h) − f(x)
h
for
h ̸= 0.
(b) Given g(x) =
1
√
x + 1
, find: (i) f(0), (ii) f(1), (iii) f(x + 2), and (iv)
g(x + h) − g(x)
h
for h ̸= 0.
(c) Given p(x) =
6 − 2x
1 + 3x
, find: (i) f(0), (ii) f(−1), (iii) f(2−x), and (iv)
p(x + h) − p(x)
h
for h ̸= 0.
(d) If f(x) = 2x2 − 4x + 1, find (i) f(1), (ii) f(0), (iii) f(2), (iv) f(a), and f(x + h).
(e) If f(x) = (x − 1)(x + 5), find (i) f(1), (ii) f(0), (iii) f(2), (iv) f(a + 1), and f(1
a ).
(f) If f(θ) = cos θ, find (i) f(π
2 ), (ii) f(0), (iii) f(π
3 ), (iv) f(π
6 ), and (v) f(π).
(g) If f(x) = x2, find (i) f(3), (ii) f(3.1), (iii) f(3.01), (iv) f(3.001), and
f(3.001) − f(3)
0.001
.
(h) If ϕ(x) = 2x, find (i) ϕ(0), (ii) ϕ(1), and (iii) ϕ(0.5).
5
1.3 Composite functions c
⃝Francis Oketch
1.3 Composite functions
The composition of functions is a function of another function. Consider the function f with domain
A and range B, and the function g with domain D and range E. If B is a subset of D, then the
composite function (gof)(x) is the function with domain A and range E such that
(gof)(x) = g(f(x))
Example(s):
1. Given f(x) = 2x + 1 and g(x) = 5x − 3, find (fog)(x) and (gof)(x).
Solution
(fog)(x) = f(g(x)) = f(5x − 3) = 2(5x − 3) + 1 = 10x − 5
(gof)(x) = g(f(x)) = g(2x + 1) = 5(2x + 1) − 3 = 10x + 2
2. Given f(x) =
x + 1
5x − 2
and g(x) =
x + 1
2x
, find (fog)(x).
Solution
(fog)(x) = f(g(x)) =
g + 1
5g − 2
=
(
x + 1
2x
)
+ 1
5
(
x + 1
2x
)
− 2
=
x + 1 + 2x
5x + 5 − 4x
=
3x + 1
x + 5
→ Note: in general, (fog)(x) ̸= (gof)(x).
Exercise:
1. Given f(x) = x2 − 1, g(x) = x − 1 and h(x) =
√
x. Find:
(a) (fog)(x)
(b) (hog)(x)
(c) (gog)(x)
(d) (gohof)(x)
2. Consider the functions f(x) = x2 + 1 and g(x) = 1/x. Evaluate
(a) (fog)(4)
(b) (gof)(−1/2)
3. (a) If f(x) =
√
x and g(x) = 4x + 2, find the domain of (fog)(x).[ans: x ≥ −0.5 or [−0.5, ∞)]
(b) If f(x) =
1
x + 1
and g(x) =
√
x − 1, find the domain of (gof)(x).[ans: x  −1 or (−1, ∞)]
4. The price of a washing machine is x dollars. The function f(x) = x − 100 gives the price of the
washing machine after a $100 rebate. The function g(x) = 0.95x gives the price of the washing
machine after a 5% discount.
(a) Find and interpret (fog)(x). [ans: (fog)(x) = 0.95x − 100 gives the price of the washing
machine after a 5% discount and a further $100 rebate]
(b) Find and interpret (gof)(x). [ans: (gof)(x) = 0.95(x − 100) gives the price of the washing
machine after a $100 rebate and a further 5% discount]
5. The number N of bacteria in a refrigerated food is given by
N(T) = 10T2
− 20T + 600, 2 ≤ T ≤ 20
where T is the temperature of the food in degrees Celsius. When the food is removed from
refrigeration, the temperature of the food is given by
T(t) = 3t + 2, 0 ≤ t ≤ 6
where t is the time in hours.
6
1.4 Inverse functions c
⃝Francis Oketch
(a) Find and interpret (NoT)(t). [ans: (NoT)(t) = 90t2 + 60t + 600, which represents the
number of bacteria in the food as a function of the amount of time the food has been out
of refrigeration.]
(b) Find the bacteria count after 0.5 hour. [ans: = 652.5]
(c) Find the time when the bacteria count reaches 1500. [ans: t ≈ 2.84 hours]
1.4 Inverse functions
To find the inverse function of the given function f(x), follow these steps
 Replace f(x) with y and make x the subject.
 In the resulting equation, replace x with f−1(x) and then y with x.
Example(s):
1. Find the inverse function of f(x) =
2x + 3
x − 1
.
Solution
Let y =
2x + 3
x − 1
. Making x the subject yields x =
y + 3
y − 2
. Set x = f−1(x) and then y = x to get
f−1
(x) =
x + 3
x − 2
→ Note:
 the domain of f must be equal to the range of f−1, and the range of f must be equal to the
domain of f−1.
 a function need not have an inverse function, but when it does, the inverse function is unique.
Exercise:
1. Find the inverse function of the following functions.
(a) f(x) =
√
x − 1 [ans: f−1(x) = x2 + 1]
(b) f(x) =
5 − x
3x + 2
[ans: f−1(x) =
5 − 2x
3x + 1
]
7
c
⃝Francis Oketch
Lecture 2
2 Limits of functions
Definition 2.1 (Basic limit definition). Let f(x) be a function and let a and L be real numbers. If
f(x) approaches L as x approaches a from either RHS or LHS of a (but is not equal to a), then we
say that f(x) has limit L as x approaches a, and is mathematically written as:
.
.
lim
x→a
f(x) = L.
Diagrammatically, we have
→ Note: lim
x→a
f(x) is the value that f(x)
approaches as x approaches a, and a does
not have to be in the domain of f.
2.1 Properties of limits
Theorem 2.1. Suppose lim
x→a
f(x) = L1 and lim
x→a
g(x) = L2. Then,
1. [Addition/subtraction rule] lim
x→a
[f(x) ± g(x)] =
[
lim
x→a
f(x)
]
±
[
lim
x→a
g(x)
]
= L1 ± L2
2. [Scalar multiple] lim
x→a
[λf(x)] = λ
[
lim
x→a
f(x)
]
= λL1, where λ is a constant.
3. [Product rule] lim
x→a
[f(x) · g(x)] =
[
lim
x→a
f(x)
]
·
[
lim
x→a
g(x)
]
= L1 · L2
4. [Quotient rule] lim
x→a
[
f(x)
g(x)
]
=
lim
x→a
f(x)
lim
x→a
g(x)
=
L1
L2
, provided g(a) ̸= 0.
5. [Power rule] lim
x→a
[f(x)]n
=
[
lim
x→a
f(x)
]n
= Ln
1 , where n is a real number.
→ Note: if f(x) = c (where c is a constant), then lim
x→a
[f(x)] = lim
x→a
[c] = c
2.2 Techniques of evaluating limits of functions
 Direct substitution (DS)
The required limit is obtained by just plugging in the value of input, say x, into the given
function, say f(x).
Example(s):
(a) Evaluate lim
x→2
3x3
− x2
+ 2x + 5.
Solution
lim
x→2
(3x3
− x2
+ 2x + 5) = 3 lim
x→2
x3
− lim
x→2
x2
+ 2 lim
x→2
x + lim
x→2
5)
= 3(23
) − (22
) + 2(2) + 5
= 29
8
2.2 Techniques of evaluating limits of functions c
⃝Francis Oketch
(b) Evaluate lim
x→1
x2 − 1
x + 1
.
Solution
lim
x→1
x2 − 1
x + 1
D.S
=
12 − 1
1 + 1
=
0
2
= 0
 Factorization
If on direct substitution we get the indeterminate form 0/0, then it means that there is a
common factor in both the numerator and denominator. In this case, we perform factorization
first so as to simplify the given function.
→ Note: if the polynomial in the numerator is of degree greater than the degree of the polynomial
in the denominator, we first need to perform long division.
Example(s):
(a) Evaluate lim
x→2
x2 + x − 6
x − 2
Solution
lim
x→2
x2 + x − 6
x − 2
= lim
x→2
(x − 2)(x + 3)
x − 2
= lim
x→2
(x + 3)
D.S
= 2 + 3
= 5
(b) Evaluate lim
x→−2
x2 + 3x + 2
2x2 − 8
Solution
lim
x→−2
x2 + 3x + 2
2x2 − 8
= lim
x→−2
(x + 2)(x + 1)
2(x + 2)(x − 2)
= lim
x→−2
x + 1
2(x − 2)
D.S
=
−2 + 1
2(−2 − 2)
=
−1
−8
=
1
8
(c) Evaluate lim
x→1
x3 − 1
x2 − 1
.
Solution
lim
x→1
x3 − 1
x2 − 1
= lim
x→1
(
x +
x − 1
x2 − 1
)
(long division)
= lim
x→1
[
x +
x − 1
(x − 1)(x + 1)
]
(factorization)
= lim
x→1
(
x +
1
x + 1
)
D.S
= 1 +
1
1 + 1
= 1 +
1
2
=
3
2
 Limits at infinity
In this case, we first divide the numerator and denominator by the highest power of x in the
denominator.
Example(s):
9
2.2 Techniques of evaluating limits of functions c
⃝Francis Oketch
(a) Evaluate lim
x→∞
5x3 − 1
4x3 − 2x − 7
.
Solution
lim
x→∞
5x3 − 1
4x3 − 2x − 7
= lim
x→∞
5 −
1
x3
4 −
2
x2
−
7
x3
D.S
=
5 −
1
∞
4 −
2
∞
−
7
∞
=
5 − 0
4 − 0 − 0
=
5
4
 Rationalization
Suppose there exists a surd in either the numerator or denominator or both. Then, we first need
to multiply both the numerator and denominator by the conjugate of the factor containing the
surd (in either the numerator or denominator) and then simplify the resulting function. After
rationalization, we perform a direct substitution.
→ Note: in case the surds appear in both the numerator and denominator, then we rationalize
the denominator.
Example(s):
(a) Evaluate lim
x→∞
√
x2 − 4x − x.
Solution
lim
x→∞
√
x2 − 4x − x = lim
x→∞
(√
x2 − 4x − x
)
(√
x2 − 4x + x
√
x2 − 4x + x
)
= lim
x→∞
x2 − 4x − x2
√
x2 − 4x + x
= lim
x→∞
−4x
√
x2 − 4x + x
= lim
x→∞
−4x ·
1
x
(√
x2 − 4x + x
)
·
1
x
= lim
x→∞
−4
√
1 −
4
x
+ 1
D.S
=
−4
√
1 −
4
∞
+ 1
=
−4
√
1 − 0 + 1
=
−4
1 + 1
= −2
(b) Evaluate lim
x→9
√
x − 3
x − 9
.
Solution
lim
x→9
√
x − 3
x − 9
= lim
x→9
(
√
x − 3)(
√
x + 3)
(x − 9)(
√
x + 3)
= lim
x→9
(x − 9)
(x − 9)(
√
x + 3)
= lim
x→9
1
√
x + 3
D.S
=
1
√
9 + 3
=
1
3 + 3
=
1
6
Exercise:
(a) lim
x→∞
√
x2 − 2 −
√
x2 + x.
10
2.2 Techniques of evaluating limits of functions c
⃝Francis Oketch
Solution
lim
x→∞
√
x2 − 2 −
√
x2 + x = lim
x→∞
(√
x2 − 2 −
√
x2 + x
)
·
√
x2 − 2 +
√
x2 + x
√
x2 − 2 +
√
x2 + x
= lim
x→∞
(x2 − 2) − (x2 + x)
√
x2 − 2 +
√
x2 + x
= lim
x→∞
−2 − x
√
x2 − 2 +
√
x2 + x
= lim
x→∞
−
2
x
− 1
√
1 −
2
x2
+
√
1 +
1
x
D.S
=
−
2
∞
− 1
√
1 −
2
∞
+
√
1 +
1
∞
= −
1
2
(b) Evaluate lim
x→1
(
x3 − 1
x − 1
)
. [ans: 3]
(c) Evaluate lim
x→1
(
1 −
√
x
1 − x
)
. [ans: 1/2]
(d) Evaluate lim
x→∞
5x2 − 3x + 2
10x2 − x + 100
. [ans: 1/2]
(e) Evaluate lim
x→0
√
1 + x −
√
1 − x
x
. [ans: 1]
→ Note: A function which grows arbitrarily large as x goes to positive or negative infinity is said to
have an infinite limit. Infinity is not a real number, so if a function has infinite limit, we
say that the limit does not exist.
Lecture 3
Theorem 2.2 (Squeeze law (sandwich theorem)). Suppose that f(x) ≤ g(x) ≤ h(x) holds for all
x around a, except possibly at x = a. If lim
x→a
f(x) = lim
x→a
h(x) = L, then lim
x→a
g(x) = L.
Example(s):
1. Find lim
x→0
x sin
(
1
x2 + x
)
.
Solution
We know that sin θ is sandwiched between −1 and 1 i.e., −1 ≤ sin(θ) ≤ 1. Therefore,
As −1 ≤ sin
(
1
x + x2
)
≤ 1
⇒ −x ≤ x sin
(
1
x + x2
)
≤ x
⇒ − lim
x→0
(x) ≤ lim
x→0
x sin
(
1
x + x2
)
≤ lim
x→0
(x)
⇒ 0 ≤ lim
x→0
x sin
(
1
x + x2
)
≤ 0
⇒ lim
x→0
x sin
(
1
x + x2
)
= 0
Exercise:
1. [Assignment 1] Prove that lim
h→0
sin h
h
= 1 and lim
h→0
(1 − cos h)
h
= 0.
11
2.3 One-Sided Limit c
⃝Francis Oketch
Proof. Consider the following unit circle. Let the length of line OA be a units, AB is b units,
CD be c units and angle AOB be h.
Here, OB = OC = 1 unit. Now, cos h = a,
sin h = b and tan h = c. From the figure, the
area of triangle OAB is less than that of the
sector OCB which is also less than that of
triangle OCD i.e.,
1
2
ab ≤
h
2π
· π(1)2 ≤
1
2
(1)c.
Thus,
1
2
cos h sin h ≤
1
2
h ≤
1
2
tan h
Multiply through by 2 and using the identity tan h =
sin h
cos h
, we have
cos h sin h ≤ h ≤
sin h
cos h
Taking reciprocals, we have
1
cos h sin h
≥
1
h
≥
cos h
sin h
Multiplying though by sin h yields
1
cos h
≥
sin h
h
≥ cos h, which can be rewritten as
cos h ≤
sin h
h
≤
1
cos h
Taking limit as h → 0, we have lim
h→0
cos h ≤ lim
h→0
sin h
h
≤ lim
h→0
1
cos h
. That is, 1 ≤ lim
h→0
sin h
h
≤ 1.
Hence, by the squeeze law we get
.
.
lim
h→0
sin h
h
= 1
Also,
lim
h→0
(1 − cos h)
h
= lim
h→0
[
(1 − cos h)
h
·
(1 + cos h)
(1 + cos h)
]
= lim
h→0
[
1 − cos2 h
h
·
1
1 + cos h
]
= lim
h→0
[
sin2 h
h
·
1
1 + cos h
]
= lim
h→0
[
sin h
h
·
sin h
1 + cos h
]
=
[
lim
h→0
sin h
h
] [
lim
h→0
sin h
(1 + cos h)
]
= (1)
[
lim
h→0
sin h
(1 + cos h)
]
D.S
=
0
(1 + 1)
= 0
Therefore,
.
.
lim
h→0
(1 − cos h)
h
= 0
2.3 One-Sided Limit
Definition 2.2 (Left-Hand Limit). If a function f(x) approaches the number L as x approaches the
real number a from the LHS of a, then we say that L is the left-hand limit of f at x = a and is written
as:
.
.
lim
x→a−
f(x) = L.
12
2.3 One-Sided Limit c
⃝Francis Oketch
Definition 2.3 (Right-Hand Limit). If a function f(x) approaches the number L as x approaches the
real number a from the RHS of a, then we say that L is the right-hand limit of f at x = a and is
written as:
.
.
lim
x→a+
f(x) = L.
→ Note: the limit of f(x) as x approaches a exists if both left-hand limit and right-hand limit exist
and are equal at x = a. In that case, we have
.
.
lim
x→a−
f(x) = lim
x→a+
f(x) = lim
x→a
f(x) = L
Example(s):
(a) Consider the function defined by f(x) =





x3 if x  1
1 if x = 1
2 − x if x  1.
Evaluate lim
x→1
f(x).
Solution
(i) LHL: lim
x→1−
f(x) = lim
x→1−
(x3
) = 13
= 1
(ii) RHL: lim
x→1+
f(x) = lim
x→1+
(2 − x) = 2 − 1 = 1
(iii) Since the result (i) = (ii), we get lim
x→1
f(x) = 1
Exercise:
(a) Consider the function defined by f(x) =





x2 − 2x if x  1
2 if x = 1
3x − 4 if x  1.
. Evaluate lim
x→1−
f(x) and
lim
x→1+
f(x).
(b) Consider the function defined by f(x) =
{
2 − 3x if x ≤ 1
2x3 if x  1
. Does lim
x→1
f(x) exist?
(c) Evaluate lim
x→0
f(x) given f(x) =
{
x if x ̸= 0
1 if x = 0.
 Meaning of absolute value functions
To separate (or split) the function contained in the absolute value function, do the following:
i) First identify the reference point by equating the interior term to zero.
ii) Investigate the signs of the interior expression to the left and the right of the reference point.
For example,
 If f(x) = |x − 3|. The reference point is x − 3 = 0 ⇒ x = 3. Thus,
f(x) =
{
−(x − 3) if x  3
+(x − 3) if x ≥ 3
 If f(x) = 5 + |x + 5|. The reference point is x + 5 = 0 ⇒ x = −5. Thus,
f(x) =
{
5 − (x + 5) if x  −5
5 + (x + 5) if x ≥ −5
13
2.3 One-Sided Limit c
⃝Francis Oketch
 If f(x) =
1
2 − |x|
. The reference point is x = 0. Thus, f(x) =











1
2 + x
if x  0
1
2 − x
if x ≥ 0
.
Example(s):
(a) Evaluate lim
x→0
|5x|
x
.
Solution
The reference point is 5x = 0 ⇒ x = 0. Thus, we have
f(x) =
|5x|
x
=
{−(5x)
x if x  0
+(5x)
x if x  0
Now,
(i) LHL: lim
x→0−
f(x) = lim
x→0−
−5x
x
= −5
(ii) RHL: lim
x→0+
f(x) = lim
x→0+
5x
x
= 5
(iii) Since (i) ̸= (ii), therefore, lim
x→0
|5x|
x
does not exist. The above problem possesses a one-sided
limits.
(b) Evaluate lim
x→7
(
|x − 7|
(x − 7)
)
.
Solution
The reference point is x − 7 = 0 ⇒ x = 7. Thus, we have
f(x) =
|x − 7|
x − 7
=
{−(x−7)
x−7 = −1 if x  7
+(x−7)
x−7 = +1 if x  7
Now,
(i) LHL: lim
x→7−
f(x) = lim
x→0−
(−1) = −1
(ii) RHL: lim
x→7+
f(x) = lim
x→0+
(+1) = 1
(iii) Since (i) ̸= (ii), therefore, lim
x→7
f(x) does not exist. The above problem possesses a one-sided
limits.
Exercise:
1. Evaluate the following
(a) lim
x→6
(
x + 6
|x + 6|
)
.
(b) lim
x→3−
(
x2 − x − 6
|x − 3|
)
.
(c) lim
x→1
(
2 −
x2 + 2x − 3
|x − 1|
)
.
(d) lim
x→3
(
|x2 − 7x|
x2 + 1
)
. [ans: = 6/5]
14
c
⃝Francis Oketch
3 Continuity of a function
A function f(x) is said to be continuous at a point x = a if the following three conditions are satisfied:
i) f(a) is defined, i.e., f(x) must be finite at x = a.
ii) lim
x→a
f(x) exists (i.e., LHL=RHL at x = a)
iii) lim
x→a
f(x) = f(a), i.e., (ii)=(i)
→ Note: if at least one of these conditions is not satisfied, then f(x) is discontinuous at x = a. In
this case, we say that the point a is a discontinuity of f (i.e., f(x) has some gaps or jumps at x = a).
Example(s):
(a) Discuss the continuity of the function f(x) =







x2 − 1
x + 1
if x  −1
x2 − 3 if x ≥ −1
at x = −1
Solution
We need to test the three conditions for continuity:
(i) f(−1) = (−1)2 − 3 = −2 (defined).
(ii) lim
x→−1
f(x):
LHL: lim
x→−1−
f(x) = lim
x→−1−
(
x2 − 1
x + 1
)
= lim
x→−1−


(x + 1)(x − 1)


(x + 1)
= lim
x→−1−
(x − 1) = −2
RHL: lim
x→−1+
f(x) = lim
x→−1+
(x2
− 3) = 1 − 3 = −2
Since LHL=RHL=-2, therefore, lim
x→−1
f(x) = −2
(iii) So, as lim
x→−1
f(x) = f(−1) therefore, f(x) is continuous on (−4, 4).
(b) Discuss the continuity of the function f(x) =
2x4 − 6x3 + x2 + 3
x − 1
at x = 1.
Solution
Clearly, the function f(x) =
2x4 − 6x3 + x2 + 3
x − 1
is discontinuous at x = 1. However, the point
of discontinuity can be removed by first simplifying the given function. Thus, by long division
we have
2x3 − 4x2 − 3x − 3
x − 1
)
2x4 − 6x3 + x2 + 3
− 2x4 + 2x3
− 4x3 + x2
4x3 − 4x2
− 3x2
3x2 − 3x
− 3x + 3
3x − 3
0
Hence, the function can be rewritten in the simplest form f(x) = 2x3 − 4x2 − 3x − 3, which is
now continuous at x = 1 [student to verify this]. Therefore, the original function is said to have
a removable point of discontinuity.
15
c
⃝Francis Oketch
(c) Find the value of the constants in the give problems if f(x) is continuous everywhere in the real
number line
i) Given f(x) =
{
4 + c if x  1
4x + 2 if x ≥ 1
. Find c [ans: c = 2]
ii) Given f(x) =







−15x if x  −1
ax + b if − 1 ≤ x  2
12x if x  2
. Find a and b [ans: a = 3, b = 18]
Solution
In these questions, we make use of the second condition of continuity in particular, i.e.,
LHL=RHL at any point x = a.
i) The reference point is x = 1. Thus,
LHL: lim
x→1−
f(x) = lim
x→1−
(4 + c) = 4 + c
RHL: lim
x→1+
f(x) = lim
x→1+
(4x + 2) = 4 + 2 = 6
Since f(x) is continuous at x = 1, we have 4 + c = 6. Therefore, c = 2.
ii)  Case 1: Taking the reference point as x = −1. Thus,
LHL: lim
x→−1−
f(x) = lim
x→−1−
(15) = 15
RHL: lim
x→−1+
f(x) = lim
x→−1+
(ax + b) = −a + b
Since f(x) is continuous at x = −1, we have −a + b = 15 (∗).
 Case 2: Taking the reference point as x = 2. Thus,
LHL: lim
x→2−
f(x) = lim
x→2−
(ax + b) = 2a + b
RHL: lim
x→2+
f(x) = lim
x→2+
(12x) = 24
Since f(x) is continuous at x = 2, we have 2a + b = 24 (∗∗). Solving equations (∗) and
(∗∗) simultaneously, we obtain a = 3 and b = 18.
Exercise:
(a) Discuss the continuity of the function f(x) =







x3 + 27
x + 3
if x ̸= −3
27 if x = −3
.
(b) Find the value of A and B so that the following function is continuous for all x.
f(x) =





















A
(
1 − cos x
sin2 x
)
if x  0
2x2
− x + B if 0 ≤ x ≤ 1
x2 + 2x − 3
x2 − 1
if x  1
Solution
lim
x→0−
f(x) = lim
x→0−
A(1 − cos(x))
sin2(x)
= lim
x→0−
A((((((
(1 − cos(x))
((((((
(1 − cos(x))(1 + cos(x))
=
A
2
lim
x→0+
f(x) = lim
x→0+
(2x2
− x + B) = B
16
c
⃝Francis Oketch
Since f(x) to be continuous at x = 0, we have
A
2
= B − − − (∗).
Also,
lim
x→1−
f(x) = lim
x→1−
(2x2
− x + B) = 1 + B
lim
x→1+
f(x) = lim
x→1+
x2 + 2x − 3
x2 − 1
= lim
x→1+


(x − 1)(x + 3)


(x − 1)(x + 1)
=
4
2
= 2
Since f(x) to be continuous at x = 1, we have 1 + B = 2 − − − (∗∗).
Solving equations (∗) and (∗∗), we get A = 2, B = 1.
(c) Find a and b so that the following functions are continuous ∀x ∈ R:
i)
f(x) =













2, if x  1
ax + b, if 1 ≤ x  2
6, if x ≥ 2
[ans: a = 4, b = −2]
ii)
f(x) =













−2x, if x  1
b − ax2
, if 1 ≤ x  4
−16x, if x ≥ 4
[ans: a =, b =]
(d) Find the values of a and b so that the following function is continuous everywhere on the real
number line and hence compute f(2).
f(x) =













x + 2, if x  2
ax2
− bx + 3, if 2 ≤ x  3
2x − a + b, if x ≥ 3
[ans: a =, b =, f(2) =]
17

Limits and Continuity of Functions

  • 1.
    SMA 2101: CALCULUSI c ⃝Francis O. Ochieng [email protected] YouTube: Prof. Francis Oketch∗ Department of Pure and Applied Mathematics Jomo Kenyatta University of Agriculture and Technology Course content • Functions: definition, domain, range, codomain, composition (or composite), inverse. • Limits, continuity and differentiability of a function. • Differentiation by first principle and by rule for xn (integral and fractional n). • Other techniques of differentiation, i.e., sums, products, quotients, chain rule; their applications to algebraic, trigonometric, logarithmic, exponential, and inverse trigonometric functions all of a single variable. • Implicit and parametric differentiation. • Applications of differentiation to: rates of change, small changes, stationary points, equations of tangents and normal lines, kinematics, and economics and financial models (cost, revenue and profit). • Introduction to integration and its applications to area and volume. References [1] Calculus: Early Transcendentals (8th Edition) by James Stewart [2] Calculus with Analytic Geometry by Roland E. Larson, Robert P. Hostetler and Bruce H. Edwards; 5th edition [3] Calculus and Analytical Geometry (9th edition) by George B. Thomas and Ross L. Finney [4] Advanced Engineering Mathematics (10th ed.) by Erwin Kreyszig [5] Calculus by Larson Hostellem Lecture 1 1 Functions To understand the word function, we consider the following scenario and definitions. For example, the growth of a sidling is an instance of a functional relation, since the growth may be affected by variations in temperature, moisture, sunlight, etc. If all these factors remain constant, then the growth is a function of time. ∗ https://www.youtube.com/channel/UC7wd3x6 08GNoUbLxmaC4vA 1
  • 2.
    c ⃝Francis Oketch Definition 1.1(Variables). A variable is an object, event, time period, or any other type of category you are trying to measure. Consider the formula used for calculating the volume of a sphere of radius r. V = 4 3 πr3 (1) Then, i) V and r vary with different spheres. Hence, they are called variables. ii) π and 4 3 are constants, irrespective of the size of the sphere. There are two types of variables, i.e., independent and dependent variables. Definition 1.2 (Independent and dependent variables). Independent variable refers to the input value while dependent variable refers to the output value. For example from formula (1), the volume, V , depends on the value of the radius, r, of the sphere. In this case, r is called the independent variable while V is called the dependent variable since it is affected by the variation of r. Similarly, for the function y = ax2 + bx + c, a, b and c are constants, x is the independent variable and y is the dependent variable. Definition 1.3 (Function). A function is a rule that assigns/associates each element in the independent set, say X, to a unique element in the dependent set, say Y . Examples of functions are i) Linear functions e.g., y = x + 5 ii) Quadratic functions e.g., y = x2 − 2x + 5 iii) Cubic functions e.g., y = x3 − 1 iv) Quartic functions e.g., y = 2x4 + x3 − 1 v) Trigonometric functions e.g., y = sin(2x + 5) vi) Logarithmic functions (log to base 10) e.g., y = log(3x + 1) vii) Natural logarithmic functions (log to base e ≈ 2.71828) e.g., y = ln(5x + 1) viii) Inverse of trigonometric functions e.g., y = tan−1(2x + 1) ix) Exponential functions e.g., y = e2x+1 x) Absolute value functions e.g., y = |x|. This function is defined as y = |x| = { −x, if x < 0 x, if x ≥ 0 → Note: in the above examples, the variable y depends on the variable x. Thus, we say that the dependent variable y is a function of the independent variable x. Using function notation, we write y = f(x), where f is a function. The function f(x) is read as f of x, meaning that f depends on x. 2
  • 3.
    1.1 Domain, Rangeand Codomain c ⃝Francis Oketch 1.1 Domain, Range and Codomain Definition 1.4 (Domain). A domain consists of all the elements in the independent set (i.e., the set of inputs), X, for which the function is defined. Definition 1.5 (Range). A range refers to a set of all the images of the elements in the domain. Definition 1.6 (Codomain). A codomain consists of all the elements in the dependent set (i.e., the set of outputs), Y . For example, consider the diagram below Example(s): 1. Find the domain and range of the following functions. (a) f(x) = (x − 4)2 + 5 Solution Since f(x) is defined (or is a real number) for any real number x, the domain of f is the interval (−∞, ∞). Let y = (x − 4)2 + 5. Making x the subject, we have x = 4 ± √ y − 5. This function is defined if y − 5 ≥ 0 or y ≥ 5. Therefore, the range is the interval [5, ∞). (b) f(x) = 2x2 − 5x + 1 Solution Since f(x) is defined (or is a real number) for any real number x, the domain of f is the interval (−∞, ∞). Let y = 2x2 − 5x + 1 or 2x2 − 5x + (1 − y) = 0. Making x the subject (use quadratic formula), we have x = 5 ± √ 25 − 8(1 − y) 4 . This function is defined if 25−8(1−y) ≥ 0 or y ≥ − 17 8 . Therefore, the range is the interval [ −17 8 , ∞ ) . (c) f(x) = 4 x2 − 5x + 6 Solution → Note: 4/0 = ∞ (infinity), i.e., a very very large value, undefined, or indeterminate. The function f(x) is defined when the denominator is nonzero, i.e., if x2 − 5x + 6 ̸= 0. Solving yields x ̸= 2 and x ̸= 3. Therefore, the domain of f includes all the real numbers of x except x = 2 and x = 3, i.e., the set (−∞, ∞){2, 3} or (−∞, 2) ∪ (2, 3) ∪ (3, ∞). Let y = 4 x2 − 5x + 6 or x2 − 5x + ( 6 − 4 y ) = 0. Making x the subject (use quadratic formula), we have x = 5 ± √ 25 − 4 ( 6 − 4 y ) 2 This function is defined if 25 − 4 ( 6 − 4 y ) ≥ 0 or y ≥ −16 and y ̸= 0. Therefore, the range is the interval [−16, 0) ∪ (0, ∞). 3
  • 4.
    1.2 Evaluation offunctions c ⃝Francis Oketch (d) f(x) = √ x − 1 Solution Since f(x) is defined (or is a real number) if x − 1 ≥ 0 or x ≥ 1, the domain of f is the interval [1, ∞). Let y = √ x − 1. Making x the subject, we have x = y2 + 1. This function is defined for any real number y. Therefore, the range is the interval [0, ∞). (e) f(x) = 2|x − 3| + 4 Solution Since f(x) is defined for all real numbers, the domain of f is the interval (−∞, ∞). Since for all |x − 3| ≥ 0, the function f(x) = 2|x − 3| + 4 ≥ 4. Therefore, the range is all the values of y for which y ≥ 4 or the interval [4, ∞). Exercise: 1. Find the domain and range of the following functions. (a) f(x) = 6 − x2. [ans: domain (−∞, ∞), range (−∞, 6]] (b) f(x) = 6 + 3x 1 − 2x . [ans: domain (−∞, 0.5) ∪ (0.5, ∞), range (−∞, −1.5) ∪ (−1.5, ∞)] (c) f(x) = x + 5 x − 2 . [ans: domain (−∞, 2) ∪ (2, ∞), range (−∞, 1) ∪ (1, ∞)] (d) f(x) = √ 4 − 2x + 5. [ans: domain (−∞, 2], range [5, ∞)] (e) f(x) = 1 √ x + 1 − 3. [ans: domain (−1, ∞), range (−3, ∞)] (f) f(x) = √ x2 − 16 x2 − 2x − 24 . [ans: domain (−∞, −4) ∪ (−4, 4] ∪ (6, ∞), range [ 0, 2 √ 5 ) ∪ ( 2 √ 5 , 1 ) ∪ (1, ∞)] (g) f(x) = √ x + 2 x − 2 . [ans: domain [−2, 2) ∪ (2, ∞), range (−∞, ∞)] (h) f(x) = 2x + 3. [ans: domain (−∞, ∞), range (3, ∞)] 1.2 Evaluation of functions This involves replacing x in the function by the suggested value and retaining the rule of the function. Example(s): 1. Given f(x) = 2x + 1. Find: (i) f(0), (ii) f(1), (iii) f(x + 2), and (iv) f(x + h) − f(x) h for h ̸= 0. Solution i) f(0) = 2(0) + 1 = 0 + 1 = 1 ii) f(1) = 2(1) + 1 = 2 + 1 = 3 iii) f(x + 2) = 2(x + 2) + 1 = 2x + 4 + 1 = 2x + 5 iv) f(x + h) − f(x) h = [2(x + h) + 1] − [2x + 1] h = 2x + 2h + 1 − 2x − 1 h = 2h h = 2. 2. Given f(x) = 3x2 − 2x + 4. Find: (i) f(0), (ii) f(−1), (iii) f(x + 2), and (iv) f(x + h) − f(x) h for h ̸= 0. Solution 4
  • 5.
    1.2 Evaluation offunctions c ⃝Francis Oketch i) f(0) = 3(0)2 − 2(0) + 4 = 0 + 0 + 4 = 4 ii) f(−1) = 3(−1)2 − 2(−1) + 4 = 3 + 2 + 4 = 9 iii) f(x + 2) = 3(x + 2)2 − 2(x + 2) + 4 = 3(x2 + 4x + 4) − 2x − 4 + 4 = 3x2 + 10x + 12 iv) f(x + h) − f(x) h = [ 3(x + h)2 − 2(x + h) + 4 ] − [ 3x2 − 2x + 4 ] h = ( 3x2 + 6hx + 3h2 − 2x − 2h + 4 ) − ( 3x2 − 2x + 4 ) h = 6hx + 3h2 − 2h h = 6x + 3h − 2 3. Given f(x) = x2 − 4x + 3. Find: (i) f(1), (ii) f(2), (iii) f(a), and (iv) f(a + h). Solution i) f(x) = x2 − 4x + 3 ⇒ f(1) = 12 − 4(1) + 3 = 0 ii) f(x) = x2 − 4x + 3 ⇒ f(2) = 22 − 4(2) + 3 = −1 iii) f(x) = x2 − 4x + 3 ⇒ f(a) = a2 − 4a + 3 iv) f(x) = x2 − 4x + 3 ⇒ f(a + h) = (a + h)2 − 4(a + h) + 3 4. Given ϕ(θ) = 2 sin θ. Find: (i) ϕ(π 2 ), (ii) ϕ(0), and (iii) ϕ(π 3 ). Solution i) ϕ(θ) = 2 sin θ ⇒ ϕ(π 2 ) = 2 sin (π 2 ) = 2 ii) ϕ(θ) = 2 sin θ ⇒ ϕ(0) = 2 sin (0) = 0 iii) ϕ(θ) = 2 sin θ ⇒ ϕ(π 3 ) = 2 sin (π 3 ) = 2 × √ 3 2 = √ 3 Exercise: (a) Given f(x) = x3 + 2x + 1, find: (i) f(0), (ii) f(−a), (iii) f(x + 2), and (iv) f(x + h) − f(x) h for h ̸= 0. (b) Given g(x) = 1 √ x + 1 , find: (i) f(0), (ii) f(1), (iii) f(x + 2), and (iv) g(x + h) − g(x) h for h ̸= 0. (c) Given p(x) = 6 − 2x 1 + 3x , find: (i) f(0), (ii) f(−1), (iii) f(2−x), and (iv) p(x + h) − p(x) h for h ̸= 0. (d) If f(x) = 2x2 − 4x + 1, find (i) f(1), (ii) f(0), (iii) f(2), (iv) f(a), and f(x + h). (e) If f(x) = (x − 1)(x + 5), find (i) f(1), (ii) f(0), (iii) f(2), (iv) f(a + 1), and f(1 a ). (f) If f(θ) = cos θ, find (i) f(π 2 ), (ii) f(0), (iii) f(π 3 ), (iv) f(π 6 ), and (v) f(π). (g) If f(x) = x2, find (i) f(3), (ii) f(3.1), (iii) f(3.01), (iv) f(3.001), and f(3.001) − f(3) 0.001 . (h) If ϕ(x) = 2x, find (i) ϕ(0), (ii) ϕ(1), and (iii) ϕ(0.5). 5
  • 6.
    1.3 Composite functionsc ⃝Francis Oketch 1.3 Composite functions The composition of functions is a function of another function. Consider the function f with domain A and range B, and the function g with domain D and range E. If B is a subset of D, then the composite function (gof)(x) is the function with domain A and range E such that (gof)(x) = g(f(x)) Example(s): 1. Given f(x) = 2x + 1 and g(x) = 5x − 3, find (fog)(x) and (gof)(x). Solution (fog)(x) = f(g(x)) = f(5x − 3) = 2(5x − 3) + 1 = 10x − 5 (gof)(x) = g(f(x)) = g(2x + 1) = 5(2x + 1) − 3 = 10x + 2 2. Given f(x) = x + 1 5x − 2 and g(x) = x + 1 2x , find (fog)(x). Solution (fog)(x) = f(g(x)) = g + 1 5g − 2 = ( x + 1 2x ) + 1 5 ( x + 1 2x ) − 2 = x + 1 + 2x 5x + 5 − 4x = 3x + 1 x + 5 → Note: in general, (fog)(x) ̸= (gof)(x). Exercise: 1. Given f(x) = x2 − 1, g(x) = x − 1 and h(x) = √ x. Find: (a) (fog)(x) (b) (hog)(x) (c) (gog)(x) (d) (gohof)(x) 2. Consider the functions f(x) = x2 + 1 and g(x) = 1/x. Evaluate (a) (fog)(4) (b) (gof)(−1/2) 3. (a) If f(x) = √ x and g(x) = 4x + 2, find the domain of (fog)(x).[ans: x ≥ −0.5 or [−0.5, ∞)] (b) If f(x) = 1 x + 1 and g(x) = √ x − 1, find the domain of (gof)(x).[ans: x −1 or (−1, ∞)] 4. The price of a washing machine is x dollars. The function f(x) = x − 100 gives the price of the washing machine after a $100 rebate. The function g(x) = 0.95x gives the price of the washing machine after a 5% discount. (a) Find and interpret (fog)(x). [ans: (fog)(x) = 0.95x − 100 gives the price of the washing machine after a 5% discount and a further $100 rebate] (b) Find and interpret (gof)(x). [ans: (gof)(x) = 0.95(x − 100) gives the price of the washing machine after a $100 rebate and a further 5% discount] 5. The number N of bacteria in a refrigerated food is given by N(T) = 10T2 − 20T + 600, 2 ≤ T ≤ 20 where T is the temperature of the food in degrees Celsius. When the food is removed from refrigeration, the temperature of the food is given by T(t) = 3t + 2, 0 ≤ t ≤ 6 where t is the time in hours. 6
  • 7.
    1.4 Inverse functionsc ⃝Francis Oketch (a) Find and interpret (NoT)(t). [ans: (NoT)(t) = 90t2 + 60t + 600, which represents the number of bacteria in the food as a function of the amount of time the food has been out of refrigeration.] (b) Find the bacteria count after 0.5 hour. [ans: = 652.5] (c) Find the time when the bacteria count reaches 1500. [ans: t ≈ 2.84 hours] 1.4 Inverse functions To find the inverse function of the given function f(x), follow these steps Replace f(x) with y and make x the subject. In the resulting equation, replace x with f−1(x) and then y with x. Example(s): 1. Find the inverse function of f(x) = 2x + 3 x − 1 . Solution Let y = 2x + 3 x − 1 . Making x the subject yields x = y + 3 y − 2 . Set x = f−1(x) and then y = x to get f−1 (x) = x + 3 x − 2 → Note: the domain of f must be equal to the range of f−1, and the range of f must be equal to the domain of f−1. a function need not have an inverse function, but when it does, the inverse function is unique. Exercise: 1. Find the inverse function of the following functions. (a) f(x) = √ x − 1 [ans: f−1(x) = x2 + 1] (b) f(x) = 5 − x 3x + 2 [ans: f−1(x) = 5 − 2x 3x + 1 ] 7
  • 8.
    c ⃝Francis Oketch Lecture 2 2Limits of functions Definition 2.1 (Basic limit definition). Let f(x) be a function and let a and L be real numbers. If f(x) approaches L as x approaches a from either RHS or LHS of a (but is not equal to a), then we say that f(x) has limit L as x approaches a, and is mathematically written as: . . lim x→a f(x) = L. Diagrammatically, we have → Note: lim x→a f(x) is the value that f(x) approaches as x approaches a, and a does not have to be in the domain of f. 2.1 Properties of limits Theorem 2.1. Suppose lim x→a f(x) = L1 and lim x→a g(x) = L2. Then, 1. [Addition/subtraction rule] lim x→a [f(x) ± g(x)] = [ lim x→a f(x) ] ± [ lim x→a g(x) ] = L1 ± L2 2. [Scalar multiple] lim x→a [λf(x)] = λ [ lim x→a f(x) ] = λL1, where λ is a constant. 3. [Product rule] lim x→a [f(x) · g(x)] = [ lim x→a f(x) ] · [ lim x→a g(x) ] = L1 · L2 4. [Quotient rule] lim x→a [ f(x) g(x) ] = lim x→a f(x) lim x→a g(x) = L1 L2 , provided g(a) ̸= 0. 5. [Power rule] lim x→a [f(x)]n = [ lim x→a f(x) ]n = Ln 1 , where n is a real number. → Note: if f(x) = c (where c is a constant), then lim x→a [f(x)] = lim x→a [c] = c 2.2 Techniques of evaluating limits of functions Direct substitution (DS) The required limit is obtained by just plugging in the value of input, say x, into the given function, say f(x). Example(s): (a) Evaluate lim x→2 3x3 − x2 + 2x + 5. Solution lim x→2 (3x3 − x2 + 2x + 5) = 3 lim x→2 x3 − lim x→2 x2 + 2 lim x→2 x + lim x→2 5) = 3(23 ) − (22 ) + 2(2) + 5 = 29 8
  • 9.
    2.2 Techniques ofevaluating limits of functions c ⃝Francis Oketch (b) Evaluate lim x→1 x2 − 1 x + 1 . Solution lim x→1 x2 − 1 x + 1 D.S = 12 − 1 1 + 1 = 0 2 = 0 Factorization If on direct substitution we get the indeterminate form 0/0, then it means that there is a common factor in both the numerator and denominator. In this case, we perform factorization first so as to simplify the given function. → Note: if the polynomial in the numerator is of degree greater than the degree of the polynomial in the denominator, we first need to perform long division. Example(s): (a) Evaluate lim x→2 x2 + x − 6 x − 2 Solution lim x→2 x2 + x − 6 x − 2 = lim x→2 (x − 2)(x + 3) x − 2 = lim x→2 (x + 3) D.S = 2 + 3 = 5 (b) Evaluate lim x→−2 x2 + 3x + 2 2x2 − 8 Solution lim x→−2 x2 + 3x + 2 2x2 − 8 = lim x→−2 (x + 2)(x + 1) 2(x + 2)(x − 2) = lim x→−2 x + 1 2(x − 2) D.S = −2 + 1 2(−2 − 2) = −1 −8 = 1 8 (c) Evaluate lim x→1 x3 − 1 x2 − 1 . Solution lim x→1 x3 − 1 x2 − 1 = lim x→1 ( x + x − 1 x2 − 1 ) (long division) = lim x→1 [ x + x − 1 (x − 1)(x + 1) ] (factorization) = lim x→1 ( x + 1 x + 1 ) D.S = 1 + 1 1 + 1 = 1 + 1 2 = 3 2 Limits at infinity In this case, we first divide the numerator and denominator by the highest power of x in the denominator. Example(s): 9
  • 10.
    2.2 Techniques ofevaluating limits of functions c ⃝Francis Oketch (a) Evaluate lim x→∞ 5x3 − 1 4x3 − 2x − 7 . Solution lim x→∞ 5x3 − 1 4x3 − 2x − 7 = lim x→∞ 5 − 1 x3 4 − 2 x2 − 7 x3 D.S = 5 − 1 ∞ 4 − 2 ∞ − 7 ∞ = 5 − 0 4 − 0 − 0 = 5 4 Rationalization Suppose there exists a surd in either the numerator or denominator or both. Then, we first need to multiply both the numerator and denominator by the conjugate of the factor containing the surd (in either the numerator or denominator) and then simplify the resulting function. After rationalization, we perform a direct substitution. → Note: in case the surds appear in both the numerator and denominator, then we rationalize the denominator. Example(s): (a) Evaluate lim x→∞ √ x2 − 4x − x. Solution lim x→∞ √ x2 − 4x − x = lim x→∞ (√ x2 − 4x − x ) (√ x2 − 4x + x √ x2 − 4x + x ) = lim x→∞ x2 − 4x − x2 √ x2 − 4x + x = lim x→∞ −4x √ x2 − 4x + x = lim x→∞ −4x · 1 x (√ x2 − 4x + x ) · 1 x = lim x→∞ −4 √ 1 − 4 x + 1 D.S = −4 √ 1 − 4 ∞ + 1 = −4 √ 1 − 0 + 1 = −4 1 + 1 = −2 (b) Evaluate lim x→9 √ x − 3 x − 9 . Solution lim x→9 √ x − 3 x − 9 = lim x→9 ( √ x − 3)( √ x + 3) (x − 9)( √ x + 3) = lim x→9 (x − 9) (x − 9)( √ x + 3) = lim x→9 1 √ x + 3 D.S = 1 √ 9 + 3 = 1 3 + 3 = 1 6 Exercise: (a) lim x→∞ √ x2 − 2 − √ x2 + x. 10
  • 11.
    2.2 Techniques ofevaluating limits of functions c ⃝Francis Oketch Solution lim x→∞ √ x2 − 2 − √ x2 + x = lim x→∞ (√ x2 − 2 − √ x2 + x ) · √ x2 − 2 + √ x2 + x √ x2 − 2 + √ x2 + x = lim x→∞ (x2 − 2) − (x2 + x) √ x2 − 2 + √ x2 + x = lim x→∞ −2 − x √ x2 − 2 + √ x2 + x = lim x→∞ − 2 x − 1 √ 1 − 2 x2 + √ 1 + 1 x D.S = − 2 ∞ − 1 √ 1 − 2 ∞ + √ 1 + 1 ∞ = − 1 2 (b) Evaluate lim x→1 ( x3 − 1 x − 1 ) . [ans: 3] (c) Evaluate lim x→1 ( 1 − √ x 1 − x ) . [ans: 1/2] (d) Evaluate lim x→∞ 5x2 − 3x + 2 10x2 − x + 100 . [ans: 1/2] (e) Evaluate lim x→0 √ 1 + x − √ 1 − x x . [ans: 1] → Note: A function which grows arbitrarily large as x goes to positive or negative infinity is said to have an infinite limit. Infinity is not a real number, so if a function has infinite limit, we say that the limit does not exist. Lecture 3 Theorem 2.2 (Squeeze law (sandwich theorem)). Suppose that f(x) ≤ g(x) ≤ h(x) holds for all x around a, except possibly at x = a. If lim x→a f(x) = lim x→a h(x) = L, then lim x→a g(x) = L. Example(s): 1. Find lim x→0 x sin ( 1 x2 + x ) . Solution We know that sin θ is sandwiched between −1 and 1 i.e., −1 ≤ sin(θ) ≤ 1. Therefore, As −1 ≤ sin ( 1 x + x2 ) ≤ 1 ⇒ −x ≤ x sin ( 1 x + x2 ) ≤ x ⇒ − lim x→0 (x) ≤ lim x→0 x sin ( 1 x + x2 ) ≤ lim x→0 (x) ⇒ 0 ≤ lim x→0 x sin ( 1 x + x2 ) ≤ 0 ⇒ lim x→0 x sin ( 1 x + x2 ) = 0 Exercise: 1. [Assignment 1] Prove that lim h→0 sin h h = 1 and lim h→0 (1 − cos h) h = 0. 11
  • 12.
    2.3 One-Sided Limitc ⃝Francis Oketch Proof. Consider the following unit circle. Let the length of line OA be a units, AB is b units, CD be c units and angle AOB be h. Here, OB = OC = 1 unit. Now, cos h = a, sin h = b and tan h = c. From the figure, the area of triangle OAB is less than that of the sector OCB which is also less than that of triangle OCD i.e., 1 2 ab ≤ h 2π · π(1)2 ≤ 1 2 (1)c. Thus, 1 2 cos h sin h ≤ 1 2 h ≤ 1 2 tan h Multiply through by 2 and using the identity tan h = sin h cos h , we have cos h sin h ≤ h ≤ sin h cos h Taking reciprocals, we have 1 cos h sin h ≥ 1 h ≥ cos h sin h Multiplying though by sin h yields 1 cos h ≥ sin h h ≥ cos h, which can be rewritten as cos h ≤ sin h h ≤ 1 cos h Taking limit as h → 0, we have lim h→0 cos h ≤ lim h→0 sin h h ≤ lim h→0 1 cos h . That is, 1 ≤ lim h→0 sin h h ≤ 1. Hence, by the squeeze law we get . . lim h→0 sin h h = 1 Also, lim h→0 (1 − cos h) h = lim h→0 [ (1 − cos h) h · (1 + cos h) (1 + cos h) ] = lim h→0 [ 1 − cos2 h h · 1 1 + cos h ] = lim h→0 [ sin2 h h · 1 1 + cos h ] = lim h→0 [ sin h h · sin h 1 + cos h ] = [ lim h→0 sin h h ] [ lim h→0 sin h (1 + cos h) ] = (1) [ lim h→0 sin h (1 + cos h) ] D.S = 0 (1 + 1) = 0 Therefore, . . lim h→0 (1 − cos h) h = 0 2.3 One-Sided Limit Definition 2.2 (Left-Hand Limit). If a function f(x) approaches the number L as x approaches the real number a from the LHS of a, then we say that L is the left-hand limit of f at x = a and is written as: . . lim x→a− f(x) = L. 12
  • 13.
    2.3 One-Sided Limitc ⃝Francis Oketch Definition 2.3 (Right-Hand Limit). If a function f(x) approaches the number L as x approaches the real number a from the RHS of a, then we say that L is the right-hand limit of f at x = a and is written as: . . lim x→a+ f(x) = L. → Note: the limit of f(x) as x approaches a exists if both left-hand limit and right-hand limit exist and are equal at x = a. In that case, we have . . lim x→a− f(x) = lim x→a+ f(x) = lim x→a f(x) = L Example(s): (a) Consider the function defined by f(x) =      x3 if x 1 1 if x = 1 2 − x if x 1. Evaluate lim x→1 f(x). Solution (i) LHL: lim x→1− f(x) = lim x→1− (x3 ) = 13 = 1 (ii) RHL: lim x→1+ f(x) = lim x→1+ (2 − x) = 2 − 1 = 1 (iii) Since the result (i) = (ii), we get lim x→1 f(x) = 1 Exercise: (a) Consider the function defined by f(x) =      x2 − 2x if x 1 2 if x = 1 3x − 4 if x 1. . Evaluate lim x→1− f(x) and lim x→1+ f(x). (b) Consider the function defined by f(x) = { 2 − 3x if x ≤ 1 2x3 if x 1 . Does lim x→1 f(x) exist? (c) Evaluate lim x→0 f(x) given f(x) = { x if x ̸= 0 1 if x = 0. Meaning of absolute value functions To separate (or split) the function contained in the absolute value function, do the following: i) First identify the reference point by equating the interior term to zero. ii) Investigate the signs of the interior expression to the left and the right of the reference point. For example, If f(x) = |x − 3|. The reference point is x − 3 = 0 ⇒ x = 3. Thus, f(x) = { −(x − 3) if x 3 +(x − 3) if x ≥ 3 If f(x) = 5 + |x + 5|. The reference point is x + 5 = 0 ⇒ x = −5. Thus, f(x) = { 5 − (x + 5) if x −5 5 + (x + 5) if x ≥ −5 13
  • 14.
    2.3 One-Sided Limitc ⃝Francis Oketch If f(x) = 1 2 − |x| . The reference point is x = 0. Thus, f(x) =            1 2 + x if x 0 1 2 − x if x ≥ 0 . Example(s): (a) Evaluate lim x→0 |5x| x . Solution The reference point is 5x = 0 ⇒ x = 0. Thus, we have f(x) = |5x| x = {−(5x) x if x 0 +(5x) x if x 0 Now, (i) LHL: lim x→0− f(x) = lim x→0− −5x x = −5 (ii) RHL: lim x→0+ f(x) = lim x→0+ 5x x = 5 (iii) Since (i) ̸= (ii), therefore, lim x→0 |5x| x does not exist. The above problem possesses a one-sided limits. (b) Evaluate lim x→7 ( |x − 7| (x − 7) ) . Solution The reference point is x − 7 = 0 ⇒ x = 7. Thus, we have f(x) = |x − 7| x − 7 = {−(x−7) x−7 = −1 if x 7 +(x−7) x−7 = +1 if x 7 Now, (i) LHL: lim x→7− f(x) = lim x→0− (−1) = −1 (ii) RHL: lim x→7+ f(x) = lim x→0+ (+1) = 1 (iii) Since (i) ̸= (ii), therefore, lim x→7 f(x) does not exist. The above problem possesses a one-sided limits. Exercise: 1. Evaluate the following (a) lim x→6 ( x + 6 |x + 6| ) . (b) lim x→3− ( x2 − x − 6 |x − 3| ) . (c) lim x→1 ( 2 − x2 + 2x − 3 |x − 1| ) . (d) lim x→3 ( |x2 − 7x| x2 + 1 ) . [ans: = 6/5] 14
  • 15.
    c ⃝Francis Oketch 3 Continuityof a function A function f(x) is said to be continuous at a point x = a if the following three conditions are satisfied: i) f(a) is defined, i.e., f(x) must be finite at x = a. ii) lim x→a f(x) exists (i.e., LHL=RHL at x = a) iii) lim x→a f(x) = f(a), i.e., (ii)=(i) → Note: if at least one of these conditions is not satisfied, then f(x) is discontinuous at x = a. In this case, we say that the point a is a discontinuity of f (i.e., f(x) has some gaps or jumps at x = a). Example(s): (a) Discuss the continuity of the function f(x) =        x2 − 1 x + 1 if x −1 x2 − 3 if x ≥ −1 at x = −1 Solution We need to test the three conditions for continuity: (i) f(−1) = (−1)2 − 3 = −2 (defined). (ii) lim x→−1 f(x): LHL: lim x→−1− f(x) = lim x→−1− ( x2 − 1 x + 1 ) = lim x→−1− (x + 1)(x − 1) (x + 1) = lim x→−1− (x − 1) = −2 RHL: lim x→−1+ f(x) = lim x→−1+ (x2 − 3) = 1 − 3 = −2 Since LHL=RHL=-2, therefore, lim x→−1 f(x) = −2 (iii) So, as lim x→−1 f(x) = f(−1) therefore, f(x) is continuous on (−4, 4). (b) Discuss the continuity of the function f(x) = 2x4 − 6x3 + x2 + 3 x − 1 at x = 1. Solution Clearly, the function f(x) = 2x4 − 6x3 + x2 + 3 x − 1 is discontinuous at x = 1. However, the point of discontinuity can be removed by first simplifying the given function. Thus, by long division we have 2x3 − 4x2 − 3x − 3 x − 1 ) 2x4 − 6x3 + x2 + 3 − 2x4 + 2x3 − 4x3 + x2 4x3 − 4x2 − 3x2 3x2 − 3x − 3x + 3 3x − 3 0 Hence, the function can be rewritten in the simplest form f(x) = 2x3 − 4x2 − 3x − 3, which is now continuous at x = 1 [student to verify this]. Therefore, the original function is said to have a removable point of discontinuity. 15
  • 16.
    c ⃝Francis Oketch (c) Findthe value of the constants in the give problems if f(x) is continuous everywhere in the real number line i) Given f(x) = { 4 + c if x 1 4x + 2 if x ≥ 1 . Find c [ans: c = 2] ii) Given f(x) =        −15x if x −1 ax + b if − 1 ≤ x 2 12x if x 2 . Find a and b [ans: a = 3, b = 18] Solution In these questions, we make use of the second condition of continuity in particular, i.e., LHL=RHL at any point x = a. i) The reference point is x = 1. Thus, LHL: lim x→1− f(x) = lim x→1− (4 + c) = 4 + c RHL: lim x→1+ f(x) = lim x→1+ (4x + 2) = 4 + 2 = 6 Since f(x) is continuous at x = 1, we have 4 + c = 6. Therefore, c = 2. ii) Case 1: Taking the reference point as x = −1. Thus, LHL: lim x→−1− f(x) = lim x→−1− (15) = 15 RHL: lim x→−1+ f(x) = lim x→−1+ (ax + b) = −a + b Since f(x) is continuous at x = −1, we have −a + b = 15 (∗). Case 2: Taking the reference point as x = 2. Thus, LHL: lim x→2− f(x) = lim x→2− (ax + b) = 2a + b RHL: lim x→2+ f(x) = lim x→2+ (12x) = 24 Since f(x) is continuous at x = 2, we have 2a + b = 24 (∗∗). Solving equations (∗) and (∗∗) simultaneously, we obtain a = 3 and b = 18. Exercise: (a) Discuss the continuity of the function f(x) =        x3 + 27 x + 3 if x ̸= −3 27 if x = −3 . (b) Find the value of A and B so that the following function is continuous for all x. f(x) =                      A ( 1 − cos x sin2 x ) if x 0 2x2 − x + B if 0 ≤ x ≤ 1 x2 + 2x − 3 x2 − 1 if x 1 Solution lim x→0− f(x) = lim x→0− A(1 − cos(x)) sin2(x) = lim x→0− A(((((( (1 − cos(x)) (((((( (1 − cos(x))(1 + cos(x)) = A 2 lim x→0+ f(x) = lim x→0+ (2x2 − x + B) = B 16
  • 17.
    c ⃝Francis Oketch Since f(x)to be continuous at x = 0, we have A 2 = B − − − (∗). Also, lim x→1− f(x) = lim x→1− (2x2 − x + B) = 1 + B lim x→1+ f(x) = lim x→1+ x2 + 2x − 3 x2 − 1 = lim x→1+ (x − 1)(x + 3) (x − 1)(x + 1) = 4 2 = 2 Since f(x) to be continuous at x = 1, we have 1 + B = 2 − − − (∗∗). Solving equations (∗) and (∗∗), we get A = 2, B = 1. (c) Find a and b so that the following functions are continuous ∀x ∈ R: i) f(x) =              2, if x 1 ax + b, if 1 ≤ x 2 6, if x ≥ 2 [ans: a = 4, b = −2] ii) f(x) =              −2x, if x 1 b − ax2 , if 1 ≤ x 4 −16x, if x ≥ 4 [ans: a =, b =] (d) Find the values of a and b so that the following function is continuous everywhere on the real number line and hence compute f(2). f(x) =              x + 2, if x 2 ax2 − bx + 3, if 2 ≤ x 3 2x − a + b, if x ≥ 3 [ans: a =, b =, f(2) =] 17