Calculus Template
Calculus Template
Calculus Template
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.
Definition 1.1 (Variables). A variable is an object, event, time period, or any other type of
category you are trying to measure.
1
⃝Francis
c Oketch
Consider the formula used for calculating the volume of a sphere of radius r.
4
V = πr3 (1)
3
Then,
i) V and r vary with different spheres. Hence, they are called variables.
4
ii) π and are constants, irrespective of the size of the sphere.
3
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 .
{
−x, if x < 0
y = |x| =
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 ⃝Francis
c Oketch
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 2x√ 2 − 5x + (1 − y) = 0. Making x the subject (use quadratic
5 ± 25 − 8(1 − y)
formula), we have x = . This function is defined if 25 − 8(1 − y) ≥ 0
4 [ )
17
or y ≥ − . Therefore, the range is the interval − 178 ,∞ .
8
4
(c) f (x) = 2
x − 5x + 6
Solution
→ Note: 4/0 = ∞ (infinity), vvvv large value, undefined, 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, ∞).
4 ( )
Let y = 2 or x2 − 5x + 6 − y4 = 0. Making x the subject (use quadratic
x − 5x + 6
formula), we have √ ( )
5± 25 − 4 6 − 4
y
x=
2
( )
This function is defined if 25 − 4 6 − 4
y ≥ 0 or y ≥ −16. Therefore, the range is the
interval [−16, ∞).
3
1.2 Evaluation of functions ⃝Francis
c 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 = y 2 + 1. This function is defined
for any real number y. Therefore, the range is the interval (−∞, ∞).
(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:
Example(s):
f (x + h) − f (x)
1. Given f (x) = 2x + 1. Find: (i) f (0), (ii) f (1), (iii) f (x + 2), and (iv) for h ̸= 0.
h
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
f (x + h) − f (x) [2(x + h) + 1] − [2x + 1] 2x + 2h + 1 − 2x − 1 2h
iv) = = = = 2.
h h h h
f (x + h) − f (x)
2. Given f (x) = 3x2 − 2x + 4. Find: (i) f (0), (ii) f (−1), (iii) f (x + 2), and (iv)
h
for h ̸= 0.
Solution
4
1.3 Composite functions ⃝Francis
c Oketch
iv)
[ ] [ ]
f (x + h) − f (x) 3(x + h)2 − 2(x + h) + 4 − 3x2 − 2x + 4
=
h ( 2 h ) ( )
3x + 6hx + 3h2 − 2x − 2h + 4 − 3x2 − 2x + 4 6hx + 3h2 − 2h
= =
h 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
Solution
(π)
i) ϕ(θ) = 2 sin θ ⇒ ϕ( π2 ) = 2 sin 2 =2
ii) ϕ(θ) = 2 sin θ ⇒ ϕ(0) = 2 sin (0) = 0
√
(π) 3 √
iii) ϕ(θ) = 2 sin θ ⇒ ϕ( π3 ) = 2 sin 3 =2× = 3
2
Exercise:
f (x + h) − f (x)
(a) Given f (x) = x3 + 2x + 1, find: (i) f (0), (ii) f (−a), (iii) f (x + 2), and (iv) for
h
h ̸= 0.
1 g(x + h) − g(x)
(b) Given g(x) = √ , find: (i) f (0), (ii) f (1), (iii) f (x + 2), and (iv) for h ̸= 0.
x+1 h
6 − 2x p(x + h) − p(x)
(c) Given p(x) = , find: (i) f (0), (ii) f (−1), (iii) f (2 − x), and (iv) for h ̸= 0.
1 + 3x h
(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 ( a1 ).
(f) If f (θ) = cos θ, find (i) f ( π2 ), (ii) f (0), (iii) f ( π3 ), (iv) f ( π6 ), and (v) f (π).
f (3.001) − f (3)
(g) If f (x) = x2 , find (i) f (3), (ii) f (3.1), (iii) f (3.01), (iv) f (3.001), and .
0.001
(h) If ϕ(x) = 2x , find (i) ϕ(0), (ii) ϕ(1), and (iii) ϕ(0.5).
5
⃝Francis
c Oketch
Similarly,
(f og)(x) = f (g(x)) = f (5x − 3) = 2(5x − 3) + 1 = 10x − 5
→ Note: (f og)(x) ̸= (gof )(x).
Exercise:
√
1. Given f (x) = x2 − 1, g(x) = x − 1 and h(x) = x. Find:
(a) (f og)(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) (f og)(4)
(b) (gof )(−1/2)
√
3. If f (x) = x and g(x) = 4x + 2, find the domain of (f og)(x). [ans: x ≥ −0.5 or (−∞, −0.5]]
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:
. = L.
lim f (x)
x→a
Diagrammatically, we have
6
2.2 Techniques of evaluating limits of functions ⃝Francis
c Oketch
Example(s):
= 29
x2 − 1
(b) Evaluate lim .
x→1 x + 1
Solution
x2 − 1 D.S 12 − 1 0
lim = = =0
x→1 x + 1 1+1 2
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):
x2 + x − 6
(a) Evaluate lim
x→2 x−2
Solution
x2 + x − 6 (x − 2)(x + 3)
lim = lim
x→2 x−2 x→2 x−2
D.S
= lim (x + 3) = 2 + 3
x→2
= 5
x2 + 3x + 2
(b) Evaluate lim
x→−2 2x2 − 8
Solution
x2 + 3x + 2 (x + 2)(x + 1)
lim = lim
x→−2 2x2 − 8 x→−2 2(x + 2)(x − 2)
x + 1 D.S −2 + 1 −1
= lim = =
x→−2 2(x − 2) 2(−2 − 2) −8
1
=
8
x3 − 1
(c) Evaluate lim .
x→1 x2 − 1
7
2.2 Techniques of evaluating limits of functions ⃝Francis
c Oketch
Solution
( )
x3 − 1 x−1
lim 2 = lim x + 2 (long division)
x→1 x − 1 x→1 x −1
[ ]
x−1
= lim x + (factorization)
x→1 (x − 1)(x + 1)
( )
1 D.S 1 1
= lim x + = 1+ =1+
x→1 x+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):
5x3 − 1
(a) Evaluate lim .
x→∞ 4x3 − 2x − 7
Solution
1 1
5x3 − 1 5− 5− 5−0
lim = lim x3 D.S
= ∞ =
x→∞ 4x3 − 2x − 7 x→∞ 2 7 2 7 4−0−0
4− 2 − 3 4− −
x x ∞ ∞
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 x2 − 4x − x.
x→∞
Solution
(√ )
√ (√ ) x2 − 4x + x
lim x2 − 4x − x = lim x2 − 4x − x √
x→∞ x→∞ x2 − 4x + x
x2 − 4x − x2 −4x
= lim √ = lim √
x→∞ x − 4x + x
2 x→∞ x − 4x + x
2
1
−4x · −4
lim (√ x lim √
= ) 1 = x→∞
x→∞
x2 − 4x + x · 4
1− +1
x x
D.S −4 −4 −4
= √ =√ =
4 1−0+1 1+1
1− +1
∞
= −2
8
2.2 Techniques of evaluating limits of functions ⃝Francis
c Oketch
√
x−3
(b) Evaluate lim .
x→9 x − 9
Solution
√ √ √
x−3 ( x − 3)( x + 3)
lim = lim √
x→9 x − 9 x→9 (x − 9)( x + 3)
(x − 9) 1
= lim √ = lim √
x→9 (x − 9)( x + 3) x→9 x+3
D.S 1 1
= √ =
9+3 3 + 3
1
=
6
Exercise:
√ √
(a) lim x2 − 2 − x2 + x.
x→∞
Solution
(√ )
√ √
√ √ √ x2 − 2 + x2 + x
lim x2 − 2 − x2 + x = lim x2 − 2 − x2 + x · √ √
x→∞ x→∞ x2 − 2 + x2 + x
(x2 − 2) − (x2 + x) −2 − x
= lim √ √ = lim √ √
x→∞ x −2+ x +x
2 2 x→∞ x − 2 + x2 + x
2
2 2
− −1 − −1
= lim √ x √
D.S
= √ ∞ √
x→∞ 2 1 2 1
1− 2 + 1+ 1− + 1+
x x ∞ ∞
1
= −
2
x3 − 1
(b) Evaluate lim . [ans: 3]
x→1 x − 1
√
1− x
(c) Evaluate lim . [ans: 1/2]
x→1 1 − x
5x2 − 3x + 2
(d) Evaluate lim . [ans: 1/2]
x→∞ 10x2 − x + 100
√ √
1+x− 1−x
(e) Evaluate lim . [ans: 1]
x→0 x
→ 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 f (x) = lim h(x) = L, then lim g(x) = L.
x→a x→a x→a
Example(s):
( )
1
1. Find lim x sin .
x→0 x2 + x
Solution