Calculus For Scientists and Engineers With Matlab PDF
Calculus For Scientists and Engineers With Matlab PDF
Calculus
2 Differentiation 55
2.1 Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Relationship Between Differentiability and Continuity . . . . . . . . . . . . . . . . . 61
2.2 Rules of Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Differentiation of Trigonometric Functions . . . . . . . . . . . . . . . . . . . . . . . . 65
Chain Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Differentiation of Inverse Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.3 Differentiation of Exponential and Logarithmic Functions . . . . . . . . . . . . . . . 75
Logarithmic Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
2.4 Implicit Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
2.5 Related Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
iv CONTENTS
3 Applications of Differentiation 97
3.1 Maximum and Minimum Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.2 Monotone Functions and Mean Value Theorem . . . . . . . . . . . . . . . . . . . . . 107
3.3 Tests for Local Extrema and Concavity . . . . . . . . . . . . . . . . . . . . . . . . . 114
Local Extrema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Concavity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
3.4 L’Hospital’s Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
3.5 Curve Sketching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
3.6 Parametric Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Polar Coordinates and Polar Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
3.7 Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
3.8 Newton’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
4 Integration 185
4.1 Areas under Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Properties of Definite Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Average Value of a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
4.2 Fundamental Theorem of Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
4.3 Indefinite Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
4.4 Substitution Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Trigonometric Substitutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
4.5 Integration by Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
4.6 Some Common Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Trigonometric Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Rational Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
4.7 Numerical Approximation of Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . 236
4.8 Improper Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Index 441
vi CONTENTS
CHAPTER
1
Limit and Continuity
1.1 Functions
In the calculus of one variable, a function y = f (x) is a rule assigning a unique real
number y to a real number x in a subset D ⊂ R. Here x is called the independent variable
and y the dependent variable. The set D is called the domain of the function and the set R
of all y values is called the range of the function. The function is denoted by f , while f (x)
represents the value y at x, i.e., y = f (x).
x
−1 O 1
2 Limit and Continuity
1 y
3. The function h(x) = is defined every-
x
where except at x = 0. So the domain
D is the whole real line with 0 deleted, 1
y=
i.e., D = (−∞, 0) ∪ (0, +∞). The range R x
is the whole real line with 0 deleted, i.e., 1
−1
R = (−∞, 0) ∪ (0, +∞). O 1
x
−1
The domain of a function sometimes is not given explicitly. In this case, the domain can be
found from the expression of the function or from the context. It is called the natural domain.
y = x3 + 1
1
x
−1 O
√
3. The function h(x) = x is defined for any y
x ≥ 0, so the natural domain is [0, +∞).
√
y= x
x
O
4. The function
y
k(x) = (x − 1)(x + 2)
p
x2 − 1
5. The natural domain of p(x) = is (−∞, 1) ∪ (1, +∞). Note that x = 1 is not in
x−1
the domain of p since p(x) cannot be evaluated at x = 1. If we let q(x) = x + 1 whose
natural domain is (−∞, +∞), then p(x) = q(x) when x 6= 1. Be alert that p and q are
not the same functions, since they have different domains.
y y
x2 − 1
y= 2 y =x+1 2
x−1
1 1
x x
−1 O 1 −1 O 1
Since x is the length of one side, we have 0 ≤ x ≤ 21 L. So the natural domain of the
function A is the closed interval [0, 12 L]. When x = 0 or 12 L, the rectangle is degenerate, i.e.,
the area of the rectangle is zero.
4 Limit and Continuity
Typical transcendental functions are exponential functions, sine function, cosine function,
logarithmic functions. The following are examples of transcendental functions:
A general transcendental function is a function that does not satisfy a polynomial equation.
Exponential Functions
For a positive number b (called the base) and a real number β (called the exponent), the
exponentiation bβ defines a real number.
The exponential function is f (x) = ax , where a is a positive number. It has domain R and
range (0, +∞).
Let a, b be positive numbers and α, β be real numbers. The following laws of exponents
hold:
α
1. aα · aβ = aα+β . 4. (a · b) = aα · bα .
aα 1
2. = aα−β . 5. a−α = .
aβ aα
β
3. (aα ) = aα·β . 6. a1 = a, a0 = 1.
A hot object tends to cool down to the surrounding temperature. Newton expressed this
as the following relationship (known as Newton’s Law of Cooling):
Trigonometric Functions
1.9 Definition: trigonometric functions
hypotenuse hypotenuse hy
p ot opposite
opposite adjacent
tan θ = , cot θ = ,
adjacent opposite θ
hypotenuse hypotenuse adjacent
csc θ = , sec θ = .
opposite adjacent
In general, for an angle θ, with θ ∈ [0, 2π), y
if we let P (x, y) be the point on the terminal
P (x, y)
side of θ and if let r be the distance |OP |, the
values of the sine and the cosine are defined
r
as θ
y x
sin θ = , cos θ = . x
r r O
For θ outside [0, 2π), the values of the sine and the cosine are defined in terms of the
following periodic property:
sin(θ + 2π) = sin θ, cos(θ + 2π) = cos θ.
sin θ
The tangent function is defined by tan θ = . The cosecant, secant, and cotangent
cos θ
function are the reciprocals of the sine, cosine, and tangent functions.
y y
sin θ cos θ
1 1
O π π 3π 2π
θ O π π 3π 2π
θ
2 2 2 2
−1 −1
domain: (−∞, ∞) domain: (−∞, ∞)
range: [−1, 1] range: [−1, 1]
y y
tan θ cot θ
− 3π
2
− π2
O π 3π
θ −π O π θ
2 2
domain: (−∞, ∞) − {± π2 , ± 3π
2
,...} domain: (−∞, ∞) − {±π, ±3π, . . . }
range: (−∞, ∞) range: (−∞, ∞)
6 Limit and Continuity
y y
csc θ sec θ
sin θ − 3π
2
− π2 cos θ
−π O π θ O π 3π
θ
2 2
√ √
45◦ π
4 2
2
2
2
√
60◦ π
3 2
3 1
2
90◦ π
2 1 0
For other trigonometric functions, the exact values at these special angles can be obtained
by using
sin θ cos θ 1 1
tan θ = , cot θ = , sec θ = , csc θ = .
cos θ sin θ cos θ sin θ
For angles in other ranges, one may use the following equalities:
iθ
e = cos θ + i sin θ, θ
O cos θ 1
Re
• Any complex number can be expressed in the form a + bi, where a and b are real
numbers. The number a is called the real part of a + bi, and b is its imaginary part.
• The complex exponential function eiθ can be treated similarly as other real expo-
nential functions.
• Many trigonometric identities can be proved by using the Pythagorean identity
sin2 θ + cos2 θ = 1 and Euler’s formula eiθ = cos θ + i sin θ. For instance, from the
following:
cos(α + β) + i sin(α + β)
= ei(α+β) = eiα · eiβ
= (cos α + i sin α) · (cos β + i sin β)
= (cos α cos β − sin α sin β) + i(sin α cos β + cos α sin β),
by identifying the real and imaginary parts on both sides, we have the angle sum
identities:
There are various ways to express functions, numerically, graphically, or using mathemat-
ical expressions.
Some functions may have different mathematical expressions over different parts of its
domain. Here are some examples.
8 Limit and Continuity
1. y
if x ≤ 0;
x,
f (x) = y = f (x)
sin x, if x > 0.
1
x
−1 O 1
2π
π
−1
2. y
cos x, if x 6= 0;
g(x) =
0, if x = 0. y = g(x) 1
x
−π − 12 π O 1
2π
π
−1
3. y
cos x, if x ≤ −1;
y = h(x) 2
h(x) = sin x, if −1 < x ≤ 1;
1
2, if x > 1.
x
−2π − 32 π −π − 12 π O 1
−1
MATLAB supports creating the symbolic function with the help of the command syms.
There are two ways to creat a symbolic function in MATLAB. The first way creates the
symbolic function by first creating the symbolic variable. The following example shows how
to create the function y = f (x) = x2 through creating the symbolic variable x.
>> syms x ;
>> y = x ^2;
>> syms f ( x ) ;
>> f ( x ) = x ^2;
where syms f(x) creates the symbolic function f(x) as well as the symbolic variable x.
Moreover, we can plot the figure of y = f (x) = x2 using the plot command in MATLAB.
The MATLAB code below shows how to plot the function y = f (x) = x2 in the domain
D = [−1, 1].
1.2 Limit 9
>> x = -1:0.01:1;
>> figure
>> plot (x , x .^2)
>> xlabel ( 'x ')
>> ylabel ( 'y = x ^2 ')
With the above MATLAB code, we can generate the figure of y = f (x) = x2 in the domain
D = [−1, 1], shown in the following:
0.9
0.8
0.7
0.6
y = x2
0.5
0.4
0.3
0.2
0.1
0
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
x
The signal is a basic concept in signal processing, communication systems and electrical
engineering. Signals in nature are mathematical functions. For example, the independent
variable can be the time; while the dependent variable can be electric current, flow rate,
sound, motion of an object, and energy, etc.
1.2 Limit
1.15 Example: behaviors near a point
x
−1 O 1
1 1
2. Consider g(x) = and h(x) = sin . When x approaches 0, both g(x) and h(x) do
x x
not approach any finite number.
10 Limit and Continuity
y y
1
y=
x 1
1
1 y = sin
x
−1
x x
O 1 −1 O 1
−1
−1
We say a function f with domain D has a finite limit L at a if f (x) approaches L when
x ∈ D approaches a. In this case, we write lim f (x) = L.
x→a
near x = 1. 1
2
(1 + h)2
P
tangent line
The secant line passes through two points
P0 = (1, 12 ) and P = (1 + h, 12 (1 + h)2 ). The
slope of the secant line is 1
2
P0
2 (1+ h)2 − 12 h + 12 h2
1
x
S(h) = = = 1 + 12 h. O 1 1+h
(1 + h) − 1 h
As the point P approaches P0 , i.e., as h approaches 0, the secant line approaches the
tangent line. In the language of limits, the tangent line is the limit of the secant line. Hence
the limit of the slope of the secant line is the slope S of the tangent line, i.e.,
x−1 y
Consider the function f (x) = . The
x2 − 1
function is not defined at 1. In fact, if we sub- y=
x−1
x−1 0 x2 − 1
stitute x by 1 in 2 , we will get , which 1
x −1 0
is meaningless. x
−1 O 1
However, the limit of the function, −1
x−1
lim 2 , only involves values of the func-
x→1 x − 1
tion near x = 1, but not the value at x = 1.
1.2 Limit 11
Indeed, the value of the limit is 12 , that can be obtained by eliminating the same “zero”
factor x − 1 in the numerator and the denominator:
x−1 x−1
lim = lim factoring
x→1 x2 − 1 x→1 (x + 1)(x − 1)
1
= lim cancelling 0-factor
x→1 x + 1
= 12 ,
This example shows that the limit of of a function at x = 1 is irrelevant to the actual value
of the function at x = 1.
Remark:
Note that in the definition of limit, we do not require a in the domain D. In
particular, the actual value of f (a) even when a ∈ D plays no role in the definition of
limit as shown in the current example.
>> syms x ;
>> limit ( x ^2 ,x ,2)
ans =
>> syms x ;
>> f = ( x - 1) /( x ^2 - 1) ;
>> limit (f ,x ,1)
ans =
1/2
MATLAB returns 1
2 as the result of the limit.
12 Limit and Continuity
2 , if − ≤ t ≤ ;
( 1
p (t) = 1
0, otherwise.
2
Note that the Dirac delta function equals to 0 everywhere except for 0, and the “area”
under the function equals 1. The Dirac delta function δ(t) is depicted as shown.
In engineering fields, especially signal processing, the Dirac delta function is also known
as the unit-impulse signal. The output of a system with the unit-impulse signal input is
called the unit-impulse response. The unit-impulse response can completely describe a linear
time-invariant (LTI) system, such as communication channels.
Limit Rules
1.2 Limit 13
Suppose lim f (x) and lim g(x) exist. Then the following rules hold.
x→a x→a
1. Sum Rule:
lim [f (x) + g(x)] = lim f (x) + lim g(x).
x→a x→a x→a
2. Difference Rule:
lim [f (x) − g(x)] = lim f (x) − lim g(x).
x→a x→a x→a
3. Product Rule:
lim [f (x) g(x)] = lim f (x) · lim g(x).
x→a x→a x→a
In particular, lim [cf (x)] = c lim f (x), where c is any constant.
x→a x→a
Using the product rule of limits, we get lim x2 = ( lim x)2 = a2 . By induction, it is easy
x→a x→a
to have lim xn = an for any positive integer n.
x→a
Then using the sum rule of limits, we get
x
−1 O 1
x2 − 1 1
lim = lim 2 = 12 .
x→1 x4 − 1 x→1 x + 1
Suppose
1
Calculate lim x sin .
x→0 x
We cannot use the product rule since y
1
lim sin does not exist. However, we can 1 y=x
x→0 x
apply the Squeeze Theorem. In fact, since
1
1
y = x sin
0 ≤ x sin ≤ |x|, we have
x
x x
−1 O 1
1
−|x| ≤ x sin ≤ |x|. y = −x
x
1
Because lim |x| = lim (−|x|) = 0, by the Squeeze Theorem, we get lim x sin = 0.
x→0 x→0 x→0 x
1 1
Calculate lim (x − 1)2 + sin .
x→1 x2 − 1 x−1
1 1
Since the values of can be made arbitrarily large when x approaches 1 and sin
x2 −1 x−1
1.2 Limit 15
1 1
is bounded by 1, + sin does not have limit (or approaches ∞) and is not
x2 − 1 x−1
bounded either. Thus we can apply neither the product rule nor the Squeeze Theorem.
However, we can do the following changes before we take the limit:
1 1
(x − 1) 2
+ sin
x2 − 1 x−1
1 1
= (x − 1)2 · + (x − 1)2 sin expanding
(x − 1)(x + 1) x−1
x−1 1
= + (x − 1)2 sin . cancelling 0-factor
x+1 x−1
For the first term above, we have
x−1
lim = 0. applying the quotient rule
x→1 x+1
For the second term, since
1
−(x − 1)2 ≤ (x − 1)2 sin ≤ (x − 1)2
x−1
and both (x − 1)2 and −(x − 1)2 approaches zero as x → 1, we apply the Squeeze Theorem
and get
1
lim (x − 1)2 sin = 0.
x→1 x−1
Thus, y
1 1
lim (x − 1)2 + sin
x→1 x2 − 1 x−1
x−1 1 1
= lim + lim (x − 1)2 sin x
x→1 x + 1 x→1 x−1 O 1
= 0 + 0 = 0.
One-Sided Limits
and say the left-hand limit of f (x) as x approaches a [or the limit of f (x) as x ap-
proaches a from the left] is equal to L, if f (x) is arbitrarily close to L for all x sufficiently
close to a with x < a.
16 Limit and Continuity
Similarly, we write
lim f (x) = L
x→a+
and say the right-hand limit of f (x) as x approaches a [or the limit of f (x) as x ap-
proaches a from the right] is equal to L, if f (x) is arbitrarily close to L for all x sufficiently
close to a with x > a.
x
O 1
Because lim− f (x) 6= lim+ f (x), we conclude that the limit lim f (x) does not exist.
x→0 x→0 x→0
>> syms x ;
>> limit ( x ^2 ,x ,2 , ' left ')
ans =
>> syms x ;
>> limit ( x ^2 ,x ,2 , ' right ')
ans =
By the Squeeze Theorem, we get lim+ sin x = 0. Because sin x is an odd function, i.e.,
x→0
sin(−x) = − sin x, we further have lim sin x = lim [− sin(−x)] = 0. Thus we get
x→0− −x→0+
lim sin x = 0.
x→0
18 Limit and Continuity
Furthermore, since
x + a
x−a x − a
| sin x − sin a| = 2 sin cos ≤ 2 sin
,
2 2 2
sin θ
1.32 Example: lim =1
θ→0 θ
sin θ
We cannot apply the quotient rule to calculate the limit lim , since the limit of the
θ→0 θ
denominator is zero.
P
Area 4OSP < Area sector OSP
1 tan θ
< Area 4OST , sin θ
or θ
x
O cos θ Q S
1
· sin θ· < π1 1 1
· 1 · tan θ.
2
2 θ· 2π < 2
Limits at Infinities
1 y
For the function y = , we see that when
x
x takes arbitrarily large values, f (x) will ap-
proach 0. The line y = 0 is called the 1
asymptote of the function. This is one of the y=
x
key components in curve sketching. x
O
• If the values of f (x) can be made arbitrarily close to L by taking x sufficiently large
positive values, then we write
lim f (x) = L.
x→+∞
• If the values of f (x) can be made arbitrarily close to L by taking x sufficiently large
negative values, then we write
lim f (x) = L.
x→−∞
• If the values of f (x) can be made arbitrarily close to L by taking |x| sufficiently large
values, then we write
lim f (x) = L.
x→∞
lim f (x) = b
x→+∞
or
lim f (x) = b.
x→−∞
The arithmetic rules and the Squeeze Theorem still hold for limits at infinities.
x2 + 1
For the rational function , we can apply some arithmetic rules of limits to
2x + x + 3
2
20 Limit and Continuity
x2 + 1
lim comparing the leading powers
x→∞ 2x2 + x + 3
1
1+ 2
= lim x dividing each term by x2
x→∞ 1 3
2+ + 2
x x
1
lim 1 + 2
x→∞ x
= = 12 . using the arithmetic rules of limits
1 3
lim 2 + + 2
x→∞ x x
x2 + 1
y=
2x2 + x + 3
y= 1
2
x
O
Rationalizing radicals is a usual approach to deal with limits of this type before applying
arithmetic rules:
√ √
lim x+1− x
x→+∞
√ √ √ √ √ √
x+1− x x+1+ x x+1+ x
= lim √ √ multiplying √ √
x→+∞ x+1+ x x+1+ x
√ 2 √ 2
x + 1 − ( x)
= lim √ √ simplifying
x→+∞ x+1+ x
1
= lim √ √ simplifying
x→+∞ x+1+ x
= 0.
1.2 Limit 21
x
O 1
>> syms x ;
>> f = sqrt ( x +1) - sqrt ( x ) ;
>> limit (f ,x , inf )
ans =
x3 − 2x2 + 1
Let us study the behaviors of the function f (x) = near the infinities.
2x2 + 1
We factor out the highest power in numerator and denominator and have
2 1 2 1
x 3
1 − + 1 − +
x3 − 2x2 + 1 x x3 x x3
= = x · .
2x2 + 1 1 1
x2 2 + 2 2+ 2
x x
By applying the arithmetic rules, we have
2 1
lim 1− + 3 y
x→+∞ x x
= 12 ,
1
lim 2+ 2 x3 − 2x2 + 1
x→+∞ x y=
2x2 + 1
so that
f (x) x
lim = 12 . O
x→+∞ x
Furthermore, we have 1
1 x−
lim f (x) − 12 x
2
y=
x→+∞
x − 2x2 + 1 1
3
= lim − x
x→+∞ 2x2 + 1 2
4x2 + x − 2
= lim − = −1.
x→+∞ 4x2 + 2
We see that as x → +∞, the difference between f (x) and 12 x − 1 approaches zero. This
means that, near the positive infinity, the function y = f (x) behaves like the function y =
2 x − 1. Similarly, the function also behaves like the function y = 2 x − 1 near the negative
1 1
Remark:
An alternating approach of finding a slant asymptote for a rational function is to
use polynomial long division. For the above example, the long division gives
so that
x3 − 2x2 + 1 −x + 4
= 21 x − 1 + 2 ,
2x + 1
2 4x + 2
The quotient 21 x − 1 gives the slant asymptote of the function f .
1.2 Limit 23
In electronic engineering and control system, the time-domain behaviour of a system can be
characterized by the step response, which is the output of a system in the time domain when
the input is a unit-step function. The unit-step input means the input changes from 0 to 1
in a very short time. In other words, there is a sudden input. Note that a sudden input may
cause a fast and possibly large system performance deviation from its long-term steady state,
which may have severe effects on a certain system component or even the overall system.
Moreover, if a sudden input occurs, it may take time for the system output to settle down to
some vicinity of its final state before the system can act properly. Hence, it is important to
understand how the system responds to a sudden input, i.e., understand the step response.
The initial slope of the step response is one of the important quantities to describe the
step response. One way to calculate the initial slope of the step response is to use the Initial
Value Theorem. Let the initial slope of the step response of a system be denoted by
lim f (t), the Initial Value Theorem says that
t→0
where F (s) is the (one-sided) Laplace transform of the step response f (t) and s is a complex
number frequency parameter. Note that the Laplace transform provides an alternative way
of analyzing the system in the frequency domain.
According to the property of Laplace transform, the Laplace transform of the slope of the
step response can be calculated as
1
F (s) = sVC (s) = .
RC · s + 1
Then, we use the Initial Value Theorem to calculate the initial slope of the step response and
have
s 1
lim f (t) = lim sF (s) = lim = .
t→0 s→+∞ s→+∞ RC · s + 1 RC
1
This shows that the initial slope of the step response is .
RC
24 Limit and Continuity
A system or process is in a steady state when the behaviour of this system or process
is unchanging in time. The steady state is an important concept in many fields, e.g., eco-
nomics, electronics, chemical engineering, etc. For example, many design specifications of
the electronic systems are given in terms of the steady-state characteristics. Given that the
step response of a system is f (t), then the steady state of a system is defined as lim f (t).
t→+∞
According to the definition, the steady state can be obtained by calculating the limit of the
step response when time t approaches infinity. Alternatively, we can use the Final Value
Theorem to calculate the steady state. The Final Value Theorem is provided in the follow-
ing.
where F (s) is the (one-sided) Laplace transform of f (t) and s is a complex number frequency
parameter. Note that the Laplace transform provides an alternative way of analyzing the
system in the frequency domain.
Infinite Limits
1 1
We know both functions f (x) = sin and g(x) = do not have limit at x = 0. However,
x x
we do know the behavior of g(x) near 0. In fact, when x approaches 0 from the right (x > 0),
the values of g(x) can be made arbitrarily large positive, and when x approaches 0 from the
left (x < 0), the values of g(x) can be made arbitrarily large negative. The infinite limits are
related to vertical asymptotes of the graph of a function.
1.2 Limit 25
y y
1
y=
1 x
1
y = sin 1
x
−1
x x
−1 O 1 O 1
−1
−1
• If the values of f (x) can be made arbitrarily large by taking x sufficiently close to a (but
not equal to a), then we write
lim f (x) = ∞.
x→a
• If the values of f (x) can be made arbitrarily large positive by taking x sufficiently close
to a (but not equal to a), then we write
• If the values of f (x) can be made arbitrarily large negative by taking x sufficiently close
to a (but not equal to a), then we write
Similarly, if we take x sufficiently close to from the left-hand side or the right-hand side of
a, then we can define
and
lim f (x) = ∞, lim f (x) = +∞, lim f (x) = −∞.
x→a+ x→a+ x→a+
The line x = a is called a vertical asymptote of the curve y = f (x) if at least one of the
following is true:
x2 − 1
Consider the function f (x) = .
(x + 2)(x − 1)
The denominator equals (x + 2)(x − 1) which have two roots x = −2 and x = 1. It seems
f (x) should have vertical asymptotes x = −2 and x = 1. However,
x2 − 1
lim
x→1 (x + 2)(x − 1)
(x − 1)(x + 1)
= lim factoring the numerator
x→1 (x + 2)(x − 1)
x+1
= lim cancelling 0-factor
x→1 x + 2
= 23 .
x
−2 O 1
1.3 Continuous Functions 27
|x| x
Consider the following functions: f (x) = , g(x) = , and h(x) = x. The graphs are
x x
given below.
y
y y
y = g(x)
y = f (x) 1 y = h(x)
1
x x x
O 1 O 1 O
−1
We can see that the graph of h(x) moves continuously as x moves along the x-axis while
the graphs of both f (x) and g(x) have a break at x = 0. In order to distinguish these two
different behaviors of functions, we introduce the concept of continuous function. Let us
check the difference between these three functions in order to get a correct definition. For
the function f (x), the limit lim f (x) does not exist. For the function g(x), the limit lim g(x)
x→0 x→0
exists but g(x) is not defined at x = 0. For the function h(x), the limit lim h(x) exists and
x→0
equals the function value at x = 0, i.e., lim h(x) = h(0).
x→0
2. f (x) is defined at x = a;
3. lim f (x) = f (a).
x→a
If f and g are continuous at a and c is a constant, then the following functions are also
continuous at a:
1. f + g; 4. f · g;
2. f − g;
f
3. cf ; 5. , provided that g(a) 6= 0.
g
|x| ,
if x 6= 0; y = f (x) 1
f (x) = x
0, if x = 0. x
O 1
−1
It is easy to calculate the one-sided limits:
|x| −x
lim f (x) = lim− = lim− = −1,
x→0− x→0 x x→0 x
|x| x
lim f (x) = lim+ = lim+ = 1.
x→0+ x→0 x x→0 x
Since the left and right-hand limits are not equal, the limit lim f (x) does not exists.
x→0
Hence, the function f is not continuous at x = 0.
Since the left and right-hand limits are both equal to 1, the limit lim g(x) exists and
x→0
equals to 1. However, since lim g(x) = 1 6= g(0) = 0, the function is not continuous at
x→0
x = 0.
Besides the facts on continuity under arithmetic operations, we can prove the following
elementary functions are continuous in their domains.
1.3 Continuous Functions 29
An engineering system usually can be described by its response to a certain input function.
The sinusoidal function is one of such input functions. The sinusoidal function, denoted as
sin x, is one of the trigonometric functions, which is thus a periodical function. The sinusoidal
function sin x (i.e., with period 2π) is plotted in the following.
y = sin x 1
x
−8 −2π − 32 π −π − 12 π O 1 π 3 2π 8
2π 2π
−1
Many systems, e.g., audio system, can be described by their responses to the sinusoidal
function. For linear time-invariant (LTI) systems, the sinusoidal input is especially important,
because the output is also a sinusoidal function with the same frequency as the input, but
possibly different amplitudes and phase angels. Then, the frequency response, which is an
important way of charactering a system, will be utilized to measure the amplitude and the
phase angel of the sinusoidal output.
As one of the four “earth-like” terrestrial planets in the solar system, Mars has been
explored by multiple organizations and space agencies. For example, the National Aeronautics
and Space Administration (NASA) has been exploring Mars for more than 40 years. In
January 2004, NASA landed on the surface of Mars with the Mars exploration rovers, spirit
30 Limit and Continuity
and Opportunity. However, humans have not landed on Mars yet. To successfully complete
the “human landing on Mars” mission, the communication between Mars and Earth is vital.
But, there is normally a significant communication delay due to the long distance between
these two planets (on average, over 100 million kilometers). Since Mars and Earth orbit Sun
at different rates, the distance between them is constantly varying. A natural question thus
arises as to when is Mars closest to Earth (so that the communication delay is the smallest)?
According to some data collected by NASA scientists and equipments, it turns out that the
distance between Mars and Earth can be modelled as a sinusoidal function (with shift),
which is plotted in the following.
y (×108 km)
y = 1.72 sin π
386
t × 108 + 2.27 × 108
4
2.27
0.557
t (×102 days)
O 2 4 6 7.72 10
We can see from the above figure that the distance between Mars and Earth is in a 772-day
(i.e., around 26 months) cycle and the closest distance between these two planets is around
5.57 × 107 kilometers. Given that the radio waves which can carry information travel in space
at the speed of light, the one-way communication time is around 3.1 minutes when Mars is
closest to Earth.
uous at x = 0.
The unit-step function is a fundamental function in engineering and can be widely applied
to many fields, e.g., circuit analysis and communication systems. In particular, for circuit
analysis, the unit-step function can model the behaviour of a switch (on/off). Moreover, it
can also describe sudden changes of the voltage or the current in a circuit. In communication
systems, the sum of unit-step functions can be used to represent waveforms.
1.3 Continuous Functions 31
Composite Functions
1.57 Definition: composite function
Let f and g be two functions such that the range of g is contained in the domain of f , we
can get a new function, called the composite function h, defined by h(x) = f (g(x)).
MATLAB can show the composite function with command compose. The following exam-
1
ple shows the composite function h(x) = f (g(x)), where f (x) = and g(x) = 1 + x2 .
x
>> syms x ;
>> f = 1/ x ;
>> g = 1+ x ^2;
>> h = compose (f , g )
h =
1/( x ^2 + 1)
Given two continuous functions f and g such that the composition f (g(x)) exists. Then
the composite function f (g(x)) is continuous.
Let f (x) = sin x and g(x) = x2 + 1. Then the composite functions f (g(x)) = sin(x2 + 1)
and g(f (x)) = (sin x)2 + 1 are continuous.
32 Limit and Continuity
Let f be a continuous function over a closed interval [a, b]. For any number ξ between f (a)
and f (b), there exists at least one c in the interval [a, b] such that f (c) = ξ.
y y
f (b) f (b)
ξ
ξ
f (a) f (a)
x x
O a c b O a c1 c2 c3 b
The Intermediate Value Theorem can be used to show that f (x) = x3 + ax2 + bx + c, which
is continuous everywhere, always has a real root for any numbers a, b and c.
In fact, since lim f (x) = +∞, there exists b > 0 such that f (b) > 0. Similarly since
x→+∞
lim f (x) = −∞, there exists a < 0 such that f (a) < 0. Because 0 is an intermediate value
x→−∞
of f (a) and f (b), from the Intermediate Value Theorem, on the closed interval [a, b], there
exists c in [a, b] such that f (c) = 0.
Exponential Functions
1. The exponential function f (x) = ax has domain R and range (0, +∞).
2. The exponential function f (x) = ax is a continuous function.
( 12 )x 10x 2x
( 14 )x 1.5x
0.8x
1.2x
1x
x
O 1
In MATLAB, the exponential functions can be simply written in the following form.
>> syms x ;
>> f = 3^ x
f =
3^ x
ans =
2.7183
ans =
7.3891
Carbon-14 is a radioactive substance with half-life 5730 years. Half-life means that 1-pound
of Carbon-14 will be half-pound after 5730 years.
Suppose the initial amount of Carbon-14 is A0 and f (t) represents the amount after t
years. Then
f (0) = A0 ,
f (5730) = A0 /2,
f (2 × 5730) = A0 /22 .
function.
36 Limit and Continuity
A bank has a savings account with the annual interest rate r. Let P be the initial deposit.
If the bank provides interest m times per year, then after t years, the amount A is given by
r mt
A=P 1+ .
m
If the interest is calculated continuously, i.e. let m go to infinity, the amount A is given by
r mt
A= lim P 1 +
m→+∞ m
rt
r mr
= P lim 1+
m→+∞ m
rt
r mr
=P lim 1+
m→+∞ m
x rt
1
= P lim 1+ = P ert .
x→+∞ x
avoid). O 1 2 3 4 5 6 7
t (year)
Inverse Function
We say f (x) is one-to-one if it never takes on the same value twice, i.e., if x1 6= x2 , then
f (x1 ) 6= f (x2 ), or equivalently, if f (x1 ) = f (x2 ), then x1 = x2 .
x
−1 O
x
−1 O 1
f −1 (y) = x ⇐⇒ f (x) = y
domain of f −1 = range of f ,
range of f −1 = domain of f .
38 Limit and Continuity
The function f and its inverse function f −1 satisfy the following cancellation
equations:
f −1 (f (x)) = x for every x in D;
f f −1 (x) = x for every x in R.
1. Write y = f (x).
2. Solve this equation for x in terms of y (if possible).
3. To express f −1 as a function of x, interchange x and y. The resulting equation is
y = f −1 (x).
√
One can see the graph of the inverse function f −1 (x) = 3 x is the mirror image of that
of the function f (x) = x3 with respect to the diagonal line y = x as the mirror.
x
=
y = x2
y
One again sees the √ graph of the inverse
function p−1 (x) = − x is the mirror im- √ x
O y=− x
age of that of the function h(x) = x2 with
respect to the diagonal line y = x as the
mirror.
x
=
y
(b, a) is on the graph of f −1 . Hence, the graph y = f (x)
of f −1 is the reflection of the graph of f about
the line y = x. x
O
y = f −1 (x)
>> syms x ;
>> f = x ^3 + 1;
>> finverse ( f )
ans =
( x - 1) ^(1/3)
√ The following figure plots both the function f (x) = x3 +1 and its inverse function f −1 (x) =
3
x − 1.
>> x = -3:0.02:3;
40 Limit and Continuity
>> y = x .^3 + 1;
>> y_i = nthroot ( x - 1 ,3) ;
>> figure
>> plot (x ,y , 'r ')
>> hold on
>> plot (x , y_i , 'b ')
>> axis ([ -3 3 -3 3]) % Change the axis limits so that both ...
the x - axis and the y - axis range from -3 to 3
>> xlabel ( 'x ')
>> ylabel ( 'y ')
>> grid
>> legend ({ '$ f ( x ) = x ^3 + 1$ ' , '$ f ^{ -1}( x ) = ...
\ sqrt [3]{ x -1}$ '} , ' Interpreter ' , ' latex ')
0
y
-1
-2
-3
-3 -2 -1 0 1 2 3
x
Logarithmic Functions
Since the exponential function ax is one-to-one, it has an inverse. The inverse function of
f (x) = ax is called logarithmic function with base a, denoted by loga x. We use ln x for
loge x.
1. The logarithmic function f (x) = loga x has domain (0, +∞) and range R.
2. The logarithmic function f (x) = loga x is a continuous function.
3. The graph of the logarithmic function f (x) = loga x depends on the value of a.
4. If a > 1, then lim loga x = +∞ and lim+ loga x = −∞; if 0 < a < 1, then
x→+∞ x→0
lim loga x = −∞ and lim+ loga x = +∞.
x→+∞ x→0
log1.5 x
log2 x
ln x
log4 x
log10 x
x
O 1
log1/4 x
log1/2 x
log0.8 x
Let us look at some examples using the fact that exponential functions and logarithmic
functions are inverse to each other.
1. To solve the equation ln(x − 1) = 0, we take exponential on both sides of the equation
simultaneously to have eln(x−1) = e0 . Using the identity eln a = a, we get x − 1 = 1, so
that x = 2.
2. To solve the equation 2x−1 = 5, we take logarithm on both sides of the equation
simultaneously to have log2 2x−1 = log2 5. Using the identity loga aα = α, we get
x − 1 = log2 5, so that
MATLAB provides commands for logarithmic functions with different bases, e.g., log2
for base 2, log for base e, and log10 for base 10. The following examples show functions
42 Limit and Continuity
f (x) = log2 (x), g(x) = ln(x) and h(x) = log10 (x) in MATLAB.
>> syms x ;
>> f = log2 ( x )
f =
>> g = log ( x )
g =
log ( x )
>> h = log10 ( x )
h =
The decibel (dB) is used to measure the ratio of two quantities with the same unit. For
example, in terms of decibel, the ratio of two quantities A and B, which have the same unit,
is defined as
A
10 log10 (dB).
B
The decibel has been widely used in a variety of science and engineering fields, such as
electronics and control theory. For example, in electronics, the gains of amplifiers, the signal-
to-noise ratio (SNR), and the attenuations of signals are often represented in decibel.
Note that the decibel can be used to express the ratio of A with respect to any absolute
value B or a fixed reference value B. In the latter case, a suffix which indicates the reference
value is usually appended to the decibel symbol. For example, if the reference value B is 1
volt, then the suffix is “V”, e.g., 10 dBV; if the reference value B is 1 milliwatt, then the
suffix is “m”, e.g., 10 dBm.
The use of the decibel has several advantages. First, since the decibel is on a logarithmic
scale, it means that a very big ratio can be represented in a convenient way. For example, if
A is a trillion times of B, then in terms of decibel, we have
A
10 log10 = 10 log10 1012 = 120 (dB),
B
Second, due to the logarithmic scale property, the decibel can be used for simplifying the
calculations of multiplied effects of a system. For example, a multi-component system has
three components with gains g1,dB (dB), g2,dB (dB) and g3,dB (dB), respectively. Then the
overall gain go,dB (dB) of the system can be calculated as
where go , g1 , g2 and g3 are the overall gain, the gain of the 1st component, the gain of the 2nd
component and the gain of the 3rd component in the linear scale, respectively. The above
additive operation is more convenient than the multiplication of multiple gains.
The capacitor is an electronic component which can store electrical energy. If a resistor
is connected in series with the capacitor to form a resistor-capacitor (RC) circuit, then the
capacitor will charge up gradually through the resistor until the voltage across this capacitor
reaches the value of the supply voltage.
Vs C vC (t)
capacitor, Vs represents the supply voltage, +
+
and vC (t) represents the voltage across the
capacitor.
Assume that Vs = 10 V, R = 4.7 × 104 Ω, C = 10−3 F, and the initial voltage (i.e.,
the voltage at t = 0) across the capacitor is 0, it can be shown that the voltage across the
capacitor is given by
t
vC (t) = Vs (1 − e− RC ) (t ≥ 0).
We can find the time taken for the capacitor to achieve vC (t) = 9.8 V.
In fact, to achieve vC (t) = 9.8 V, we need to solve the following equation:
t
Vs (1 − e− RC ) = 9.8.
After some algebraic manipulations, we find that the time taken can be represented in terms
of a logarithmic function, and it is shown as follows:
Note that the maximum voltage the capacitor can achieve is the supply voltage Vs . The
result above thus shows that it takes 183.86 seconds which is around 3 minutes for the
capacitor to virtually fully charged (i.e., achieve 98% of its maximum value).
Moreover, in RC circuit, the term τ = RC is defined as the time constant. In this example,
τ = RC = 47 (s). We notice that 183.86
47 ≈ 4, which means the time taken for the capacitor to
achieve 98% of its maximum voltage is 4 times of the time constant. The time period taken
for the capacitor to reach this 4τ point (i.e., achieve 98% of the maximum voltage) is known
as the transient period.
sin −1
x = y (|x| ≤ 1) − π2 −1 O 1 π
x
2
⇐⇒ sin y = x, − π2 ≤y≤ π
2.
−1
− π2
−1
1.4 Some Transcendental Functions 45
tan−1 x
tan−1 x = y (x ∈ R) x
− π2 O π
2
⇐⇒ tan y = x, − π2 <y< π
2. − π2
cot x
and range (0, π). That is, π
2
cot−1 x
cot−1
x = y (x ∈ R) π
x
O π
−1 O 1 π
x
csc−1 x = y (|x| ≥ 1) −1
2
− π2
⇐⇒ csc y = x, y ∈ [− π2 , 0) ∪ (0, π2 ].
sec−1 x = y (|x| ≥ 1) −1 O 1 π π
x
2
⇐⇒ sec y = x, y ∈ [0, 2)
π
∪ ( π2 , π]. −1
46 Limit and Continuity
√
Solution Let θ = sin−1 2
2
. Then, by the definition of sin−1 , θ is an angle in [− π2 , π2 ]
√
and sin θ = 2 .
So θ = π4 .
2
√
2. Calculate cos−1 − 22 .
√
Solution Let θ = cos−1 − 22 . Then, by the definition of cos−1 , θ is an angle in [0, π]
√
and cos θ = − 2 .
2
So θ = 4 .
3π
In MATLAB, there are several commands for calculating the trigonometric and inverse
trigonometric functions, which are provided in the following table.
Command Function
sin Sine function
cos Cosine function
tan Tangent function
cot Cotangent function
sec Secant function
csc Cosecant function
asin Inverse sine function
acos Inverse cosine function
atan Inverse tangent function
acot
Inverse cotangent function
asec Inverse secant function
acscInverse cosecant function
The following examples show the calculations of sin π2 and tan−1 (1), respectively, in
MATLAB.
ans =
1.4 Some Transcendental Functions 47
ans =
0.7854
Besides calculating the values of the trigonometric and inverse trigonometric functions,
graphs of the trigonometric and inverse trigonometric functions can also be easily plotted by
MATLAB. The following code shows the plot of cos−1 (x) within the interval [−1, 1]:
>> x = -1:0.01:1;
>> y = acos ( x ) ;
>> figure
>> plot (x ,y , 'r ')
>> xlabel ( 'x ')
>> ylabel ( 'y = cos ^{ -1}( x ) ')
>> grid
3.5
2.5
y = cos -1 (x)
1.5
0.5
0
-1 -0.5 0 0.5 1
x
The following types of basic elementary functions are continuous at every point in their
domains:
It is said that the National Aeronautics and Space Administration (NASA) astronauts will
explore the surface of Moon again by 2020. This time, the astronauts are going to stay, build
outposts, and pave a way for the journeys to Mars and beyond. It is thus critical to have a
reliable and robust surface-to-surface communication between astronauts on Moon, and also
keep constant communications with Earth. This will likely be accomplished by a combined
use of communication satellites in orbit around Moon and communication equipments on
the lunar surface. In the case of no satellite coverage over an outpost, the astronauts there
will purely rely on the communication equipments on the lunar surface, e.g., communication
towers. Since Moon is a sphere, the surface-to-surface communication is limited by the height
of the communication tower. In particular, the communication signals cannot be received
beyond the point of tangency P in the following figure.
Parameter Description
r radius of Moon (1738.14 km)
h tower height
d line of sight distance
P point of tangency
a arc length
θ central angle measure
In the case of no satellite coverage over a certain area on the lunar surface, if there is a
communication tower with height 60 meters, then calculate the maximum distance that the
astronaut can explore in this area.
First, we note that the area which the astronaut can explore should be within the com-
munication range of the communication tower, i.e., not beyond the point of tangency P.
Moreover, the distance that the astronaut can explore refers to the one on the lunar surface.
Hence, the maximum distance is the arc length a in the above figure.
In order to calculate the arc length a, we first need to calculate the central angel measure
θ which can be obtained by using the inverse tangent function. Specifically, we have
d
θ = tan −1
.
r
We have known the Moon radius r = 1738.14 km. Now, we need to calculate the line of
2
sight distance d. We note that r2 + d2 = (r + h) , so we have
q
2
d = (r + h) − r2
q
2
= (1738.14 + 0.06) − 1738.142 ≈ 14.44 (km).
1.4 Some Transcendental Functions 49
14.44
θ = tan −1
≈ 0.0083.
1738.14
Finally, we can calculate the arc length a, i.e., the maximum distance that the astronaut
can explore, as follows:
θ
a= × 2πr = 0.0083 × 1738.14 ≈ 14.43 (km).
2π
50 Summary
Summary
Definition: basic concepts
• function : f: D ⊂R→R
(D = domain, R = range)
Definition: limit
Definition: asymptotes
Suppose lim f (x) and lim g(x) exist. Then the following rules hold.
x→a x→a
1. Sum Rule:
lim [f (x) + g(x)] = lim f (x) + lim g(x).
x→a x→a x→a
2. Difference Rule:
3. Product Rule:
lim [f (x) g(x)] = lim f (x) · lim g(x).
x→a x→a x→a
5. Squeeze Theorem: If f (x) ≤ g(x) ≤ h(x) and lim f (x) = lim h(x) = L, then
x→a x→a
lim g(x) = L.
x→a
6. Limit and One-Sided Limit: lim f (x) = L if and only if lim− f (x) = lim+ f (x) =
x→a x→a x→a
L.
The following types of basic elementary functions are continuous at every point in their
domains:
If f and g are continuous at a and c is a constant, then the following functions are also
continuous at a:
1. f + g; 4. f · g;
2. f − g;
f
3. cf ; 5. , provided that g(a) 6= 0.
g
52 Summary
sin x
x
1
1. lim = 1. 2. lim 1+ = e.
x→0 x x→+∞ x
x
=
y
(b, a) is on the graph of f −1 . Hence, the graph y = f (x)
of f −1 is the reflection of the graph of f about
the line y = x. x
O
y = f −1 (x)
4. If a > 1, then lim ax = +∞ and lim ax = 0; if 0 < a < 1, then lim ax = 0 and
x→+∞ x→−∞ x→+∞
lim ax = +∞.
x→−∞
( 12 )x 10x 2x
( 14 )x 1.5x
0.8x
1.2x
1x
x
O 1
1. The logarithmic function f (x) = loga x has domain (0, +∞) and range R.
log1.5 x
log2 x
ln x
log4 x
log10 x
x
O 1
log1/4 x
log1/2 x
log0.8 x
54 Summary
Let f be a continuous function over a closed interval [a, b], for any number ξ between f (a)
and f (b), there exists at least one c in the interval [a, b] such that f (c) = ξ.
y y
f (b) f (b)
ξ
ξ
f (a) f (a)
x x
O a c b O a c1 c2 c3 b
CHAPTER
2
Differentiation
2.1 Derivatives
Let y = f (t) = t2 be the distant function describing a movement of a particle on the x-axis
and t is the time variable. The velocity of the particle is not a constant and depends uopn the
time t. So we call the velocity at time t the instantaneous velocity v(t). How to calculate
the instantaneous velocity? We know how to find the average velocity. So let’s calculate the
average velocity from time t = 1 to time t. The distance traveled by the particle within the
time is f (t) − f (1) = t2 − 12 . The time spent is t − 1. Thus the average velocity is
f (t) − f (1) t2 − 1
= = t + 1.
t−1 t−1
Clearly this average velocity doesn’t equal the instantaneous velocity at t = 1. However, if
we use the average velocity to approximate the instantaneous velocity at t = 1, the approx-
imation is better if t is closer to 1. Using the idea of limits, it is reasonable to say that the
instantaneous velocity v(1) is the limit of the average velocity as t approaches 1, i.e.,
f (t) − f (1)
v(1) = lim = lim (t + 1) = 2.
t→1 t−1 t→1
Consider the function f (x) = 12 x2 and the tangent line of the graph of y = f (x) at x = 1.
We first consider the secant line of the graph at x = 1.
56 Differentiation
secant line
y = 12 x2
1
2
(1 + h)2 tangent line
1
2
x
O 1 1+h
The secant line passes through two points P0 = (1, 12 ) and P = (1 + h, 12 (1 + h)2 ). The
slope of the secant line is
2 (1 + h)2 − 21 h + 21 h2
1
S(h) = = = 1 + 21 h.
(1 + h) − 1 h
As the point P approaches P0 , i.e., as h approaches 0, the secant line approaches the
tangent line. In the language of limits, the tangent line is the limit of the secant line. Hence
the limit of the slope of the secant line is the slope S of the tangent line, i.e.
f (1 + h) − f (1)
S = lim S(h) = lim = lim (1 + 12 h) = 1.
h→0 h→0 h h→0
Given a function y = f (x), take a point a in the domain of the function. The change in
f (x) − f (a)
y from a to x is f (x) − f (a). The average rate of change is . The instantaneous
x−a
rate of change at a is the limit of average rate of change when x approaches a, i.e.,
f (x) − f (a)
lim .
x→a x−a
Since many important concepts such as velocity and slope of the tangent line of a function
can be described in this way, we will call such kind of limit the derivative of the function at
x = a.
f (x) − f (a)
lim ,
x→a x−a
provided the limit exists. In this case, we say f has a derivative at x = a.
For single variable functions, the term “being differentiable” is used as synonymous with
“having a derivative”.
2.1 Derivatives 57
∆y
Hence the change in y is ∆y, the change in x is ∆x, the average rate of change is , and
∆x
the (instantaneous) rate of change of the function at x is the limit of the average rate of
change as ∆x approaches zero.
df (x)
• Leibniz notation: f 0 (x) can also be expressed as . If we write y = f (x), we can
dx
dy
also write for f 0 (x).
dx
df (x)
• We sometimes use f 0 (x)|x=a , or to denote f 0 (a).
dx x=a
f (x + h) − f (x) (x + h)2 − x2
f 0 (x) = lim = lim
h→0 h h→0 h
2hx + h2
= lim = lim (2x + h) = 2x.
h→0 h h→0
58 Differentiation
f (x + h) − f (x)
f 0 (x) = lim
h→0 h
√ √
x+h− x
= lim
h→0 h
√ √ √ √
( x + h − x)( x + h + x)
= lim √ √
h→0 h( x + h + x)
h
= lim √ √
h→0 h( x + h + x)
1 1
= lim √ √ = √ .
h→0 ( x + h + x) 2 x
>> syms x ;
>> f = x ^2;
>> d = diff ( f )
d =
2* x
ans =
6
2.1 Derivatives 59
y − 1 = 2 · (x − 1).
x
O 1
If we toss a ball straightly up into the air with initial velocity 98 m/s, the distance (mea-
sured in meters) of the ball to the ground is given by the function f (t) = −4.9t2 + 98t where
t is the time measured in seconds. Find the velocity of the ball at time t and find the time
and the distance travelled when the ball reaches the highest height.
Solution Since the velocity v(t) is the derivative of the distance function, we obtain
The ball reaches the highest height when the velocity is zero. So let v(t) = 0, we get
−9.8t + 98 = 0 and t = 10. So in ten seconds, the ball reaches the highest height. The
distance travelled during the ten seconds is f (10) = −490 + 980 = 490 meters.
An electric current is the flow of electric charge. Electric currents can cause Joule heating
which creates light in the incandescent light bulbs. Electric currents can also cause magnetic
fields which are used in motor, inductors and generators.
In mathematics, the electric current can be defined as the rate at which the electric charge
flows through a given surface, which is given as follows:
dQ
I= ,
dt
where I represents the electric current, Q represents the electric charge, and t represents the
time.
60 Differentiation
The angular velocity is a basic concept in physics. It is the rate at which a particle rotates
around a center point. In other words, the angular velocity represents how fast an object
goes around something. For example, the angular velocity of Earth represents how fast the
Earth obits the Sun.
dφ
ω= ,
dt
where ω represents the angular velocity, φ represents the angular displacement, and t repre-
sents the time. The angular velocity can be depicted in the figure.
Suppose a person is jogging on a circular track with angular displacement φ(t) = 20 1
t
(radians). Calculate this person’s angular velocity.
According to the definition of angular velocity, we have
dφ(t) d( 1 t)
ω= = 20 = 1
(radians/second).
dt dt 20
Acceleration widely exists in our life. For example, when a car speeds up, the passengers
might experience a force of pushing them back to seats. This feeling occurs because they are
accelerating. In layman’s words, acceleration means any process where the velocity (either
the magnitude or the direction) changes. In particular, the magnitude of the velocity is called
speed. Mathematically, the magnitude of the acceleration is defined as the rate of the speed
change of an object with respect to time, and given as follows:
dv
a= ,
dt
where a represents the acceleration, v represents the speed, and t represents the time.
Suppose a person is running on the track. At the starting stage, the speed of this person
is v(t) = t (meter/second). Calculate the acceleration of this person.
According to the definition of acceleration, we have
dv(t) dt 2
a= = = 1 (meter/second ).
dt dt
2.2 Rules of Differentiation 61
If f is differentiable at a, then f is continuous at a. The converse is false; that is, there are
functions that are continuous but not differentiable.
Pitfall: continuous but not differentiable
Justification:
f (x) − f (a)
If f is differentiable at a, then lim = f 0 (a) exists. Thus,
x→a x−a
f (x) − f (a)
lim [f (x) − f (a)] = lim · (x − a)
x→a x→a x−a
f (x) − f (a)
= lim · lim (x − a) = f 0 (a) · 0 = 0.
x→a x−a x→a
Suppose f 0 (x) and g 0 (x) exist. Then the following rules of differentiation hold.
1. Sum Rule:
0
[f (x) + g(x)] = f 0 (x) + g 0 (x).
2. Difference Rule:
0
[f (x) − g(x)] = f 0 (x) − g 0 (x).
3. Product Rule:
0
[f (x) g(x)] = f (x) g 0 (x) + g(x) f 0 (x).
62 Differentiation
Justification:
By the definition, for the sum and difference rules, we have
0
[f (x) ± g(x)]
[f (x + h) ± g(x + h)] − [f (x) ± g(x)]
= lim
h→0 h
[f (x + h) − f (x)] ± [g(x + h) − g(x)]
= lim
h→0 h
f (x + h) − f (x) g(x + h) − g(x)
= lim ±
h→0 h h
f (x + h) − f (x) g(x + h) − g(x)
= lim ± lim
h→0 h h→0 h
= f 0 (x) ± g 0 (x).
lim f (x + h) = f (x).
h→0
Hence,
0
[f (x)g(x)]
g(x + h) − g(x) f (x + h) − f (x)
= lim f (x + h) · lim + lim · g(x)
h→0 h→0 h h→0 h
= f (x) g 0 (x) + g(x) f 0 (x).
Show that
0
an xn + an−1 xn−1 + · · · + a1 x + a0 = nan xn−1 + · · · + a1 .
(x + h) − x h
f 0 (x) = lim = lim = 1.
h→0 h h→0 h
0
Hence, for any positive integer n, (xn ) = nxn−1 .
4. If f (x) = cg(x), then f 0 (x) = cg 0 (x).
In fact, applying the product rule gives
0
(cg) = c0 · g + c · g 0 = 0 + c · g 0 = cg 0 .
In fact,
0 0 0
f 0 (x) = (an xn ) + · · · + (a1 x) + (a0 ) sum rule
= nan x n−1
+ · · · + a1 + 0 items 1, 3, 4
= nan x n−1
+ · · · + a1 .
64 Differentiation
Suppose f is differentiable. By applying the quotient rule, we get the following reciprocal
rule: 0
1 (1)0 · f (x) − 1 · f 0 (x) f 0 (x)
= = − .
f (x) f (x)2 f (x)2
Find points where the tangent lines of y = f (x) = 2x3 − 3x2 − 12x + 1 are horizontal.
Solution A line is horizontal if and only if the slope of the line is zero. Since the slope of
the tangent line is given by f 0 (x), we just need to find points where f 0 (x) = 0.
Since y
0
2x3 − 3x2 − 12x + 1
= 2 · 3x2 − 3 · 2x − 12 8
x
= 6(x2 − x − 2) −1 O 2
With diff, we can easily calculate the derivatives of f (x) + g(x), f (x) − g(x), f (x) g(x)
f (x) f (x)
and . Following examples show the derivatives of f (x) g(x) and in MATLAB.
g(x) g(x)
>> syms f ( x ) g ( x ) ;
>> diff ( f ( x ) * g ( x ) ,x )
ans =
f ( x ) * diff ( g ( x ) , x ) + g ( x ) * diff ( f ( x ) , x )
>> diff ( f ( x ) / g ( x ) ,x )
ans =
diff ( f ( x ) , x ) / g ( x ) - ( f ( x ) * diff ( g ( x ) , x ) ) / g ( x ) ^2
2.2 Rules of Differentiation 65
Justification:
The derivatives of all six trigonometric functions can be found as follows.
1. By using some trigonometric identities (addition and double angle identities), continuity
sin h
of sin x, and the limit lim = 1, we have
h→0 h
sin(x + h) − sin x
(sin x)0 = lim
h→0 h
sin x cos h + cos x sin h − sin x
= lim
h→0 h
sin x(cos h − 1) + sin h cos x
= lim
h→0 h
−2 sin2 (h/2) sin h
= lim sin x · + cos x ·
h→0 h h
sin(h/2) sin h
= sin x · lim − sin(h/2) · + cos x · lim
h→0 h/2 h→0 h
= 0 + cos x = cos x.
2. By using some trigonometric identities (addition and double angle identities), continuity
sin h
of sin x, and the limit lim = 1, we have
h→0 h
cos(x + h) − cos x
(cos x)0 = lim
h→0 h
cos x cos h − sin x sin h − cos x
= lim
h→0 h
cos x(cos h − 1) − sin h sin x
= lim
h→0 h
−2 sin2 (h/2) sin h
= lim cos x · − sin x ·
h→0 h h
sin(h/2) sin h
= cos x · lim − sin(h/2) · − sin x · lim
h→0 h/2 h→0 h
= 0 − sin x = − sin x.
66 Differentiation
We can calculate the derivatives of trigonometric functions easily using command diff.
Moreover, with the help of the variable precision arithmetic command vpa and the symbolic
substitution command subs, we can calculate the value of the derivative of a trigonometric
function at a certain point. The following example shows the calculations of f 0 (x), where
f (x) = sin(x), and f 0 (1).
>> syms x ;
>> f = sin ( x ) ;
>> d = diff ( f )
d =
cos ( x )
2.2 Rules of Differentiation 67
v1 =
cos (1)
>> vpa ( v1 )
ans =
0.54030230586813971740093660744298
Find the equation of horizontal tangent line(s) of y = f (x) = sin x + cos x in (0, π).
Solution Horizontal tangent lines have zero slope. The slope of the tangent line is given
by the derivative of f . Thus we calculate
−1
Consider a circuit with a capacitor below, where C is the capacitance of the capacitor, i(t)
is the current through the capacitor, and vC (t) is the voltage across the capacitor.
vC (t)
− +
i(t)
C
Given that vC (t) = 4 cos t, where t ≥ 0, calculate the electric current i(t) where i(t) =
C dvdt
C (t)
.
First, we calculate dvdt
C (t)
, and we have
dvC (t)
= −4 sin t.
dt
68 Differentiation
Chain Rule
2.23 Theorem: chain rule
Justification:
Thus,
Hence,
∆y = [f 0 (b) + ε2 ]∆u = [f 0 (b) + ε2 ][g 0 (a) + ε1 ]∆x,
so that
∆y
= [f 0 (b) + ε2 ][g 0 (a) + ε1 ].
∆x
Since g is differentiable at a, it must be continuous at a and thus lim g(a + ∆x) = g(a) so
∆x→0
that ∆u goes to zero as ∆x goes to zero. This gives that both ε1 → 0 and ε2 → 0 as ∆x → 0.
Therefore,
∆y
F 0 (a) = lim = lim [f 0 (b) + ε2 ][g 0 (a) + ε1 ]
∆x→0 ∆x ∆x→0
= f 0 (b)g 0 (a) = f 0 (g(a))g 0 (a).
dy
h (x) =
0
· g 0 (x) = 2u|u=g(x) · cos x = 2 sin x cos x.
du u=g(x)
dy
h0 (x) = · g 0 (x) = cos u|u=g(x) · 2x = 2x cos(x2 ).
du u=g(x)
The following example shows the calculation of F 0 (x), where F (x) = f (g(x)), in MATLAB.
It verifies that the Chain Rule holds in general.
>> syms f ( x ) g ( x ) ;
>> F ( x ) = compose ( f ( x ) ,g ( x ) )
F(x) =
f(g(x))
>> diff ( F ( x ) )
ans =
D ( f ) ( g ( x ) ) * diff ( g ( x ) , x )
Consider the maximum wind speed at the site of the building. Denote the maximum
wind speed as V (the wind direction is ignored for simplicity) and the probability that this
maximum wind speed is no larger than v as FV (v). Empirical data indicate that, in many
locations, FV (v) has the following form:
FV (v) = e−( u )
v −k
Specifically, in Boston, plausible values of u and k are 49.4 miles per hour (mph) and 6.5,
respectively. Hence, in Boston, FV (v) can be written as
where a = 6.5 × 49.46.5 ≈ 6.6395 × 1011 . Note that in probability theory and statistics, FV (v)
is called the cumulative distribution function of V and F0V (v) is called the probability density
function of V , which are both important functions to determine the statistical characteristics
of V .
Consider a resistor-capacitor (RC) circuit below, where R is the resistance of the resistor,
C is the capacitance of the capacitor and vC (t) is the voltage across the capacitor.
R
i(t)
−
−
vI (t) C vC (t)
+
+
t dvC (t)
Given that vC (t) = 1−e− RC (t ≥ 0), calculate the electric current i(t) where i(t) = C .
dt
dvC (t) dvC (t)
First, we calculate . Let y = 1 − eu and u = − RC
t
. Then, can be written as
dt dt
dy
. By the chain rule, we have
dt
dy dy du 1 1 − t
= · = −e −u
= e RC .
dt du dt RC RC
dvC (t)
Substituting the above result into i(t) = C , we can obtain the electric current i(t), as
dt
shown in the following:
1 − t
i(t) = e RC .
R
2.2 Rules of Differentiation 71
d (1 − R(t))
Calculate .
dt
d (1 − R(t))
First, given the expression of R(t), can be written as
dt
√
d (1 − R(t)) d 1 − e− t
=
dt dt
√ d (1 − R(t))
Let f (t) = 1 − et and g(t) = − t. Then, can be rewritten as
dt
d (1 − R(t)) df (g(t))
= .
dt dt
By the chain rule, we have
df (g(t)) 1 1 √
= f 0 (g(t)) g 0 (t) = −eg(t) − √ = √ e− t .
dt 2 t 2 t
d (1 − R(t))
Note that R(t) and are the complementary cumulative distribution function
dt
and the probability density function of the lifetime of the component, respectively. Besides
the engineering field, the reliability function can also be used for the study in other fields,
e.g., the duration of marriage, the death of a patient, etc. In these cases, the reliability
function is commonly known as the survival function.
df −1 (x) 1 1
= 0 −1 = .
dx f (f (x)) df (u)
du u=f −1 (x)
72 Differentiation
Justification:
We can apply the chain rule to prove the formula for differentiation of inverse functions.
If applying the differentiation with respect to x to the identity
f (f −1 (x)) = x,
we obtain
df (f −1 (x)) df (u) df −1 (x)
= 1 =⇒ · =1
dx du u=f −1 (x) dx
df −1 (x) 1
=⇒ = .
dx df (u)
du u=f −1 (x)
√
2.30 Example: derivative of n
x
√
Let f (x) = xn with n a positive integer, then f −1 (x) = n x. We write f (u) = un . Thus
df (u) df (u)
√
= nun−1 . Thus we get = n( n x)n−1 , and
du du u=f −1 (x)
1
0 √ 1 1 1
xn = ( n x)0 = √ = x n −1 .
n( n x)n−1 n
dun √ 0 √ n−1 1 1 −1
0
(xa ) = · m
x = n m
x · xm
du u= m√x
m
n n−1 + 1 −1 n n −1
= x m m = x m = axa−1 .
m m
If a is negative, we can write xa = x−b , where b = −a is a positive rational number. Then
2.2 Rules of Differentiation 73
1
xa = . Applying the quotient rule gives
xb
0
a 0 xb bxb−1
(x ) = − 2 = − = −bx−b−1 = axa−1 .
(xb ) x2b
1 1
1. (sin−1 x)0 = √ ; 4. (csc−1 x)0 = − √ ;
1 − x2 |x| x2 − 1
1 1
2. (cos−1 x)0 = − √ ; 5. (sec−1 x)0 = √ ;
1 − x2 |x| x2 − 1
1 1
3. (tan−1 x)0 = ; 6. (cot−1 x)0 = − .
1 + x2 1 + x2
Justification:
We can use the formula of derivative of inverse functions to calculate the derivatives of the
inverse trigonometric functions. For example,
0 1 1
sin−1 x = 0 = .
(sin u) |u=sin−1 (x) cos(sin−1 x)
The last expression can be simplified as fol-
lows. Let θ = sin−1 x, then sin θ = x. Draw
a right triangle with one angle |θ| whose op-
posite side has length |x| and hypotenuse has 1
|x|
length 1. Then the adjacent
√ √ side has length
1 − x2 . Thus, cos θ = 1 − x2 . |θ|
√
1 − x2
Hence,
0 1 1
sin−1 x = =√ .
cos θ 1 − x2
The other five derivatives can be calculated similarly.
θ
A B
Now, we need to design the rise r. Find the rate at which the angle θ between the rafter AC
and the span AB changes with the rise r, i.e., find dθ
dr .
First, let the length of the span AB be lAB . We note that tan θ = 1 lrAB = 8r . So, we have
2
r
θ = tan−1 .
8
Let u = 8r , f (x) = tan x, then θ = f −1 (u). According to the chain rule, we have
dθ df −1 (u)
=
dr dr
df −1 (u) du
= .
du dr
Moreover, according to the theorem for the differentiation of inverse function, we can calculate
df −1 (u) 1
=
du
df (x)
dx
x=f −1 (u)
1
=
sec2 tan−1 (u)
1
=
1 + tan tan−1 (u)
2
1
= .
1 + u2
Therefore, we can get
dθ 1 du
=
dr 1 + u2 dr
1 1
=
r 2 8
1+
8
8
= 2 .
r + 64
2.3 Differentiation of Exponential and Logarithmic Functions 75
(ex )0 = ex .
In general, for any a > 0,
(ax )0 = ax ln a.
Justification:
x
1
Since e = lim 1+ , by making a change of variable, we get
x→+∞ x
e = lim+ (1 + y)1/y .
y→0
ln(1 + y)
lim = lim+ ln(1 + y)1/y = ln e = 1.
y→0+ y y→0
h ln(1 + y)
lim = lim = 1.
h→0+ eh − 1 y→0+ y
We further get
h −h heh
lim− = lim = lim = 1.
h→0 eh − 1 h→0+ e−h − 1 h→0+ eh − 1
h
So, we know that lim = 1. Hence,
h→0 eh − 1
ex+h − ex eh − 1
(ex )0 = lim = ex · lim = ex .
h→0 h h→0 h
In general,
ax+h − ax ah − 1
(ax )0 = lim = ax · lim
h→0 h h→0 h
e h ln a
−1
= ax ln a · lim = ax ln a.
h→0 h ln a
The atmospheric pressure on earth changes with the altitude of the surface. The weather
conditions, such as the temperature and the humidity, also affect the atmospheric pressure,
so it is necessary to know these to calculate an accurate atmospheric pressure at a certain lo-
76 Differentiation
cation. However, for general conditions, the National Aeronautics and Space Administration
(NASA) has averaged the conditions for all parts of the earth year-round, and it is shown
that the atmospheric pressure decreases as the altitude increases.
Specifically, at low altitudes above sea level (e.g., the first 1000 meters above sea level),
the atmospheric pressure decreases by approximately 11.3 Pa per meter. For higher altitudes
where the standard temperature lapse rate (i.e., the rate at which the temperature changes
with the altitude) is zero, the atmospheric pressure is shown in the following equation:
gM
− RT (h−hb )
P (h) = Pb e b
where
Parameter Explanation
Pb static pressure of layer b (Pa)
2
g gravitational acceleration : 9.80665 m/s
M molar mass of Earth’s air : 0.0289644 (kg/mol)
R universal gas constant : 8.3144598 (J/mol/K)
Tb standard temperature of layer b (K)
hb height at bottom of layer b (m)
with b ∈ [0, 6] (b ∈ Z) in accordance with each of seven successive layers of the atmosphere.
dP (h)
Calculate .
dh
In P (h), we treat h as the independent variable and all the other parameters as constants.
Then, by the chain rule, we have
0
dP (h)
gM
− RT (h−hb ) gM
= Pb e b − (h − hb )
dh RTb
gM − gM (h−hb )
=− Pb e RTb .
RTb
Note that the result above represents the rate at which the atmospheric pressure changes
with the altitude.
For example, in the stratosphere (i.e., b = 1), the standard temperature lapse rate is 0. We
dP (h)
thus can use the above expressions of P (h) and to calculate the atmospheric pressure
dh
and its changing rate, respectively. In particular, when b = 1, we have
Parameter Value
P1 22632.10 (Pa)
T1 216.65 (K)
h1 11000 (m)
2.3 Differentiation of Exponential and Logarithmic Functions 77
dP (h)
Therefore, P (h) and in the stratosphere can be calculated as follows:
dh
9.80665×0.0289644
P (h) = 22632.10e− 8.3144598×216.65 (h−11000)
−4
≈ 2.2 × 104 e−1.6×10 (h−11000)
(Pa),
dP (h) 9.80665 × 0.0289644 9.80665×0.0289644
=− × 22632.10 × e− 8.3144598×216.65 (h−11000)
dh 8.3144598 × 216.65
−4
≈ −3.6e−1.6×10 (h−11000)
(Pa/m).
dP (h)
Note that the sign “−” in means that the atmospheric pressure decreases with the
dh
altitude.
1
(ln x)0 = .
x
In general, for any a > 0, a 6= 1,
1
(loga x)0 = .
x ln a
Justification:
Let f (u) = au and u = loga x. Then the equality aloga x = x can be re-written as au = x.
Applying the chain rule, we get
du
au ln a · = 1.
dx
Hence,
du 1 1
(loga x)0 = = u = .
dx a ln a x ln a
1
Show that (ln |x|)0 = for any x 6= 0.
x
78 Differentiation
1
(ln |x|)0 = (ln x)0 = .
x 1
y = ln |x| y=
If x < 0, then, by the chain rule, 1
x
1 1 x
−1 O 1 2
(ln |x|)0 = [ln(−x)]0 = · (−1) = .
−x x
0 1 ax ln a
[ln(ax + 1)] = · (ax + 1)0 = x .
ax +1 a +1
First introduced by Claude Shannon in 1948, in information theory, the entropy is used
to quantitively measure the information which is produced by a stochastic source of data.
Specifically, when a low-probability event occurs at the source, then the event carries more
information than when a high-probability event occurs. The amount of information conveyed
by each event becomes a random variable whose expected value is the entropy. Hence, the
low-probability event has more entropy. In general, the more uncertain a event is, the more
information the event carries and the more the entropy of this event is. In other words, the
entropy refers to uncertainty or disorder.
For a communication system, if it has two inputs 0 and 1 and they occur with probability
p and 1 − p (0 < p < 1), respectively, then the entropy of the source is defined as
H(p) = −p log2 p − (1 − p) log2 (1 − p).
Calculate dH(p)
dp in this communication system.
By applying the product rule and the chain rule, we have
dH(p) 0 0
= − log2 p − p (log2 p) − (−1) log2 (1 − p) − (1 − p) (log2 (1 − p))
dp
1 −1
= − log2 p − p + log2 (1 − p) − (1 − p)
p ln 2 (1 − p) ln 2
= log2 (1 − p) − log2 p.
Logarithmic Differentiation
2.40 Method: logarithmic differentiation
1. Take natural logarithms of both sides of an equation y = f (x) and use the Laws of
Logarithms to simplify.
2. Differentiate implicitly with respect to x.
The “logarithmic differentiation” method can often be used to calculate the derivatives for
exponential functions in the form [u(x)]v(x) , or products u1 (x)u2 (x) · · · uk (x) with relatively
larger k.
Thus,
f 0 (x) = f (x) · µx−1 = µxµ−1 .
ln f (x) = ln xx = x ln x.
Then we can take derivative of both sides of the last equation and apply the chain rule
to obtain
1 0 1
f (x) = ln x + x · = ln x + 1.
f (x) x
Thus,
f 0 (x) = f (x) · (ln x + 1) = xx (ln x + 1).
√
ex 1 − x2
3. Calculate the derivative of f (x) = .
1 + x + x2
Solution We can calculate this derivative directly using the product rule and the
quotient rule. Since there are many terms, it is quite involved. In the following, we
make use of logarithm for a simpler calculation. In fact, we have
√
ex 1 − x2
ln f (x) = ln
1 + x + x2
= x + 21 ln(1 − x2 ) − ln(1 + x + x2 ).
Taking derivative of both sides of the equation and applying the chain rule, we obtain
1 0 x 1 + 2x
f (x) = 1 − − ,
f (x) 1 − x2 1 + x + x2
so that √
ex 1 − x2 1 + 2x
x
f (x) =
0
1− − .
1 + x + x2 1 − x2 1 + x + x2
2.4 Implicit Differentiation 81
For the function y = f (x) defined by y 2 + x2 = 1, we can take the derivative of y with
respect to x of both sides of the equation. By treating y as a function of x and applying the
chain rule, we get
d x2 + y 2 dy
= 0 =⇒ 2x + 2y · = 0,
dx dx
so that
dy x
=− .
dx y
This function y = f (x) is defined implicitly. We keep in mind that y is a function of x.
dy
We can find the derivative by “implicit differentiation”.
dx
1. Replace y by y(x) in the given equation which defines the function y = y(x) implicitly.
2. Differentiate both sides of the equation with respect to x, by applying the rules of
differentiation.
dy
3. Solve for from the resulting equation.
dx
The equation 2y 4 − x2 − sin y + 1 = 0 (x > 0) gives a curve on the plane. Use implicit
dy
differentiation to find y 0 = and then determine the tangent line of the curve at the point
dx
P = (1, 0).
Solution By treating y as a function of x, we differentiate both sides of the equation
2y 4 − 2x2 − sin y + 1 = 0 with respect to x and get
8y 3 y 0 − 2x − y 0 cos y = 0.
MATLAB supports the implicit differentiation if the symbolic function y(x) is appropriately
created. The following example shows the calculation of y 0 in MATLAB, where x and y satisfy
the equation 2y 4 − x2 − sin y + 1 = 0.
>> syms x y ( x ) t
>> f = 2* y ( x ) ^4 - x ^2 - sin ( y ( x ) ) + 1;
>> d = diff (f , x )
d =
d0 =
8* t * y ( x ) ^3 - 2* x - t * cos ( y ( x ) )
>> s = solve ( d0 , t )
s =
s_x =
s_xy =
-2
MATLAB shows that the slope of the tangent line at point (1, 0) is −2.
Solution Let y(t) be the distance traveled by the balloon from the launch site at time t.
Let θ(t) be the angle of elevation at time t.
The speed of the balloon is y 0 (t), which equals to 2 m/s. “How fast is the angle of the
elevation” means that we need to find the rate of change of θ(t), i.e., the derivative θ0 (t).
The relation between y(t) and θ(t) is given by
y(t) = 100 · tan θ(t).
Taking the differentiation of both sides of the equation above, we obtain
100 · θ0 (t)
y 0 (t) = .
cos2 θ(t)
Since we need to find θ0 (t), we obtain
y 0 (t) 2
θ0 (t) = cos2 θ(t) = cos2 θ(t).
100 100
84 Differentiation
y(50) = 2 × 50 = 100.
From the relation between y(t) and θ(t), we have 100 = 100 · tan θ(50), so that θ(50) = 4.
π
Thus we obtain √
2
cos θ(50) = cos( 4 ) =
π
.
2
Therefore, we have
√ 2
2 2
θ0 (50) = · = 0.01.
100 2
Since two rates of change, i.e., derivatives θ0 (t) and y 0 (t), are related by the equation
y 0 (t)
θ0 (t) = cos2 θ(t).
100
This is a typical problem of related rates. In general, so-called related rates problems
involve finding a rate at which a quantity changes by relating that quantity to other quantities
whose rates of change are known.
An oil tank springs an oil leak on the ground, and the oil spreads in a circular patch around
the tank. If the radius of the oil patch increases at a rate of 10 meters/hour, how fast is the
area of the patch increasing when the patch has a radius of 20 meters?
Solution
Step 1: Label all variables:
Let r(t) be the radius of the oil patch at time t and A(t) be the area of the oil patch at
time t.
The rate of the area change is the quantity A0 (t).
Step 2: Write the relation between concerned variables:
The area of the patch is
A(t) = πr(t)2 .
Step 3: Write the relations between rates:
We take the differentiation with respect to t on both sides of the equation above,
r0 (t) = 10.
Solution
Step 1: Label all variables:
Let x(t) be the distance of the westbound boat to the port at time t. Let y(t) be the
distance of the northbound boat to the port at time t. Let z(t) be the distance between two
boats at time t.
The rate of the distance change is the quantity z 0 (t).
Step 2: Write the relation between concerned variables:
From the Pythagorean theorem,
z(t)2 = x(t)2 + y(t)2 .
Step 3: Write the relations between the rates:
We take the differentiation with respect to t on both sides of the equation above,
x(t) · x0 (t) + y(t) · y 0 (t)
2z(t) · z 0 (t) = 2x(t) · x0 (t) + 2y(t) · y 0 (t) =⇒ z 0 (t) = .
z(t)
Step 4: List all given quantities:
At the time t0 when westbound boat is 30 miles from the port, we have
x(t0 ) = 30, y(t0 ) = 40, x0 (t0 ) = −8, y 0 (t0 ) = −10.
Notice that the derivatives x0 (t) and y 0 (t) are negative, since the distances from both boats
to the port decrease in time.
Step 5: Determine other quantities from the given quantities:
We can determine the quantity z(t0 ) by using the Pythagorean identity:
p
z(t0 ) = x(t0 )2 + y(t0 )2 = 302 + 402 = 50.
p
y = 12 x2
1 tangent line
2
1
2
x
O 1O 1
x
Geometrically, the tangent line of a graph y = f (x) at x = a is close to the graph when x
is very close to a. Algebraically, the value f (a) + f 0 (a)(x − a) is very close to f (x) when x is
close to a, that is, when x ≈ a,
This linear function y = f (a) + f 0 (a)(x − a) is called the linear approximation (or
linearization) of f at x = a.
√ 1
Consider the function f (x) = 1 + x. Its derivative is f 0 (x) =
√ . The tangent
2 1+x
line at x = 0 is y = f (0) + f (0)x = 1 + 2 x. We know that, for small x, y = 1 + 12 x
0 1
√
approximates 1 + x. Numerically, we can verify this. For different values of small x, we
make the following table
2.6 Linear Approximation 87
√
x 1+x 1 + 21 x
√ 1
Solution Consider the function f (x) = 3
1 + x. Since f 0 (x) = , the linear
3 3 (1 + x)2
p
approximation of f is
y = 1 + 13 x.
√
Thus, we have an approximate value of 3 1.02:
√
1.02 ≈ 1 + 31 (0.02) ≈ 1.006667.
3
√
The real value of 3
1.02 is 1.0066227 · · · .
In MATLAB, the linear approximation of a function can be calculated using the command
taylor.
√ The following examples show the calculations of the linear approximations of f (x) =
3
1 + x at x = 0 and f (x) = cos x at x = a, respectively.
>> syms x ;
>> f = (1+ x ) ^(1/3) ;
>> taylor (f ,x ,0 , ' Order ' ,2)
ans =
x /3 + 1
>> syms x a ;
>> f = cos ( x ) ;
>> taylor (f ,x ,a , ' Order ' ,2)
ans =
cos ( a ) + sin ( a ) *( a - x )
Because the linear approximation f (x) ≈ f (a) + f 0 (a)(x − a) has two terms, we specify
88 Differentiation
In electronic circuits, many of the components that make up of the circuits are nonlinear,
e.g., diodes, transistors and vacuum tubes. For these nonlinear components, the current
through them is not proportional to the voltage, which makes calculations and analysis
complicated. Moreover, there are many applications where nonlinear devices only operate
in a very restricted range of voltage or current, such as many sensor applications and audio
amplifiers. For easy calculations and analysis of the voltage and current, a method called
small signal analysis (or incremental analysis) is proposed to approximate circuits containing
nonlinear elements with linear equations over a restricted region. Specifically, if the time-
varying alternating current (AC) signal of an electronic current is small compared to the
deterministic direct current (DC) bias, then using linear approximation, the nonlinear
circuit elements are replaced by linear elements over a restricted range in the resultant AC-
equivalent circuit. The small signal analysis method widely applies to electronic circuits
where the AC signals are small compared to the DC ones, e.g., radio receivers, sensors,
telecommunications and signal processing circuits.
A nonlinear circuit example is shown in the following, where the diode is a nonlinear
component.
Parameter Description
iD
VD DC voltage
ID DC current
−
− vI vD vd AC voltage
+
+ id AC current
vD = VD + vd total voltage
iD = ID + id total current
vI input voltage
For the total voltage vD and the total current iD of the above circuit, we have iD = f (vD ).
Note that iD is a nonlinear function of vD due to the nonlinear diode. We will then use the
small signal analysis method to approximate the behaviour of this circuit near the DC bias
point.
In particular, at vD = VD , using linear approximation, the function iD = f (vD ) can be
approximated as
df (vD )
iD ≈ f (VD ) + · (vD − VD )
dvD vD =VD
df (vD )
= f (VD ) + · vd .
dvD vD =VD
df (vD )
id = · vd .
dvD vD =VD
2.6 Linear Approximation 89
df (vD )
Further, we note that is independent of vd , so id is in proportion with vd
dvD vD =VD
after linear approximation, i.e.,
id ∝ vd .
iD
iD = f (vD )
df (vD )
A iD = f (VD ) + · vd
dvD vD =VD
id B
ID
vd
vD
O VD
The point (VD , ID ) representing the steady DC voltage and current is called the operating
point. Note that the small signal analysis is dependent on the operating point, i.e., the DC
bias voltage and current. From the figure above, we see that over a restricted range around
vD = VD , the time-varying AC current id becomes a linear function of the AC voltage vd (or
graphically, we approximate A with B in the restricted region), which facilitates the analysis
of the nonlinear circuit over this range.
Differential
Compute the differential of the function f (x) = cos x. Use it to find approximate value of
cos 94◦ .
Solution For the function y = cos x, we have y 0 = − sin x, so that dy = − sin x dx. Thus,
dk
For any polynomial Pn (x) of degree n, show that Pn (x) = 0 for k > n.
dxk
dm m
Solution Since (xm )0 = mxm−1 for integer m, we know that (x ) = m! and hence
dxm
dm+1 m dk m
(x ) = (m!)0
= 0. Thus we obtain (x ) = 0 if k > m. If k > n, then
dxm+1 dxk
dk dk
Pn (x) = (a0 + a1 x + · · · + an xn )
dx k dxk
dk dk dk
= a0 k (1) + a1 k (x) + · · · + an k (xn )
dx dx dx
= 0 + 0 + · · · + 0 = 0.
Prove that
dn dn
sin x = sin(x + 12 nπ), cos x = cos(x + 21 nπ).
dxn dxn
Solution Both equalities can be proved by induction. Here we only demonstrate the proof
of the first equality.
Clearly, since (sin x)0 = cos x = sin(x + 21 π), the equality holds for n = 1.
dk
Suppose the equality holds for n = k, that is, sin x = sin(x + 12 kπ). Thus,
dxk
0
dk+1 d
k
sin x = sin x
dxk+1 dxk
0
= sin(x + 21 kπ)
= sin(x + 12 kπ + 12 π)
= sin x + 12 (k + 1)π .
dy x
(1) By differentiating = − once more, we have
dx y
dy
d2 y d
x
1·y−x·
= − =− dx
dx2 dx y y2
x
1·y−x· −
y x2 + y 2 1
=− = − = − 3.
y2 y3 y
dy
(2) By implicitly differentiating 2y + 2x = 0, we have
dx
2
dy d2 y
2 + 2y 2 + 2 = 0,
dx dx
so that
2 2
dy
x
1+ 1 + −
d2 y dx y
=− =−
dx2 y y
x2 + y 2 1
=− = − 3.
y3 y
Newton’s second law of motion presents the relationship between the net force acting on
an object and the rate of the object’s momentum change. This is one of the most important
laws in physics. It was first proposed by Isaac Newton in his book “Philosophiae Naturalis
Principia Mathematica (Mathematical Principles of Natural Philosophy)”, which was first
published in 1687. In terms of magnitude, Newton’s second law is given in the following:
dp dv
F = =m ,
dt dt
where F is the net force acting on an object, p is the momentum of the object, v is the speed,
and t is the time.
Note that the speed v equals to the rate of an object’s displacement change with respect to
2.7 Higher Derivatives 93
dx
time, i.e., v = , where x is the displacement of an object. Then, we can rewrite Newton’s
dt
second law as
d2 x
F =m .
dt2
Suppose that a ball of mass 0.25 kg is rolling on the ground, and it starts to decelerate at
t = 0. The displacement of this ball from its original position at t = 0 is x(t) = 2t − 0.2t2
(0 ≤ t ≤ 5). What is the resistive force acting on the ball?
According to Newton’s second law, we have
Leibniz Formula
If f (n) and g (n) exits, so is (f · g)(n) and the Leibniz Formula holds:
n
(n)
X n
[f (x) · g(x)] = f (i) (x) · g (n−i) (x).
i=0
i
Justification:
The formula can be proved by induction. In fact, it is clear that the formula holds for
n = 1:
1
0
X 1 (i)
[f (x) · g(x)] = f 0 (x) g(x) + f (x) g 0 (x) = f (x) · g (1−i) (x).
i=0
i
Suppose the formula holds for n = k, that is,
k
(k)
X k
[f (x) · g(x)] = f (i) (x) · g (k−i) (x).
i=0
i
94 Differentiation
Thus,
(k+1)
[f (x) · g(x)]
" k #0
X k
= f (x) · g
(i) (k−i)
(x)
i=0
i
k h
X k i
= f (i+1) (x) · g (k−i) (x) + f (i) (x) · g (k+1−i) (x)
i=0
i
k
X k
=f (k+1)
(x) g(x) + f (i) (x) · g (k+1−i) (x)
i=1
i − 1
k
X k (i)
+ f (x) · g (k+1−i) (x) + f (x) g (k+1) (x)
i=1
i
= f (k+1) (x) g(x)
k
X k k
+ + f (i) (x) · g (k+1−i) (x) + f (x) g (k+1)
i=1
i − 1 i
k+1
X k + 1
= f (i) (x) · g (k+1−i) (x)
i=0
i
dn
Compute x2 ex for n ≥ 1.
dxn
Solution We know that
dn n(n − 1) 2 00 x (n−2)
x2 ex = x2 (ex )(n) + n(x2 )0 (ex )(n−1) + (x ) (e )
dx n 2
= x + 2nx + n(n − 1) e .
2 x
95
Summary
f (x + h) − f (x)
derivative : f 0 (x) = lim
h→0 h
(n−1) 0
higher derivative : f (x) = f (x), n ≥ 2
(n)
differential : dy = f 0 (x) dx
Suppose f 0 (x) and g 0 (x) exist. Then the following rules of differentiation hold.
1. Sum Rule:
0
[f (x) + g(x)] = f 0 (x) + g 0 (x).
2. Difference Rule:
0
[f (x) − g(x)] = f 0 (x) − g 0 (x).
3. Product Rule:
0
[f (x) g(x)] = f (x) g 0 (x) + g(x) f 0 (x).
or in Leibniz notation,
dy dy du
= · .
dx du dx
6. Inverse Function: Suppose f is one-to-one and differentiable with non-zero derivative.
Then
−1 0 1
f (x) = 0 −1 .
f (f (x))
1. Take natural logarithms of both sides of an equation y = f (x) and use the Laws of
Logarithms to simplify.
2. Differentiate implicitly with respect to x.
3. Solve the resulting equation for y 0 .
1. Replace y by y(x) in the given equation which defines the function y = y(x) implicitly.
2. Differentiate both sides of the equation with respect to x, by applying the rules of
differentiation.
dy
3. Solve for from the resulting equation.
dx
CHAPTER
3
Applications of Differentiation
1. Consider f (x) = x2 defined over the interval [−1, 1]. From the graph of the function,
we see that
98 Applications of Differentiation
f (0) = 0.
2. Consider g(x) = x2 defined over the interval (−1, 1). From the graph of the function,
we see that
3. Consider h(x) = x2 defined over (−∞, +∞). From the graph of the function, we see
that
1
4. Consider k(x) = defined over (0, +∞). From the graph of the function, we see that
x
• k has no absolute maximum value; y
5. Consider r(x) = cos x defined over (−∞, +∞). From the graph, we see that, for
n = 0, ±1, ±2, . . . ,
6. Consider the function p(x) = xe−x with the graph given below. We see that
Justification:
Without loss of generality, suppose f has a local maximum at c, that is,
f (c + h) − f (c)
f 0 (c) = lim+ ≤ 0.
h→0 h
Similarly, if h < 0 and h is sufficiently small, we have
f (c + h) − f (c)
≥ 0.
h
Since f is differentiable at c, we have
f (c + h) − f (c)
f 0 (c) = lim− ≥ 0.
h→0 h
Since both f 0 (c) ≤ 0 and f 0 (c) ≥ 0 hold, we get f 0 (c) = 0.
The case of a local minimum can be proved in a similar manner.
That a point is an interior point means that it is not a boundary point. For example, the
point 0 is an interior point of the interval [−1, 1] since 0 ∈ (−1, 1) ⊂ [−1, 1]. The point −1 is
not an interior point of [−1, 1], but a boundary point.
The point 0 is not an interior point of the interval (0, 1) since it is even not a point in
(0, 1). In fact, 0 is a boundary point of (0, 1). The number 10−100 is an interior point of
(0, 1) since 10−100 ∈ (0.5 × 10−100 , 1.5 × 10−100 ) ⊂ (0, 1).
Fermat’s Theorem concludes that a local extreme value f (c), where c is in the domain of
f , only occurs at one of the following three types of locations:
1. Consider the function p(x) = 2x3 − 3x2 − 12x + 1 with the graph given below. The
derivative of p is
2. Consider the function q(x) = |x|. Since q(x) does not have derivative at x = 0, so that
x = 0 is a critical point. The function also attains a local minimum value as well as an
absolute minimum value at x = 0.
3.7 Pitfall: critical points do not necessarily yield local extreme values
Fermat’s Theorem states that a local extremed value only occurs at an interior critical
point or at a boundary point. However, not all critical points will yield local extreme values.
−1
102 Applications of Differentiation
Let f be a continuous function defined over a finite closed interval [a, b]. Then f (x) has at
least one absolute maximum point and one absolute minimum point in the interval [a, b].
1. Find the critical points and evaluate the values of f at critical points.
2. Evaluate the values of f at the boundary points x = a and x = b.
3. The largest value and smallest value from steps 1 and 2 are the absolute maximum
value and the absolute minimum value respectively.
1. To obtain the local maximum or minimum value of a function, we can first plot the
function in MATLAB to see the rough location of the local maximum or minimum value.
The following code shows how to plot the figure of the function p(x) = 2x3 −3x2 −12x+1.
>> syms x ;
>> p ( x ) = 2* x ^3 - 3* x ^2 - 12* x + 1;
>> x_array = -3:0.05:3;
>> y_array = p ( x_array ) ;
>> figure
>> plot ( x_array , y_array , 'r ')
104 Applications of Differentiation
>> grid
>> xlabel ( 'x ')
>> ylabel ( 'p ( x ) ')
p(x)
-20
To obtain the exact locations of the local maximum and minimum values of p, we need
the following MATLAB code.
>> d = diff ( p ) ;
>> d_fun = matlabFunction ( d )
d_fun =
max_p =
-1
min_p =
2. The following example shows how to find the absolute minimum value of the function
f (x) = x2 − 2.1x + 1.1025. First, we plot the curve of f . The MATLAB code is shown
below.
>> syms x ;
>> f ( x ) = x ^2 - 2.1* x + 1.1025;
>> x_array = -1:0.2:3;
>> y_array = f ( x_array ) ;
>> figure
>> plot ( x_array , y_array , 'r ')
>> xlabel ( 'x ')
>> ylabel ( 'f ( x ) ')
>> grid
graph of f . 4
3.5
1
MATLAB code. 0.5
0
-1 -0.5 0 0.5 1 1.5 2 2.5 3
x
>> d = diff ( f ) ;
>> d_fun = matlabFunction ( d )
d_fun =
min_p =
1.0500
MATLAB returns that the absolute minimum value of f (x) can be achieved at x = 1.05.
106 Applications of Differentiation
rough location of the minimum value. The code is shown in the following.
>> syms x
>> f ( x ) = x - 1 - log ( x - 1) - log (1 + 1/ x ) ;
>> x_array = 1.1:0.1:10;
>> y_array = f ( x_array ) ;
>> figure
>> plot ( x_array , y_array , 'r ')
>> grid
>> xlabel ( 'x ')
>> ylabel ( 'f ( x ) ')
0
0 2 4 6 8 10
x
>> df = diff ( f )
df ( x ) =
df_fun =
x_min =
1.8393
It shows that f 0 (1.8393) = 0, i.e., the minimum value of f (x) is achieved when the compress-
ibility factor x = 1.8393.
Substituting x = 1.8393 into the fugacity coefficient function f (x), we have the minimum
value of the fugacity coefficient shown as follows.
f_min =
0.58031458931953300345263227407065
The result shows that the minimum value of the fugacity coefficient is around 0.5803.
• decreasing on an interval I if
f (x1 ) > f (x2 ) whenever x1 < x2 in I.
108 Applications of Differentiation
x
−1 O 1
1 y
3. The function h(x) = is deceasing on the
x
interval (−∞, 0) as well as on the interval
(0, +∞). y=
1
x
1
−1
x
O 1
−1
x
− 12 π O 1
2π
3
2π
−1
f (b) − f (a)
f 0 (c) =
b−a
or, equivalently,
f (b) − f (a) = f 0 (c)(b − a).
y y
f (b) f (b)
f (a) f (a)
x x
O a c b O a c1 c2 b
Justification:
An equation of the line segment connecting (a, f (a)) and (b, f (b)) is
f (b) − f (a)
y = f (a) − (x − a).
b−a
As shown in the figure, at x with a ≤ x ≤ b, consider the auxiliary function
f (b) − f (a)
h(x) = f (x) − f (a) − (x − a).
b−a
f (b)
h(x)
f (x)
f (a) f (b) − f (a)
f (a) + (x − a)
b−a
x
O a x b
Since f is continuous on [a, b], so is h. By the Extreme Value Theorem, there exist absolute
maximum point M and absolute minimum point m.
If one of m and M is attained at an interior point of (a, b), since h is differentiable in (a, b),
by Fermat’s Theorem, there exists c ∈ (a, b) such that h0 (c) = 0. Since
f (b) − f (a)
h0 (x) = f 0 (x) − ,
b−a
110 Applications of Differentiation
we get
f (b) − f (a)
f 0 (c) = .
b−a
If both m and M are attained at the boundary points of [a, b], since
f (b) − f (a)
h(a) = f (a) − f (a) − (a − a) = 0,
b−a
f (b) − f (a)
h(b) = f (b) − f (a) − (b − a)
b−a
= f (b) − f (a) − [f (b) − f (a)] = 0,
we must have m = M = 0. This means that h must be a constant function. Thus, for any
c ∈ (a, b), we have h0 (c) = 0. Similarly as above, we again have
f (b) − f (a)
f 0 (c) = .
b−a
3.19 Pitfall: when the hypotheses in the Mean Value Theorem fail
The hypotheses of the Mean Value Theorem are that the function f is continuous on the
closed interval [a, b] and differentiable in the open interval (a, b). We will see that if any of
these fails, then the conclusion of the Mean Value Theorem does not necessarily hold.
1. Consider the function f defined on [0, 1]:
1, if 0 < x ≤ 1;
f (x) =
0, if x = 0.
Clearly, f is discontinuous at x = 1, so that f is not continuous on [0, 1]. Obviously,
for any x ∈ (0, 1), f 0 (x) = 0 and
f (1) − f (0) 1−0
= = 1.
1−0 1−0
So there exists no c in (0, 1) such that
f (1) − f (0)
f 0 (c) = .
1−0
2. Consider the function g(x) = |x| defined over [−1, 1]. We know that g 0 (0) does not
exist, so g is not differentiable in (−1, 1). It is easy to see that
g(1) − g(−1) 1−1
= = 0,
1 − (−1) 2
and
−1, if −1 < x < 0;
g (x) =
0
1, if 0 < x < 1.
Clearly, there exists no c inside (−1, 1) such that
g(1) − g(−1)
g 0 (c) = .
1 − (−1)
3.2 Monotone Functions and Mean Value Theorem 111
Justification:
Suppose f 0 (x) > 0 on (a, b). We take any two numbers x1 , x2 ∈ (a, b) such that with
x1 < x2 . By the Mean Value Theorem, there is c ∈ (x1 , x2 ) such that
which implies that f (x1 ) < f (x2 ). Hence, f is increasing on (a, b).
The other case can be proved similarly.
Consider the function f (x) = 2x3 − 3x2 − 12x + 1. To find the intervals where f is
monotone, by the Monotone Test, we need to determine the intervals in which f 0 keeps its
sign unchanged.
In fact,
f 0 (x) = 6x2 − 6x − 12 = 6(x2 − x − 2) = 6(x − 2)(x + 1),
so that it has two real roots x = −1 and x = 2. These two numbers divide the interval
(−∞, +∞) into three open intervals (−∞, −1), (−1, 2), and (2, +∞). Since the function f 0
is continuous and nonzero over each of these intervals, by the Intermediate Value Theorem,
it must be either positive or negative on each interval. In (−∞, −1), since f 0 is positive for
large negative x, f 0 (x) is positive on (−∞, −1). The function f 0 changes its sign on two sides
of x = −1 and x = 2, so that f 0 (x) is negative on (−1, 2) and positive on (2, +∞).
y y
x x
−1 O 2 −1 O 2
y = f (x)
y = f 0 (x) −19
Thus the function f (x) is increasing over the intervals (−∞, −1) and (2, +∞), and de-
creasing over the interval (−1, 2).
112 Applications of Differentiation
There is a method that works for solving inequalities of the form f (x) > 0, or inequalities
involving ≥, <, or ≤, where f is a polynomial. It consists of the following major steps:
(1) Solve the equation f (x) = 0 to find all real roots.
(2) Specify the roots on the number line.
(3) Sketch the graph of y = f (x) by starting from x near −∞. If the order of f is odd, the
graph of f is below the number line; if the order of f is even, the graph is above the number
line.
(4) From the left to the right, the curve y = f (x) intersects the number line at the roots,
one after another.
(5) The curve y = f (x) crosses the number line at roots when the multiplicities are odd
and does not cross at roots when the multiplicities are even.
(6) The inequality f (x) > 0 holds on the interval over which the graph of y = f (x) is above
the number line.
The method can be modified for inequalities with f being rational functions or even tran-
scendental functions.
Suppose f is differentiable in (a, b). If f 0 (x) = 0 for all x in (a, b), then f is a constant
function.
Justification:
For any two numbers x1 , x2 in (a, b), by the Mean Value Theorem, there is a number
x∗ ∈ (x1 , x2 ) ⊂ (a, b) such that
Since f 0 (x) = 0 for all x in an interval (a, b), we have f 0 (x∗ ) = 0. Thus, f (x1 ) = f (x2 ). This
shows that at any two numbers in (a, b), the values of f are the same. So, f is constant on
(a, b).
3 1
= −√ +p (3 − 12x2 )
1 − x2 1 − (3x − 4x3 )2
3 1
= −√ +√ (3 − 12x2 ) = 0,
1 − x2 1 − x2 · (1 − 4x2 )
3.2 Monotone Functions and Mean Value Theorem 113
so we have
3 arccos x − arccos(3x − 4x3 ) = C, − 21 < x < 12 ,
where C is a constant. Setting x = 0 gives C = π. Hence,
>> syms x ;
>> f ( x ) = 2* x ^3 - 3* x ^2 - 12* x + 1;
>> d ( x ) = diff ( f ( x ) ,x ) ;
>> rts_d = solve ( d ( x ) == 0 , x )
rts_d =
-1
2
Note that for a string (e.g., x inside ‘x’ and f”(x) inside ‘f”(x)’ ), we need to use double
single quotes to obtain a single quote (simply using one single quote represents conjugate
transpose in MATLAB), e.g., we use ‘f”(x)’ to represent f 0 (x).
20
Monotone Test, we know that f is decreasing 10
on the interval (−1, 2), and f is increasing on 0
the intervals (−∞, −1) and (2, +∞). -10
-20
-3 -2 -1 0 1 2 3
x
114 Applications of Differentiation
>> f ( x ) = 2* x ^3 - 3* x ^2 - 12* x + 1;
>> figure
>> plot ( x_array , f ( x_array ) , 'r ')
>> xlabel ( 'x ')
>> ylabel ( 'f ( x ) ')
>> grid
-10
f(x)
-20
-30
-40
-50
-3 -2 -1 0 1 2 3
x
Local Extrema
y y
c x c x
O O
y y
c x c x
O O
Justification:
Near c, suppose f 0 (x) is positive for a < x < c and negative for c < x < b. Then f (x)
is continuous on [a, c] and differentiable on (a, c). Thus f (x) is increasing over [a, c], i.e. for
any x with a < x < c, f (x) < f (c). By the similar argument, f (x) is decreasing over [c, b],
i.e. for any x with c < x < b, f (c) > f (x). Therefore c is a local maximum point.
The same argument applies to the other two cases.
point.
h(x) = |x|. y
4. Consider r(x) = 1
2 sin x − 12 x cos x over (−5, 5). Its derivative is
r0 (x) = 1
2 cos x − 21 (cos x − x sin x) = 12 x sin x.
Solving r0 (x) = 12 x sin x = 0 in the interval (−5, 5) gives three critical points −π, 0, π.
Since sin x is positive for −5 < x < −π, we know that r0 (x) is negative near x = −5.
Thus, we can sketch the graph of r0 , as shown.
3.3 Tests for Local Extrema and Concavity 117
From the graph of r0 , we see that r0 (x) changes from negative to positive at the critical
point x = −π, does not change sign at the critical point x = 0, and changes from
positive to negative at the critical point x = π.
Justification:
1. Assume f 0 (c) = 0 and f 00 (c) > 0. Since f 00 is continuous near c, we know that f 00 (x) > 0
near c. Thus f 0 is an increasing function near c. Hence for x near c, f 0 (x) < f 0 (c) = 0 for
x < c, and f 0 (x) > f 0 (c) = 0 for x > c. By the First Derivative Test, c is a local minimum
point.
2. The proof for this case is similar as case 1.
3. We use two functions to demonstrate this. They both satisfy the hypotheses, but the
first function has no local extreme value at c while the second has a local maximum value at
c.
(1) Consider f (x) = x3 . It is easy to see that f 0 (0) = 0, f 00 (0) = 0, and f 00 (x) = 6x is
continuous near x = 0. Since f (x) < 0 = f (0) when x < 0 and f (x) > 0 = f (0), f (0) is not
a local extreme value.
(2) Consider g(x) = x4 . It is easy to see that g 0 (0) = 0, g 00 (0) = 0, and g 00 (x) = 12x2 is
continuous near x = 0. Since g(x) ≥ 0 = g(0) for all real x, g(0) is a local minimum value.
f 0 (x) = 6x2 − 6x − 12 y
= 6(x − 2)(x + 1),
f 00 (x) = 12x − 6. 8
x
Solving f 0 (x) = 0 gives x = −1, 2. Since −1 O 2
2. Consider r(x) = 1
2 sin x − 12 x cos x over (−5, 5). Its derivatives are
However, since r00 (0) = 0, the Second Derivative Test is inconclusive in this case. In
fact, we can apply the First Derivative Test to conclude that r has not a local extreme
at x = 0, since r0 does not change sign at the critical point x = 0.
−2x, if x < 0;
f 0 (x) =
2x, if x > 0.
Since the left limit and right limit are equal, f 0 (0) = 0. Thus f 0 (x) = 2|x| for all x ∈ R.
3.3 Tests for Local Extrema and Concavity 119
The following example shows the tests for local extrema of the function f (x) = 2x3 − 3x2 −
12x + 1.
We first test the local extrema of f using First Derivative Test.
>> syms x ;
>> f ( x ) = 2* x ^3 - 3* x ^2 - 12* x + 1;
>> d ( x ) = diff ( f ( x ) ,x ) ;
>> rts_d = solve ( d ( x ) == 0 , x )
rts_d =
-1
2
20
Derivative Test, we know that f has a local 10
maximum value at x = −1 and a local mini- 0
mum value at x = 2. -10
-20
-3 -2 -1 0 1 2 3
x
120 Applications of Differentiation
d2 ( x ) =
12* x - 6
>> d2 ( -1)
ans =
-18
>> d2 (2)
ans =
18
We see from the MATLAB code above that f 00 (−1) = −18 < 0 and f 00 (2) = 18 > 0. Hence,
according to Second Derivative Test, f has a local maximum value at x = −1 and a local
minimum value at x = 2.
Actually, we can plot f to check the above results.
>> figure
>> plot ( x_array , f ( x_array ) , 'r ')
>> xlabel ( 'x ')
>> ylabel ( 'f ( x ) ')
>> grid
-10
f(x)
-20
-30
-40
-50
-3 -2 -1 0 1 2 3
x
3.3 Tests for Local Extrema and Concavity 121
Next, we calculate the value of p in the open interval (0, 1) at which f can achieve the
local maximum value. Note that when p ∈ (0, 1), we have p96 (1 − p)102 > 0. Hence, from the
expression above, we know that f 0 (p) = 0 when p = 20097
= 0.485 and
According to First Derivative Test, f can achieve the local maximum value at p = 0.485.
To verify whether f can achieve its absolute maximum value at p = 0.485, we need to
calculate the values of f (p) at the boundary points p = 0 and p = 1, respectively. We can
easily calculate that f (0) = f (1) = 0 < p(0.485). Therefore, we conclude that f can achieve
the absolute maximum value at p = 0.485.
MATLAB solution:
Alternatively, this problem can also be solved using MATLAB.
First, we calculate f 0 and the root of f 0 (p) = 0 using the following MATLAB code.
>> syms p
>> f ( p ) = 2^47* p ^97*(1 - p ) ^103;
>> df ( p ) = simplify ( diff ( f ( p ) ) )
df ( p ) =
df_root =
97/200
p = 200
97
, f achieves a local maximum value.
f'(p)
-0.5
-1
-1.5
-2
0 0.2 0.4 0.6 0.8 1
p
Quality control is a process of reviewing the quality of all factors to confirm the fulfillment
of the quality requirements. A quality control engineer is testing the failure rate of a certain
type of beams under stress. To conduct the testing, beams are put under steady stress for
some time. Suppose that the beam can pass the test with probability p, then it cannot
pass the test with probability 1 − p. If the quality control engineer conducts trials for 100
beams and 5 of them do not pass the test, then the probability of observing this sequence of
successes and failures is
First, using the rules of differentiation, we calculate the first derivative of f (p) in the
following:
Next, we calculate the value of the local maximum point p in the open interval (0, 1). Note
that when p ∈ (0, 1), we have p94 (1 − p)4 > 0. Hence, from the expression above, we know
that f 0 (p) = 0 when p = 100
95
= 0.95 and
According to First Derivative Test, we know that f (p) can achieve a local maximum value
at p = 0.95.
To verify whether p = 0.95 is an absolute maximum point, we now calculate the values of
f (p) at p = 0 and p = 1, respectively. It can be easily calculated that f (0) = f (1) = 0 and
f (0.95) > 0. Therefore, we conclude that f (p) is maximized at p = 0.95.
MATLAB solution:
Alternatively, this problem can also be solved using MATLAB.
First, we calculate f 0 (p) and the root of f 0 (p) = 0 using the following MATLAB code.
>> syms p
>> f ( p ) = p ^95*(1 - p ) ^5;
>> df ( p ) = simplify ( diff ( f ( p ) ) )
df ( p ) =
df_root =
19/20
p < 2019
and f 0 (p) < 0 if p > 1920 . Hence, 2
f'(p)
-2
-4
-6
-8
-10
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
p
At last, to check whether p = 1920 is an absolute maximum point, we need to calculate the
values of f(p) at p = 0 and p = 1, respectively. It can be easily shown that f (0) = f (1) = 0
and f 19 20 > 0. Therefore, p = 20 is an absolute maximum point and f is maximized at
19
p = 20 .
19
In economics, profit maximization is a short run or long run process by which a firm can
determine the price, input and output levels to make the greatest profit. Given price p ∈ R,
the demand of a product is d(p). If the unit cost is c, then to maximize the profit, the seller’s
objective is
max d(p)(p − c)
p
Calculate the value of p which satisfies the seller’s objective in the following cases:
1. If d(p) is a linear demand, i.e., d(p) = a − bp.
2. If d(p) is an exponential demand, i.e., d(p) = λ exp − pθ .
3. In the constant elasticity of substitution case, i.e., d(p) = ap−b (b > 1).
Let the objective function be f (p) = d(p)(p − c). First, by the Product Rule, we can easily
calculate f 0 (p) as follows:
Next, we calculate the value of p which maximizes f (p) in different cases, respectively.
f 0 (p) = (−b)(p − c) + a − bp
= −2bp + bc + a.
3.3 Tests for Local Extrema and Concavity 125
i.e., it satisfies the seller’s objective. Note that the optimal price p = 2 c + b increases
1 a
Hence, according to First Derivative Test, we know that p = θ + c maximizes f (p), i.e.,
it satisfies the seller’s objective. Note that p = θ + c > c, which means the optimal
price is greater than and increasing with the unit cost c.
3. If d(p) = ap−b , we have
RS
−
VS + RL
Consider the circuit in the following figure. A load of resistance RL is connected over a
power source of voltage VS and internal resistance RS .
According to Ohm’s Law, we have
VS
Electric Current : I = ;
RS + RL
VS2 RL
Output Power : P = 2.
(RS + RL )
Calculate the the value of RL such that the output power P is maximized.
V 2R
Let f (RL ) = P = (R S+RL )2 , then by Quotient Rule, we have
S L
2
VS2 (RS + RL ) − 2VS2 RL (RS + RL )
f 0 (RL ) = 4
(RS + RL )
V (RS − RL )
2
= S 3 .
(RS + RL )
Hence, according to First Derivative Test, we know that RL = RS maximizes f (RL ), i.e.,
the maximum power transfer occurs in the load when the load resistance (RL ) equals to the
source resistance (RS ). This is called a “matched condition”, and it illustrates the theorem
that the maximum power would be transferred to the output when the impedance of the
external device matches that of the source. Note that improper impedance matching would
lead to excessive power use and dissipation.
Consider the case where a ball is thrown with initial velocity u and an angle θ
(0◦ ≤ θ ≤ 90◦ ) against the ground.
1. Find the relationship between the horizontal distance that the ball can reach sx , and
the variables u and θ.
3.3 Tests for Local Extrema and Concavity 127
2. Prove that in order to throw a ball as far as possible, we need to start the motion with
an angle of 45◦ .
y y
θ = 60◦
θ = 45◦
θ = 30◦
θ
x x
O O
1. First, we note that for the motion, the only force that affects the system is the gravi-
tational force in the vertical direction. For the vertical movement, we have
uy = u sin θ
where uy is the velocity in the y-axis direction.
With the velocity in the y-axis direction uy , we can calculate the displacement of the
ball in the y-direction at time t, which is shown in the following:
sy = uy t − 21 gt2
= (u sin θ)t − 12 gt2 .
2u sin θ
Solving the above equation, we can obtain two roots: t = 0 and t = . Note
g
that at t = 0, the ball is at its initial position. Hence, the ball hits the ground again
2u sin θ 2u sin θ
at t = . In other words, the projectile motion ends at t = and the ball
g g
hits the ground again.
Next, we consider the horizontal movement of the ball. The velocity in the x-axis
direction can be calculated as follows:
ux = u cos θ.
With the velocity in the x-axis direction ux , we can calculate the displacement of the
ball in the x-direction at time t, which is shown in the following:
sx = ux t = (u cos θ)t.
2u sin θ
At t = , the displacement of the ball in the x-direction is
g
2u sin θ 2u2
sx = u cos θ = sin θ cos θ.
g g
128 Applications of Differentiation
2u2
2. Let f (θ) = sx = sin θ cos θ. To calculate the maximum horizontal movement of
g
the ball, i.e., to maximize sx , we first need to calculate f 0 (θ). According to Product
Rule, the calculation is shown in the following:
2u2
f 0 (θ) = cos2 θ − sin2 θ .
g
verified that
f (θ) > 0, if 0 ≤ θ < π4 ;
0
f 0 (θ) < 0, if π4 < θ ≤ π.
MATLAB solution:
2u2
We now turn to the use of MATLAB. Let f (θ) = sx = sin θ cos θ. Specifically, we
g
calculate f (θ) and the roots of f (θ) = 0 using MATLAB.
0 0
df ( x ) =
a * cos ( x ) ^2 - a * sin ( x ) ^2
root_df =
pi /4
1 0
0.9 -0.1
0.8 -0.2
0.7 -0.3
0.6 -0.4
g( )
g( )
0.5 -0.5
0.4 -0.6
0.3 -0.7
0.2 -0.8
0.1 -0.9
0 -1
0 0.2 0.4 0.6 0.8 0.8 1 1.2 1.4
Note that π
4≈ 0.7854. We thus see from the figure above that
Concavity
• concave up if its graph is above all its tangent lines over the interval;
• concave down if its graph is below all its tangent lines over the interval.
y y
2 y
1 1 y = x3 1
y = −x2
O −1
x x x
−1 O 1 −1 1 O 1
y=x 2
−1 −1
1. For the function y1 = x2 , we have y100 = 2 > 0. Thus, by the Concavity Test, this
function is concave up on R. For the function y2 = −x2 , we have y200 = −2 < 0 and the
function is concave down on R.
3.3 Tests for Local Extrema and Concavity 131
y y
2 1
y = −x2
1
O x
−1 1
x −1
−1 O 1
y=x 2
−1
The example below shows the concavity test of the function f (x) = 2x3 − 3x2 − 12x + 1.
>> syms x ;
>> f ( x ) = 2* x ^3 - 3* x ^2 - 12* x + 1;
>> d2 ( x ) = diff ( f ( x ) ,x ,2)
d2 ( x ) =
12* x - 6
rts_d2 =
132 Applications of Differentiation
1/2
f''(x)
-10
to the Concavity Test, f is concave down on -20
−∞, 12 and concave up on 21 , +∞ , while
-30
x = 12 is thus an inflection point.
-40
-50
-3 -2 -1 0 1 2 3
x
>> figure
>> plot ( x_array , f ( x_array ) , 'r ')
>> xlabel ( 'x ')
>> ylabel ( 'f ( x ) ')
>> grid
-20
-30
-40
-50
-3 -2 -1 0 1 2 3
x
3.4 L’Hospital’s Rule 133
sin x
1. In calculating limits, we often encounter indeterminate forms such as lim where it
x→0 x
0
becomes the indeterminate form if we naively plug x = 0 into the expression. In order
0
sin x
to calculate the limit, we used some geometry of the sine function to get lim = 1.
x→0 x
x2 − 1
2. For the limit lim , if we directly plug x = 1 into the expression, we will get the
x→1 x − 1
0
indeterminate form . To calculate the actual limit, we can perform the cancellation
0
x2 − 1 x2 − 1
= x + 1 and lim = lim (x + 1) = 2.
x−1 x→1 x − 1 x→1
ln x 0
3. For the limit lim , it is an indeterminate form if we plug x = 1 into the
x→1 x − 1 0
expression. We will develop a general approach to find such a limit.
f (x)
lim ,
x→a g(x)
where f (x) → 0 and g(x) → 0 as x → a. The other indeterminate forms arise similarly in
the corresponding symbolic expressions.
0 ln x • 00 : lim xx ;
• : lim ;
0 x→1 x − 1 x→0+
∞ ex
• : lim ; • ∞0 : lim x1/x ;
∞ x→∞ x x→+∞
• 0 · ∞: lim+ (sin x) ln x;
x→0 x
1
√ √
• ∞ − ∞: lim ( x + 1 − x); • 1∞ : lim 1− .
x→+∞ x→∞ x
Suppose
f 0 (x)
4. lim exists or is ∞.
x→a g 0 (x)
Then
f (x) f 0 (x)
lim = lim 0 .
x→a g(x) x→a g (x)
The rule also holds when limits are one-sided limits or when x → a is replaced by x → ∞.
0
3.46 Example: form
0
ln x
Find the limit lim .
x→1 x−1
Solution For the given limit, we can verify the hypotheses of l’Hospital’s Rule:
1. Both functions ln x and x − 1 are differentiable;
2. (x − 1)0 = 1 is nowhere zero near x = 1;
3. lim ln x = 0 and lim (x − 1) = 0;
x→1 x→1
(ln x)0 1
4. lim = lim = 1.
x→1 (x − 1)0 x→1 x
Thus, legitimately we can apply l’Hospital’s Rule and get
ln x H (ln x)0 1
lim = lim = lim = 1.
x→1 x − 1 x→1 (x − 1)0 x→1 x
3.4 L’Hospital’s Rule 135
∞
3.47 Example: form
∞
ex
Find the limit lim .
x→+∞ x
Solution For the given limit, we can verify the hypotheses of l’Hospital’s Rule:
1. Both functions ex and x are differentiable;
2. x0 = 1 is nowhere zero;
3. lim ex = +∞ and lim x = +∞;
x→+∞ x→+∞
(ex )0
4. lim = lim ex = +∞.
x→+∞ (x)0 x→+∞
Thus, legitimately we can apply l’Hospital’s Rule and get
ex H (ex )0
lim = lim = lim ex = +∞.
x→+∞ x x→+∞ (x)0 x→+∞
ex
Find the limit lim .
x→+∞ x2
Analysis: If we apply l’Hospital’s Rule, we get
ex H (ex )0 ex
lim = lim = lim .
x→+∞ x2 x→+∞ (x2 )0 x→+∞ 2x
For the last limit, we again apply l’Hospital’s Rule and get
ex H (ex )0 ex
lim = lim = lim = +∞.
x→+∞ 2x x→+∞ (2x) 0 x→+∞ 2
These two steps need to be justified by checking the hypotheses of l’Hospital’s Rule.
ex
Solution For the limit lim , we can verify the hypotheses of l’Hospital’s Rule:
x→+∞ 2x
1. Both functions e and 2x are differentiable;
x
ex H (ex )0 ex
lim = lim = lim = +∞.
x→+∞ 2x x→+∞ (2x)0 x→+∞ 2
ex
For the original limit lim , we can verify the hypotheses of l’Hospital’s Rule:
x→+∞ x2
1. Both functions ex and x2 are differentiable;
2. (x2 )0 = 2x is nowhere zero when x is large;
136 Applications of Differentiation
ex H (ex )0
lim = lim = +∞.
x→+∞ x2 x→+∞ (x2 )0
Remark:
Since the verification of the hypotheses of l’Hospital’s Rule is straightforward, often
ex
we omit this step. Thus, for finding the limit lim 2 , typically, we simply write:
x→+∞ x
ex H (ex )0 ex
lim = lim = lim
x→+∞ x2 x→+∞ (x2 )0 x→+∞ 2x
H (e )
x 0
ex
= lim = lim = +∞.
x→+∞ (2x)0 x→+∞ 2
1 − sin x
1. Consider lim .
x→0 1 + sin x
If one calculates the limit by using l’Hospital’s Rule without verifying the hypotheses,
one would get
1 − sin x H (1 − sin x)0 − cos x
lim = lim = lim = −1.
x→0 1 + sin x x→0 (1 + sin x)0 x→0 cos x
However, this is a wrong value! The correct value can be obtained by the continuity:
1 − sin x 1 − sin 0
lim = = 1.
x→0 1 + sin x 1 + sin 0
The reason for the failure is that one of the hypotheses of l’Hospital’s Rule is not
satisfied. In fact, we see that lim (1 − sin x) = 1, which is neither zero nor ∞.
x→0
x + sin x
2. Consider lim .
x→+∞ x
If one applies l’Hospital’s Rule, one would get
x + sin x H (x + sin x)0
lim = lim = lim (1 + cos x).
x→+∞ x x→+∞ (x)0 x→+∞
This contradiction shows that not all indeterminate form can apply l’Hospital’s Rule.
The failure in this example is due to the fact that the limit lim (1 + cos x) does not
x→+∞
exist. This is one of the hypotheses of l’Hospital’s Rule.
Solution The given limit is indeterminate form of 0 · ∞. We may first convert it to a form
∞
of then apply l’Hospital’s Rule, as shown in the following:
∞
ln x
lim (sin x) ln x = lim+ −1
x→0+ x→0 (sin x)
0
H (ln x)
= lim+ h i0
x→0 −1
(sin x)
x−1
= lim+ −2
− (sin x) · cos x
x→0
sin2 x
= lim+ = 0.
x→0 −x cos x
Remark:
0
We may first convert it to a form of then apply l’Hospital’s Rule, as shown in the
0
following:
sin x
lim+ (sin x) ln x = lim+ −1
x→0 x→0 (ln x)
0
H (sin x)
= lim+ h i0
x→0 −1
(ln x)
cos x
= lim+ −2
x→0− (ln x) · x−1
= lim+ −x ln2 x · cos x .
x→0
We see that the last limit seems more complicated than the original one. This shows
0 ∞
that sometimes it is an art to convert indeterminate form to or in order to
0 ∞
rightfully apply l’Hospital’s Rule.
138 Applications of Differentiation
ln x
Solution Let y = x1/x . If taking logarithm of both sides, we get ln y = ln x1/x = .
x
ln x ∞
Clearly, is form. Applying l’Hospital’s Rule gives
x ∞
ln x H (ln x)0
lim = lim
x→+∞ x x→+∞ (x)0
x−1
= lim = 0.
x→+∞ 1
1
ln 1 −
x ln(1 − z)
lim = lim
x→∞ x−1 z→0 z
0
H [ln(1 − z)]
= lim
z→0 (z) 0
−1
= lim = −1.
z→0 1 − z
ln x • lim+ xx ;
• lim ;
x→1 x − 1 x→0
ex
• lim ; • lim x1/x ;
x→∞ x x→+∞
• lim+ (sin x) ln x;
x→0 x
1
√ √
• lim ( x + 1 − x); • lim 1 − .
x→+∞ x→∞ x
>> syms x ;
>> f = log ( x ) /( x -1) ;
>> limit (f ,x ,1)
ans =
>> f = exp ( x ) / x ;
>> limit (f ,x , inf )
ans =
Inf
ans =
ans =
>> f = x ^ x ;
>> limit (f ,x ,0 , ' right ')
ans =
3.5 Curve Sketching 141
>> f = x ^(1/ x ) ;
>> limit (f ,x , inf )
ans =
>> f = (1 - 1/ x ) ^ x ;
>> limit (f ,x , inf )
ans =
exp ( -1)
2 y y
1 y = cos x 1 1
x x x
−1 O 1 − 21 π O 1
2
π −1 O 1
y=x 2 −1
−1
y = 3x4 − 2x2 − 1
2
142 Applications of Differentiation
F (−a) = F (a) = b,
we know that (−a, b) is also on the graph of F . This means that the graph of every
even function is symmetric with respect to the y-axis.
2. f (x) = x3 , g(x) = cos x, and h(x) = −x5 + 2x3 − x are odd functions.
y y
y
1 1
y = x3 y = sin x 1
x x
−1 O 1 x −1 O 1
− 21 π O 1
2
π
−1 −1
−1
y = −x5 + 2x3 − x
we know that (−a, −b) is also on the graph of F . This means that the graph of every
odd function is symmetric with respect to the origin.
By following the guidelines, you are able to make a sketch that displays the most important
aspects of a given function y = f (x).
A. Domain: Domain D is the set of values of x for which f is defined.
B. Intercepts:
The y-intercept is f (0). The x-intercepts are the real solutions of the equation f (x) = 0.
C. Symmetry:
(i) If f (−x) = f (x) for all x ∈ D, then f is an even function and the curve is symmetric
about the y-axis.
(ii) If f (−x) = −f (x) for all x ∈ D, then f is an odd function and the curve is symmetric
about the origin.
(iii) If f (x + p) = f (x) for all x ∈ D, where p is a positive constant, then f is a
periodic function and the smallest such number p is the period.
D. Asymptotes:
(i) The line y = L is a horizontal asymptote of the curve y = f (x) if either
(ii) The line x = a is a vertical asymptote of the curve y = f (x) if at least one of the
following statements is true:
H. Sketch the Curve: Sketch the curve y = f (x) by using the information in items A-G.
The exact values of solutions can be approximated by using the Intermediate Value Theorem.
In fact, we can obtain the following bounds for the three roots of f :
C. Symmetry: The function f is neither even nor odd, and it is not a periodic function
either.
D. Asymptotes: The function f is defined everywhere and thus has no vertical asymptote.
Since
3 12 1
lim (2x3 − 3x2 − 12x + 1) = lim x3 2 − − 2 + 3 = ±∞,
x→±∞ x→±∞ x x x
the function f does not have any horizontal asymptote either.
E. Intervals of Increase or Decrease: Since
we see that the derivative f 0 has two simple roots x = −1 and x = 2. These two points
divide the interval (−∞, +∞) into three open intervals (−∞, −1), (−1, 2), and (2, +∞). We
solve the inequalities f 0 (x) ≷ 0 by using the number line and know that f 0 is positive on
(−∞, −1), negative in (−1, 2), and positive in (2, +∞). Thus, by the Monotone Test, the
function f is increasing over the intervals (−∞, −1) and (2, +∞), and decreasing over the
interval (−1, 2).
F. Local Maximum and Minimum Values: The roots of f 0 , x = −1 and x = 2, are
critical points of f . The second derivative
f 00 (x) = 12x − 6
gives f 00 (−1) < 0 and f 00 (2) > 0. By the Second Derivative Test, f has a local maximum
value f (−1) = 8 and a local minimum value f (−1) = −19.
G. Concavity and Inflection Points: Since f 00 (x) < 0 when x < 21 , by the Concavity
Test, f is concave down on (−∞, 12 ). Similarly, since f 00 (x) > 0 when x > 21 , f is concave up
on ( 12 , +∞). Thus, x = 12 is an inflection point, with f ( 12 ) = − 11
2 .
H. Sketch the Curve: Use the results obtained in items A-G, we can sketch the graph
of f (x) = 2x3 − 3x2 − 12x + 1.
x
−1 O 2
√ √
It has three simple roots x = − 3, x = 0, and x √= 3. √These three √ points divide
√ the
interval (−∞, +∞) into four open intervals (−∞, − 3), (− 3, 0), (0, 3), and ( 3, +∞).
We solve the
√ inequalities f (x)
00
√ ≷ 0 by using the number
√ line and know √that f 00 is negative
in (−∞, − 3), positive in (− 3, 0), negative in (0, 3), and positive in ( 3, +∞). Thus, by
the Concavity Test, we can have the following table:
This table gives the intervals in which the function is concave up/down and √ the locations of
the inflection points. In fact, the inflection points are at x = 0 and x = ± 3.
H. Sketch the Curve: Use the results obtained in items A-G, we can sketch the graph
x
of f (x) = 2 .
x +1
1
x
y=
x2 + 1
x
−1 O 1
−1
x3
Sketch the function f (x) = .
x2 − 1
x3
A. Domain: The function f (x) = is defined everywhere except ±1, so that the
x2 − 1
domain of f is (−∞, −1) ∪ (−1, 1) ∪ (1, +∞).
B. Intercepts: The y-intercept is f (0) = 0. The x-intercept(s) is the real solutions of the
equation f (x) = 0, that is,
x3
= 0,
x −1
2
which gives the unique solution x = 0. Thus, the curve passes through the x-axis at the
origin.
3.5 Curve Sketching 147
C. Symmetry: Since
(−x)3 x3
f (−x) = = − = −f (x),
(−x)2 − 1 x2 − 1
the function f is odd, so the graph is symmetric about the origin.
The function f is not a periodic function.
D. Asymptotes: Since
x3 x3
lim = lim = −∞,
x→−1− x2 − 1 x→1− x2 − 1
x3 x3
lim = lim = +∞,
x→−1+ x2 − 1 x→1+ x2 − 1
Moreover, by long division, we have
x3 x
=x+ 2 ,
x2 −1 x −1
so that
x3
x
lim − x = lim 2 .=0
x→∞ x2 − 1 x→∞ x − 1
This shows that y = x is a slant asymptote along both infinity directions, i.e., the graph of
f (x) gets closer to the line y = x when x → ∞. We also see that the graph of f is above the
asymptote for x > 0 and below the asymptote for x < 0.
E. Intervals of Increase or Decrease, and
F. Local Maximum and Minimum Values: The derivative f 0 is
x2 (x2 − 3)
f 0 (x) = .
(x2 − 1)2
Its denominator
√ has two
√ double roots at x = ±1, while the numerator has two simple roots
x = − 3 and x = 3, and a double root √ x = 0. √These five points divide the √ inter-
val
√ (−∞, +∞) into six open intervals (−∞, − 3), (− 3, −1), (−1, 0), (0, 1), (1, 3), and
( 3, +∞). We solve the inequalities
√ f 0
(x) ≷ 0 by using the number line and know that f 0
changes its signs only at x = ± 3. By the Monotone Test and the First Derivative Test, we
can have the following table:
interval sign of f 0 monotonicity
√
(−∞,√ − 3) + %
− 3
√ 0 local max
(− 3, −1) − &
−1 not exist
(−1, 0) − &
0 0 no extreme
(0, 1) − &
1√ not exist
(1,√ 3) − &
√ 3 0 local min
( 3, +∞) + %
148 Applications of Differentiation
This table gives the intervals in which the function is monotone and the locations of the local
√ √
extrema. In fact, the local maximum value is f (− 3) = − 3 2 3 and the local minimum value
√ √
is f ( 3) = 3 2 3 .
G. Concavity and Inflection Points: The second derivative f 00 is
2x(x2 + 3)
f 00 (x) = .
(x2 − 1)3
Its denominator has two triple roots at x = ±1, while the numerator has one simple root
x = 0. These three points divide the interval (−∞, +∞) into four open intervals (−∞, −1),
(−1, 0), (0, 1), and (1, +∞). We solve the inequalities f 00 (x) ≷ 0 by using the number line
and know that f 00 changes its signs at x = ±1 and x = 0. By the Concavity Test, we can
have the following table:
The function has one inflection point at x = 0, with f (0) = 0. The other two points x = ±1
are not inflection points, since they are not in the domain of f .
H. Sketch the Curve: Use the results obtained in items A-G, we can sketch the graph
x3
of f (x) = 2 .
x −1
x3
y=
x2 − 1 1
x
−1 O 1
−1
syms x ;
f ( x ) = 2* x ^3 - 3* x ^2 - 12* x + 1;
g ( x ) = x /( x ^2 + 1) ;
subplot (2 ,1 ,2)
x_array2 = linspace ( -3 ,3 ,121) ; % a vector with 121 ...
evenly spaced points from -3 to 3
plot ( x_array2 , g ( x_array2 ) , 'b ')
xlabel ( 'x ')
ylabel ( 'g ( x ) ')
grid
Note that we use different commands to generate vectors for x-axis, but the vectors
generated, i.e., x_array and x_array2, are the same.
The figure plotting f and g is shown below.
0
f(x)
-20
-40
-3 -2 -1 0 1 2 3
x
0.5
g(x)
-0.5
-3 -2 -1 0 1 2 3
x
x3
2. The following example shows the plot of f (x) = using the command fplot.
x2 − 1
syms x ;
f ( x ) = x ^3/( x ^2 - 1) ;
fplot ( f ( x ) )
150 Applications of Differentiation
where fplot(f(x)) plots the figure of f on the default interval [−5, 5] along the x-axis.
The figure of f on [−5, 5] is shown below.
f(x) 0
-2
-4
-6
-5 -4 -3 -2 -1 0 1 2 3 4 5
x
We can see from the figure above that x = −1 and x = 1 are vertical asymptotes of the
curve y = f (x).
Note that we can input the expression of f into fplot directly without the need of
defining a symbolic function beforehand. In this way, f should be input in the form of
an anonymous function. Moreover, we can also specify the interval along the x-axis for
the figure to be plotted. The following example shows this alternative way of using the
command fplot.
2
f(x)
-2
-4
-6
-4 -3 -2 -1 0 1 2 3 4
x
Suppose that x and y are both given as functions of a third variable t (called a parameter)
by the so-called parametric equations:
x = f (t), y = g(t), a ≤ t ≤ b.
As t varies, the point (x, y) = (f (t), g(t)) varies and traces out a curve, which we call a
parametric curve. The points (f (a), g(a)) and (f (b), g(b)) are called the initial point and
terminal point of the curve.
x = cos t, y = sin t, 0 ≤ t ≤ 2π
describe the unit circle. In fact, for each value of t, the corresponding ordered pair (x, y) is
a point on the circle centered at (0, 0) with radius 1. To be more explicit, for some special
values of t, we can generate the following table and the corresponding points (x, y) which are
on the circle.
t (x, y)
0 (1, 0) t= 2 , (0, 1)
π
√ √ √ √
√ √ t= 4 , (− 2 , 2 )
3π 2 2
t= 4,( 2 , 2 )
π 2 2
π
4 ( 2 , 2 )
2 2
π
2 (0, 1) t = π, (−1, 0) t = 0, (1, 0)
√ √ t = 2π, (1, 0)
x
O
3π
4 (− 2 , 2 )
2 2
π (−1, 0)
3π
2 (0, −1) t= 2 , (0, −1)
3π
2π (1, 0)
From the figure, we see that as t increases from the initial value t = 0 to the final value
of t = 2π, the curve is generated from the initial point (1, 0) to the final point (1, 0). The
parametric equations trace out the unit circle in the counterclockwise direction. The initial
point and the final point coincide at the same location.
152 Applications of Differentiation
Suppose a point P starting at the origin on the circumference of a circle of radius r traces
out a curve as the circle rolls along the x-axis. Show that the parametric equations of the
curve are
x = r(t − sin t), y = r(1 − cos t),
where the parameter t is the angle of the rotation of the circle with t = 0 when P is at the
origin.
Solution We take t, the angle of the rotation of the circle, as the parameter. Suppose the
circle has rotated through t radians. From the figure, we see that the distance it has rolled
from the origin is
|OT | = arc P T = rt,
so that the coordinates of the center of the circle is C(rt, r). Let the coordinates of P be
(x, y). Then
r C(rt, r)
P Q
y
x
x
O T 2πr
rt
A curve can have more than one parametrizations. For example, it is easy to verify that
3.6 Parametric Curves 153
x = f (t), y = g(t).
If f and g are differentiable functions, and if f 0 (t) 6= 0, then the chain rule gives the slope of
the tangent line at (x, y) = (f (t), g(t)):
dy dy/dt g 0 (t)
= = 0 .
dx dx/dt f (t)
dy dx
= g 0 (t) = 0, = f 0 (t) 6= 0.
dt dt
dx dy
= f 0 (t) = 0, = g 0 (t) 6= 0.
dt dt
In MATLAB, parametric curves can be plotted using the command plot. The following
examples show the plot of two parametric curves.
1. The parametric equations are
x = cos t, y = sin t, 0 ≤ t ≤ 2π
The parametric curve is plotted using the following code:
0.8
0.6
0.4
0.2
0
y
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
x
x = t − sin t, y = 1 − cos t, 0 ≤ t ≤ 4π
1.8
1.6
1.4
1.2
1
y
0.8
0.6
0.4
0.2
0
0 2 4 6 8 10 12 14
x
3.6 Parametric Curves 155
x = r cos θ, y = r sin θ.
y
Conversely, we can express r and θ in terms
of x and y: θ
x x
O
y
r =x +y ,
2 2 2
tan θ = .
x
The graph of a polar equation r = f (θ), or more generally F (r, θ) = 0, consists of all points
P that have at least one polar representation (r, θ) whose coordinates satisfy the equation.
r = a + bθ, θ ≥ 0,
where a and b are real numbers. Sketch the curve with a = 2 and b = 1.
Solution For θ ≥ 0, in Cartesian coordinates, the equation r = 2 + θ gives a line of slope
1 in the first quadrant, starting from the point (0, 2), as in the following left figure. As θ
increases from 0, it shows that r increases monotonically from 2. It gives a spiral curve, as
shown in the following right figure.
135◦ 45◦
r
150◦ 30◦
◦
165 15◦
180◦ 0◦
2 4 6 8
r =2+θ 195◦ 345◦
◦
210 330◦
2
◦ ◦
225 315
O 1
θ 240◦ 300◦
255◦ 270 ◦ 285◦
Solution The function is periodic of period 23 π, and a full revolution is 2π, so the least
common multiple is 2π. Thus, we sketch r = 2 sin 3θ, 0 ≤ θ ≤ 2π, in Cartesian coordinates
in the following left figure.
(1) As θ increases from 0 to π6 , r increases from 0 to 2; as θ increases from π6 to π3 , r
decreases from 2 to 0. Since r is positive, the curve is in the first quadrant.
(2) As θ increases from π3 to π2 , r decreases further from 0 to −2; as θ increases from π2 to
3 , r increases from −2 to 0. Since r is negative, the curve is in the lower-half plane.
2π
135◦ 45◦
r = 2 sin 3θ ◦
2 150 30◦
Ä Á
165◦ 15◦
À Á Ä Å
1
3π
2
3π
π 2π Å À
θ 180◦ 0◦
O 1 2
 à 195 ◦
345◦
 Ã
−2 210◦ 330◦
225◦ 315◦
240◦ 300◦
255◦ 270◦ 285◦
r = a + b cos θ,
Solution For any given a and b, the function r = a + b cos θ is periodic of period 2π. Since
a full revolution is 2π, we only need to sketch the polar curve for 0 ≤ θ ≤ 2π.
(A) For 0 ≤ θ ≤ 2π, we sketch r = 4 + 4 cos θ in Cartesian coordinates in the following left
figure. As θ increases from 0 to π, it shows that r decreases from 4 to 0. Since r is positive,
the curve is in the upper-half plane. As θ increases from π to 2π, r increases from 0 to 4.
Again since r is positive, the curve is in the lower-half plane. Thus, as θ varies from 0 to 2π,
the curve completes one loop, as shown in the following right figure. This is a cardioid.
3.6 Parametric Curves 157
135◦ 45◦
150◦ 30◦
r = 4 + 4 cos θ À
◦
165 15◦
8
180◦ 0◦
2 4 6 8
À Á 195◦ 345◦
4
Á
◦
210 330◦
◦ ◦
225 315
O π 2π
θ 240◦ 300◦
◦ ◦
255 270◦ 285
(B) For 0 ≤ θ ≤ 2π, we sketch r = 3 + 5 cos θ in Cartesian coordinates in the following left
figure.
(1) As θ increases from 0 to cos−1 (− 35 ) ≈ 2.2143 (rad) ≈ 126.87◦ , r decreases from 8 to 0.
Since r is positive, the curve is in the upper-half plane.
(2) As θ increases from cos−1 (− 53 ) to π, r decreases further from 0 to −3. Since r is
negative, the curve is in the fourth quadrant.
(3) As θ increases from π to 2π − cos−1 (− 53 ) ≈ 4.0689 (rad) ≈ 233.13◦ , r increases from
−2 to 0. Since r is negative, the curve is in the first quadrant.
In fact, when θ varies from cos−1 (− 53 ) to 2π − cos−1 (− 53 ), the curve completes the small
loop.
(4) As θ increases from 2π − cos−1 (− 53 ) to 2π, r increases from 0 to 8, and the curve is in
the lower-half plane.
The curve also completes a large loop, as shown in the following right figure. We get a
limaçon.
r
105◦ 90◦ 75◦
120◦ 60◦
135◦ 45◦
r = 3 + 5 cos θ
150◦ −1
(− 35 )
À 30◦
8 θ = cos
◦
165 15◦
Â
À Ã 180◦ 0◦
4 2 4 6 8
Á
195◦ 345◦
◦
θ = 2π − cos−1 (− 35 )
210 Ã 330◦
O π 2π
θ
Á Â 225◦ 315◦
−2
240◦ 300◦
255◦ 270◦ 285◦
Suppose a polar curve is given by the equation r = f (θ). Then we can write its parametric
equations as
x = r cos θ = f (θ) cos θ, y = r sin θ = f (θ) sin θ.
dx
If f is differentiable, and if = f 0 (θ) cos θ − f (θ) sin θ 6= 0, then the chain rule gives the
dθ
slope of the tangent line at (x, y) = (f (θ) cos θ, f (θ) sin θ):
The parametric curve has a horizontal tangent at (x, y) = (f (θ) cos θ, f (θ) sin θ) if
dy dx
= f 0 (θ) sin θ + f (θ) cos θ = 0, = f 0 (θ) cos θ − f (θ) sin θ 6= 0.
dθ dθ
The parametric curve has a vertical tangent at (x, y) = (f (θ) cos θ, f (θ) sin θ) if
dx dy
= f 0 (θ) cos θ − f (θ) sin θ = 0, = f 0 (θ) sin θ + f (θ) cos θ 6= 0.
dθ dθ
Solution The function r = 3 + 5 cos θ is periodic of period 2π. Since a full revolution is
2π, we only need to determine the highest point for 0 ≤ θ ≤ 2π.
The parametric equations for the limaçon are
dy
Solving = 0 gives
dθ
√ √
cos θ = 20 (−3
1
+ 209) ≈ 0.5728 or 20 (−3
1
− 209) ≈ −0.8728.
Thus, for 0 < θ < 2π, there are four critical points:
√
θ1 = cos−1 201
(−3 + 209) ≈ 0.9608,
√
θ2 = cos−1 201
(−3 − 209) ≈ 2.6318,
√
θ3 = 2π − cos−1 20 1
(−3 + 209) ≈ 3.6514,
√
θ4 = 2π − cos−1 20 1
(−3 − 209) ≈ 5.3224,
The Cartesian coordinates of two endpoints when θ = 0 and θ = 2π coincide at (8, 0). By
comparing the values of the y-coordinates at these five points, we see that the highest point
of the curve attains at (x1 , y1 ), approximately at (3.35926, 4.8067).
135◦ 45◦
150◦ 30◦
θ= cos(− 53 )
165◦ 15◦
180◦ 0◦
2 4 6 8
◦
195 345◦
θ = 2π − cos(− 35 )
210◦ 330◦
225◦ 315◦
240◦ 300◦
255◦ 270◦ 285◦
160 Applications of Differentiation
In MATLAB, the command polarplot facilitates the plot of polar curves. Two examples
are provided below to show how to plot polar curves in MATLAB.
1. The polar curve is described by the following equation:
r = 2 sin 3θ.
This polar curve can be plotted using the following code:
1.5
150 30
1
0.5
180 0 0
210 330
240 300
270
6
150 30
4
180 0 0
210 330
240 300
270
3.7 Optimization 161
3.7 Optimization
3.79 Example: optimization - largest area
John has 120 meters of fencing to build a rectangular fence along a straight river. He needs
to build three sides, and the side along the river does not need fencing. What are the lengths
of sides of the field to have the largest area?
x x
Solution This is a typical example of optimization problems. Its solution involves a few
steps, shown below.
Step 1: Introduce variables.
Let x be the length of the side of the rectangle perpendicular to the river and y be the
length of the other side.
Step 2: Write down the function to be optimized and the constraints on variables. Simplify
the function under the constraints.
(1) We need to maximize the area of the rectangle, which is A = xy.
(2) There are some constraints for variables x and y. Clearly, we must have 2x + y = 120,
or y = 120 − 2x. We also have 0 ≤ x ≤ 60 and 0 ≤ y ≤ 120.
(3) Substitute y = 120 − 2x into the function we need to optimize, we get
A(x) = x(120 − 2x) = 120x − 2x2 ,
where 0 ≤ x ≤ 60.
Step 3: Solve the optimization problem.
This is a problem of finding maximum for the function A(x) = 120x − 2x2 defined in a
finite closed interval [0, 120].
In fact, the function A is continuous on [0, 120] and differentiable in (0, 120). The derivative
of A is
A0 (x) = 120 − 4x.
Solving A0 (x) = 0 gives only one critical point x = 30 in [0, 120]. We can use one of the
following two approaches to determine the absolute maximum value of A in the interval
[0, 120].
(a) We evaluate the function A at two boundary points x = 0 and x = 120 and the critical
point at x = 30:
A(0) = 0 = A(60), A(30) = 30 × 60 = 1800.
By choosing the largest value, we get the absolute maximum value A(30) = 1800.
(b) It is easy to see that
A (x) > 0, if 0 < x < 30;
0
A0 (x) < 0, if 30 < x < 120.
162 Applications of Differentiation
Thus, by the First Derivative Test, the function A has a local maximum value at x = 30.
Since A is increasing on (0, 30), and decreasing on (30, 120), the local maximum value is also
the absolute maximum.
Hence, the function A attains the absolute maximum value A(30) = 1800.
Fermat’s principle says that light travels along the path of shortest traveling time. In the
figure below, we consider a light ray traveling from point A located in one medium to point
B in another medium. The media are separated by the x-axis. Assume that the speed of
light is respectively c1 and c2 in the media. Denote by θ1 the angle of incidence and θ2 the
angle of refraction.
A
θ1
a
d−x
x C
b
θ2
B
d
The total time for light to travel along the path ACB is
T (x) = (time from A to C) + (time from C to B)
√
a2 + x2 b2 + (d − x)2
p
= + .
c1 c2
We shall determine the value of x by applying Fermat’s Principle to minimize the function
T on [0, d].
In fact, the derivative of T is
x d−x
T 0 (x) = √ − p .
c1 a +x
2 2 c2 b + (d − x)2
2
We claim that the equation T 0 (x) = 0 has a unique solution on [0, d]. Indeed, the equation
has a solution by the Intermediate Value Theorem, and
d d
T 0 (0) = − √ < 0, T 0 (d) = √ > 0.
c2 b2 + d2 c1 a2 + d2
The solution is unique since T 0 is increasing on (0, d):
a2 2 b2
T 00 (x) = (a + x2 )−3/2 + (b2 + (d − x)2 )−3/2 > 0.
c1 c2
Let x = x0 be the unique solution of the equation T 0 (x) = 0 on (0, d). The above argument
shows that
T (x) < 0, if 0 < x < x0 ;
0
T 0 (x) > 0, if x0 < x < d.
3.7 Optimization 163
Thus, by the First Derivative Test, the function T has a local minimum at x = x0 . Since
T is increasing on (x0 , d), and decreasing on (0, x0 ), the local minimum is also the absolute
minimum. Hence, along the path ACB when x = x0 , light travels from A to B in the shortest
time.
When x = x0 , the equation T 0 (x0 ) = 0 gives
x0 d − x0
= .
+ b2 + (d − x0 )2
p p
c1 a2 x20 c2
Find points on the parabola y = 12 x2 that is closest to the point (4, 1).
Solution The distance from a point (x, y) on the parabola to the point (4, 1) is
q
d = (x − 4)2 + ( 12 x2 − 1)2 .
We need to minimize the function d. It is equivalent to minimize the function f (x) = d2 (x),
which is computationally easier.
In fact, the derivative f 0 is
0
f 0 (x) = (x − 4)2 + ( 12 x2 − 1)2 = 2(x − 4) + 2( 21 x2 − 1)x = x3 − 8.
By solving f 0 (x) = 0, we see that f has only one critical point x = 2. It is easy to see that
f (x) < 0, if x < 2;
0
f 0 (x) > 0, if x > 2.
Thus, by the First Derivative Test, the function f has a local minimum value at x = 2. Since
f is decreasing on (−∞, 2), and increasing on (2, +∞), the local minimum value is also the
absolute minimum.
2 (2, 2)
1 (4, 1)
x
O 1 2 4
164 Applications of Differentiation
John has 120 meters of fencing to build a rectangular fence along a straight river. He needs
to build three sides, and the side along the river does not need fencing. What are the lengths
of sides of the field to have the largest area?
The following MATLAB code solves the above optimization problem.
>> syms x y S ( x ) ;
>> y = 120 - 2* x ; % the side parallel to the river
>> S ( x ) = x * y ; % area
>> d ( x ) = diff ( S ( x ) ,x )
d(x) =
120 - 4* x
rts_d =
30
150
100
50
S'(x)
-50
-100
-150
0 10 20 30 40 50 60
x
We see from the above MATLAB code that S 0 (x) = 0 has one root: x = 30. Moreover,
we note from the above figure of S 0 (x) that S 0 (x) > 0 on (0, 30) and S 0 (x) < 0 on (30, 60).
According to the First Derivative Test, S(x) has a local maximum value at x = 30. Moreover,
since S 0 (x) > 0 on (0, 30), i.e., S(x) is increasing on (0, 30), and S 0 (x) < 0 on (30, 60), i.e.,
S(x) is decreasing on (30, 60), we know that S(x) also has an absolute maximum value at
3.7 Optimization 165
x = 30. Therefore, to have the largest area, the length perpendicular to the river should be
30 meters, and the side parallel to the river should be 120 − 2 × 30 = 60 meters.
When an external force is applied to a structural element, e.g., beam, and it causes this el-
ement to bend, we say the bending moment is induced. The bending moment is an important
concept in physics and engineering, especially civil and mechanical engineering.
Suppose there is a beam of length L with uniform distributed loading of q per unit length.
At the distance x of the beam, the bending moment M is given by
q qL
M = − x2 + x.
2 2
This is illustrated in the figure below.
x
L
Find the value of x which gives the maximum bending moment and calculate this maximum
bending moment.
First, let f (x) = M = − 2q x2 + qL
2 x (0 ≤ x ≤ L). Then, we have
qL
f 0 (x) = −qx + .
2
It is easy to see that
f 0 (x) > 0, if 0 ≤ x < L2 ;
i.e., S(x) is decreasing on L2 , L , we know that f (x) also has an absolute maximum value at
One piece of metal is provided to build a water tank. For this purpose, four corners of the
metal should be cut, as illustrated in the figure below.
x
3m
6m
Find the value of x such that the volume of the water tank is maximized and calculate the
maximum volume of the water tank.
First, the volume of the water tank can be calculated as follows:
Since 2x < 3, the value of x should satisfy 0 < x < 1.5, which shows that x cannot be 2.336.
We will then check whether x = 0.634 is a maximum point.
The second derivative of V (x) can be easily calculated and shown below:
According to the Second Derivative Test, we know that V (x) has a local maximum value at
x = 0.634. To check whether x = 0.634 is also an absolute maximum point, we rewrite V 0 (x)
as
which means V (x) is increasing on (0, 0.634) and decreasing on (0.634, 1.5). Therefore, x =
0.634 is also an absolute maximum point, i.e., the volume of the water tank is maximized at
x = 0.634 (m). Finally, substituting x = 0.634 into V (x), we have the maximum volume of
the water tank as
In information theory, the entropy refers to the uncertainty or the disorder of an event. If
an event has more uncertainty, then it carries more information and has more entropy.
For a communication system, if it has two inputs 0 and 1 and they occur with probability
p and 1 − p (0 < p < 1), respectively, then the entropy of the source is given by
Find the value of p such that the entropy H(p) is maximized and calculate the maximum
entropy.
By applying the product rule and the chain rule, we have
dH(p) 0 0
= − log2 p − p (log2 p) − (−1) log2 (1 − p) − (1 − p) (log2 (1 − p))
dp
1 −1
= − log2 p − p + log2 (1 − p) − (1 − p)
p ln 2 (1 − p) ln 2
= log2 (1 − p) − log2 p.
According to Fermat’s Theorem, we first calculate the value of p such that dH(p)
dp = 0. It
dH(p)
can be calculated that dp = 0. Moreover, since log2 x is an increasing function, we
p=0.5
notice that when p < 0.5, dH(p)
dp > 0; while when p > 0.5, dH(p)
dp < 0. Therefore, according to
the first derivative test, the entropy H(p) is maximized at p = 0.5.
Substituting p = 0.5 into the expression of H(p), we have
whose x-intercept gives the first approximation x1 , obtained by putting y = 0 in the last
equation:
f (x0 )
0 − f (x0 ) = f 0 (x0 )(x1 − x0 ) =⇒ x1 − x0 = −
f 0 (x0 )
f (x0 )
=⇒ x1 = x0 − 0 .
f (x0 )
f (x1 )
x2 = x1 − .
f 0 (x1 )
f (xn )
xn+1 = xn − .
f 0 (xn )
This recursive formula is called Newton’s iteration and the sequence {xn } generated is
called Newton’s approximations.
y
(x0 , f (x0 ))
(x1 , f (x1 ))
(x2 , f (x2 ))
r
x
O x3 x2 x1 x0
3.8 Newton’s Method 169
Given f (x) = x3 − 5x + 1. Use six steps of Newton’s method to approximate all three real
roots of f .
by the Intermediate Value Theorem, f must have one root in each of the three intervals
(−3, −2), (0, 1), and (2, 3).
Hence, it is plausible to choose the initial guessing values −2.5, 0.5, 2.5 for Newton’s
iterations for approximating the three roots of f .
2. Write the recursive formula of Newton’s method.
For f (x) = x3 − 5x + 1, we have
2x30 − 1 2(−2.5)3 − 1
x1 = = = −2.345455,
3x20 − 5 3(−2.5)2 − 5
2x3 − 1 2(−2.345455)3 − 1
x2 = 12 = = −2.330203,
3x1 − 5 3(−2.345455)2 − 5
..
.
2x34 − 1
x5 = = −2.330059.
3x24 − 5
170 Applications of Differentiation
k xk xk xk
0 −2.500000 0.500000 2.500000
1 −2.345455 0.176471 2.200000
2 −2.330203 0.201568 2.131933
3 −2.330059 0.201640 2.128428
4 −2.330059 0.201640 2.128419
5 −2.330059 0.201640 2.128419
There is a need for a good estimation of the error of the approximation. However,
since the actual value of the root is not know, it is not easy to get the estimation
of the error. The rule of thumb is that if we want n decimal accuracy, we should
compute until two successive approximations agree up to n decimal places.
For a given accuracy, the number of steps of Newton’s iteration can vary. In the
example, if the initial guessing value is x0 = 1.3, then Newton’s approximations are
k xk
0 1.300000
1 48.485718
2 32.346600
.. ..
. .
12 2.128441
13 2.128419
In Newtons’s method, f 0 (xn ) appears in the denominator of the formula. When f 0 (xn ) is
zero, the method breaks down. When f 0 (xn ) is close to zero, the method is slow to converge
to the actual root or may fail to converge.
8x2
Consider f (x) = 2 . Then the recursive formula of Newton’s method is
3x + 1
f (xn ) xn (3x2n + 1) xn
xn+1 = xn − = x n − = (1 − 3x2n ).
f 0 (xn ) 2 2
Clearly the function f has 0 as the only real root. For the following three initial guessing
3.8 Newton’s Method 171
k xk xk xk
0 1.000000 0.150000 1.200000
1 −1.000000 0.069938 −1.992000
2 1.000000 0.034456 10.860575
3 −1.000000 0.017166 −1.92 × 103
4 1.000000 0.008576 1.06 × 1010
5 −1.000000 0.004287 −1.76 × 1030
6 1.000000 0.002143 8.21 × 1090
From the computations, we see that the approximations with the initial guessing values
x0 = 1 and x0 = 1.2 fail to converge.
The following example shows how to calculate the roots of f (x) = x3 − 5x + 1 in MATLAB.
We note that f is a polynomial of degree 3, so it has at most three real roots. To roughly
estimate these roots, we first plot the figure of f as follows.
>> syms x ;
>> f ( x ) = x ^3 - 5* x + 1;
>> x_array = -3:0.05:3;
>> figure
>> plot ( x_array , f ( x_array ) , 'r ')
>> xlabel ( 'x ')
>> ylabel ( 'f ( x ) ')
>> grid
15
10
5
f(x)
-5
-10
-15
-3 -2 -1 0 1 2 3
x
From the figure above, we see that there are 3 roots of f , and these roots are on intervals
(−3, −2), (0, 1) and (2, 3), respectively. Hence, we choose the initial guessing values −2.5,
0.5 and 2.5 for Newton’s iterations for approximating the three roots of f (x).
Next, we use Newton’s method to approximate these three roots of f . The MATLAB code
is provided below.
172 Applications of Differentiation
syms x ;
f ( x ) = x ^3 - 5* x + 1; % function
d ( x ) = diff ( f ( x ) ,x ) ;
n = 5;
N_max = 10; % maximum no . of iterations
x = zeros (1 , N_max ) ;
x0 = - 2.5; % initial guess
x (1) = x0 ;
By inputting different initial guessing values, we can obtain approximations of all three
roots. Moreover, we can have 15-digit approximations by using the command format long.
The Newton’s approximations of all three roots with initial guessing values −2.5, 0.5 and 2.5,
respectively, are listed in the following table.
k xk xk xk
0 −2.500000000000000 0.500000000000000 2.500000000000000
1 −2.345454545454545 0.176470588235294 2.200000000000000
2 −2.330203407719357 0.201568074338339 2.131932773109244
3 −2.330058752527104 0.201639675087802 2.128428202971012
4 −2.330058739567982 0.201639675723405 2.128419063906659
5 2.128419063844577
Note that to ensure the 5 decimal accuracy, it requires the absolute difference of two
successive approximations to be less than 10−6 in the MATLAB code. In this case, the
initial guessing values of −2.5 and 0.5 result in 4 iterations, and the initial guessing value of
2.5 results in 5 iterations.
Consider the case where a ball is thrown with initial velocity u and an angle θ
(0◦ ≤ θ ≤ 90◦ ) against the ground, as shown in the following figure. Then, at time t, the
1
displacement of the ball in the y-direction is sy = u sin θt − gt2 , where g ≈ 9.8 m/s2 is
2
the standard gravity. Suppose that the initial velocity is 40 m/s and the angle against the
ground is 45◦ . Use Newton’s method to calculate the time t at which the ball is 10 meters
3.8 Newton’s Method 173
θ
x
O
When u = 40 m/s and θ = 45◦ , the displacement of the ball in the y-direction is
9.8 2 √
f (t) = 40 sin(45◦ )t − t = 20 2t − 4.9t2 .
2
√
Note that 2 ≈ 1.414, we thus have
f (t) ≈ 28.28t − 4.9t2 .
First, we need to find an initial guessing value x0 . We notice that
f (5) ≈ 18.9 > 10;
We see that three steps are required to achieve 5 decimal accuracy. Moreover, since t3 =
5.393947, we can conclude that at t = 5.393947, the ball is in the falling down stage and is
10 meters above the ground.
MATLAB solution: √
We now turn to the use of MATLAB. Let g(t) = f (t) − 10 = 20 2t − 4.9t2 − 10. We will
run the following MATLAB code of the Newton’s method to calculate the result.
syms t ;
g ( t ) = 20* sqrt (2) * t - 4.9* t ^2 - 10;
d ( t ) = diff ( g ( t ) ,t ) ;
n = 5; % n decimal accuracy
N_max = 10; % maximum no . of iterations
x = zeros (1 , N_max ) ;
x0 = 5.5; % initial guess
x (1) = x0 ;
Starting from the initial guessing value t0 = 5.5, we can obtain approximations of the root
near 5.5. Note that by using the command format long, we can have 15-digit approxima-
tions. The Newton’s approximations are listed in the following table.
k tk
0 5.500000000000000
1 5.396098675752262
2 5.393948136613312
3 5.393947214525773
One piece of metal is provided to build a water tank. For this purpose, four corners of the
metal should be cut, as illustrated in the figure below.
3.8 Newton’s Method 175
3m
6m
By Newton’s method, find the value of x such that the volume of the water tank is 3.5 m3
and the water tank covers the least area on the ground.
First, the volume of the water tank can be calculated as follows:
To find the value of x such that the volume of the water tank V (x) is 3.5 m3 , we actually
need to find x which satisfies 4x3 − 18x2 + 18x = 3.5. Let g(x) = 4x3 − 18x2 + 18x − 3.5.
The derivative of g(x) is
g(xn )
xn+1 = xn −
g 0 (xn )
4x3 − 18x2n + 18xn − 3.5
= xn − n .
12x2n − 36xn + 18
The function g(x) is a polynomial of degree 3, so it has at most three real roots. Since
by the Intermediate Value Theorem, g(x) must have one root in each of the three intervals
(0, 1), (1, 1.5), and (3, 4). Note that 2x < 3, so we have 0 < x < 1.5. Moreover, the area that
the water tank covers on the ground can be written as (6 − 2x)(3 − 2x) which is a decreasing
function of x. Hence, if we are looking for the value of x such that the water tank covers the
least area on the ground, the value of x should be as large as possible, i.e., it is within the
interval (1, 1.5). Therefore, we choose the initial value x0 as 1.25.
Now, we use the recursive formula of Newton’s method to calculate the root of g(x) = 0
176 Applications of Differentiation
within (1, 1.5). From the initial guessing value x0 = 1.25, we have
g(x0 ) g(1.25)
x1 = x0 − = 1.25 − 0
g 0 (x0 ) g (1.25)
−1.3125
= 1.25 − = 1.090909,
−8.25
g(x1 ) g(1.090909)
x2 = x1 − 0 = 1.090909 − 0
g (x1 ) g (1.090909)
−0.092035
= 1.090909 − = 1.077746,
−6.991735
g(x2 ) g(1.077746)
x3 = x2 − 0 = 1.077746 − 0
g (x2 ) g (1.077746)
−0.000863
= 1.077746 − = 1.077620.
−6.860419
We see that three steps are required to achieve 3 decimal accuracy. Moreover, since x3 =
1.077620, we can conclude that the volume of the water tank is 3.5 m3 and the water tank
covers the least area on the ground if x = 1.078 m.
MATLAB solution:
We now turn to the use of MATLAB. Let g(x) = 4x3 − 18x2 + 18x − 3.5. We will run the
following MATLAB code of the Newton’s method to calculate the result.
syms x ;
g ( x ) = 4* x ^3 - 18* x ^2 + 18* x - 3.5;
d ( x ) = diff ( g ( x ) ,x ) ;
n = 3; % n decimal accuracy
N_max = 10; % maximum no . of iterations
x_array = zeros (1 , N_max ) ;
x0 = 1.25; % initial guess
x_array (1) = x0 ;
Starting from the initial guessing value x0 = 1.25, we can obtain approximations of the
root near 1.25. The Newton’s approximations are listed in the following table.
k tk
0 1.250000000000000
1 1.090909090909091
2 1.077745540511498
3 1.077620217678657
4 1.077620206075159
We see that in order to ensure 3 decimal accuracy, 4 iterations are needed if running the
MATLAB code above. At x = 1.077620206075159, i.e., x = 1.078 m, the volume of the water
tank is 3.5 m3 and the water tank covers the least area on the ground.
One piece of metal is provided to build a water tank. For this purpose, four corners of the
metal should be cut, as illustrated in the figure below.
x
3m
6m
By Newton’s method, find the value of x such that the volume of the water tank is maximized.
First, the volume of the water tank can be calculated as follows:
V (x) = (6 − 2x)(3 − 2x)x
= 4x3 − 18x2 + 18x.
The derivative of V (x) is
V 0 (x) = 12x2 − 36x + 18.
To find the value of x such that the volume of the water tank V (x) is maximized, we need
to find x which satisfies V 0 (x) = 12x2 − 36x + 18 = 0, i.e., find the root of V 0 (x) = 12x2 −
36x + 18 = 0. As such, we let f (x) = V 0 (x) = 12x2 − 36x + 18, and the derivative of f (x) is
f 0 (x) = 24x − 36.
Then, the recursive formula of Newton’s method can be written as
f (xn )
xn+1 = xn −
f 0 (xn )
12x2n − 36xn + 18
= xn − .
24xn − 36
178 Applications of Differentiation
Before using Newton’s method to find the value of x, we need to find an initial guessing
value x0 . Hence, we plot the figure of f (x) = V 0 (x), as shown below.
f (x) = V 0 (x)
x
O 1.5
Note that 2x < 3, so we have 0 < x < 1.5. To find the value of x which maximizes V (x),
we need to find the root of V 0 (x) = 0 within the interval (0, 1.5). From the figure of V 0 (x)
above, we notice that there is one root within the interval (0, 1.5) and it is roughly in the
middle of this interval. Thus, we choose the initial guessing value x0 around this root and
set it as 0.75.
Now, we use the recursive formula of Newton’s method to calculate the root of f (x) =
V 0 (x) = 0 within (0, 1.5). From the initial guessing value x0 = 0.75, we have
f (x0 ) f (0.75)
x1 = x0 − = 0.75 − 0
f (x0 )
0 f (0.75)
−2.25
= 0.75 − = 0.625,
−18
f (x1 ) f (0.625)
x2 = x1 − 0 = 0.625 − 0
f (x1 ) f (0.625)
0.1875
= 0.625 − = 0.633928,
−21.0
f (x2 ) f (0.633928)
x3 = x2 − 0 = 0.633928 − 0
f (x2 ) f (0.633928)
0.000968
= 0.633928 − = 0.633974.
−20.785728
We see that three steps are required to achieve 3 decimal accuracy. Moreover, from the
figure of V 0 (x) above, we see that if x is smaller than the root of V 0 (x) within (0, 1.5), then
V 0 (x) > 0, i.e., V 0 (x) is an increasing function; if x is larger than this root, then V 0 (x) < 0,
i.e., V 0 (x) is a decreasing function. So this root is an absolute maximum point. Therefore,
we can conclude that the volume of the water tank is maximized when x = 0.634 (m).
MATLAB solution:
We now turn to the use of MATLAB. Let f (x) = V 0 (x) = 12x2 − 36x + 18. We will run
the following MATLAB code of the Newton’s method to calculate the result.
syms x ;
f ( x ) = 12* x ^2 - 36* x + 18;
d ( x ) = diff ( f ( x ) ,x ) ;
3.8 Newton’s Method 179
n = 3; % n decimal accuracy
N_max = 10; % maximum no . of iterations
x_array = zeros (1 , N_max ) ;
x0 = 0.75; % initial guess
x_array (1) = x0 ;
Starting from the initial guessing value x0 = 0.75, we can obtain approximations of the
root near 0.75. The Newton’s approximations are listed in the following table.
k tk
0 0.750000000000000
1 0.625000000000000
2 0.633928571428571
3 0.633974594992636
We see that 3 iterations are needed to ensure 3 decimal accuracy. Moreover, as explained in
the first part, the root of V 0 (x) within (0, 1.5) is an absolute maximum point. Therefore, we
can conclude that when x = 0.634 (m), the volume of the water tank is maximized.
Remark:
The Newton’s method is utilized to find the root of f (x) = 0 by iteratively approx-
imating the root from an initial guessing value. Hence, any function whose root is
required to be found can be set to be f (x), e.g., V 0 (x) instead of V (x) is set to be
f (x) in this example.
180 Summary
Summary
Definition: basic concepts
Extrema :
absolute maximum : if f (c) ≥ f (x) for all x in D
absolute minimum : if f (c) ≤ f (x) for all x in D
local maximum : if f (c) ≥ f (x) when x is near c
local minimum : if f (c) ≤ f (x) when x is near c
SpecialPoints :
critical point c : either f 0 (c) = 0 or f 0 (c) does not exist
interior point c of D : if there exists (a, b) such that c ∈ (a, b) ⊂ D
inflection point P : at P , f is continuous and changes concavity
Monotonicity :
increasing : if f (x1 ) < f (x2 ) whenever x1 < x2 in (a, b)
decreasing : if f (x1 ) > f (x2 ) whenever x1 < x2 in (a, b)
Concavity :
concave up : if the graph of f is above all its
tangent lines over (a, b)
concave down : if the graph of f is below all its
tangent lines over (a, b)
Let f be a continuous function defined over a finite closed interval [a, b]. Then f (x) has at
least one absolute maximum point and one absolute minimum point in the interval [a, b].
1. Find the critical points and evaluate the values of f at critical points.
2. Evaluate the values of f at the boundary points x = a and x = b.
3. The largest value and smallest value from steps 1 and 2 are the absolute maximum
181
f (b) − f (a)
f 0 (c) =
b−a
or, equivalently,
f (b) − f (a) = f 0 (c)(b − a).
y y
f (b) f (b)
f (a) f (a)
x x
O a c b O a c1 c2 b
Suppose f is differentiable in (a, b). If f 0 (x) = 0 for all x in (a, b), then f is a constant
function.
y y
c x c x
O O
y y
c x c x
O O
Suppose
f (x)
0
4. lim exists or is ∞.
x→a g 0 (x)
Then
f (x) f 0 (x)
lim = lim 0 .
x→a g(x) x→a g (x)
The rule also holds when limits are one-sided limits or when x → a is replaced by x → ∞.
By following the guidelines, you are able to make a sketch that displays the most important
aspects of a given function y = f (x).
A. Domain: Domain D is the set of values of x for which f is defined.
B. Intercepts:
The y-intercept is f (0). The x-intercepts are the real solutions of the equation f (x) = 0.
C. Symmetry:
(i) If f (−x) = f (x) for all x ∈ D, then f is an even function and the curve is symmetric
about the y-axis.
(ii) If f (−x) = −f (x) for all x ∈ D, then f is an odd function and the curve is symmetric
about the origin.
(iii) If f (x + p) = f (x) for all x ∈ D, where p is a positive constant, then f is a
periodic function and the smallest such number p is the period.
D. Asymptotes:
(i) The line y = L is a horizontal asymptote of the curve y = f (x) if either
(ii) The line x = a is a vertical asymptote of the curve y = f (x) if at least one of the
following statements is true:
H. Sketch the Curve: Sketch the curve y = f (x) by using the information in items A-G.
f (xn )
xn+1 = xn − , n = 0, 1, 2, . . .
f 0 (xn )
converges to r:
lim xn = r.
n→∞
CHAPTER
4
Integration
To find the area A of the region bounded by the curve y = f (x) = x2 and the x-axis over
1
[0, 1], we divide the interval [0, 1] into n subintervals of equal length . Let
n
1 2 n−1 n
x0 = 0, x1 = , x2 = , ..., xn−1 = , xn = =1
n n n n
be the endpoints of these subintervals. For each i (1 ≤ i ≤ n), over the i-th subinterval
[xi−1 , xi ], we use the the area of the rectangle with height f (xi ) to approximate the area of
the region between the curve and the x-axis over the interval [xi−1 , xi ].
y y
RSn RS2n
x1 x2 xi−1 xi xn = 1
x 1
x
O O
186 Integration
RSn = f ( n1 ) · n1 + f ( n2 ) · n1 + · · · + f ( nn ) · 1
n
2 2
= n12 + n2 2 + · · · + nn2 · n1
1 n(n + 1)(2n + 1)
= 1 + 2 2 + . . . + n2 · 3 = .
n 6n3
Clearly RSn approximates the area A, and when n get larger, the approximation gets better.
n(n + 1)(2n + 1)
Since lim RSn = lim = 13 , we get A = 13 .
n→∞ n→∞ 6n3
We can similarly choose the left endpoint of each subinterval instead of the right endpoint
to make a new approximation to A. Denote it as LSn . By the same manner, we also get
A = lim LSn = 13 .
n→∞
y y
LSn Sn
x1 x2 xi−1 xi xn = 1
x x1 x2 xi−1 ∗ xi xn = 1
x
O O xi
For any fixed n, if we choose x∗i in the interval [xi−1 , xi ] arbitrarily and use the rectangle
of height f (x∗i ) over the base [xi−1 , xi ] to make approximation, we will get the sum
1
Sn = [f (x∗1 ) + . . . + f (x∗n )] · .
n
Clearly LSn ≤ Sn ≤ RSn . As n → ∞, since both LSn and RSn converge to the same limit
3 , by using a similar argument as the Squeeze Theorem, we get
1
lim Sn = 13 .
n→∞
>> syms x ;
>> f = x ^2;
>> rsums (f ,[0 ,1])
After running the MATLAB code above, the figure shown in the following is generated.
0.332500
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1
10
The figure above displays a graph of f (x) = x2 using 10 rectangles. In other words,
the interval [0, 1] is divided into 10 subintervals. Note that the height of each rectangle
is determined by the value of f (x) = x2 in the middle of each subinterval. In this case,
ˆ 1
x2 dx ≈ 0.332500, which we can see from the top of the figure. Furthermore, we can
0
adjust the number of the rectangles (from 2 to 128) by using the slider below the figure. For
example, if we choose the number of the rectangles to be 80, the graph of f (x) = x2 is shown
below.
ˆ 1
From the figure above, we see that x2 dx ≈ 0.333320 which is closer to the real value
ˆ 1 0
of x2 dx (i.e., 13 ).
0
188 Integration
1 + 2 2 + · · · + n2 .
Here i2 is the general term of the summation. The symbol Σ is the Greek capital letter
Sigma corresponding to our letter ‘S’, and refers to the initial letter of the word ‘Sum’. So
this expression means the sum of all the terms i2 , where i takes the values from 1 to n.
In general, for fixed numbers k and n with k ≤ n, let ai be a number depending on i.
Then the sum ak + ak+1 + · · · + an can be represented in terms of the following sigma sum
notation:
Xn
ai = ak + ak+1 + · · · + an .
i=k
Let f be a function defined over [a, b]. Divide the interval into n subintervals of equal
b−a
length :
n
[x0 , x1 ], [x1 , x2 ], . . . , [xn−1 , xn ].
b−a
Let ∆x = xi − xi−1 = . Choose x∗i in [xi−1 , xi ] for each subinterval. The Riemann sum
n
is
n
X
f (x∗i )∆x.
i=1
The function f is said to be integrable if the limit of the Riemann sum exists and has a
unique limit, i.e.,
Xn
lim f (x∗i )∆x = L
∆x→0
i=1
The function y
cos x, if x ≤ −1;
y = h(x) 2
h(x) = sin x, if −1 < x ≤ 1;
2, if x > 1 1
x
is integrable on [−2, 2] since it is discontin- −2π − 32 π −π − 21 π O
−1
1
1 y
The integrand of the definite integral,
x
ˆ 2
1 1
dx, y=
x
−1 x 1
−1
is continuous everywhere except at x = 0. x
O 2
However, the integral does not exist since
f (x) is not bounded.
1
The function is not integrable on [−1, 2].
x
y = f (x)
+
a +
x
− − b
190 Integration
• Let R be a region. The area of R is the area of the part of R above the x-axis plus
the area of the part of R below the x-axis. If R is bounded by the graph y = f (x) and the
x-axis over the interval [a, b], then the area of the region R is
ˆ b
|f (x)| dx.
a
y y
y = f (x) y = |f (x)|
a
x a
x
b b
ˆ 1 y
2. The integral x dx calculates the net
−1
area of the region between the curve y = x 1
ˆ 1 y
3. The integral x dx calculates the net
−2
area of the region between the curve y = x 1
y=x
and the x-axis over the interval [−2, 1]. −2 −1
The net area is the area of the region in the O 1
x
first quadrant, which is 12 , minus the area
of the region in the third quadrant, which −1
To calculate definite integrals, we can use the commands int and integral. Specifically,
int performs symbolic integration and integral performs numerical integration. The fol-
ˆ 1
lowing example shows the calculation of (1−x2 ) dx using int and integral, respectively.
−1
>> syms x ;
>> f = 1 - x ^2;
>> int (f , -1 ,1)
ans =
4/3
ans =
1.3333
We see from the MATLAB code above that the command int returns a symbolic number
3,while the command integral returns a floating-point number 1.3333. Note that the first
4
input of the command int is a symbolic expression, but the first input of the command
integral should be a function handle.
Besides int and integral, the command quadgk can also be used for numerical integration.
If the integrand is a polynomial, besides int and integral, we can also use the command
ˆ 1
polyint to calculate the integral. The following example shows the calculation of (1 −
−1
x2 ) dx using polyint.
First, we calculate the coefficients of the new polynomial obtained after integration, and
192 Integration
>> p = [ -1 0 1]; % -x ^2 + 1
>> q = polyint ( p ) % coefficients of the polynomial after ...
integration
q =
-0.3333 0 1.0000 0
We see from the MATLAB code above that after integration, the new polynomial is
−0.3333x3 + x. Next, we calculate the values of −0.3333x3 + x at the lower limit −1 and the
upper limit 1, respectively, and obtain the result of the integral using the following code.
q_val =
-0.6667 0.6667
polyint_ans =
1.3333
ˆ 1
The result shows that (1 − x2 )dx = 1.3333. Note that for diff(X),
−1
if the input X is a vector, the command diff(X) returns the result of
[X(2) − X(1), X(3) − X(2), . . . , X(n) − X(n − 1)].
The capacitor is an electrical component that can store electrical energy in an electric field.
Capacitors have been widely used as important parts of electrical circuits in many common
electrical devices. The following figures show a real capacitor and a symbol for the capacitor
in circuits, respectively.
4.1 Areas under Curves 193
V
− +
The energy stored in a capacitor is equal to the work done in establishing the electric
field from an uncharged state by moving charge for the negative to the positive plate of the
capacitor. Mathematically, the energy W stored in a capacitor can be written as a definite
integral, as shown in the following:
ˆ Q
W = V (q) dq,
0
where Q is the total charge stored in the capacitor, q is a variable representing the charge,
and V is the voltage across the capacitor (which is a function of q).
where Kp ≥ 0, Ki ≥ 0 and Kd ≥ 0 are the coefficients for the proportional (P), integral (I),
and derivative (D) terms, respectively, and e(t) is the error value.
Any object that carries charges will experience electrical force created by electrical potential
difference (voltage) in electrical field. The force will drive charges to move orderly in one
direction. Such orderly movement of charges will form current. All electrical devices work
based on the transformation of electrical energy to other types of energy, for example, heat,
light, mechanical energy, etc. The power generated/consumed by a component (battery,
resistor, etc.) is calculated by the product between the voltage across the component and
the current going through the component. Consider a circuit as shown in the following:
194 Integration
i(t) R
−
−
vs (t) C vC (t)
+
+
The power generated by the power source at time t can be obtained by vs (t)i(t), where
vs (t) is the voltage of the source and i(t) is the electric current. As a result, the electrical
energy E provided by the source during T can be calculated as
ˆ T
E= vs (t)i(t) dt.
0
Let f and g be integrable functions over an interval I and let a < b < c be points in I.
1. If f and g are integrable over [a, b], then f + g is integrable over [a, b], and we have
ˆ b ˆ b ˆ b
[f (x) + g(x)] dx = f (x) dx + g(x) dx.
a a a
2. If f is integrable over [a, b], then kf (x) is integrable over [a, b], and we have
ˆ b ˆ b
kf (x) dx = k f (x) dx.
a a
3. If f is integrable over [a, b] and [b, c], then f is integrable over [a, c], and we have
ˆ b ˆ c ˆ c
f (x) dx + f (x) dx = f (x) dx.
a b a
ˆ a
4. f (x) dx = 0.
a
5. If f and g are both integrable over [a, b], and f (x) ≤ g(x), then
ˆ b ˆ b
f (x) dx ≤ g(x) dx.
a a
6. ˆ ˆ
b b
f (x) dx ≤ |f (x)| dx.
a a
4.1 Areas under Curves 195
7. (Mean Value Theorem for Integrals) If f is continuous on [a, b], then there is c ∈
[a, b] such that
ˆ b
f (x) dx = f (c)(b − a).
a
Justification: Part 1
The proof of these properties follows directly from the definition of the definite integral.
Let’s prove the last two statements.
Consider the Riemann sum of the function f for any partition:
which divides the interval [a, b] into n subintervals. For each index i, choose x∗i inside the
subinterval [xi−1 , xi ] and make the Riemann sum
n
X
Rn (f ) = f (x∗i )∆xi ,
i=1
where ∆xi = xi −xi−1 > 0 is the length of the subinterval [xi−1 , xi ]. Using the same partition
and same choice of x∗i , we can also have the Riemann sum of the function |f (x)| ,
n
X
Rn (|f |) = |f (x∗i )|∆xi .
i=1
Justification: Part 2
If f is continuous on [a, b], by the Extreme Value Theorem, the function f can attain its
minimum m and maximum M :
f (c1 ) = m, f (c2 ) = M,
Thus,
ˆ
1 b
f (c1 ) ≤ f (x) dx ≤ f (c2 ).
b−a a
By the Intermediate Value Theorem, there is a number c between c1 and c2 , such that
ˆ
1 b
f (c) = f (x) dx.
b−a a
[0, 1]:
ˆ 1 ˆ 1 ˆ 1 y = 2x + 1
(2x + 1) dx = (2x) dx + 1 dx
0 0 0
ˆ 1 ˆ 1 1
=2 x dx + 1 dx
0 0
x
=2· 1
2 + 1 = 2. O 1
We note that the contributions from the integrals with negative integrands are negative.
Since temperatures fluctuate throughout the day, as well as varying substantially depending
on the locations, the average temperature gives you a more accurate picture of the tempera-
ture in a specific location than a single measurement ever could. For example, knowing the
average temperature of a given week in Hong Kong will certainly help a traveler to prepare
his trip to the city.
The average temperature can be calculated from several temperature measurements using
the formula:
sum of measured temperatures
average temperature = .
number of measurements
198 Integration
For instance, for calculating the average temperature on January 1, 2019, one may first
measure temperature every hour in Central, Hong Kong to get a dataset of 24 temperatures.
Then using the formula above, one may obtain an approximation of the average temperature.
Apparently, increasing the number of measurements should get a better result in reflecting
Hong Kong’s temperature situation on the New Year Day.
Justification:
To compute the average value of a function y = f (x) on [a, b], we start by dividing
the interval [a, b] into n equal subintervals, each with length ∆x = (b − a)/n. Then we
choose points x∗1 , . . . , x∗n in successive subintervals and calculate the average of the numbers
f (x∗1 ), . . . , f (x∗n ):
f (x∗1 ) + · · · + f (x∗n )
.
n
Since n = (b − a)/∆x, the average value becomes
f (x∗1 ) + · · · + f (x∗n ) 1
= [f (x∗1 )∆x + · · · + f (x∗n )∆x]
(b − a)/∆x b−a
n
1 X
= f (x∗i )∆x,
b − a i=1
so that ˆ
n
1 X 1 b
lim f (x∗i )∆x = f (x) dx.
n→∞ b − a b−a a
i=1
The perihelion is the shortest distance from a planet to the Sun, and aphelion is the longest
distance. The Sun is at one of the two foci. For the Pluto, the perihelion is 4.44 billion km
and the aphelion is 7.38 billion km.
4.1 Areas under Curves 199
2 2
x y
2
+ 2 = 1, Pluto
a b
d
where 0 < b < a.√ It is known that the foci
x
are located at (± a2 − b2 , 0). √
Let us assume Sun a
Then the distance from the Pluto, located at (x, y), to the Sun is
q p
d = (x − a2 − b2 )2 + y 2
s
x2
p
= (x − a − b ) + b 1 − 2
2 2 2 2
a
r 2
p
= a−1 a2 − a2 − b2 x
p p
= a−1 a2 − a2 − b2 x . a2 > a2 − b2 x for −a ≤ x ≤ a
The signal we get from the wall socket is from the power plant. This signal fluctuates in
terms of both the magnitude and the direction, we thus call it “Alternating Current (AC)
signal”. Specifically, the voltage provided by the AC signal can be formulated as
v −
v(t) R R
+
As we said, in practice, we use the AC signal, as shown in the left figure. Assume that
the AC signal provides power PAC for the resistance R. Can we find an equivalent Direct
Current (DC) signal, as shown in the right figure, which provides power PDC for R such that
PDC = PAC ?
In order to answer this question, we first need to calculate the power PAC . Let the period
of the AC signal be denoted by T . Based on Ohm’s law, the calculation is shown below:
ˆ ˆ
1 T
v 2 (t) 1 T
PAC = dt = v02 sin2 (ωt) dt
T 0 R TR 0
ˆ T ˆ ˆ !
1 2 1 − cos(2ωt) 1 v02 T v02 T
= v dt = dt − cos(2ωt)dt
TR 0 0 2 TR 2 0 2 0
1 v02 1 v02 1 v2
T
= − sin(2ωt) = 0.
R 2 T 2 2ω 0 2R
For the DC circuit in the right figure, based on Ohm’s law, the power provided for R can
be calculated as
v2
PDC = .
R
If PDC = PAC , we have
v2 v2 v0
= 0 ⇒ v = √ ≈ 220 (V).
R 2R 2
Therefore, the “220 volts” is a DC equivalent voltage such that the DC signal provides the
same power as the AC signal v(t) = 311 sin (100πt).
4.2 Fundamental Theorem of Calculus 201
Justification: Part 1
Since f is continuous over [a, b], it has an absolute maximum and an absolute minimum
over [a, b], and thus it is bounded, i.e., there exists B such that |f (x)| ≤ B for all x in [a, b].
Let c be a point in [a, b]. Let x be an arbitrary point and assume x > c. By the properties
of integration, we have
ˆ x ˆ c ˆ x
|A(x) − A(c)| = f (t) dt − f (t) dt = f (t) dt
ˆ ax ˆa x c
Thus when x → c+ , by the Squeeze Theorem, lim+ |A(x) − A(c)| = 0, i.e., lim+ A(x) = A(c).
x→c x→c
By the same argument, we get lim A(x) = A(c). Therefore we conclude that lim A(x) =
x→c− x→c
A(c), i,e., A is continuous at c.
To show that f is differentiable in (a, b), we assume c is any point in (a, b). Without loss
of generality, assume x > c. We write:
ˆ x ˆ c ˆ x
A(x) − A(c) − f (c)(x − c) = f (t) dt − f (t) dt − f (c) dt
ˆax ˆax c
= f (t) dt − f (c) dt
ˆc x c
Let M (x) be the maximum value of the function |f (t) − f (c)| over the interval between c and
x, i.e.,
|f (t) − f (c)| ≤ M (x) for all t between c and x.
202 Integration
It depends on x. Since f (x) is continuous, M (x) goes to zero as x goes to 0. Thus we get
ˆ x
f (t) − f (c)
A(x) − A(c)
− f (c) = dt
x−c c x−c
ˆ x
f (t) − f (c)
≤ x − c dt properties of integrals
c
ˆ x
M (x)
≤ dt the order rule
c x−c
M (x)
= (x − c) = M (x),
x−c
which goes to zero as x goes to 0. Thus
A(x) − A(c) A(x) − A(c)
lim − f (c) = 0, i.e. lim = f (c).
x→c x−c x→c x−c
Justification: Part 2
b−a
Partition the interval [a, b] with n subintervals of equal length . By the Mean Value
n
Theorem, there exists x∗i in [xi−1 , xi ] such that
b−a
F (xi ) − F (xi−1 ) = F 0 (x∗i )(xi − xi−1 ) = f (x∗i ) · .
n
Then, we take the Riemann sum of the function f on [a, b]:
n n
X b−a X
f (x∗i ) · = [F (xi ) − F (xi−1 )] = F (xn ) − F (x0 ) = F (b) − F (a).
i=1
n i=1
Evaluate ˆ ˆ ˆ
1 π 1
x2 dx, sin x dx, and ex dx.
0 0 0
Solution
4.2 Fundamental Theorem of Calculus 203
1 3 0
1. Since = x2 , by the Fundamental Theorem of Calculus, we have
3x
ˆ 1
1 3 1
x2 dx = = 13 .
3x 0
0
1. Find the net area of the region between the graph of f (x) = x2 − 1 and the x-axis over
[−2, 2].
2. Find the area of the region between the graph of f (x) = x2 − 1 and the x-axis over
[−2, 2].
Solution The area of the region equals the sum of the area of the region above the
x-axis and the area of the region below the x-axis.
We need to find the intervals over which f does not change its sign. Solve
x2 − 1 = 0 =⇒ x = 1 or x = −1.
Thus f (x) is positive over [−2, −1], negative over [−1, 1], and positive over [1, 2]. Thus,
204 Integration
+ 31 (23 ) − 2 − 13 (13 ) − 1
= 44
3 .
y y
3 3
y = x2 − 1 y = |x2 − 1|
1 1
O x x
−2 −1 1 2 −2 −1 O 1 2
−1 −1
1. We can use directly the Fundamental Theorem of Calculus to compute the first integral:
ˆ x
d
sin t2 dt = sin x2 .
dx 0
ˆ u
2. Here we need to apply the chain rule of differentiation. If we let f (u) = sin t2 dt
1
and u = g(x) = x2 , we get
ˆ x2
sin t2 dt = f g(x) .
1
4.3 Indefinite Integrals 205
1
The computation is incorrect because the integrand is not defined at x = 0 which is a
x2
point in [−1, 2]. In fact, if one uses Riemann sum to approximate this integral, the limit of
the Riemann sum diverges.
4.27 Remark:
From the Fundamental Theorem of Calculus, in order to calculate a definite integral
ˆ b
f (x) dx,
a
it is important to know a function F (x) whose derivative is f (x), i.e., F 0 (x) = f (x). This
leads to the concept of indefinite integral, equivalently, antiderivative.
F 0 (x) = f (x).
Solution We know that (x2 )0 = 2x and (x2 + 1)0 = 2x. In fact, for any constant C,
(x + C)0 = 2x.
2
We know from the Mean Value Theorem that zero derivative implies constant function.
Thus, any differentiable function F with F 0 (x) = 2x must differ from x2 at most by a
constant. Hence, by the definition of indefinite integral, we have
ˆ
2x dx = x2 + C.
Justification:
The equalities follow from the linearity of differentiation.
ˆ ˆ
dx
10. = sec2 x dx = tan x + C
cos2 x
ˆ ˆ
dx
11. = csc2 x dx = − cot x + C
sin2 x
ˆ
12. sec x tan x dx = sec x + C
ˆ
13. csc x cot x dx = − csc x + C
Justification:
For formula 1, it is easy to see that (kx + C)0 = k for any constant C. We know from the
Mean Value Theorem that zero derivative implies constant function. Thus, any differentiable
function F with F 0 (x) = k must differ from kx at most by a constant. Hence, by the definition
of indefinite integral, we have ˆ
k dx = kx + C.
= x + C1 + x2 + C2 = x + x2 + C1 + C2 .
If s(t) is the displacement function, then v(t) = s0 (t) is the velocity function from the
definition of derivatives.
Conversely, if we are given the velocity function v(t), then the indefinite integral
ˆ
v(t) dt
A particle moves on a line with the velocity at time t, v(t) = t2 − t − 6 (measured in meters
per second).
1. Find the displacement function of the particle as a function of the time t. Assume the
particle is at the position of the origin when time t = 0.
Solution Let f be the displacement function of the particle satisfying f (0) = 0. Since
f 0 (t) = v(t), in order to find f , we just need to calculate the indefinite integral
ˆ ˆ
f (t) = v(t) dt = (t2 − t − 6) dt = 31 t3 − 12 t2 − 6t + C.
ˆ 4
Solution This amounts to calculate the definite integral |v(t)| dt.
1
To do so, we need to find intervals where v has the same sign. In fact, let v(t) = 0, we
get
t2 − t − 6 = 0 =⇒ (t − 3)(t + 2) = 0 =⇒ t = 3 or t = −2.
It is easy to see that v(t) is positive on (−∞, −2), negative on (−2, 3), and positive on
(3, ∞). Therefore the distance traveled during the time period 1 ≤ t ≤ 4 is
ˆ 4 ˆ 3 ˆ 4
|v(t)| dt = − v(t) dt + v(t) dt
1 1 3
3 4
=− 1 3
3t − 12 t2 − 6t 1 + 1 3
3t − 21 t2 − 6t 3 = 61
6 .
>> syms x ;
210 Integration
>> f = x ^ n ;
>> int (f , x )
ans =
piecewise ( n == -1 , log ( x ) , n 6= -1 , x ^( n + 1) /( n + 1) )
>> syms t ;
>> g = t ^2 - t - 6;
>> m = int ( g )
m =
-( t *( - 2* t ^2 + 3* t + 36) ) /6
m_cl =
t ^3/3 - t ^2/2 - 6* t
Or, if we let u = x2 , then we get du = (x2 )0 dx = 2x dx, and the integral can be rewritten as
ˆ ˆ ˆ
2 2 2
2xex dx = ex 2x dx
| {z } = eu du = eu + C = ex + C.
du
Justification:
It follows directly from the chain rule for differentiation. Let F (x) be a function whose
derivative is f (x), i.e., F 0 (x) = f (x). Equivalently, we have
ˆ
f (u) du = F (u) + C.
d dF (u) 0
F g(x) = · g (x) = f (u) · g 0 (x) = f g(x) · g 0 (x),
dx du
or equivalently
ˆ ˆ
d
f g(x) · g 0 (x) dx = F g(x) dx
dx
= F g(x) + C = F (u) + C u = g(x)
ˆ
= f (u) du.
√
2. We can also make the following substitution u = x + 1. Then x = u2 − 1 and
dx = 2u du. Thus, we have
ˆ
x
√ dx
x+1
ˆ 2
u −1 √
= 2u du u = x + 1, dx = 2u du
u
ˆ
= (2u2 − 2) du simplifying
= 23 u3 − 2u + C evaluating
√ √
= 23 (x + 1)3 − 2 x + 1 + C. replacing u by x+1
p
From this example, we see that there might be more than one way to make substitution.
Let u = g(x), where g 0 (x) is continuous on [a, b], and let f be continuous on an interval
containing the range of g. Then
ˆ b ˆ g(b)
f g(x) · g 0 (x) dx = f (u) du.
a g(a)
Evaluate ˆ π
2
sin3 x cos x dx.
0
Solution If we let u = sin x, then
The electrical power can be supplied to business and homes by the electrical power industry
through electrical power grids, and it can be converted into other forms of energy, such as
heat, light and motion. The amount of power produced in a circuit is related to the electric
current, the voltage, etc.
In particular, in the case of an alternating current (AC) circuit with Ohmic resistive loads,
the Ohm’s law can be combined, and thus the electrical power during one time period (0, T )
is given by
ˆ T
R
P = i2 (t)dt,
T 0
du = ωdt.
dv = 2du.
1 2 1 2 1
P = A R− A R sin (4π) = A2 R.
2 8π 2
The hazard function provides the instantaneous failure rate of a component at time t.
Mathematically, the hazard function h(t) can be defined as the ratio of the probability density
function f (t) and the complementary cumulative distribution function R(t) of the lifetime of
a component, i.e.,
f (t)
h(t) = .
R(t)
Note that R(t) can be calculated in terms of f (t) as follows:
ˆ t
R(t) = 1 − f (u)du,
0
√
Suppose that the probability density function of a component is f (t) = 2√ 1
t
e− t
. Find
h(t).
In order to calculate h(t), we first calculate the integral in the denominator:
ˆ ˆ
t
1 t
1 √
f (u)du = √ e− u du.
0 2 0 u
√
Let v = u, then
1
dv = √ du.
2 u
√ √
When u = 0, v = 0 = 0; when u = t, v = t. We thus have
ˆ t ˆ √
t
f (u)du = e−v dv
0 0
√t √
= − e−v 0 = 1 − e− t .
Substituting the above result into the expression of h(t) and after some algebraic manipu-
lations, we have
1
h(t) = √ .
2 t
Trigonometric Substitutions
√
4.44 Example: integrals involving a2 − x2
In order to remove the radical in the integrals, we use the following trigonometric substi-
tution for integrals involving a2 − x2 . Let x = a sin θ. Then dx = a cos θ dθ, and when x = 0,
216 Integration
θ = 0; when x = a, θ = π2 . Hence,
ˆ ap
4 a2 − x2 dx
0
ˆ π
2 p
=4 a2 − a2 sin2 θ · a cos θ dθ making substitution x = a sin θ
0
ˆ π
2
=4 a cos θ · a cos θ dθ using 1 − sin2 θ = cos2 θ
0
ˆ π
2
= 4a 2
2 (1
1
+ cos 2θ) dθ using the double-angle formula
0
π
= 2a2 θ + sin 2θ 0
1
evaluating
2
2
= 2a π
+ 0 = πa2 . simplifying
2
2
√
4.46 Example: integrals involving x2 − a2
Solution In order to remove the radical in the integrals, we use the trigonometric substi-
tution x = sec θ. Then we have
Thus
ˆ ˆ
dx sec θ tan θ
= dθ substituting x = sec θ
(x2 1)3 tan3 θ
p
−
ˆ
cos θ
= dθ simplifying
sin2 θ
ˆ
1
= du substituting u = sin θ
u2
1
=− +C evaluating
u
1
=− +C changing the variable from u to θ
sin θ
x
= −√ + C. changing the variable from θ to x
x2 − 1
Here we use the following diagram to convert
the variable from θ to x: x √
x2 − 1
√
x2 − 1
sin θ = . θ
x 1
√
4.47 Example: integrals involving a2 + x2
ˆ
dx
Evaluate the integral .
(1 + x2 )2
Let u(x) and v(x) be differentiable functions of x. The product rule of differentiation gives
that
(uv)0 = u0 v + uv 0 .
Rewrite the expression as
uv 0 = (uv)0 − u0 v.
ˆ
As an example, consider the integral xex dx. If we let
u(x) = x, v 0 (x) = ex ,
then, for the latter, we may choose v = ex . From the equality uv 0 = (uv)0 − u0 v, we get
ˆ
xex dx
ˆ ˆ
= x(e ) dx = u(x)v 0 (x) dx
x 0
u = x and v = ex
ˆ h i
0
= u(x)v(x) − u0 (x)v(x) dx applying the product rule
ˆ
= u(x)v(x) − u0 (x)v(x) dx definition of indefinite integral
ˆ
= xex − ex dx
= xex − ex + C.
or ˆ ˆ
u dv = uv − v du.
Justification:
By the product rule of differentiation, we get
(uv)0 = u0 v + uv 0 =⇒ uv 0 = (uv)0 − u0 v.
or equivalently ˆ ˆ
u dv = uv − v du.
By further applying the Fundamental Theorem of Calculus, we get the formula of integra-
tion by parts for definite integral.
We obtain
ˆ
e2x sin x dx
ˆ ˆ
= e2x (− cos x)0 dx = u(x)v 0 (x) dx u = e2x and v = − cos x
ˆ h i
0
= u(x)v(x) − u0 (x)v(x) dx applying the product rule
ˆ
= u(x)v(x) − u0 (x)v(x) dx definition of indefinite integral
ˆ
= e (− cos x) − (− cos x)2e2x dx
2x
ˆ
= −e2x cos x + 2 e2x cos x dx.
ˆ ˆ
By comparing the last integral e2x cos x dx with the original integral e2x sin x dx,
we see that integration by parts converts the sine function to the cosine function in the
220 Integration
integrands. This motivates us to apply integration by part once more to the integral
ˆ
e2x cos x dx.
We obtain
ˆ
e2x cos x dx
ˆ ˆ
= e (sin x) dx =
2x 0
u(x)v 0 (x) dx u = e2x and v = sin x
ˆ h i
0
= u(x)v(x) − u0 (x)v(x) dx applying the product rule
ˆ
= u(x)v(x) − u0 (x)v(x) dx definition of indefinite integral
ˆ
= e2x sin x − sin x · 2e2x dx
ˆ
= e sin x − 2 e2x sin x dx.
2x
Now we see the resulting integration on the right hand side is more complicated than the
original one. Thus we made a wrong choice of u and v.
Instead, if we let u = x and v = ex , we get
ˆ ˆ
xe dx = x(ex )0 dx
x
ˆ
= xex − ex dx = xex − ex + C.
In many cases, integration by parts can be used to yield recursive formula for integrals, so
that some complicated integrals can be evaluated through simpler integrals.
ˆ π2
Consider the integral Ip = cosp x dx.
0
For p > 1, if taking u(x) = cosp−1 x and v(x) = sin x, we integrate by parts to have
ˆ π
2
Ip = cosp−1 x · (sin x)0 dx
0
ˆ π
π 2
= cosp−1 x · sin x 02 − sin x · (p − 1) cosp−2 x · (− sin x) dx
0
ˆ π
2
= (p − 1) (1 − cos2 x) cosp−2 x dx
0
= (p − 1)Ip−2 − (p − 1)Ip .
Therefore, we have
ˆ π
2 2n − 1 2n − 1 2n − 3
cos2n x dx = I2n = I2n−2 = · I2n−4
0 2n 2n 2n − 2
2n − 1 2n − 3 1
= ··· = · · · · I0
2n 2n − 2 2
(2n − 1)(2n − 3) · · · 1 π
= ·
2n(2n − 2) · · · 2 2
(2n)! · π
= 2n+1 ;
2 (n!)2
ˆ π
2 2n 2n 2n − 2
cos2n+1 x dx = I2n+1 = I2n−1 = · I2n−3
0 2n + 1 2n + 1 2n − 1
2n 2n − 2 2
= ··· = · · · · I1
2n + 1 2n − 1 3
(2n)(2n − 2) · · · 2
= ·1
(2n + 1)(2n − 1) · · · 3
22n (n!)2
= .
(2n + 1)!
1. Assume p = −1. In this case, we use the substitution method. We take u = ln x. Then
du = x−1 dx. Thus,
ˆ ˆ
x−1 ln x dx = u du = 12 u2 + C = 12 ln2 x + C.
4.5 Integration by Parts 223
The inductor is a two-terminal electrical component that can store energy in a magnetic
field and is characterized by its inductance. The inductance is defined as the ratio of the
voltage to the rate of the change of the electric current. Mathematically, the inductance L is
defined as
v(t)
L = di(t)
dt
where v(t) is the voltage across the inductor and i(t) is the electric current through the
inductor.
Alternatively, according to the fundamental theorem of calculus, the electric current
through the inductor i(t) can be calculated as follows:
ˆ
1 t
i(t) = v(u)du.
L 0
Suppose that L = 5 × 10−3 (H) and v(t) = 3te−t (V), find i(t).
First, we know that
ˆ t
3
i(t) = × 103 ue−u du.
5 0
Integrating by parts, the integral above can be solved as
ˆ t ˆ t
0
ue dt = −
−u
u e−u du
0 0
ˆ t
−u t
= − ue 0
+ e−u du
0
t
= −te−t − e−u 0
= 1 − e−t − te−t .
Therefore, the electric current through the inductor is
i(t) = 600 1 − e−t − te−t (A).
224 Integration
Trigonometric Integrals
1. Calculate ˆ
sin 2x cos 3x dx.
sin α cos β = 1
2 [sin(α − β) + sin(α + β)] ,
we have
ˆ ˆ
sin 2x cos 3x dx = 1
2 (− sin x + sin 5x) dx
= 1
2 cos x − 1
10 cos 5x + C.
2. Calculate ˆ
cos 4x cos x dx.
cos α cos β = 1
2 [cos(α − β) + cos(α + β)] ,
we have
ˆ ˆ
cos 4x cos x dx = 1
2 (cos 3x + cos 5x) dx
= 1
6 sin 3x + 1
10 sin 5x + C.
For evaluating
ˆ ˆ ˆ
sin mx cos nx dx, sin mx sin nx dx, cos mx cos nx dx,
sin α cos β = 1
2 [sin(α − β) + sin(α + β)]
sin α sin β = 1
2 [cos(α − β) − cos(α + β)]
cos α cos β = 1
2 [cos(α − β) + cos(α + β)]
4.6 Some Common Integrals 225
The capacitor is a two-terminal electronic component that can store electrical energy in an
electric field. The electric power is the rate (per unit time) at which the electrical energy is
transferred by an electric circuit. Hence, to calculate the energy that is stored in a capacitor,
we can calculate the electric power of the capacitor first. In particular, the instantaneous
electric power of the capacitor Pc (t) can be calculated by
where ic (t) is the electric current through the capacitor at time t and vc (t) is the voltage
across the capacitor at time t. Then, the energy stored in a capacitor during the time interval
(0, Tc ) is given by
ˆ Tc ˆ Tc
Wc = Pc (t)dt = ic (t)vc (t)dt.
0 0
Suppose that the voltage across a capacitor with capacitance C and zero energy storage
at time 0 is vc (t) = A sin (ωt), where A is the amplitude and ω is the angular frequency.
Calculate Wc which is the energy stored during the time interval (0, Tc ).
First, the electric current through the capacitor can be calculated as
Let u = cos (ωt), then we have du = −ω sin (ωt) dt. Moreover, when t = 0, u = 1; when
t = Tc , u = cos (ωTc ). So we can get
ˆ cos(ωTc ) ˆ 1
Wc = −CA u du = CA udu
1 cos(ωTc )
2 1
= CA = 12 CA 1 − cos2 (ωTc )
1
2 u cos(ωTc )
= 2 CA sin (ωTc ) .
1 2
1. Calculate ˆ
sin2 x cos x dx.
Solution We apply the substitution method and let u = sin x. Then we have du =
226 Integration
= 13 u3 + C = 1
3 sin3 x + C.
2. Calculate ˆ
sin3 x cos2 x dx.
= 15 u5 − 13 u3 + C = 1
5 cos5 x − 1
3 cos3 x + C.
3. Calculate ˆ
sin2 x cos2 x dx.
= 18 (1 − cos 4x).
Thus,
ˆ ˆ
sin2 x cos2 x dx = 8 (1
1
− cos 4x) dx
= 18 x − 1
32 sin 4x + C.
substitute u = sin x.
3. When m and n both even nonnegative integers: use half-angle identities to transform
the integrand into a polynomial in terms of cos 2x, and apply previous strategies.
where R is rational in sin x and cos x. Then the universal trigonometric substitution
t = tan( 21 x) or x = 2 tan−1 t
Justification:
so that
1 1
sec x = =
cos x 2 cos2 ( 12 x) − 1
1 1 + t2
= = .
1 1 − t2
2· − 1
1 + t2
It is easy to have
2
dt = 1
sec2 ( 12 x) dx or dx = dt.
2 1 + t2
Thus, by applying the substitution rule, we get
ˆ ˆ
1 + t2 2
sec x dx = · dt
1 − t2 1 + t2
ˆ
2
= dt. rational integrand
1 − t2
For the last integral, we write the integrand as its form of the partial fraction decomposition:
2 1 1
= + .
1 − t2 1−t 1+t
Hence,
ˆ ˆ
1 1
sec x dx = + dt
1−t 1+t
= − ln |1 − t| + ln |1 + t| + C
1 + tan( 21 x)
= ln
+ C.
1 − tan( 1 x)
2
4.6 Some Common Integrals 229
Rational Functions
It seems a mystery to have the identity. However, there is an algorithm to derive this,
as demonstrated below.
Step 1 Factorize the denominator:
x2 − x − 2 = (x − 2)(x + 1).
2x − 1 = (A + B)x + A − 2B =⇒ A + B = 2, A − 2B = −1
=⇒ A = 1, B = 1.
For an improper rational function P (x)/Q(x), where P and Q are polynomials with deg P ≥
deg Q, one can use long division to reduce it to the form
P (x) R(x)
= S(x) + ,
Q(x) Q(x)
where S(x) and R(x) are polynomials and R(x)/Q(x) is a proper rational function with
deg R < deg Q. Hence, for integrating rational functions, it is essential to integrate proper
rational functions.
For any proper rational function, we can integrate it by using partial fractions in one of
the four cases:
1. The denominator Q has only distinct real roots.
In this case, we write
Q(x) = A(x − λ1 )(x − λ2 ) · · · (x − λk ).
In this case, a proper rational function R(x)/Q(x) can be expressed as
R(x) A1 A2 Ak
= + + ··· + .
Q(x) x − λ1 x − λ2 x − λk
For each fraction, we can make a substitution t = x − λ to integrate:
ˆ ˆ
1 1
dx = dt = ln |t| + C.
x−λ t
2. The denominator Q is a product of linear factors and some of them are repeated.
A1
Suppose the function (x−λ) is repeated r times. Then instead of the single term ,
x−λ
one needs to use the form
A1 A2 Ar
+ + ··· + .
x − λ (x − λ) 2 (x − λ)r
1
For each fraction of the form , we can make a substitution to integrate. In
(x − λ)m
fact, if m = 1, we can integrate the fraction as in Case 1. If m > 1, by making the
substitution t = x − λ, we get
ˆ ˆ
1 1 t−m+1
dx = dt = + C.
(x − λ)m tm −m + 1
4.6 Some Common Integrals 231
3. The denominator Q contains irreducible quadratic factors and none of them is repeated.
Suppose x2 + ax + b is an irreducible quadratic factor, with a2 − 4b < 0. Then the
partial fraction for the proper rational function R(x)/Q(x) will have a term of the form
Ax + B
x2 + ax + b
whose integration can be re-written as
ˆ ˆ
Ax + B 1
+ a) + (B − 12 aA)
2 A(2x
dx = dx
x + ax + b
2 x2 + ax + b
ˆ 1
2 A(x + ax + b) + (B − 2 aA)
2 0 1
= dx
x2 + ax + b
ˆ 1 ˆ
2 A(x + ax + b) (B − 21 aA)
2 0
= dx + dx.
x2 + ax + b x2 + ax + b
For the last two integrals on the right-hand side, they can be compute by using different
substitution. In fact, for the first integral, by using the substitution t = x2 + ax + b, it
can be reduced to ˆ
dt
= ln |t| + C;
t
for the second integral, by using the substitution t = x + 21 a, we can reduce the last
integral to the form ˆ
1 1
t
dt = tan −1
+ C.
t2 + α 2 α α
In fact, if m = 1, we can integrate the fraction as in Case 3. If m > 1, the first integral
on the right-hand side, by using the substitution t = x2 + ax + b, it can be reduced to
ˆ
dt 1
=− + C;
t m (m − 1)tm−1
232 Integration
for the second integral, by using the substitution t = x + 12 a, we can reduce it to the
form ˆ
1
dt.
(t2 + α2 )m
By integrating by parts, we have
ˆ
1
dt
(t + α2 )m−1
2
ˆ
t
= 2 − t · (−m + 1)(t2 + α2 )−m · 2t dt
(t + α2 )m−1
ˆ
t
= 2 + 2(m − 1) (t2 + α2 )−m (t2 + α2 − α2 ) dt
(t + α2 )m−1
ˆ
1 α2
t
= 2 + 2(m − 1) − 2 dt.
(t + α2 )m−1 (t2 + α2 )m−1 (t + α2 )m
ˆ
x6
1. Calculate the integral dx.
+1
x2
x6
Solution The integrand 2 is an improper rational function. By long division, we
x +1
have
x6 −1
= (x2 − x + 1) + 2 .
x +1
2 x +1
−1
The denominator x2 + 1 is an irreducible quadratic polynomial, so the term 2 is
x +1
in the form of partial fraction already. Hence,
ˆ ˆ
x6
−1
dx = (x 2
− x + 1) + dx
x2 + 1 x2 + 1
ˆ ˆ
1
= (x2 − x + 1) dx − dx
x2 + 1
= 31 x3 − 12 x2 + x − tan−1 x = C.
4.6 Some Common Integrals 233
ˆ
2x2 + 1
2. Calculate the integral dx.
(x + 1)(x − 1)3
Solution We express the proper rational integrand as its partial fraction decomposition:
2x2 + 1 A1 B1 B2 B3
= + + + .
(x + 1)(x − 1) 3 x + 1 x − 1 (x − 1) 2 (x − 1)3
So,
x = −1 : 3 = A1 · (−2)3 =⇒ A1 = − 83 ;
x=1: 3 = B3 · 2 =⇒ B3 = 32 ;
differentiating then x = 1 : 4 = B2 · 2 + B3 =⇒ B2 = 45 ;
coefficients of x3 : 0 = A1 + B 1 =⇒ B1 = 83 .
Thus, we have the partial fraction decomposition:
2x2 + 1 1 1 1 1
= − 38 · + 3
· + 5
· + 3
· .
(x + 1)(x − 1) 3 x+1 8 x−1 4 (x − 1)2 2 (x − 1)3
Hence,
ˆ
2x2 + 1
dx
(x + 1)(x − 1)3
ˆ
1 1 1 1
= − 38 · +3· + 5
· +2·
3
dx
x+1 8 x−1 4 (x − 1)2 (x − 1)3
1 1
= − 83 ln |x + 1| + 3
ln |x − 1| − 5
· −3· + C.
8 4 x − 1 4 (x − 1)2
ˆ
x
3. Calculate the integral dx.
x3 + 1
Solution We express the proper rational integrand as its partial fraction decomposition:
x x A1 B1 x + C1
= = + .
x3 + 1 (x + 1)(x2 − x + 1) x + 1 x2 − x + 1
So,
x = −1 : −1 = A1 · 3 =⇒ A1 = − 31 ;
x=0: 0 = A1 + C1 =⇒ C1 = 13 ;
coefficients of x2 : 0 = A1 + B 1 =⇒ B1 = 31 .
234 Integration
x 1 1
x + 13
= − 13 · + 23 .
x3 +1 x+1 x −x+1
Note that (x2 − x + 1)0 = 2x − 1, so we further write the integrand as
1 6 (2x − 1) + 2
1 1
x
= − 1
· + .
x3 + 1 3 x+1 x2 − x + 1
Hence,
ˆ
x
dx
x3 + 1
ˆ
1 6 (2x − 1) + 2
1 1
= 1
−3 · + dx
x+1 x2 − x + 1
ˆ
dx
= − 31 ln |x + 1| + 16 ln(x2 − x + 1) + 12 .
x2 − x + 1
The last integral can be integrated as
ˆ ˆ
dx dx
= completing square
x −x+1
2 (x − 12 )2 + 43
ˆ
q
4 sec t dt
3 2 q
= x − 1 = 4 tan t
3
3
sec 2t
ˆ q 4
= 3 dt
4
q q q
= 43 t + C = 43 tan−1 43 (x − 1) + C.
Therefore,
ˆ
x 2x − 1
dx = − 13 ln |x + 1| + 1
ln(x2 − x + 1) + √1 tan−1 √ + C.
x3 +1 6 3 3
ˆ
x2 + 1
4. Calculate the integral dx.
x4 + 1
Solution The denominator x4 + 1 can be factored as a product of irreducible quadratic
factors:
Thus, we can express the proper rational integrand as its partial fraction decomposition:
x2 + 1 A1 x + B 1 A2 x + B 2
= √ + √ .
x4 + 1 x − 2x + 1 x + 2x + 1
2 2
4.6 Some Common Integrals 235
So,
x=0: 1 = B1 + B2 ;
coefficients of x3 : 0 = A1 + A2 ;
√ √
coefficients of x : 0 = A1 + 2B1 + A2 − 2B2 ;
√ √
coefficients of x2 : 1 = B1 + 2A1 + B2 − 2A2 .
A1 = 0, A2 = 0, B1 = 12 , B2 = 21 .
x2 + 1 1 1
= √2 + √2 .
x +1
4
x2 − 2x + 1 x2 + 2x + 1
Since
ˆ ˆ
dx dx
√ = completing square
x2 − 2x + 1 (x − √1 )2
2
+ 1
2
ˆ √1 sec t dt2
2
= x− √1 = √1 tan t
2 sec t
1 2 2 2
ˆ
√
= 2 dt
√ √ √
= 2t + C = 2 tan−1 ( 2x − 1) + C,
similarly, ˆ
dx √ √
√ = 2 tan−1 ( 2x + 1) + C,
x2 − 2x + 1
Therefore,
ˆ
x2 + 1 √ √
dx = √1 tan−1 ( 2x − 1) + √1 tan−1 ( 2x + 1) + C.
x4 + 1 2 2
For integrating rational functions, one important step is to perform the partial fraction
decomposition for the rational functions. In MATLAB, the partial fraction decomposition
can be executed by using the command partfrac. The following MATLAB code shows how
2x2 + 1
to perform the partial fraction decomposition for the rational functions and
(x + 1)(x − 1)3
236 Integration
x
, respectively.
x3 + 1
>> syms x
>> f ( x ) = (2* x ^2 + 1) /(( x + 1) *( x - 1) ^3) ;
>> partfrac ( f ( x ) ,x )
ans =
>> g ( x ) = x /( x ^3 + 1) ;
>> partfrac ( g ( x ) ,x )
ans =
( x /3 + 1/3) /( x ^2 - x + 1) - 1/(3*( x + 1) )
´ Based
2x2 +1
on the above
´ xresults of the partial fraction decomposition, the integrals of
(x+1)(x−1) 3 dx and x3 +1 dx can be solved by utilizing some integration methods such
as the substitution method.
Or, one can use the Riemann sum of middle points. In fact, if we let
x0 + x1 1 x1 + x2 3 xn−1 + xn 2n − 1
x∗1 = = , x∗2 = = , . . . , x∗n = =
2 2n 2 2n 2 2n
be the middle points of each subinterval, then the Riemann sum of middle points is
1
Mn = [f (x∗1 ) + f (x∗2 ) + · · · + f (x∗n )] · .
n
For instance, if one takes n = 10, the approximation gives:
ˆ 1
2
ex dx ≈ M10 = f ( 20 ) + f ( 20 ) + · · · + f ( 19
20 ) ·
1 3
1
10
0
= e0.0025 + e0.0225 + · · · + e0.9025 · 0.1
≈ 1.460393.
Or one can approximate the region under the graph of the function f on [xi−1 , xi ] by a
trapezoidal region, equivalently, the average of Riemann sums of left end points and right
end points:
Ln + Rn 1
Tn = = [f (x0 ) + 2f (x1 ) + · · · + 2f (xn−1 ) + f (xn )] .
2 2n
Let f be integrable function over [a, b]. Divide the interval [a, b] into n equal subintervals
b−a (n − 1)(b − a)
x0 = a, x1 = a + , . . . , xn−1 = a + , xn = b.
n n
• The left point rule is the Riemann sum y
of left end points of f on [a, b]. The re-
gion under the graph of the function f on
[xi−1 , xi ] is approximated by a rectangle.
ˆ b
f (x) dx ≈ Ln
a
x
b−a x0 x1 xi−1 xi xn
= [f (x0 ) + f (x1 ) + · · · + f (xn−1 )] · .
n left point rule
238 Integration
b−a
= [f (x0 ) + 2f (x1 ) + · · · + 2f (xn−1 ) + f (xn )] · . trapezoidal rule
2n
Each subinterval has length 0.25. The values at the partition points are
Then we get the approximate values of the integral I according to various rules
≈ 0.782794.
If we double the number of partition points by taking n = 8, then the length of each
subinterval is 0.125, and we have
i xi yi x̄i ȳi
0 0 1.000000
1 0.125 0.984615 0.0625 0.996109
2 0.250 0.941176 0.1875 0.966038
3 0.325 0.876712 0.3125 0.911032
4 0.500 0.800000 0.4375 0.839344
5 0.625 0.719101 0.5625 0.759644
6 0.750 0.640000 0.6875 0.679045
7 0.875 0.566372 0.8125 0.602353
8 1.000 0.500000 0.9375 0.532225
We may compare the approximate values with the actual value in the following table.
1. Both midpoint rule and trapezoidal rule produce better approximation as n increases.
2. Generally, the error of the midpoint rule is about half of the error of the trapezoidal
rule.
Let f be integrable function over [a, b]. For an even integer n, divide the interval [a, b] into
n equal subintervals
b−a (n − 1)(b − a)
x0 = a, x1 = a + , . . . , xn−1 = a + , xn = b.
n n
4.7 Numerical Approximation of Integrals 241
ˆ b
Simpson’s rule is the approximation to the integral f (x) dx:
a
ˆ b
b−a
f (x) dx ≈ Sn = · [f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + · · ·
a 3n
+2f (xn−2 ) + 4f (xn−1 ) + f (xn )] .
Justification:
(1) Let us first derive a formula for the area under a parabola of equation y = ax2 + bx + c
passing through the three points (−h, y0 ), (0, y1 ), and (h, y2 ).
y The area is
ˆ h
y = ax2 + bx + c
(0, y1 ) (h, y2 ) A= (ax2 + bx + c) dx
−h
h
= + 12 bx2 + cx
1 3
(−h, y0 ) 3 ax x=−h
= 2
3 ah
3
+ 2ch = 13 h(2ah2 + 6c).
x
−h O h
(2) Since the parabola passes through (−h, y0 ), (0, y1 ), and (h, y2 ), we have
y0 = a(−h)2 + b(−h) + c,
y1 = c,
y2 = ah2 + bh + c.
A = 31 h(y0 + 4y1 + y2 ).
This formula shows that the area under the parabola depends only on the values of y0 , y1 , y2 ,
and h. It is clear that shifting this parabola horizontally does not change the area under it.
ˆ b
(3) For an integral f (x) dx, we divide [a, b] into an even number n of subintervals of
a
b−a
equal length ∆x = by using n + 1 points
n
x0 = a, x1 = a + ∆x, x2 = a + 2∆x, ..., xn = a + n∆x = b.
For each consecutive pair of subintervals, we apply the area under the parabola. Adding all
242 Integration
ˆ
b K(b − a)5
f (x) dx − Sn ≤ .
180n4
a
S2n = 13 Tn + 32 Mn .
3. The error of Simpson’s rule is smaller than the error in the trapezoidal rule. In other
words, Simpson’s rule generally yields a better result in evaluating integrals.
Ln = 0;
a = 0; % interval start
b = 1; % interval end
n = 4; % number of subintervals
itv = ( b - a ) / n ; % subinterval length
In the MATLAB code above, the interval [0, 1] is partitioned into 4 subintervals. After
executing the above MATLAB code, the result can be seen by typing Ln in the command
window, as shown in the following.
>> Ln
Ln =
0.8453
Rn = 0;
a = 0; % interval start
b = 1; % interval end
n = 4; % number of subintervals
itv = ( b - a ) / n ; % subinterval length
y = 1./(1 + x .^2) ;
In the MATLAB code above, the interval [0, 1] is partitioned into 4 subintervals. After
executing the above MATLAB code, the result can be seen by typing Rn in the command
window, as shown in the following.
>> Rn
Rn =
0.7203
Mn = 0;
a = 0; % interval start
b = 1; % interval end
n = 4; % number of subintervals
itv = ( b - a ) / n ; % subinterval length
In the MATLAB code above, the interval [0, 1] is partitioned into 4 subintervals. After
executing the above MATLAB code, the result can be seen by typing Mn in the command
window, as shown in the following.
>> Mn
Mn =
4.7 Numerical Approximation of Integrals 245
0.7867
In MATLAB, the command trapz can be used to compute the approximation of an integral
using the trapezoidal rule.
ˆ 1 The following MATLAB code shows an example of how to use
dx
trapz to approximate .
0 1 + x2
T4 =
0.7828
In the MATLAB code above, the interval [0, 1] is partitioned into 4 subintervals of equal
length 0.25. Note that if there is only one input in trapz, i.e., the command is written as
trapz(y), then the length of the subinterval (or the gap between two neighbouring points)
will be set to the default value 1.
Sn = 0;
a = 0; % interval start
b = 1; % interval end
n = 4; % even number of subintervals
itv = ( b - a ) / n ; % subinterval length
In the MATLAB code above, the interval [0, 1] is partitioned into 4 subintervals. After
executing the above MATLAB code, the result can be seen by typing Sn in the command
window, as shown in the following.
246 Integration
>> Sn
Sn =
0.7854
The error function is an important function in statistics, applied mathematics, physics, etc.
For example, it is useful in determining the bit error rate (BER) of a digital communication
system. The error function is defined as
ˆ x
2 2
erf(x) = √ e−t dt.
π 0
Use the left point rule, the right point rule, the midpoint rule, the trapezoidal rule and the
Simpson’s rule, respectively, to approximate erf(3).
First, erf(3) can be written as
ˆ
2 3
2
erf(3) = √ e−t dt.
π 0
[0, 0.3], [0.3, 0.6], [0.6, 0.9], [0.9, 1.2], [1.2, 1.5],
[1.5, 1.8], [1.8, 2.1], [2.1, 2.4], [2.4, 2.7], [2.7, 3].
2
Each subinterval has length 0.3. Let y = f (t) = √2 e−t .
π
The values of y = f (t) at the
partition points are
y0 = 1.128379167095513, y1 = 1.031260909618963,
y2 = 0.787243431714287, y3 = 0.501968574240363,
y4 = 0.267344347003539, y5 = 0.118930289223629,
y6 = 0.044191723332011, y7 = 0.013715649999807,
y8 = 0.003555648680878, y9 = 0.000769924759855,
y10 = 0.000139253051947,
where yi denotes the value of y = f (t) at the ith partition point. Then we get the approximate
values of erf(3) according to various rules. In particular, by the left point rule, the right point
4.7 Numerical Approximation of Integrals 247
rule, the trapezoidal rule and the Simpson’s rule, respectively, we have
9
X
L10 = 0.3 yi = 1.169207899700653,
i=0
10
X
R10 = 0.3 yi = 0.830735925487584,
i=1
9
0.3 X
T10 = (yi + yi+1 ) = 0.999971912594118,
2 i=0
0.3
S10 = (y0 + 4y1 + 2y2 + 4y3 + · · · + 2y8 + 4y9 + y10 )
3
= 0.999977011297936.
Before using the midpoint rule to approximate erf(3), we first need to get the middle points
of each interval:
x∗1 = 0.15, x∗2 = 0.45, x∗3 = 0.75, x∗4 = 1.05, x∗5 = 1.35,
x∗6 = 1.65, x∗7 = 1.95, x∗8 = 2.25, x∗9 = 2.55, x∗10 = 2.85.
Actually, the exact value of erf(3) can be calculated by MATLAB using command erf, as
shown below:
y =
We may compare the approximate values with the actual value in the following table.
error n = 10
y − Ln −0.169229990197652
y − Rn 0.169241984015417
y − Tn 5.996908883365570 × 10−6
y − Sn 8.982050653250084 × 10−7
y − Mn −2.898565637621253 × 10−6
1
Consider the area of the graph of the function f (x) = above the x-axis over the interval
x2
[1, +∞). Since the interval [1, +∞) is unbounded, we can consider the area over a finite
interval [1, T ], and let T get larger and larger to approximate the required area. We need to
calculate ˆ T T
1 1 1
2
dx = − =1− T.
1 x x 1
Thus the required area is
ˆ T
1 1
lim dx = lim 1− = 1.
T →+∞ 1 x2 T →+∞ T
We can use the following notation to denote this area, called an improper integral
ˆ ˆ
+∞
1 T
1
dx = lim dx.
1 x2 T →+∞ 1 x2
1
If we want to know the area of the graph of the function f (x) = above the x-axis over
x
the interval [1, +∞), we need to calculate the improper integral
ˆ ˆ
+∞
1 T
1
dx = lim dx = lim (ln T − 1) = +∞.
1 x T →+∞ 1 x T →+∞
We say the improper integral is convergent if the limit exists, otherwise divergent.
Similarly, we define ˆ ˆ
a a
f (x) dx = lim f (x) dx.
−∞ b→−∞ b
ˆ ∞ ˆ a
If f (x) dx and f (x) dx are convergent, then we define
a −∞
ˆ ∞ ˆ a ˆ ∞
f (x) dx = f (x) dx + f (x) dx,
−∞ −∞ a
b −1
x
O
y = xex
−1
ˆ 0
By definition, we first calculate the definite integral xex dx on a finite interval. From
b
integration by parts, we have
ˆ 0 ˆ 0 ˆ 0
0 0
xex dx = x d(ex ) = xex |b − ex dx = −beb − ex |b = −beb − 1 + eb .
b b b
Thus, ˆ 0
xex dx = lim (−beb − 1 + eb ) = −1.
−∞ b→−∞
250 Integration
y
y = cos x
1
b
x
O
−1
ˆ 0
By definition, we first calculate the definite integral cos x dx on a finite interval. From
b
integration by parts, we have
ˆ 0
0
cos x dx = sin x|b = − sin b.
b
Thus, ˆ 0
cos x dx = − lim sin b,
−∞ b→−∞
y y
1 x 1
y y== cos
(p > 1) y= (0 < p < 1)
xp xp
1 1
b
x x
O 1 b O 1 b
ˆ b
1
By definition, we first calculate the definite integral dx on a finite interval:
1 xp
ˆ b
b
1 x1−p b1−p 1
dx = = − .
1 xp 1−p 1 1−p 1−p
4.8 Improper Integrals 251
Thus,
ˆ +∞
1 b1−p 1 1
dx = lim − = , when p > 1;
1 xp b→+∞ 1−p 1−p p−1
ˆ +∞
1 b1−p 1
dx = lim − = ∞, when p < 1.
1 xp b→+∞ 1−p 1−p
So, when p > 1, the given improper integral is convergent; when p < 1, it is divergent.
We say the improper integral is convergent if the limit exists, otherwise divergent.
c 1
x
O
y = xex
−1
ˆ 1
By definition, we first calculate the definite integral ln x dx on [c, 1]. From integration
c
by parts, we have
ˆ 1 ˆ 1
1 1
ln x dx = x ln x|c − 1 dx = −c ln c − x|c = −c ln c − 1 + c.
c c
Thus, ˆ 1
ln x dx = lim (−c ln c − 1 + c) = −1.
0 c→0
Here we used l’Hospital’s Rule and had lim (−c ln c) = 0. Hence, the given improper integral
c→0
is convergent to −1.
y y
1 1
c x x c x x
O 1 O 1
4.8 Improper Integrals 253
ˆ 1
By definition, we first calculate the definite integral xp dx on [c, 1]:
c
ˆ 1
1
xp+1 1 cp+1
x dx =
p
= − .
c p+1 c p+1 p+1
Thus,
ˆ 1
1 cp+1 1
xp dx = lim − = , when −1 < p < 0;
0 c→0 p+1 p+1 p+1
ˆ 1
1 cp+1
x dx = lim
p
− = +∞, when p < −1.
0 c→0 p+1 p+1
So, when −1 < p < 0, the given improper integral is convergent; when p < −1, it is
divergent.
1
This is incorrect since the integral is an improper integral, for being unbounded near
x
0 ∈ [−1, 1].
We could write a sum of two improper integrals
ˆ 1 ˆ 0 ˆ 1
1 1 1
dx = dx + dx.
−1 x −1 x 0 x
One may naively calculate the improper integral as limits of the following definite integrals,
for b > 0,
ˆ −b ˆ
1 1
1 −b 1
dx + dx = ln |x|−1 + ln |x|b = ln b − ln 1 + ln 1 − ln b = 0.
−1 x b x
So, one might conclude that the improper integral is zero. In fact, this is a wrong answer
again.
The correct way is to apply the definition. For each of the two improper integrals,
ˆ 0 ˆ 1
1 1
dx and dx,
−1 x 0 x
254 Integration
one should first evaluate the corresponding definite integral. Indeed, for −1 < a < 0 and
0 < b < 1, one gets
ˆ a ˆ 1
1 1 a 1
dx + dx = ln |x| + ln |x| = ln |a| − ln 1 + ln 1 − ln b.
−1 x b x −1 b
Clearly when a →ˆ 0 and b → 0, the expression above diverges. Therefore, the original
1
1
improper integral dx is divergent.
−1 x
Similar results also hold for other types of improper integrals.
Let f and g be continuous over [a, +∞) and 0 ≤ f (x) ≤ g(x). Then
ˆ +∞ ˆ +∞
1. If g(x) dx converges, then f (x) dx converges.
a a
ˆ +∞ ˆ +∞
2. If f (x) dx diverges, then g(x) dx diverges.
a a
1 + sin x 2
2
≤ 2, 2
x x
and
ˆ +∞ we know the improper integral 2
1 y=
2 x2
2
dx converges, the improper integral
x 1 + sin x
ˆ1 +∞ y=
1 + sin x x2
x x
dx converges. O 1
1 x2
In MATLAB, the commands integral, quadgk and int support calculating improper
integrals over infinite intervals, i.e., the input which specifies theˆ interval of the integral can
0
be -Inf or Inf. The following example shows the calculation of xex dx using integral,
−∞
quadgk and int, respectively.
4.8 Improper Integrals 255
integral_ans =
-1
quadgk_ans =
-1.0000
>> syms t
>> f ( t ) = t * exp ( t ) ;
>> int_ans = int ( f ( t ) ,- Inf ,0)
int_ans =
-1
Note that the first input of the commands integral and quadgk should be a function handle,
and the first input of the command int is a symbolic expression.
For convergent improper integrals with unbounded integrands, we can use the commands
integral, quadgk and int to calculate the results. The following example shows the calcu-
ˆ 1
lation of x−0.5 dx in MATLAB.
0
integral_ans =
2.0000
quadgk_ans =
2.0000
>> syms t
>> f ( t ) = t ^( -0.5) ;
>> int_ans = int ( f ( t ) ,0 ,1)
256 Integration
int_ans =
>> syms t
>> f ( t ) = 1/ t ;
>> int_ans = int ( f ( t ) , -1 ,1)
int_ans =
NaN
>> f ( t ) = t ^( -2) ;
>> int_ans = int ( f ( t ) ,0 ,1)
int_ans =
Inf
ˆ 1 ˆ 1
1 1
It shows that the result of dx is NaN, i.e., Not-a-Number, which means dx is
x x
ˆ 1 −1
ˆ 1 −1
divergent. The result of x−2 dx is Inf, i.e., ∞, which also means x−2 dx is divergent.
0 0
where f (x) is in the time domain, and fˆ(ξ) is in the frequency domain.
The Fourier transform decomposes a function in the time domain into the frequency-
domain components which make it up. It allows us to analyze a signal in the time domain
from a different perspective, i.e., in the frequency domain. The Fourier transform has wide
applications in communication engineering, differentiation equation analysis area, quantum
mechanics, etc. For example, the Fourier transform is used to help with the deduction of
noise in a communication system. Moreover, the Fourier transform can facilitate the analysis
of partial differential equations.
4.8 Improper Integrals 257
The Laplace transform takes a function of a real variable t (e.g., time) to a function of
a complex variable s (e.g., frequency). Mathematically, the Laplace transform f (s) of an
integrable function f (t) (ξ ∈ R+ ) is defined as follows
ˆ ∞
ˆ
f (s) = f (t)e−st dt,
0
where f (t) is in the time domain, and f (s) is in the frequency domain.
Similar to the Fourier transform, the Laplace transform provides an alternative way of
analyzing a signal in the time domain, i.e., in the frequency domain. The Laplace transform
has been widely used in engineering and physics. For example, the Laplace transform has
been used to analyze the linear time-invariant system in control theory by transforming the
convolution to a multiplication which is easier to solve due to the algebraic form. Another
important application of the Laplace transform is to solve partial differential equations, which
has been extensively used in mechanical engineering and electrical engineering. In particular,
the Laplace transform can turn a linear differential equation to an algebraic equation which
can be easily solved by the formal rules of algebra, and the original linear differential equation
can then be solved using the inverse Laplace transform.
Alternatively, H(x) can also be defined as an integral of the Dirac delta function δ(s),
which is provided as follows:
ˆ x
H(x) = δ(s) ds
−∞
if x ≤ 0;
x,
δ(s) =
sin x, if x > 0,
ˆ ∞
and δ(s) ds = 1.
−∞
In communication theory, sum of the unit-step functions can be used for representations
of waveforms. Moreover, the unit-step response, which is the time behaviour of the output
of a general system when its input is a unit-step function, can be used to describe the
characteristics of a system and is thus widely used in electronic engineering and control
theory.
258 Integration
The function produced by convolution, i.e., (f ? g)(t), shows how the shape of one function
(e.g., f (t)) is modified by the other one (e.g., g(t)). The continuous-time convolution has
wide applications in probability, statistics, signal processing and many other engineering
areas. For example, the convolution is an important computation tool to characterize the
linear time invariant (LTI) systems.
The integrator is a device whose output signal is the time integral of its input signal. It is
an important part in many engineering and scientific applications, such as signal processing
circuits and mechanical engineering devices.
In signal processing area, block diagrams are commonly seen to illustrate the signal flow
paths. One example is shown below, where the quadrate block represents an integrator.
ˆ
x(t) y(t)
Given that the input signal is x(t) and the output signal is y(t), then the integrator
represents the following integral:
ˆ t
y(t) = x(τ ) dτ.
−∞
259
Summary
Let f and g be integrable functions over an interval I and let a < b < c be points in I.
1. If f and g are integrable over [a, b], then f + g is integrable over [a, b], and we have
ˆ b ˆ b ˆ b
[f (x) + g(x)] dx = f (x) dx + g(x) dx.
a a a
2. If f is integrable over [a, b], then kf (x) is integrable over [a, b], and we have
ˆ b ˆ b
kf (x) dx = k f (x) dx.
a a
3. If f is integrable over [a, b] and [b, c], then f is integrable over [a, c], and we have
ˆ b ˆ c ˆ c
f (x) dx + f (x) dx = f (x) dx.
a b a
ˆ a
4. f (x) dx = 0.
a
5. If f and g are both integrable over [a, b], and f (x) ≤ g(x), then
ˆ b ˆ b
f (x) dx ≤ g(x) dx.
a a
6. ˆ ˆ
b b
f (x) dx ≤ |f (x)| dx.
a a
7. (Mean Value Theorem for Integrals) If f is continuous on [a, b], then there is c ∈
[a, b] such that
ˆ b
f (x) dx = f (c)(b − a).
a
260 Summary
Let u = g(x), where g 0 (x) is continuous on [a, b], and let f be continuous on an
interval containing the range of g. Then
ˆ b ˆ g(b)
f g(x) · g 0 (x) dx = f (u) du.
a g(a)
or ˆ ˆ
u dv = uv − v du.
Let f be integrable function over [a, b]. Divide the interval [a, b] into n equal subintervals
b−a (n − 1)(b − a)
x0 = a, x1 = a + , . . . , xn−1 = a + , xn = b.
n n
• The left point rule is the Riemann sum of left end points of f on [a, b]:
ˆ b
b−a
f (x) dx ≈ Ln = [f (x0 ) + f (x1 ) + · · · + f (xn−1 )] · .
a n
262 Summary
• The right point rule is the Riemann sum of right end points of f on [a, b]:
ˆ b
b−a
f (x) dx ≈ Rn = [f (x1 ) + f (x2 ) + · · · + f (xn )] · .
a n
• The trapezoidal rule is the average of Riemann sum of left end points and right end
points:
ˆ b
b−a
f (x) dx ≈ Tn = [f (x0 ) + 2f (x1 ) + · · · + 2f (xn−1 ) + f (xn )] · .
a 2n
The region under the graph of the function f on [xi−1 , xi ] is approximated by a trape-
zoid.
• The midpoint rule is the Riemann sum of middle points of f on [a, b]:
ˆ b
b−a
f (x) dx ≈ Mn = [f (x∗1 ) + f (x∗2 ) + · · · + f (x∗n )] · ,
a n
xi−1 + xi
where x∗i = .
2
• Simpson’s rule is the following approximation
ˆ b
b−a
f (x) dx ≈ Sn = · [f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 )
a 3n
+ · · · + 2f (xn−2 ) + 4f (xn−1 ) + f (xn )] ,
ˆ
b K(b − a)5
f (x) dx − Sn ≤ .
180n4
a
Let f and g be continuous over [a, +∞) and 0 ≤ f (x) ≤ g(x). Then
ˆ +∞ ˆ +∞
1. If g(x) dx converges, then f (x) dx converges.
a a
ˆ +∞ ˆ +∞
2. If f (x) dx diverges, then g(x) dx diverges.
a a
5
Applications of Integration
ˆ b
x=a
x
[f (x) − g(x)] dx.
a y = g(x)
1
Find the area of the closed region bounded by the graphs of the functions f (x) =
x2 + 1
and g(x) = 21 .
Find the area of the closed region bounded by the graphs of the functions f (x) = x + 2
and g(x) = |x| over the interval [−2, 1].
is not the area of the region bounded by the curves over [−2, 1]. This is because that neither
f (x) ≥ g(x) hold over the whole interval [−2, 1], nor g(x) ≥ f (x) over the whole interval.
Hence, we need to determine the interval(s) over which f (x) ≥ g(x) and f (x) ≤ g(x),
respectively.
In general, the area between the curve y = f (x) and y = g(x) over [a, b] is
ˆ b
|f (x) − g(x)| dx.
a
sin x = cos x
y = sin x
and get x = π4 . We know that sin x ≤ cos x x
when 0 ≤ x ≤ π4 ; sin x ≥ cos x when π4 ≤ x ≤ O π
4
π
2
x2 + y 2 = r 2 , (x − r)2 + y 2 = r2
x=r− x=
p p
√ r2 − y2 r2 − y2
gives y = ± 23 r. It is easy to get the two arcs
x
that enclosed
p the region are x = r − y
p
2 2 O
To evaluate the last integral, we make a trigonometric substitution y = r sin t. Then the area
5.1 Areas of Regions Between Curves 269
is
ˆ √
3
2 r p ˆ π
3
>> syms x
>> y1 ( x ) = cos ( x ) ;
>> y2 ( x ) = sin ( x ) ;
>> x_array = linspace (0 , pi /2 ,200) ;
>> y1_array = y1 ( x_array ) ;
>> y2_array = y2 ( x_array ) ;
>> figure
>> plot ( x_array , y1_array , 'b ' , x_array , y2_array , 'r ') % plot ...
two curves on the same figure
>> legend ( 'y = cos x ' , 'y = sin x ')
>> xlabel ( 'x ')
>> ylabel ( 'y ')
>> grid
Note that to plot two curves on the same figure, we can write specifications of the two curves
using one plot command instead of two plot commands. The figure plotted is shown below.
270 Applications of Integration
1
y = cos x
0.9 y = sin x
0.8
0.7
0.6
0.5
y
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
x
We see that y = cos x and y = sin x intersect at a point around x = 0.8. So, we try to find a
point around x = 0.8 such that cos x = sin x. This is shown in the following MATLAB code.
>> Delta_y = y1 - y2
Delta_y ( x ) =
cos ( x ) - sin ( x )
Delta_y_hd =
@( x ) cos ( x ) - sin ( x )
x0 =
0.7854
We see from the result above that y = cos x and y = sin x intersect at x0 = 0.7854. Hence,
we can determine the two intervals over which the two curves bound a closed region, namely,
[0, x0] and x0, π2 . According to these two intervals, we calculate the area bounded by the
area =
2*2^(1/2) - 2
√
The result shows that the area bounded by y = cos x and y = sin x over [0, π2 ] is 2 2 − 2.
Note that the command viscircles can plot a circle with given center and radius. Moreover,
to specify the colour of the circle, besides the parameter specifying the colour, e.g., ‘b’ and
‘r’, we also need to type in ‘Color’ in the command viscircles. Furthermore, since the
command viscircles does not clear the target axes before plotting circles, we need to first
remove any graphs that have been previously plotted in the axes using the cla command.
The figure plotted is shown below.
272 Applications of Integration
y
-1 x 2 + y2 = 32
(x - 3)2 + y 2 = 3 2
-2
-3
-3 -2 -1 0 1 2 3 4 5 6
x
>> syms y
>> x1 = sqrt (3^2 - y ^2) ;
>> x2 = 3 - sqrt (3^2 - y ^2) ;
>> Delta_x = x1 - x2
Delta_x =
Delta_x_hd =
y1 =
-2.5981
y2 =
2.5981
and y2 = 2.5981. Hence, we can determine the interval over which these two functions bound
a closed region, i.e., [y1, y2]. Then, we calculate the area bounded by the two curves as
follows:
area =
6* pi - (9*3^(1/2) ) /2
We see from√the result above that the common area of two disks x2 +y 2 ≤ 32 and (x−3)2 +y 2 ≤
32 is 6π − 9 2 3 .
If a curve is traced out once by the parametric equations x = f (t) and y = g(t), α ≤ t ≤ β,
then the area under the curve is ˆ β
g(t) f 0 (t) dt.
α
Justification:
ˆ b
The area under a curve y = F (x) over [a, b] is A = F (x) dx. By applying the substitu-
a
tion rule, we get
ˆ β
A= F (f (t)) f 0 (t) dt,
α
where F (a) = α and F (b) = β. Since the curve y = F (x), a ≤ x ≤ b, is traced out by the
given parametric equations, we have
y = F (x) = F (f (t)),
and y = g(t), so that F (f (t)) = g(t). Hence, we obtain the area formula in parametric
equations.
274 Applications of Integration
2r
x
O 2πr
Solution It is known that, for a given curve above the x-axis, the area under the curve
ˆ b
over an interval [a, b] is A = y(x) dx. Thus, if the curve is given by parametric equations
a
x = x(t), y = y(t), then these equations can be served as a substitution.
Hence, the area under one arch of the cycloid is
ˆ 2πr
A= y dx
0
ˆ 2π
x = r(t − sin t)
0
= r(1 − cos t) · [r(t − sin t)] dt
0 y = r(1 − cos t)
ˆ 2π
= r2 (1 − 2 cos t + cos2 t) dt
0
ˆ 2π
= r2 1 − 2 cos t + 12 (1 + cos 2t) dt double-angle formula
0
2π
= r2 − 2 sin t + sin 2t = 3πr2 .
3 1
2t 4 t=0
3
y
2
0
0 2 4 6 8 10 12 14 16 18 20
x
Then, the area under one arch of the cycloid can be calculated as follows:
>> syms t
>> x ( t ) = 3*( t - sin ( t ) ) ;
>> y ( t ) = 3*(1 - cos ( t ) ) ;
>> dx ( t ) = diff ( x ( t ) ,t ) ;
>> area = int ( y ( t ) * dx ( t ) ,0 ,2* pi )
area =
27* pi
5.2 Volumes
5.13 Definition: volume
Similarly, if S is a solid that lies between y = c and y = d and if the cross-sectional area
276 Applications of Integration
Find the volume of a pyramid whose base is a square with side L and whose height is h.
Solution We place the origin O of the coordinates at the vertex of the pyramid and the
x-axis along its central axis. Any plane Px that passes through x and is perpendicular to
the x-axis intersects the pyramid in a square with side of length s, say. We can express s in
terms of x by observing from the similar triangles:
x h
=
s L
xL L2
and so s = . Thus, the cross-sectional area is A(x) = s2 = 2 x2 .
h h
y
z
s L
x
x
O
x x
h
h
Consider a solid whose base is a circular disk with radius r. Find the volume of the solid
if parallel cross-sections perpendicular to the base are isosceles triangles with height h and
unequal side in the base.
√
y= r 2 − x2
y
x
O
√ x
y = − r 2 − x2
Solving the equation x2 + y 2 = r2 for x, we have the expressions of the top-half and the
bottom-half of the circle, p
x = ± r2 − y2 .
It is clear that the circle intersects the x-axis at x = ±r.
By symmetry, without loss of generality, we can assume that cross-sections are perpendic-
ular to the x-axis. For −r ≤ x ≤ r, the area of the cross-section is
√ √
A(x) = 21 · 2 r2 − x2 · h = h r2 − x2 .
We observe that the last integral is the area of semi-circular disk of radius r, so
V = h · 21 πr2 = 12 πr2 h.
It is known that the area of circular disk of radius r is πr2 . Find the volume of the ball of
radius r.
√
Solution A ball of radius r can be generated by rotating the upper semicircle y = r2 − x2
about the x-axis. For −r ≤ x ≤ r, the cross-section is a circular disk, with area π(r2 − x2 ),
as shown in the figure.
278 Applications of Integration
y
√
y= r 2 − x2
x
−r O r
The solid obtained by rotating the region about the y-axis is the solid torus, as shown in the
figure.
R + r2 − y2
p
p
R − r − y2
2
y
R
R+r
x
O R−r
(x − R)2 + y 2 = r2
We shall use the method of slices to compute the volume of the solid.
The region and a typical slice are shown in the figure.
Wepsee that the slice is a washer, with outer radius R + r2 − y 2 , and inner radius
p
Since the last integral represents the area of the semicircular region of radius r, we have
figure
surf (X ,Y ,Z , ' FaceAlpha ' ,0.2 , ' FaceColor ' , 'b ') % ' FaceAlpha ': ...
face transparency - ranges from 0 ( fully transparent ) to 1 ...
( fully opaque )
xlabel ( 'x ')
ylabel ( 'y ')
zlabel ( 'z ')
y1 = linspace (0 , r0 ,200) ;
z1 = zeros (1 , length ( y1 ) ) ;
y = y1 ( ind ) ;
z1 ( ind ) = sqrt ( r0 ^2 - y ^2) ;
end
hold on
plot3 ( x_array , y_array , z_array , 'r ' , ' LineWidth ' ,4)
Note that the command sphere can be used to generate a ball with unit radius, the
command surf can be used to plot the surface of the ball, and the command plot3 can
be used to plot curves in three-dimensional space. Moreover, the face transparency and the
face colour of the ball can be specified when using surf, and the width of the curve can be
specified when using plot3.
The figure plotted is shown below.
5.2 Volumes 281
Since the cross-section is a circular disk with area π(32 − x2 ), as shown in the figure above,
we thus can calculate the volume of the ball by solving the following integral:
ˆ 3
V = π(32 − x2 )dx.
−3
>> syms x
>> f ( x ) = pi *(3^2 - x ^2) ;
>> V = int ( f ( x ) , -3 ,3)
V =
36* pi
Justification:
We divide the interval [a, b] into n subintervals [xi−1 , xi ] of equal width ∆x and let x∗i be a
point in the ith subinterval. If the rectangle with base [xi−1 , xi ] and height f (x∗i ) is rotated
about the y-axis, then the result is a cylindrical shell with average radius x∗i , height f (x∗i ),
and thickness ∆x, so its volume is
f (x∗i )
a b
x
∆x
x∗i
a b
x
x∗i
f (x∗i )
∆x
2πx∗i
Hence an approximation to the volume V of S is given by the sum of the volumes of these
shells:
Xn Xn
V ≈ Vi = 2πx∗i f (x∗i )∆x.
i=1 i=1
x2 + y 2 = r 2
r
x h
x
O
−r
The solid obtained by rotating the region about the y-axis is the solid torus, as shown in the
figure.
(x − R)2 + y 2 = r2
R h
x
O x
We shall use the method of cylindrical shells to compute the volume of the solid.
The region and a typical shell are shown in the figure.
We see that the shell has radius x, circumference 2πx, and height 2 r2 − (x − R)2 . So
p
284 Applications of Integration
the volume is
ˆ R+r
V = 2πx · 2 r2 − (x − R)2 dx
p
R−r
ˆr p
= 4π(u + R) r2 − u2 du u = x − R, du = dx
−r
ˆ r p p
= 4π u r2 − u2 + R r2 − u2 du
−r
ˆ r p
= 4π R r2 − u2 du odd function
−r
ˆ r p
= 4πR r2 − u2 du.
−r
Since the last integral represents the area of the semicircular region of radius r, we have
Find the volume of the solid obtained by rotating the region bounded by the curves
√
y = x and y = x2 ,
1. The region and a typical slice are shown in the following figures.
y y
y = x2 y = x2
√ √
y= x y= x
1 1
√
x+k
x x
O x 1 x2 + k O 1
y = −k y = −k
√
We see that the slice is a washer, with inner radius x2 + k and outer radius x + k. So
5.2 Volumes 285
the volume is
ˆ 1 √
V = π( x + k)2 − π(x2 + k)2 dx
0
ˆ 1 √
=π x + 2k x − x4 − 2kx2 dx
0
= π
30 (9 + 20k).
2. The region and a typical shell are shown in the following figures.
y y
√
y y = x2 y = x2
√ √
y 2
y= x y= x
1 1
y
y+k
x x
O 1 O 1
y = −k y = −k
√
We see that the shell has radius y + k, circumference 2π(y + k), and height y − y2 .
So the volume is
ˆ 1
√
V = 2π(y + k) · ( y − y 2 ) dy
0
ˆ 1
3 1
= 2π y 2 − y 3 + ky 2 − ky 2 dx
0
= π
30 (9 + 20k).
about the x-axis and the y-axis, respectively. Find the volumes of the two solids.
286 Applications of Integration
2r
x
O 2πr
Solution
1. When rotating the region about the x-axis, we compute the volume of the solid by
slices.
A typical slice is shown in the following figure.
2r
x
O 2πr
ˆ 2π
The volume of the solid is V = π[y(x)]2 dx. We can use the parametric equations
0
for the cycloid as a substitution for the definite integral. Thus, the volume of the solid
is
ˆ 2πr
V = π[y(x)]2 dx
0
ˆ 2π
x = r(t − sin t)
2 0
= π [r(1 − cos t)] · [r(t − sin t)] dt
0 y = r(1 − cos t)
ˆ 2π
= πr3 (1 − cos t)3 dt
0
ˆ 2π
= πr 3
1 − 3 cos t + 3 cos2 t − cos3 t dt expanding
0
ˆ 2π
= πr 3
1 − 3 cos t + 23 (1 + cos 2t)
0
2π
= πr3 − 3 sin t + sin 2t − sin t + sin3 t
5 3 1
2t 4 3 t=0
= 5π r .
2 3
2. When rotating the region about the y-axis, we compute the volume of the solid by
shells.
5.2 Volumes 287
2r
x
O 2πr
ˆ 2π
The volume of the solid is V = 2πx · y(x) dx. We use the parametric equations for
0
the cycloid as a substitution for the definite integral. Thus, the volume of the solid is
ˆ 2πr
V = 2πx · y(x) dx
0
ˆ 2π
0
= 2πr(t − sin t) · [r(1 − cos t)] · [r(t − sin t)] dt
0
ˆ 2π
= 2πr3 (t − sin t)(1 − cos t)2 dt.
0
Hence,
ˆ 2π
V = 2πr3 t(1 − cos t)2 dt
0
ˆ 2π
= 2πr3 t(1 − 2 cos t + cos2 t) dt
0
ˆ 2π
= 2πr 3
t 1 − 2 cos t + 21 (1 + cos 2t) dt
0
2π
= 2πr · − 2t sin t − 2 cos t + 14 t sin 2t + cos 2t
3
3 2 1
4t 8 t=0
= 6π 3 r3 .
288 Applications of Integration
y
Pn
P1
Pi−1 Pi
P0
x0 x1 xi−1 xi xn
x
Similarly, If g 0 is continuous on [c, d], then the length of the curve x = g(y), c ≤
y ≤ d, is
ˆ d ˆ dq
s 2
dx 2
L= 1+ dy = 1 + [g 0 (y)] dy.
c dy c
If f 0 is continuous on [a, b], the distance along the curve from the initial point
(a, f (a)) to the point (x, f (x)) defines the arc length function:
ˆ xq
2
s(x) = 1 + [f 0 (t)] dt.
a
5.3 Arc Lengths 289
Justification:
Hence,
n
X n q
X 2
L = lim |Pi−1 Pi | = lim 1 + [f 0 (x∗i )] ∆x
n→∞ n→∞
i=1 i=1
ˆ b q
2
= 1 + [f 0 (x)] dx.
a
3 12 y = x2
2 x . Thus, the arc length of the curve from
(0, 0) to (1, 1) is x
O 1
ˆ 1 p ˆ 1 q
L= 1 + y 02 dx = 1 + 94 x dx
0 0
ˆ 13
4 1 9
= t · 2 4
dt t=1+ x
1
9 4
h i 13
4
√
2 32
= 4
9 3t = 13 13−8
27 .
t=1
290 Applications of Integration
Remark:
2 dx 1
The same curve can be expressed as x = y 3 , which gives = 32 y − 3 . Thus, the
dy
arc length from (0, 0) to (1, 1) is
ˆ 1 ˆ 1q
s 2
dx 2
L= 1+ dy = 1 + 94 y − 3 dy.
0 dy 0
Evaluation of the last integral (an improper integral!) is technically more complicated.
So, when there are more than one choices in finding a quantity (like area, volume,
arc length, etc), one may need to choose a wise setup.
2 2
32
y = a3 − x3 ,
where 0 ≤ x ≤ a, so that
dy 2 2
21 1 1
2 2
21
= 23 · a 3 − x 3 · (−1) 32 x− 3 = −x− 3 a 3 − x 3 .
dx
Thus, the circumference of the astroid is
ˆ ar h i
2 2 2
L=4 1 + x− 3 a 3 − x 3 dx
ˆ
0
a
1 1
=4 a 3 x− 3 dx an improper integral
0
ˆ a
1 1
= 4a 3 lim+ x− 3 dx
→0
1
h 2 ia
= 4a 3 lim+ 32 x 3 = 6a.
→0 x=
5.3 Arc Lengths 291
>> syms x
>> f ( x ) = x ^(3/2) ;
>> x_array = linspace (0 ,1 ,200) ;
>> figure
>> plot ( x_array , f ( x_array ) , 'b ')
>> xlabel ( 'x ')
>> ylabel ( 'y ')
>> grid
To calculate the arc length of the curve in MATLAB, we provide two methods.
1. We calculate the arc length of the curve by using the arc length function.
>> syms x
>> f ( x ) = x ^(3/2) ;
>> df ( x ) = diff ( f ( x ) ,x )
df ( x ) =
(3* x ^(1/2) ) /2
arc_len =
2. We calculate an approximation of the arc length based on the arc length definition.
x_array = linspace (0 ,1 , N ) ;
y_array = x_array .^(3/2) ;
arc_len = 0;
x2 = x_array ( ind ) ;
x1 = x_array ( ind - 1) ;
y2 = y_array ( ind ) ;
y1 = y_array ( ind - 1) ;
seg_len = sqrt (( y2 - y1 ) ^2 + ( x2 - x1 ) ^2) ;
arc_len = arc_len + seg_len ;
end
Note that the bigger the number of line segments N is, the more accurate the approxi-
mation is.
The result of the arc length can be seen when we type in arc_len in the command
window, as shown below.
arc_len =
x = f (t), y = g(t), α ≤ t ≤ β,
where f 0 and g 0 are continuous and the parametric curve is traversed exactly once as t
5.3 Arc Lengths 293
Justification: Part 1
The length L of C is defined as the limit of the lengths of these approximating polygons
as n → ∞:
Xn
L = lim |Pi−1 Pi |.
n→∞
i=1
Justification: Part 2
Thus,
q
|Pi−1 Pi | =(∆xi )2 + (∆yi )2 = [f 0 (t∗i )]∆t)2 + [g 0 (t∗∗
i )]∆t)
p
2
q
= [f 0 (t∗i )]2 + [g 0 (t∗∗
i )] ∆t,
2
and so
n q
X
L = lim [f 0 (t∗i )]2 + [g 0 (t∗∗
i )] ∆t.
2
n→∞
i=1
The last sum resembles a Riemann sum for the function [f 0 (t)]2 + [g 0 (t)]2 but it is not
p
it can be shown that the limit is the same as if ti and ti were equal, namely,
∗ ∗∗
ˆ β q
2 2
L= [f 0 (t)] + [g 0 (t)] dt.
α
294 Applications of Integration
x = a cos3 t, y = a sin3 t,
a x = a cos3 t,
y = a sin3 t
where 0 ≤ t ≤ 2π. (0 ≤ t ≤ 2π)
x
Solution The astroid is symmetric about O a
ˆ π
2
q
L=4 [3a cos2 t · (− sin t)]2 + [3a sin2 t · (cos t)]2 dt
0
ˆ π
2
= 12a sin t cos t dt
0
π2
= 12a sin2 t = 6a.
1
2 t=0
x = cos3 t, y = sin3 t,
where 0 ≤ t ≤ 2π.
Solution First, we plot the curve of x = cos3 t, y = sin3 t where 0 ≤ t ≤ 2π.
>> syms t
>> x ( t ) = cos ( t ) ^3;
>> y ( t ) = sin ( t ) ^3;
>> t_array = linspace (0 ,2* pi ,200) ;
>> figure
>> plot ( x ( t_array ) ,y ( t_array ) , 'r ')
>> xlabel ( 'x ')
>> ylabel ( 'y ')
>> grid
0.8
0.6
0.4
0.2
y
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
x
We see from the figure above that the plotted astroid is symmetric about the x-axis and the
y-axis. So, its circumference is four times the arc length in the first quadrant. We thus first
calculate the arc length of the curve in the first quadrant, and then multiply it by 4.
To calculate the arc length of the astroid in MATLAB, we provide two methods.
1. We calculate the arc length of the astroid by using the arc length function.
>> syms t
>> x ( t ) = ( cos ( t ) ) ^3;
>> y ( t ) = ( sin ( t ) ) ^3;
>> dx ( t ) = diff ( x ( t ) ,t )
dx ( t ) =
>> dy ( t ) = diff ( y ( t ) ,t )
dy ( t ) =
3* cos ( t ) * sin ( t ) ^2
arc_len =
The result above shows that the arc length of the astroid is 6.
2. We calculate an approximation of the arc length based on the arc length definition.
t_array = linspace (0 , pi /2 , N ) ;
x_array = cos ( t_array ) .^3;
y_array = sin ( t_array ) .^3;
arc_len1 = 0; % arc length in the 1 st quadrant
x2 = x_array ( ind ) ;
x1 = x_array ( ind - 1) ;
y2 = y_array ( ind ) ;
y1 = y_array ( ind - 1) ;
seg_len = sqrt (( x2 - x1 ) ^2 + ( y2 - y1 ) ^2) ;
arc_len1 = arc_len1 + seg_len ;
end
arc_len = 4* arc_len1 ;
Note that the bigger the number of line segments N is, the more accurate the approxi-
mation is.
The result of the arc length can be seen when we type in arc_len in the command
window, as shown below.
arc_len =
Consider the surface is obtained by rotating the curve defined by y = f (x), where f is
positive and a ≤ x ≤ b. In order to define its surface area, we divide the interval [a, b] into
n subintervals with endpoints x0 , x1 , . . . , xn and equal width ∆x. The part of the surface
between xi−1 and xi is approximated by taking the line segment Pi−1 Pi and rotating it
about the x-axis, where Pi (xi , f (xi )) lies on the curve. The result is a band with slant height
5.4 Surface Area of Revolution 297
|Pi−1 Pi |. Therefore, in the case where f is positive we define the surface area obtained by
rotating the curve y = f (x), a ≤ x ≤ b, about the x-axis as
y
n
X
S = lim Si , Pi−1 Pn
n→∞ Pi
i=1
P0
where Si is the area of the band with slant
height |Pi−1 Pi |. x
If f 0 is continuous on [a, b], then the surface area of the surface obtained by rotating
the curve y = f (x), a ≤ x ≤ b, about the x-axis, is
ˆ b ˆ b
s 2
dy
q
2
S= 2π y(x) 1 + dx = 2π f (x) 1 + [f 0 (x)] dx.
a dx a
Similarly, if g 0 is continuous on [c, d], then the surface area of the surface obtained
by rotating the curve x = g(y), c ≤ y ≤ d, about the y-axis, is
ˆ d ˆ d
s 2
dx
q
2
S= 2π x(y) 1 + dy = 2π g(y) 1 + [g 0 (y)] dy.
c dy c
Justification: Part 1
Let us first derive a formula for the area of a circular cone with base radius r and slant
height l.
l θ
2πr
In fact, we can flat it to form a sector of a circle with radius l and central angle θ = 2πr/l.
Since it is a part of a disk of radius l, we have the area of the sector to be
A = 21 l2 θ = 21 l2 · (2πr/l) = πrl.
298 Applications of Integration
Justification: Part 2
Thus, the area of the band, or frustum of a cone, with slant height l and upper and lower
radii r1 and r2 is
A = πr2 (l1 + l) − πr1 l1 = π [(r2 − r1 )l1 + r2 l] .
From similar triangles we have
l1 l1 + l
=
r1 r2
which gives
r2 l1 = r1 l1 + r1 l or (r2 − r1 )l1 = r1 l.
Hence,
A = π [r1 l + r2 l] = 2πrl = (average circumference) × (slant height),
where r = 2 (r1
1
+ r2 ) is the average radius of the band.
l1
r1
r2
Justification: Part 3
Suppose f 0 is continuous on [a, b]. For a band with slant height l = |Pi−1 Pi | and average
radius r = 12 (f (xi−1 ) + f (xi )), its surface area is
Si = 2π · 12 (f (xi−1 ) + f (xi )) · |Pi−1 Pi |.
By the Pythagorean Theorem and the Mean Value Theorem,
q
2
|Pi−1 Pi | = (xi − xi−1 )2 + [f (xi ) − f (xi−1 )]
q q
2 2
= (∆x)2 + [f 0 (x∗i )∆x] = 1 + [f 0 (x∗i )] ∆x.
Thus, by approximating 21 (f (xi−1 ) + f (xi )) using f (x∗i ), we get
q
2
Si ≈ 2π · f (x∗i ) 1 + [f 0 (x∗i )] ∆x.
Therefore,
n
X n
X q
2
S = lim Si = lim 2π · f (x∗i ) 1 + [f 0 (x∗i )] ∆x
n→∞ n→∞
i=1 i=1
ˆ b q
2
= 2π f (x) 1 + [f 0 (x)] dx.
a
5.4 Surface Area of Revolution 299
For rotations about the x-axis and the y-axis, respectively, the surface area formula becomes
ˆ ˆ
S = 2πy ds or S = 2πx ds,
where s s
2 2
dy dx
ds = 1+ dx or 1+ dy.
dx dy
In general, the surface area of rotation is
ˆ
(2πr) (ds)
| {z } |{z}
circumference arc length
y
y
about the x-axis, as shown in the figure. Find its surface area.
y
√
y= r 2 − x2
x
−r O r
300 Applications of Integration
(x − R)2 + y 2 = r2
x
O R
The torus
p consists of two portions: the outer portion generated by the rightmost semicircle
x =pR + r2 − y 2 (−r ≤ y ≤ r), and the inner portion by the leftmost semicircle x =
R − r2 − y 2 (−r ≤ y ≤ r). It is easy to see that
dx y
along the rightmost semicircle : = −p ;
dy r − y2
2
dx y
along the leftmost semicircle : =p .
dy r2 − y2
5.4 Surface Area of Revolution 301
ˆ
v !2
u
r p u y
S= 2π R + r − y t1 +
2 2 −p dy
−r r2 − y2
ˆ
v !2
u
r p u y
+ 2π R − r − y t1 +
2 2 p dy
−r r2 − y2
ˆ r
r
= 4πR p dy
−r r2 − y2
ˆ r
r
= 8πR p dy even function
0 r2 − y2
ˆ π
2 r cos θ dθ
= 8πRr y = r sin θ
0 r cos θ
π
= 8πRr · = 4π 2 Rr.
2
>> syms x
>> y ( x ) = sqrt (3^2 - x ^2) ;
>> dy ( x ) = diff ( y ( x ) ,x )
dy ( x ) =
S =
36* pi
The result above shows that the surface area of the sphere is 36π.
302 Applications of Integration
x_array = linspace ( -R ,R , N ) ;
y_array = sqrt (3^2 - x_array .^2) ;
S_sum = 0;
x2 = x_array ( ind ) ;
x1 = x_array ( ind - 1) ;
y2 = y_array ( ind ) ;
y1 = y_array ( ind - 1) ;
ell = sqrt (( x2 - x1 ) ^2 + ( y2 - y1 ) ^2) ;
S = 2* pi *0.5*( y1 + y2 ) * ell ;
S_sum = S_sum + S ;
end
Note that the bigger the number of line segments N is, the more accurate the approxi-
mation is.
The result of the surface area can be seen when we type in S_sum in the command
window, as shown below.
S_sum =
x-axis is
ˆ ˆ
s 2 2
β
dx dy β
q
2 2
S= 2πy + dt = 2πg(t) [f 0 (t)] + [g 0 (t)] dt.
α dt dt α
Justification:
The general formula for the surface area of revolution about the x-axis is
ˆ
S = 2πy ds.
about the x-axis and the y-axis, respectively. Find the surface areas of the two solids.
2r
x
O 2πr
1. When the area under one arch of the cycloid rotates about the x-axis, a typical circle
has radius y = y(t), while the arc length is given by
2r
x
O 2πr
2. When the area under one arch of the cycloid rotates about the y-axis, a typical circle
has radius x = x(t), while the arc length is given by
x(t)
2r
x
O 2πr
5.4 Surface Area of Revolution 305
about the x-axis. Find the surface area of the generated solid.
Solution We calculate the surface area of the solid by two methods.
1. The surface area of the solid is calculated by using the formula for surface area of
revolution.
>> syms t
>> x ( t ) = 3*( t - sin ( t ) ) ;
>> y ( t ) = 3*(1 - cos ( t ) ) ;
>> dx ( t ) = diff ( x ( t ) ,t ) ;
>> dy ( t ) = diff ( y ( t ) ,t ) ;
>> int_fun = 2* pi * y ( t ) * sqrt ( dx ( t ) ^2 + dy ( t ) ^2)
int_fun =
S =
603.1858
The result above shows that the surface area of the solid is 603.1858. Note that the com-
mand integral can only deal with a function handle, so we need to convert the symbolic
expression int_fun to the function handle int_fun2 using command matlabFunction.
x2 = x_array ( ind ) ;
x1 = x_array ( ind - 1) ;
y2 = y_array ( ind ) ;
y1 = y_array ( ind - 1) ;
ell = sqrt (( x2 - x1 ) ^2 + ( y2 - y1 ) ^2) ;
S = 2* pi *0.5*( y1 + y2 ) * ell ;
S_sum = S_sum + S ;
end
Note that the bigger the number of line segments N is, the more accurate the approxi-
mation is.
The result of the surface area can be seen when we type in S_sum in the command
window, as shown below.
>> S_sum
S_sum =
603.1845
Justification:
We write its parametric equations as
Since
2 2
dx dy
2 2
+ = [f 0 (θ) cos θ − f (θ) sin θ] + [f 0 (θ) sin θ + f (θ) cos θ]
dθ dθ
2 2
= [f (θ)] + [f 0 (θ)] ,
the length is
ˆ ˆ
s 2 2
β
dx dy β
q
2 2
L= + dθ = [f (θ)] + [f 0 (θ)] dθ.
α dθ dθ α
r = a + a cos θ,
where a > 0.
308 Applications of Integration
135◦ 45◦
150◦ 30◦
◦
165 15◦
180◦ 0◦
a
195◦ 345◦
◦
210 330◦
◦ ◦
225 315
240◦ 300◦
◦ ◦
255 270◦ 285
Solution The given polar curve r = a+a cos θ is periodic of period 2π. Since r0 = −a sin θ,
we get the arc length
ˆ 2π p
L= (a + a cos θ)2 + (−a sin θ)2 dθ
0
ˆ 2π √
= a 2 + 2 cos θ dθ
0
ˆ 2π
= 2a cos( 1 θ) dθ
2
0
ˆ π ˆ 2π
= 2a cos( 21 θ) dθ + 2a (−1) cos( 21 θ) dθ
0 π
π 2π
= 2a 2 sin( 12 θ) θ=0 − 2a 2 sin( 12 θ) θ=π = 8a.
r = 1 + cos θ.
The arc length of the cardioid can be calculated in MATLAB using the following code:
dr ( theta ) =
- sin ( theta )
arc_len =
5.5 Lengths and Areas in Polar Coordinates 309
The result above shows that the arc length of the cardioid is 8.
ˆ β ˆ β
θ=α
A= 1 2
2 r dθ = 2 [f (θ)] dθ.
1 2
θ=0
α α O
ˆ β θ=α
2 2
A= 1
2 [f (θ)] − [g(θ)] dθ. O
θ=0
α
Justification:
We divide the interval [α, β] into subintervals of equal width ∆θ with endpoints
θ0 , θ1 , θ2 , . . . , θn . If we choose θi∗ in the ith subinterval [θi−1 , θi ], then the area ∆Ai of
the ith region is approximated by the area of the sector of a circle with central angle ∆θ and
310 Applications of Integration
(central angle)
∆Ai ≈ π(radius)2 · = 21 (radius)2 × (central angle)
2π
2
= 12 [f (θi∗ )] ∆θ.
Hence, we obtain the formula for the area A of the polar region R
n
X ˆ β
2 2
A = lim 1
2 [f (θi∗ )] ∆θ = 1
2 [f (θ)] dθ.
n→∞ α
i=1
θ = θi
θ = θi−1
f (θi∗ )
r = f (θ)
r
θ=β
θ
θ=α
area = 12 r2 θ O
θ=0
Find the area of the region that lies inside the circle r = 9 cos θ outside of the cardioid
r = 3 + 3 cos θ.
135◦ 45◦
π
θ= 3
150◦ 30◦
◦
165 15◦
180◦ 0◦
2 4 6 8
195◦ 345◦
◦
210 330◦
θ = − π3
◦ ◦
225 315
240◦ 300◦
255◦ 270 ◦ 285◦
Solution The circle r = 9 cos θ makes a complete rotation when θ varies from − π2 to 2;
π
5.5 Lengths and Areas in Polar Coordinates 311
the cardioid r = 3 + 3 cos θ make a complete loop when θ varies from −π to π. By solving the
simultaneous equations r = 9 cos θ and r = 3 + 3 cos θ, we find the intersections at θ = − π3
and θ = π3 . Since r(−θ) = r(θ) for both polar equations, these curves are symmetric about
the polar axis.
Thus, the area of the region that lies inside the circle outside of the cardioid is
ˆ π
3
A=2 1
(9 cos θ)2 − (3 + 3 cos θ)2 dθ
2
0
ˆ π
3
= (−9 − 18 cos θ + 72 cos2 θ) dθ
0
ˆ π
3
= [−9 − 18 cos θ + 36(1 + cos 2θ)] dθ
0
π
= [27θ − 18 sin θ + 18 sin 2θ]θ=0
3
= 9π.
The limaçon r = 3 + 5 cos θ consists of an inner loop and an outer loop. Find the area
between these loops.
105◦ 90◦ 75◦
120◦ 60◦
135◦ 45◦
◦
150 30◦
θ = cos−1 (− 53 )
165◦ 15◦
◦
180 0◦
2 4 6 8
195◦ 345◦
◦
θ = 2π − cos−1 (− 35 )
210 330◦
◦ ◦
225 315
240◦ 300◦
◦ ◦
255 270◦ 285
Solution The given polar curve r = 3+5 cos θ is periodic of period 2π. Since r(−θ) = r(θ),
the polar graph is symmetric to the polar axis. As θ varies from 0 to arccos(− 35 ), the polar
equation describes the upper-half outer loop; as θ varies from π to 2π − arccos(− 35 ), it
describes the upper-half inner loop. Thus, the area between these loops is
ˆ arccos(− 35 ) ˆ 2π−arccos(− 35 )
A=2 1
2 (3 + 5 cos θ)2
dθ − 2 2 (3 + 5 cos θ) dθ.
1 2
0 π
We can compute the following indefinite integral:
ˆ ˆ
(3 + 5 cos θ)2 dθ = (9 + 30 cos θ + 25 cos2 θ) dθ
ˆ
= 9 + 30 cos θ + 2 (1
25
+ cos 2θ) dθ
= 43
2 θ + 30 sin θ + 25
4 sin 2θ + C.
312 Applications of Integration
Hence,
arccos(− 35 )
A= θ + 30 sin θ + sin 2θ
43 25
2 4 θ=0
2π−arccos(− 35 )
− 2 θ + 30 sin θ + sin 2θ θ=π
43 25
4
= 2 · arccos(− 5 ) + 30 · ( 5 ) + 4 · 2( 5 )(− 5 )
43 3 4 25 4 3
2 · 2π − arccos(− 5 ) − 30 · (− 5 ) − 4
− 43 · 2(− 45 )( 35 ) +
3 4 25 43
2 ·π
= 36 − 432 π + 43 · arccos(− 5 )
3
≈ 63.6705.
Find the area of the region that lies inside the circle r = 9 cos θ outside of the cardioid
r = 3 + 3 cos θ.
First, we plot these two polar curves in MATLAB.
120 60
8
6
150 30
4
180 0 0
210 330
240 300
270
In order to calculate the area of the specified region, we need to first find the intersections
of these two polar curves, which is shown in the following:
5.6 Moments, Centers of Mass, and Centroids 313
ans =
- pi /3
pi /3
We see that the circle r = 9 cos θ intersects with the cardioid r = 3 + 3 cos θ at θ = − π3 and
θ = π3 . Then, we can calculate the area of the specified region below.
S =
9* pi
Discrete Systems
n
where M = mi xi is the moment of the system about the origin.
P
i=1
314 Applications of Integration
n
Here My = mi xi is the moment of the system about the y-axis and Mx =
P
i=1
n
mi yi is the moment of the system about the x-axis.
P
i=1
Justification:
Consider a situation with two particles with masses m1 and m2 on a rod that lies along
x-axis. Suppose the distances from the masses to fulcrum are d1 and d2 respectively. The
rod will balance if
m1 d1 = m2 d2 .
d1 d2
m1 m1
Denote the coordinates of m1 and m2 to be x1 and x2 , and the center of mass at x̄. We
see that d1 = x̄ − x1 and d2 = x2 − x̄. Then we have
m1 x1 + m2 x2
m1 (x̄ − x1 ) = m2 (x2 − x̄) =⇒ x̄ = .
m1 + m2
If we have a system of n particles with masses m1 , m2 , . . . , mn located at the points
x1 , x2 , . . . , xn on the x-axis, and if the rod balances, then the center of mass x̄ satisfies:
n
P
n
X mi xi
mi (xi − x̄) = 0 =⇒ x̄ = i=1
Pn .
i=1 mi
i=1
n y
X
mi (xi − x̄) = 0,
i=1 m3
n
X mn
mi (yi − ȳ) = 0,
m2
m5
i=1 m8
x
so that (x̄, ȳ)
m4
n n
P P m1
mi xi mi yi m7
My Mx
x̄ = = i=1
n , ȳ = = i=1
n .
m P m P m6
mi mi
i=1 i=1
In particular, if ρ(x) = ρ is a constant, then the center of mass is the same as the
centroid of the curve, with
ˆ
1 b
x̄ = 1 + [f 0 (x)]2 dx,
p
x
L a
ˆ
1 b
ȳ = f (x) 1 + [f 0 (x)]2 dx,
p
L a
ˆ b
where L = 1 + [f 0 (x)]2 dx is the length of the curve C .
p
a
316 Applications of Integration
Justification:
We divide the interval [a, b] into n subintervals with endpoints x0 , x1 , . . . , xn and equal
width ∆x. Then the ith arc can be approximated by a line segment from (xi−1 , f (xi−1 )) to
(xi , f (xi )), whose approximate length is, by the Mean value Theorem,
s 2
f (xi ) − f (xi−1
(∆x) + (f (xi ) − f (xi−1 )) = 1 + ∆x
p
2 2
xi − xi−1
q
2
= 1 + [f 0 (x∗i )] ∆x.
Adding these moments, we obtain the approximate moment of C . By taking the limit as
n → ∞ we obtain the moment of C about the y-axis:
n
X q
2
My = lim ρ(x∗i )x∗i 1 + [f 0 (x∗i )] ∆x
n→∞
i=1
ˆ b q
2
= ρ(x) · x 1 + [f 0 (x)] dx.
a
In a similar fashion, the moment along the ith piece of arc about the x-axis is
q
2
ρ(x∗i ) 1 + [f 0 (x∗i )] ∆x · f (x∗i )
My Mx
Hence, the center of mass of the curve is located at the point (x̄, ȳ) = , , that is,
m m
ˆ b q ˆ b q
2 2
ρ(x) · x 1 + [f 0 (x)]
dx ρ(x) · f (x) 1 + [f 0 (x)] dx
x̄ = ˆa b q , ȳ = aˆ b q .
2 2
ρ(x) · 1 + [f (x)] dx
0 ρ(x) · 1 + [f (x)] dx
0
a a
It is easy to deduce the centroid from the center of mass when the density is a constant.
1 x
y 0 = 12 (r2 − x2 )− 2 · (−2x) = − √ .
r2 − x2
we have
ˆ
s 2
1 r
p x
ȳ = 1 + −√
r 2 − x2 · dx
L −r r 2 − x2
ˆ r
1 1 2
= r dx = · 2r2 = r.
πr −r πr π
Hence, the centroid of the semicircle is at y
(x̄, ȳ) = (0, π2 r). y=
√
r 2 − x2
0, π2 r
x
−r O r
>> syms x
318 Applications of Integration
df ( x ) =
>> L = 3* pi ;
>> int_fun_y = f ( x ) * sqrt (1 + df ( x ) ^2) ;
>> cen_y = int ( int_fun_y , -3 ,3) / L
cen_y =
6/ pi
Consider a continuous system of mass distributed along a parametric curve C given by the
parametric equations
x = f (t), y = g(t), α ≤ t ≤ β,
with density ρ(t). Suppose f 0 and g 0 are continuous. Then the center of mass of C is (x̄, ȳ),
where
ˆ
1 β
x̄ = ρ(t) · f (t) [f 0 (t)]2 + [g 0 (t)]2 dt,
p
L α
ˆ
1 β
ȳ = ρ(t) · g(t) [f 0 (t)]2 + [g 0 (t)]2 dt,
p
L α
ˆ β
and m = [f 0 (t)]2 + [g 0 (t)]2 dt is the total mass of C .
p
ρ(t) ·
α
In particular, if ρ(t) = ρ is a constant, then the center of mass is the same as the
centroid of the curve, with
ˆ
1 β
x̄ = f (t) [f 0 (t)]2 + [g 0 (t)]2 dt,
p
L α
ˆ
1 β
ȳ = [f 0 (t)]2 + [g 0 (t)]2 dt,
p
g(t)
L α
ˆ β
where L = [f 0 (t)]2 + [g 0 (t)]2 dt is the length of the curve C .
p
α
5.6 Moments, Centers of Mass, and Centroids 319
Justification:
The moment of C about the y-axis is
ˆ
My = ρx ds.
Hence, we get
qˆ β
2 2
ρ(t) · f (t) [f 0 (t)] + [g 0 (t)] dt
My
x̄ = = ˆ β
α
.
m
q
2 2
ρ(t) · [f (t)] + [g (t)] dt
0 0
α
Similarly, we have
q ˆ β
2 2
ρ(t) · g(t) [f 0 (t)] + [g 0 (t)] dt
Mx
ȳ = = ˆ β
α
.
m
q
2 2
ρ(t) · [f (t)] + [g (t)] dt
0 0
α
where 0 ≤ t ≤ 2π. x
O 2πr
Without loss of generality, assume the density ρ = 1. Then the moment of the curve about
the y-axis is
ˆ 2π q
02 02
My = r(t − sin t) · [r(t − sin t)] + [r(1 − cos t)] dt
0
ˆ 2π q
= r2 (t − sin t) (1 − cos t)2 + sin2 t dt
0
ˆ 2π √
= r2 (t − sin t) · 2 − 2 cos t dt
0
ˆ 2π
= r2 (t − sin t) · 2 sin( 12 t) dt half-angle formula
ˆ
0
π
= 2r2 (2u − sin 2u) sin u · 2 du t = 2u
ˆ0 π
= 4r2 (2u sin u − sin 2u sin u) du
0
π
= 4r2 −2u cos u + 23 sin u + 16 sin 3u u=0
= 4r2 · 2π = 8πr2 ;
= 8r2 · 4
3 = 32 2
3 r .
where 0 ≤ t ≤ 2π.
Solution For one arch of the cycloid, the centroid is calculated in MATLAB using the
following code:
>> syms t
>> x ( t ) = 3*( t - sin ( t ) ) ;
>> y ( t ) = 3*(1 - cos ( t ) ) ;
>> dx ( t ) = diff ( x ( t ) ,t ) ;
>> dy ( t ) = diff ( y ( t ) ,t ) ;
>> int_fun_L = sqrt ( dx ( t ) ^2 + dy ( t ) ^2) ;
>> L = int ( int_fun_L ,0 ,2* pi )
L =
24
cen_x =
3* pi
cen_y =
The result above shows that the centroid is (3π, 4). Note that the command int cannot
ˆ 2π q
0 0
solve the integral 3 (1 − cos t) (3(t − sin t)) + (3(1 − cos t)) dt, so we use the command
0
integral to numerically evaluate the integral.
322 Applications of Integration
Consider a flat plate (called a lamina) with uniform density ρ that occupies a region R. If
R lies between two curves y = f (x) and y = g(x), where f (x) ≥ g(x) for a ≤ x ≤ b, then the
centroid of R is (x̄, ȳ), where
ˆ ˆ
1 b
1 b n
2 2
o
x̄ = x [f (x) − g(x)] dx, ȳ = 1
2 [f (x)] − [g(x)] dx,
A a A a
ˆ b
where A = [f (x) − g(x)] dx is the area of R.
a
Justification: Part 1
In a similar fashion, the moment of the ith approximating rectangle about the x-axis is
ρf (x̄i )∆x · 21 f (x̄i )
so we get the moment of R about the x-axis:
n
X ˆ b
2 2
Mx = lim ρ· 1
2 [f (x̄i )] ∆x = ρ 1
2 [f (x)] dx.
n→∞ a
i=1
2 f (x̄i )
1
x0 x1 xi−1 xi xn
x
x̄i
5.6 Moments, Centers of Mass, and Centroids 323
So, the center of mass of the plate (or the centroid of R since the density is uniform) is
located at the point (x̄, ȳ), where
ˆ b ˆ b
2
xf (x) dx 1
2 [f (x)] dx
My Mx
x̄ = = ˆa b , ȳ = = a
ˆ b
.
m m
f (x) dx f (x) dx
a a
Justification: Part 2
where A is the area bounded by the functions y = f (x) and y = g(x) over the interval [a, b].
The moment of R about the y-axis and about the x-axis are, respectively,
ˆ b
My = ρ x [f (x) − g(x)] dx,
a
ˆ b n o
2 2
Mx = ρ 1
2 [f (x)] − [g(x)] dx.
a
Hence,
ˆ ˆ
1 b
1 b n
2 2
o
x̄ = x [f (x) − g(x)] dx, ȳ = 1
2 [f (x)] − [g(x)] dx.
A a A a
Solution By symmetry, the centroid (x̄, ȳ) must lie on the y-axis, so that x̄ = 0. The area
324 Applications of Integration
Solution By applying the substitution rule using the parametric equations, the area of
one arch of the cycloid is
ˆ 2πr
A= y dx
0
ˆ 2π
x = r(t − sin t)
0
= r(1 − cos t) · [r(t − sin t)] dt
0 y = r(1 − cos t)
ˆ 2π
= r2 (1 − 2 cos t + cos2 t) dt
0
ˆ 2π
= r2 1 − 2 cos t + 12 (1 + cos 2t) dt double-angle formula
0
2π
= r2 − 2 sin t + sin 2t = 3πr2 .
3 1
2t 4 t=0
Without loss of generality, assume the density ρ = 1. Then the moment of the plate about
5.6 Moments, Centers of Mass, and Centroids 325
the y-axis is
ˆ 2πr
My = xy dx
0
ˆ 2π
x = r(t − sin t)
0
= r(t − sin t) · r(1 − cos t) · [r(t − sin t)] dt
0 y = r(1 − cos t)
ˆ 2π
= r3 (t − sin t)(1 − cos t)2 dt = 3π 2 r3 ;
0
>> syms x
>> y ( x ) = sqrt (3^2 - x ^2) ;
>> A = 3^2* pi /2;
>> int_fun = 0.5* f ( x ) ^2;
>> cen_y = int ( int_fun , -3 ,3) / A
cen_y =
4/ pi
Find the centroid of the plate between one arch of the cycloid
>> syms t
>> x ( t ) = 3*( t - sin ( t ) ) ;
>> y ( t ) = 3*(1 - cos ( t ) ) ;
>> dx ( t ) = diff ( x ( t ) ,t ) ;
>> int_fun_A = y ( t ) * dx ( t ) ;
>> A = int ( int_fun_A ,0 ,2* pi )
A =
27* pi
>> int_fun_x = x ( t ) * y ( t ) * dx ( t ) ;
>> cen_x = int ( int_fun_x ,0 ,2* pi ) / A
cen_x =
3* pi
cen_y =
5/2
The result above shows that the centroid of the plate is 3π, 52 .
Pappus’s Theorem
5.60 Example: relationship - arc length and surface area of revolution
We know that the arc length is L = 8r and the centroid of the arc is (x̄, ȳ) = (πr, 34 r).
1. For the solid obtained by rotating the region under the curve about the x-axis, we know
5.7 Work 327
S= 64
3 πr
2
= 2π( 43 r) × (8r) = 2π ȳ × L.
2. For the solid obtained by rotating the region under the curve about the y-axis, we know
that the surface area is S = 16π 2 r2 . It is easy to verify that
We have calculated several geometric quantities associated with the area under the cycloid
We know that the area under the arc is A = 3πr2 and the centroid of region under the arc is
(x̄, ȳ) = (πr, 65 r).
1. For the solid obtained by rotating the region under the curve about the x-axis, we know
that the volume is V = 5π 2 r3 . It is easy to verify that
V = 5π 2 r3 = 2π( 56 r) · (3πr2 ) = 2π ȳ · A.
2. For the solid obtained by rotating the region under the curve about the y-axis, we know
that the volume is V = 6π 3 r3 . It is easy to verify that
5.7 Work
Suppose that the object moves along the x-axis in the positive direction, from x = a to
x = b, and at each point x between a and b a force f (x) acts on the object, where f is a
328 Applications of Integration
Justification:
Suppose that the object moves along the x-axis in the positive direction, from x = a
to x = b, and at each point x between a and b a force f (x) acts on the object, where f
is a continuous function. We divide the interval [a, b] into n subintervals with endpoints
x0 , x1 , . . . , xn and equal width ∆x. We choose a sample point x∗i in the ith subinterval
[xi−1 , xi ]. Then the force at that point is f (x∗i ). If n is large, then ∆x is small, and since f is
continuous, the values of f don’t change very much over the interval [xi−1 , xi ]. In other words,
f is almost constant on the interval and so the work Wi that is done in moving the particle
from xi−1 to xi is approximately given by Wi ≈ f (x∗i ) × ∆x. Thus we can approximate the
total work by
X n
W ≈ f (x∗i )∆x.
i=1
Therefore, the work done in moving the object from a to b as the limit of this quantity as
n → ∞. Since the right side is a Riemann sum, we recognize its limit as being a definite
integral:
Xn ˆ b
W = lim f (x∗i )∆x = f (x) dx.
n→∞ a
i=1
A spring exerts a force of 10 N when stretched 10 cm beyond its natural length. How much
work is required to stretch the spring 20 cm beyond its natural length?
Solution According to Hooke’s law, the force needed to extend or compress a spring by
some distance x meters away from its natural length scales linearly with respect to that
distance, that is, f (x) = kx. When the spring is stretched 10 cm beyond its natural length,
the force is 0.1k. By the hypothesis, 10 = 0.1k, so that k = 100. Thus, f (x) = 100x.
Hence the work done in stretching the spring 20 cm beyond its natural length is
ˆ 0.2
0.2
W = 100x dx = 50x2 x=0 = 2 J.
0
A cable 60 meters long whose mass is 30 kilograms is hanging over the edge of a tall
building and does not touch the ground. How much work is required to lift the top 12 meters
of the cable to the top of the building?
Solution To lift the top 12 meters of the cable to the top of the building, the total work
5.7 Work 329
done consists of two parts: (1) W1 for moving the first top 12 meters of the cable to the top
the building; (2) W2 for moving the bottom (60 − 12) = 48 meters of the cable 12 meters
higher.
(1) Let us place the origin at the top of the building and the x-axis pointing downward.
To compute the work W1 , we divide the cable into small segments with length ∆x. If x∗i is a
point in the ith such segment, then all points in the segment are lifted by approximately the
same amount, namely x∗i . Since the cable weights 6030
= 12 kilograms per meter, so the weight
of the ith segment is 2 ∆x. Thus, the work done on the ith segment is
1
By adding all these approximations and letting the number of segments becomes large (equiv-
alently ∆x → 0), we get the work done for moving the first top 12 meters of the cable to the
top the building:
n ˆ 12
2 12
X
W1 = lim 1 ∗
∆x = 2 gx dx
1
= = 36g.
1
n→∞ 2 gxi 4 gx x=0
i=1 0
(2) Similar as above, we divide the second portion of cable into small segments with length
∆x. This gives the weight of the ith segment to be 12 ∆x. Thus, the work done on the ith
segment is
( 21 ∆x) · 12 · g = 6g∆x,
By adding all these approximations and letting the number of segments becomes large (equiv-
alently ∆x → 0), we get the work done for moving the bottom 48 meters of the cable to the
top the building:
n
X ˆ 60
W2 = lim 6g∆x = 6g dx = 6g × (60 − 12) = 288g.
n→∞ 12
i=1
In fact, we can compute W2 without using integration. Since this portion of cable exerts a
force of 21 × 48g along the direction of motion, the work done is W2 = 12 × 48g × 12 = 288g.
Hence the total work done is
A frustum of a cone of height H, top radius R and base radius r contains some liquid of
density ρ. Suppose that the depth of the liquid in the frustum is h. How much work does it
take to pump the liquid to the top of the container?
Solution Let x be the distance to the top of the container. Then the liquid extends from
x = H − h to x = H. We sketch a diagram of the situation.
330 Applications of Integration
R
O R
x∗i
H
ri
ri ∆x h
rH
r
r R−r
r(x) − r H −x
= ,
R−r H
which gives
H −x
r(x) = (R − r) + r.
H
We divide the interval [H − h, H] into subintervals. Then the thin layer corresponding to
[xi−1 , xi ] has approximate volume
and the work needed to pump the layer to the top of the container is approximately
where g is the gravitational constant. Therefore the total work needed to pump all the liquid
to the top of container is approximately
n
X n
X
∆Wi = πgρ x∗i [r(x∗i )]2 ∆x.
i=1 i=1
r h
where a = and b = .
R H
5.7 Work 331
A spring exerts a force of 10 N when stretched 10 cm beyond its natural length. How much
work is required to stretch the spring 20 cm beyond its natural length?
Solution The problem can be solved in MATLAB as follows:
>> syms k
>> g ( k ) = 0.1* k ; % Hooke ' s law
>> k0 = solve ( g ( k ) == 10) % solve the constant k
k0 =
100
>> syms x
>> int_fun = k0 * x ;
>> W = int ( int_fun ,0 ,0.2)
W =
Summary
Theorem: area
• If f (x) ≥ g(x),
y
ˆ b
A= [f (x) − g(x)] dx y = f (x)
a
x=b
• In general, x=a
x
ˆ b
A= |f (x) − g(x)| dx y = g(x)
a
Theorem: volume
• by slices:
ˆ b
V = A(x) dx x=a A(x) x=b
a x
• by shells: y
ˆ b
V = (2πx) [f (x)] (dx) y = f (x)
a | {z } | {z } |{z}
circumference height thickness x
a b
333
• In general,
ˆ
(2πr) (ds) .
| {z } |{z}
circumference arc length
334 Summary
6
Infinite Sequences and Series
An infinite sequence (or sequence for short) is an ordered list of numbers of the form
{a1 , a2 , a3 , . . . , an , . . . }.
For each n, the term an is called the nth term of the sequence.
For convenience, sometimes we write a sequence as {an }.
1. The sequence {1, 2, 3, . . . , n, . . . } consists of all the positive integers, with the nth term
of the sequence being an = n.
2. The nth term of the sequence {1, −1, 1, −1, 1, −1, . . . } is an = (−1)n−1 .
3. The terms in the sequence
are from the truncations of the number π. The nth term of the sequence is the num-
ber obtained by truncating π to n − 1 decimal place. For this sequence, there is no
elementary formula available to express an in terms of n.
4. For a given expression of a function f , by evaluating the function at integers, we can
obtain a sequence
{a1 , a2 , a3 , . . . , an , . . . } ,
338 Infinite Sequences and Series
can be defined as
√
a1 = 2; an = 2 + an−1 , for n ≥ 2.
p
By using the formula, we can generate the whole sequence recursively. In fact, for the
first few terms:
√
when n = 1 : a1 = 2;
√
when n = 2 : a2 = 2 + a1
p √
= 2 + 2;
√
when n = 3 : a3 = 2 + a2
√
q p
= 2 + 2 + 2;
√
when n = 4 : a4 = 2 + a3
r
√
q p
= 2 + 2 + 2 + 2.
lim an = L or an → L as n → ∞
n→∞ L
1. The sequence 1 1 1 1
1, 2, 3, . . . , n, . . .
1
converges to 0, since we can make the terms an = as close to 0 as we like by taking
n
n sufficiently large. In fact, for instance, to make the terms an close to 0 within 0.1,
that is,
|an − 0| < 0.1,
we just need to take n > 10, as shown in the figure.
n an n an
1 1.0 11 0.090909
2 0.5 12 0.083333 an
3 0.333333 13 0.076923
4 0.25 14 0.071429
5 0.2 15 0.066667
6 0.166667 20 0.05 0.5
7 0.142857 30 0.033333
8 0.125 40 0.025 0 + 0.1
n
9 0.111111 50 0.02 0 − 0.1 1 2 3 4 5 10
10 0.1 60 0.016667
2. The sequence
2, (2) , (2) , . . . , (2) , . . .
1 1 2 1 4 1 n
n an
1 0.5
2 0.25 an
3 0.125
4 0.0625 0.5
5 0.03125
6 0.015625
7 0.0078125 0 + 0.05
8 0.00390625 0 − 0.05 1 2 3 4 5 10
n
9 0.00195313
10 0.000976563
340 Infinite Sequences and Series
3. The sequence
{0.9, 0.99, 0.999, 0.9999, . . . }
converges to 1, since the terms increase in magnitude and approach 1. For instance, to
make the terms an close to 0 within 0.07, that is,
an
n an
1 + 0.07
1
1 0.9 1 − 0.07
2 0.99
3 0.999 0.5
4 0.9999
5 0.99999
n
6 0.999999 1 2 3 10
4. The sequence
1 8 3 n2 + 2 · (−1)n n
− , , ,..., ,...
3 9 19 2n2 + 1
n2 + 2 · (−1)n
converges to 2,
1
since we can make the terms an = as close to 12 as we
2n2 + 1
like by taking n sufficiently large. In fact, for instance, to make the terms an close to
2 within 0.15, that is,
1
an − 1 < 0.15,
2
n an n an an
1 −0.333333 11 0.407407
2 0.888889 12 0.581315
3 0.157895 13 0.421829 1
+ 0.15
4 0.727273 14 0.569975 2
1
2
5 0.294118 15 0.432373 1
2 − 0.15
6 0.657534 20 0.549313
7 0.353535 30 0.533037 1 2 3 4 5 6 7 10 20
n
8 0.620155 40 0.524836
9 0.386503 60 0.516595
10 0.597015 80 0.512460
6.1 Infinite Sequences 341
5. The sequence an
−1
6. The sequence
1 2 3
n an
, , ,..., ,...
ln 2 ln 3 ln 4 ln(n + 1)
diverges to ∞. This is because,
x H 1 5
lim = lim
x→∞ ln(x + 1) x→∞ 1
x+1 2
= lim (x + 1) = ∞, 1
x→∞ n
1 2 3 4 5 10 20
n
we have lim an = lim = ∞.
n→∞ n→∞ ln(n + 1)
If lim f (x) = L and f (n) = an when n is an integer, then lim an = L. The same result
x→∞ n→∞
holds when L = ∞ or −∞.
Suppose {an } and {bn } are convergent sequences and c is a constant. Then the following
hold.
an lim an
5. lim = n→∞ if lim bn 6= 0.
n→∞ bn lim bn n→∞
n→∞
342 Infinite Sequences and Series
h ip
6. lim apn = lim an if p > 0 and an > 0.
n→∞ n→∞
1
1. Show that lim = 0 (p > 0).
np
n→∞
1 1
Solution Because lim = 0, we know that lim = 0. Thus, for p > 0, by the
x→∞ x n→∞ n
Limit Laws, p
1 1
lim p = lim = 0p = 0.
n→∞ n n→∞ n
3
n 2 + 2n − 1
2. Compute lim 3 .
n→∞ n2 + 1
Solution Since
1 1 1 1
3
3 n2 1+2· 1 − 3 1+2· 1 − 3
n + 2n − 1
2
n 2 n 2 n n
= = 2 2
,
3
n2 + 1 1 1
n
3
2 1+ 3 1 + 3
n2 n2
1 1 cos n
Because lim √ = lim − √ = 0, by the Squeeze Theorem, we get that lim √ = 0.
n→∞ n n→∞ n n→∞ n
6.1 Infinite Sequences 343
−|an | ≤ an ≤ |an |,
Since
0 ≤ |an | ≤ a2n + n−1 ,
p
• The notation
an bn , as n → ∞,
which is read “an is much smaller than bn as n tends to ∞,” means
an
lim = 0.
n→∞ bn
• The notation
an ∼ bn , as n → ∞,
which is read “an is asymptotic to bn as n tends to ∞,” means that
an − bn bn , as n → ∞,
or, equivalently,
an
lim = 1.
n→∞ bn
For any real numbers p > 0, q > 0, r > 0, and b > 1, the following asymptotic relations
hold: as n → ∞,
lnq n np np lnr n bn n! nn .
344 Infinite Sequences and Series
Justification: lnq n np
Since, as n → ∞,
1/q
lnq n lnq n ln n
ln n n
q p
⇐⇒ 1 ⇐⇒ 1 ⇐⇒ 1 ⇐⇒ ln n np/q ,
np np np/q
ln n np , as n → ∞.
ln n
so that lim = 0. Thus, ln n np as n → ∞.
n→∞ np
Justification: np np lnr n
Since, as n → ∞,
np np lnr n ⇐⇒ 1 lnr n ⇐⇒ 1 ln n,
1 1
we only need to show that lim = 0. The latter is obvious since lim = 0.
n→∞ ln n x→∞ ln x
Justification: np lnr n bn
Since lnq n np as n → ∞ for any positive p and q, to show that np lnr n bn , we only
need to show that the asymptotic relation np bn for any positive p and b > 1. Furthermore,
since
np bn ⇐⇒ n (b1/p )n ,
it is sufficient to show that n bn for any b > 1.
In fact, we may write b = 1 + a, with a > 0. Then, by the binomial expansion, we have
We get
n 2 1
0< < 2· .
bn a n−1
6.1 Infinite Sequences 345
1 n
Because lim = 0, by the Squeeze Theorem, we have lim n = 0. That is, n bn .
n→∞ n−1 n→∞ b
Justification: bn n!
For the given number b, take a sufficiently large K such that b < K. Then, for n > K, we
have
n factors
z }| {
n
b b · b···b · b
0< =
n! n · (n − 1) · · · 2 · 1
b b b b b b
= · ··· · ··· ·
n n−1 K K −1 2 1
b b b b
< · ··· · .
n K −1 2 1
Since
1
b b b b b b b
lim · ··· · = b· ··· · · lim = 0,
n→∞ n K −1 2 1 K −1 2 1 n→∞ n
bn
by the Squeeze Theorem, we have lim = 0. That is, bn n! as n → ∞.
n→∞ n!
Justification: n! nn
Since
n! n · (n − 1) · · · 2 · 1 n n−1 2 1 1
0< = = · ··· · < .
nn n
| · n ·
{z· · n · n
} n n n n n
n factors
1 n!
It is known that lim = 0. By the Squeeze Theorem, we have lim n = 0. That is,
n→∞ n n→∞ n
n! nn as n → ∞.
lim rn = 1, if r = 1;
n→∞
diverges, if r ≤ −1 or r > 1.
Justification:
1
When 0 < r < 1, we put b = and know that b > 1. Since 1 bn as n → ∞, we have
r
1
lim = 0 =⇒ lim rn = 0.
n→∞ bn n→∞
−|r|n ≤ rn ≤ |r|n ,
and lim |r|n = lim (−|r|n ) = 0, by the Squeeze Theorem, we know that lim rn = 0.
n→∞ n→∞ n→∞
3. Suppose r ≤ −1 or r > 1.
When r > 1, we know that 1 rn , so that {rn } diverges to ∞.
When r ≤ −1, {|r|n } diverges to ∞, so that {rn } oscillates and never approach any
finite number. Hence, {rn } diverges in this case.
√
2. Compute the limit lim n
n.
n→∞
√ ln n √
Solution Let an = ln n n = . Then n n = ean . We know that ln n n as n → ∞,
n
so that lim an = 0. Because ex is a continuous function at x = 0, we have
n→∞
√
lim n
n = lim ean = e0 = 1.
n→∞ n→∞
n
2
3. Compute the limit lim 1 − .
n→∞ n
6.1 Infinite Sequences 347
n n
2 2 2
Solution Let an = ln 1 − = n · ln 1 − . Then 1 − = ean . Replacing
n n n
n by a continuous variable x−1 , we see that n → ∞ is a special case when x → 0+ .
Applying l’Hospital’s Rule gives
−2
ln (1 − 2x)
= lim+ 1 − 2x = −2,
H
lim x−1 · ln (1 − 2x) = lim+
x→0+ x→0 x x→0 1
so we have lim an = −2. Because ex is a continuous function at x = −2, we have
n→∞
n
2
lim 1− = lim ean = e−2 .
n→∞ n n→∞
• {an } is decreasing if an+1 < an . For example, {0, −1, −2, −3, . . . }.
• {an } is non-increasing if an+1 ≤ an . For example, {0, 0, −1, −1, −2, −2, . . . }.
• {an } is monotonic if it is either non-increasing or non-decreasing.
• {an } is bounded if there is number M such that |an | ≤ M for all n.
Remark:
The proof of the theorem is based on a fundamental property of the real numbers
that if a sequence (or a nonempty set) is bounded above, then it has a least upper
bound. It is an expression of the fact that there is no gap or hole in the real number
line. We omit the details of the proof because it is beyond the scope of the text.
an = 12 an−1 + 1, (n ≥ 2); a1 = 1,
n
O 1 2 3 4 5 6 7 8 9 10
a2 = 21 a1 + 1 = 1
2 ·1+1= 3
2 > 1 = a1 ,
1 = a1 < 2.
Then,
ak+2 = 21 ak+1 + 1 > 12 ak + 1 = ak+1 ,
and
1 ≤ ak < ak+1 = 21 ak + 1 < 1
2 · 2 + 1 = 2,
that is
ak+2 > ak+1 ,
Sk+1 :
1 ≤ ak+1 < 2,
Sk+1 is also true. Hence, by the principle of induction, the statement Sn is true for all n ≥ 1.
6.1 Infinite Sequences 349
Because {an } is increasing and bounded, by the Monotonic Sequence Theorem, lim an
n→∞
exists, say L.
To find the limit L, we let n tend to ∞ on the both sides of the recurrence relation
an = 21 an−1 + 1. This yields L = 12 L + 1. Solving the equation gives L = 2.
>> syms a n
>> assume (a , ' positive ') % a >0
>> assume (n , ' positive ') % n >0
>> assumeAlso (n , ' integer ') % n is also an integer
>> limit ( a ^(1/ n ) ,n , Inf )
ans =
√
2. lim n
n.
n→∞
Solution
>> syms n
>> assume (n , ' positive ') % n >0
>> assumeAlso (n , ' integer ') % n is also an integer
>> limit ( n ^(1/ n ) ,n , Inf )
ans =
n
2
3. lim 1− .
n→∞ n
Solution
>> syms n
>> assume (n , ' positive ') % n >0
>> assumeAlso (n , ' integer ') % n is also an integer
>> limit ((1 - 2/ n ) ^n ,n , Inf )
350 Infinite Sequences and Series
ans =
exp ( -2)
6.2 Series
Convergence of Series
6.21 Definition: convergent series
∞
For a given series ak = a1 + a2 + a3 + · · · , let sn denote its nth partial sum:
P
k=1
n
X
sn = ak = a1 + a2 + · · · + an .
k=1
If the sequence {sn } is convergent and lim sn = s exists as a real number, then the series
n→∞
ak is called convergent and we write
P
∞
X
a1 + a2 + a3 + · · · = s or ak = s.
k=1
The number s is called the sum of the series. If the sequence {sn } is divergent, then the
series is called divergent.
The series
∞
X
ark−1 = a + ar + ar2 + · · ·
k=1
is called a geometric series. Each term is obtained from the preceding one by
multiplying it by the common ratio r.
6.2 Series 351
Justification:
If r = 1, the nth partial sum sn = a + a + · · · + a = na diverges either to ∞ or −∞, as n
tends to ∞.
If r 6= 1, the nth partial sum sn can be found as follows: by multiplying r to both side of
sn = a + ar + ar2 + · · · + arn−1 ,
we get
sn − rsn = a − arn ,
so that
a − arn
sn = .
1−r
Thus, if −1 < r < 1, since rn → 0 as n → ∞, we get
a − arn a − a · lim rn a
n→∞
lim sn = lim = = .
n→∞ n→∞ 1 − r 1−r 1−r
If r ≤ −1 or r > 1, the sequence {rn } is divergent, so {sn } is also divergent. Thus, if
r ≤ −1 or r > 1, the geometric series diverges.
Remark:
It is easy to generalize the above argument to show that any repeating decimal can
be expressed as a fraction. Hence, any repeating decimal must be a rational number.
352 Infinite Sequences and Series
∞ 1 1
1. Evaluate the series − k+1 .
P
k=1 2k 2
Solution The partial sum for the given series is
n
1 1
X
sn = −
2k 2k+1
k=1
1 1 A1 − 1 + A1 − 1 + · · · + A1 − 1
= − +
21 22 2A2 23 2A3 24 2An 2n+1
1 1
= 1 − n+1 .
2 2
Thus,
1 1 1
lim sn = lim − n+1 = .
n→∞ n→∞ 21 2 2
Hence,
∞
1 1 1
X
− = .
2k 2 k+1 2
k=1
This is called telescoping series since the partial sum collapses (like a pirate’s collapsing
telescope) into just two terms.
∞ 1
2. Evaluate the series .
P
k=1 k(k + 1)
Solution The partial sum for the given series can be evaluated by writing it as a
telescoping sum:
n n
1 1 1
X X
sn = = −
k(k + 1) k k+1
k=1 k=1
1 1 1 1 1 1 1 1
= − + C − + C − + ··· + C −
1 2 2C 3 3C 4 nC n+1
1 1
= − .
1 n+1
Thus,
1 1
lim sn = lim − = 1.
n→∞ n→∞ 1 n+1
Hence,
∞
X 1
= 1.
k(k + 1)
k=1
6.2 Series 353
1. If ak converges and c is a real number, then the series cak converges and
P P
X X
cak = c ak .
X X X
(ak ± bk ) = ak ± bk .
∞ ∞
3. If N is a positive integer, then ak and ak either both converge or both diverge.
P P
k=1 k=N
In general, changing a finite number of terms in a convergent series does not change its
convergence, although it does change the value of the series.
Justification:
n ∞
1. Let sn = ak and lim sn = s. Then the nth partial sum for the series cak is
P P
k=1 n→∞ k=1
n
X n
X
un = cak = c ak = csn ,
k=1 k=1
and
∞
X ∞
X
cak = c ak .
k=1 k=1
2. Let
n
X n
X
sn = ak , tn = bk ,
k=1 k=1
∞
and lim sn = s, lim tn = t. Then the nth partial sum for the series (ak + bk ) is
P
n→∞ n→∞ k=1
n
X n
X n
X
un = (ak + bk ) = ak + bk = sn + tn ,
k=1 k=1 k=1
and
∞
X ∞
X ∞
X
(ak + bk ) = ak + bk .
k=1 k=1 k=1
∞
X ∞
X ∞
X
(ak − bk ) = ak − bk .
k=1 k=1 k=1
∞ ∞
If ak converges, then the right side has a finite value as n tends to ∞, so
P P
ak
k=1 k=N
converges. Similarly, it is easy to see that, from the equality
n
X N
X −1 n
X
ak = ak + ak ,
k=1 k=1 k=N
∞ ∞
if ak converges, then ak converges.
P P
k=N k=1
If bk is generated by changing a finite number of terms in a convergent series ak ,
P P
then there exists a sufficiently large N , such that, when n > N ,
n
X n
X
bk = ak .
k=N k=N
∞
where K is a fixed constant. It is easy to see from the last equality that bk converges,
P
k=1
∞
while its value may differ from the value of ak .
P
k=1
Besides the geometric series and telescoping series, generally, it is not easy to find the sum
of a series. However, it is possible to study convergence of a series without knowing its sum.
6.2 Series 355
In MATLAB, we can use the command symsum to evaluate the sum of a series. In the
following, we will show two examples.
∞ 1 1
1. .
P
−
k=1 2 2k+1
k
Solution
>> syms k
>> f = 1/2^ k - 1/2^( k + 1) ;
>> symsum (f ,k ,1 , Inf )
ans =
1/2
∞ 1
2. .
P
k=1 k(k + 1)
Solution
>> syms k
>> f = 1/( k *( k + 1) ) ;
>> symsum (f ,k ,1 , Inf )
ans =
The convolution is an operation on two functions to produce a third function that shows
how the shape of one of the original functions is modified by the other one. For two functions
f [n] and g[n] defined on the set Z of integers, the discrete-time convolution of f [n] and g[n]
is given by
∞
X
f [n] ? g[n] = f [m]g[n − m].
m=−∞
The discrete-time convolution has wide applications in engineering fields, e.g., computer
vision, natural language processing and digital signal processing (DSP) systems.
For example, the block diagram for a linear time-invariant (LTI) system is shown below,
where x[n] is the input and y[n] is the output.
356 Infinite Sequences and Series
The output of the system y[n] is the convolution of the input x[n] with the system’s
response to an impulse, i.e., the impulse response. Mathematically, it can be written as
Correlation is a way to compare signals with each other and search for similarities between
signals. The signal correlation can be performed either between two different signals or with
one signal.
Specifically, the correlation between two different signals is called cross-correlation.
Given two signals x[n] and y[n], the cross-correlation between x[n] and y[n] is defined as
∞
X
Rxy [k] = x[m]y[m − k].
m=−∞
There are many applications of signal cross-correlation in signal processing systems. For
example, when a signal is corrupted by another undesirable signal, e.g., noise, during trans-
mission, the cross-correlation is then used to estimate the signal at the receiver side.
The correlation with one signal is called auto-correlation. For the signal x[n], its auto-
correlation is defined as
X∞
Rxx [k] = x[m]x[m − k].
m=−∞
The auto-correlation is widely applied in radar, sonar, satellite, wireless communication sys-
tems, etc.
Assume a programmer has 85% chance of finding a bug every time he compiles his code.
Then, the probability that he finds the bug at the kth (k ≥ 1) trial can be calculated as
Note that the probability that the programmer finds the bug at the kth trial, i.e., p(k), obeys
the geometric distribution.
Suppose that the total number of chances that the programmer can try to find the bug
every workday is n. Then, the probability that the programmer can find the bug before he
6.2 Series 357
∞
X
The result above shows that the series (1 − 0.85)k−1 0.85 converges to 1. Note that this
k=1
∞
X
result holds for any bug finding probability q ∈ (0, 1], i.e., (1 − q)k−1 q = 1 for any
k=1
0 < q ≤ 1. It means if given enough times of trial, no matter how proficient the programmer
is, he can find the bug for sure.
The Poisson distribution is a discrete probability distribution that describes the likelihood
of a given number of events occurring within a fixed interval of time (or space), if these events
occur 1) with a knowing constant average rate, and 2) independently of the time since the
last event occurred. The Poisson distribution can be used to model quite a large number of
processes, e.g., the number of births expected during the night in a hospital, the number of
arrivals in any service facility such as at an ATM, bank, bus station and petrol pump, and
the number of clicks on any website.
Let the probability of k arrivals at a bus station during a fixed time interval be denoted as
p(k). Since p(k) obeys the Poisson distribution, we have
λk
p(k) = e−λ
k!
where λ is the average number of arrivals at the bus station during the fixed time interval.
Furthermore, it can be proved that
∞ ∞
X X λk
s= p(k) = e−λ = 1.
k!
k=0 k=0
The convergent series above means there is either no arrival or at least one arrival at the bus
station during the fixed time interval, which is consistent with the intuition.
358 Infinite Sequences and Series
Divergence Test
Justification:
n
If ak is convergent, by the definition, lim sn = s exists, where sn = ak . Thus,
P P
n→∞ k=1
∞ (−1)k k 2
Show that the series diverges.
P
k=1 k + 1
2
Solution Since, as k → ∞,
(−1)k k 2 k2 k2 1
k2 + 1 = k2 + 1 = =
1
→ 1 6= 0,
1
k 1+ 2
2 1 +
k k2
(−1)k k 2
we know that lim 6= 0. Hence, by the Divergence Test, the given series is divergent.
k→∞ k 2 + 1
1. If lim ak 6= 0, then either the limit does not exist, or the limit exists but does not
k→∞
equal to 0.
2. If lim ak = 0, the Divergence Test is inconclusive. In other words, the zero limit of
k→∞
the sequence {an } is not sufficient for the convergence of the series ak . An example
P
P1
of such kind of series is the so-called harmonic series .
k
the sequence {sn } does not have a finite limit. For the first few terms, we see that
s2 = 1 + 12 ,
s4 = 1 + 1
+ 1
+ 1
>1+ 1
+ 1
+ 1
= 1 + 22 ,
2 3 4 2 4 4
s8 = 1 + 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
2 3 4 5 6 7 8
>1+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
= 1 + 32 ,
2 4 4 8 8 8 8
s16 = 1 + 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 9 + 10 + · · · + 16
1 1 1
2 3 4 5 6 7 8
>1+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 16 + 16 + · · · + 16
1 1 1
= 1 + 24 .
2 4 4 8 8 8 8
∞ (−1)k k 2
Show the convergence/divergence of the series in MATLAB.
P
k=1 k + 1
2
Solution We will use the Divergence Test to verify the convergence/divergence of the
series, as shown in the following:
>> syms k
>> f = ( -1) ^ k * k ^2/( k ^2 + 1) ;
>> limit ( abs ( f ) ,k , Inf )
ans =
Note that in MATLAB, the command abs(x) can calculate the absolute value of x. From
(−1)k k 2 (−1) k 2
k
the result above, we see that limk→∞ 2 = 1 6= 0, which means limk→∞ 6= 0.
k +1 k2 + 1
∞ (−1) kk 2
Hence, according to the Divergence Test, we know that the series is divergent.
P
k=1 k + 1
2
In other words:
ˆ ∞ ∞
1. If f (x) dx is convergent, then ak is convergent;
P
1 k=1
ˆ ∞ ∞
2. If f (x) dx is divergent, then ak is divergent.
P
1 k=1
y = f (x)
Justification:
ˆ ∞ ∞
1. Suppose f (x) dx converges. To show that f (k) converges, since f ≥ 0, we only
P
1 k=1
n
need to show that f (k) is bounded with respect to n.
P
k=1
Since
∞ 2 ∞
X 1 X 1 X 1
= + ,
(2k − 5) 2 (2k − 5) 2 (2k − 5)2
k=1 k=1 k=3
∞ 1
we know that is indeed convergent.
P
k=1 (2k − 5)2
362 Infinite Sequences and Series
∞ 1
Hence, by the Integral Test, the harmonic series is divergent.
P
k=1 k
∞ k
1. Determine whether the series converges.
P
k=1 k2 +1
Solution Consider the function f (x) =
x y
. It is clear that f is a continuous,
x2 + 1
positive function on [1, ∞). It is decreas-
ing on (1, ∞), since 1
2
0
1 · (x2 + 1) − x · 2x
x
f 0 (x) = =
x +1
2 (x2 + 1)2
x
x2 − 1 O 1 2 3 4 5 6
=− 2 < 0.
(x + 1) 2
ˆ ∞
x
The improper integral 2+1
dx is divergent:
1 x
ˆ ∞ ˆ b
x x b
dx = lim dx = lim 21 ln(x2 + 1)x=1
1 x2 + 1 b→∞ 1 +1 x2 b→∞
1
= lim ln(b2 + 1) − ln 2 = ∞.
b→∞ 2
∞ k
Hence, by the Integral Test, the series is divergent.
P
k=1 k2 +1
1 ∞
2. Determine whether the series converges.
P
k=1 +2 k2
1
Solution Consider the function f (x) = 2 . It is clear that f is a continuous, posi-
x +2
6.3 Integral Test 363
ˆ ∞
1
tive, decreasing function on [1, ∞). The improper integral dx is convergent:
1 x2 + 2
ˆ ∞ ˆ
1 1 b
dx = lim dx
1 x2 +2 b→∞ 1 x 2+2
b
= lim √12 tan−1 √12 x
b→∞
h x=1 i
= lim √2 tan
1 −1 √ b − tan−1
1
2
√1
2
b→∞
= √12 π2 − tan−1 √12 .
∞ 1
Hence, by the Integral Test, the series is convergent.
P
k 2+2
k=1
1 ∞
3. Determine whether the series converges.
P
√
k=1 2k −1
1
Solution Consider the function f (x) = √ . It is clear that f is a continuous,
2x − 1 ˆ ∞
y = f (x)
1
positive, decreasing function on [1, ∞). The improper integral √ dx is di-
1 2x −1
vergent:
ˆ ∞ ˆ
1 1b
√ dx = lim dx
√
1 2x − 1 b→∞ 1 2x − 1
√ b √
= lim 2x − 1x=1 = lim 2b − 1 − 1 = ∞.
b→∞ b→∞
∞ 1
Hence, by the Integral Test, the series is divergent.
P
√
k=1 2k − 1
∞ ln k
4. Determine whether the series converges.
P
k=1 k
1
ln x
0 · x − ln x · 1
f (x) =
0
= x
x x2 x
O 1 2 3 4 5 6
ln x − 1
=− 2 < 0.
(x + 1)2
364 Infinite Sequences and Series
ˆ ∞
ln x
The improper integral dx is divergent:
3 x
ˆ ∞ ˆ
ln x ln x
b
dx = lim dx
3 x b→∞ 3 x
b
= lim 12 ln2 xx=3 = lim 1
ln2 b − ln2 3 = ∞.
b→∞ b→∞ 2
∞ ln k ∞ ln k
Thus, by the Integral Test, the series is divergent. Hence is divergent.
P P
k=3 k k=1 k
∞ 1
5. Show that the series √ converges.
P
k=1 k3
1
Solution Consider the function f (x) = √ . It is clear that f is a continuous, positive,
x3 ˆ ∞
1
decreasing function on [1, ∞). The improper integral √ dx is convergent:
1 x3
ˆ ∞ ˆ b
1 1
√ dx = lim √ dx
x 3 b→∞ x3
1 1
b
2 1
= lim − √ = lim 2 1 − √ = 2.
b→∞ x x=1 b→∞ b
∞ 1
Hence, by the Integral Test, the series √ is convergent. This is a special case of
P
k=1 k3
the p-series.
Justification:
1 1 1
If p < 0, then lim = ∞. If p = 0, then lim p = 1. In either case lim p 6= 0, so
k→∞ kp k→∞ k k→∞ k
the p-series diverges by the Divergence Test.
1
If p > 0, then the function f (x) = p is clearly continuous, positive, and decreasing on
x
6.3 Integral Test 365
ˆ ∞
1
[1, ∞). For the improper integral dx,
1 xp
ˆ ∞ ˆ b
1 1 b
x−p+1
when p 6= 1 : dx = lim dx = lim
1 xp b→∞ 1 x
p b→∞ −p + 1 x=1
1
−p+1
b
= lim −
b→∞ −p + 1 −p + 1
1
, if p > 1;
= p−1
∞, if p < 1;
ˆ ∞ ˆ b
1 1 b
when p = 1 : dx = lim dx = lim ln x|x=1
1 xp b→∞ 1 x b→∞
= lim ln b = ∞,
b→∞
so that it converges if p > 1 and diverges if p ≤ 1. It follows from the Integral Test that the
∞ 1
converges if p > 1 and diverges if 0 < p ≤ 1.
P
p-series p
k=1 k
We will determine whether the following series are convergent by applying the Integral
Test.
∞ k
1. .
P
k 2+1
k=1
Solution
>> syms x
>> f ( x ) = x /( x ^2 + 1) ;
>> int ( f ( x ) ,1 , Inf )
ans =
Inf
ˆ ∞ ∞
x k
Since dx = we thus know that is divergent.
P
∞,
1 x +1
2
k=1 k + 1
2
∞ 1
2. .
P
k=1 k2 +2
Solution
>> syms x
366 Infinite Sequences and Series
>> f ( x ) = 1/( x ^2 + 2) ;
>> int ( f ( x ) ,1 , Inf )
ans =
>> syms x
>> f ( x ) = 1/ sqrt (2* x - 1) ;
>> int ( f ( x ) ,1 , Inf )
ans =
Inf
ˆ ∞
1 ∞ 1
Since dx = ∞, the series is thus divergent.
P
√ √
1 2x − 1 k=1 2k −1
∞ ln k
4. .
P
k=1 k
Solution
>> syms x
>> f ( x ) = log ( x ) / x ;
>> int ( f ( x ) ,1 , Inf )
ans =
Inf
ˆ ∞
ln x ∞ ln k
Since dx = ∞, the series is thus divergent.
P
1 x k=1 k
∞ 1
5. √ .
P
k=1 k3
>> syms x
6.3 Integral Test 367
ans =
2
ˆ ∞
1 ∞ 1
We see from the result above that √ dx < ∞, the series √ is thus conver-
P
x 3 k=1 k3
1
gent.
Suppose f is a continuous, positive, decreasing function on [1, ∞). Let ak = f (k) and
∞ ∞
suppose ak = s is convergent. Denote Rn = s − sn = ak . Then
P P
k=1 k=n+1
ˆ ∞ ˆ ∞
1. f (x) dx ≤ Rn ≤ f (x) dx;
n+1 n
ˆ ∞ ˆ ∞
2. sn + f (x) dx ≤ s ≤ sn + f (x) dx.
n+1 n
Justification:
1. We apply the same ideas as in the Integral Test, assuming that f is decreasing on
[n, ∞).y =
Comparing
f (x) the areas of the rectangles with
y =the
f (x)area under y = f (x) for x > n,
we see that ˆ ∞
Rn = an+1 + an+2 + · · · ≤ f (x) dx.
n
Similarly, we have ˆ ∞
Rn = an+1 + an+2 + · · · ≥ f (x) dx.
n+1
y y
an+1
an+1
an+2 an+2 an+3
an+3 a ... an+4
n+4 ...
O n
x O n+1
x
368 Infinite Sequences and Series
2. Adding sn to each side of the inequalities in part 1, we get the desired inequalities in
part 2.
6.44 Example:
1. How many terms of the series must be used to obtain an approximation that is within
10−4 of the exact value of the series?
2. Find an approximation to the series using 50 terms of the series.
1
Solution The function associated with this series is f (x) = . Clearly it is continuous,
x2
positive, and decreasing on [1, ∞).
so that
1 1
s50 + < s < s50 + ,
51 50
50 1
where s50 = . By using a calculator, we have s50 ≈ 1.62513273, which has 8th
P
2
k=1 k
decimal place accuracy. Thus,
Taking the average of these two bounds as our approximation of s, we find that s ≈
1.64493665.
π2
For comparison, = 1.64493406 · · · . We see that our approximation matches first
6
five decimal places.
6.4 Convergence Tests for Nonnegative Series 369
Justification:
n
X n
X ∞
X
sn = ak , tn = bk , t= bk
k=1 k=1 k=1
Since both series have positive terms, the sequences {sn } and {tn } are increasing.
Because tn → t, we have tn ≤ t for all n. Since ak ≤ bk , we have sn ≤ tn . Thus,
sn ≤ t for all n. This means that {sn } is increasing and
Pbounded above and therefore
converges by the Monotonic Sequence Theorem. Thus ak converges.
2. Suppose bk is divergent. We show that ak is divergent by contradiction.
P P
∞ k
1. Determine whether the series converges.
P
k=1 3k 3 − k2 + 1
Solution The given series has all positive term
terms. For any integer k ≥ 1,
1
k
k k 3k − k + 1 3 2
= 3 1
3k − 2k + 1
3 2k + (k − k ) + 1
3 2
0.5
k 2
k k
≤ 3 < 3
2k + 1 2k
k
1 1 2 3 4 5 10
< 2.
k
∞ 1
Since the p-series is convergent (p = 2), by the Comparison Test, the series
P
2
k=1 k
∞ k
is convergent.
P
k=1 3k 3 − k2 + 1
370 Infinite Sequences and Series
∞ ln k
2. Determine whether the series converges.
P
2
k=1 k
< 2 = 3. k2
1
k2 k k2 3
k2
0.5
P 1
∞
Since the p-series 3 is convergent
k=1 k 2
k
(p = 32 ), by the Comparison Test, the se- 1 2 3 4 5 10
∞ ln k
ries is convergent.
P
2
k=1 k
0.a1 a2 a3 · · · ,
ak
lim = c.
k→∞ bk
1. If 0 < c < ∞ (that is, c is a finite positive number), then ak and bk either both
P P
converge or both diverge.
Justification:
1. If 0 < c < ∞, let m and M be positive numbers such that m < c < M . Because
ak
→ c as k → ∞, there is an integer K such that
bk
ak
m< <M for k > K,
bk
or equivalently,
mbk < ak < M bk for k > K.
If bk converges, so does bk . Thus ak converges by part 1 of the Comparison
P P P
MP
Test. If diverges, so does and part 2 of the Comparison Test shows that
P
bk mbk
an diverges.
P
It follows from part 1 of the Comparison Test that if bk converges, then ak con-
P P
verges.
3. If c = ∞, similarly as in Case 1, there is an integer K such that
It follows from part 2 of the Comparison Test that if bk diverges, then ak diverges.
P P
∞ k
1. Determine whether the series converges.
P
k=1 3k 3 − k2 + 1
Solution The given series has all positive terms. We calculate the limit of the ratio of
∞ 1
the kth terms of the series and the p-series (p = 2):
P
2
k=1 k
k
3k 3 − 2k + 1 = lim k3 1 1
lim = lim = .
k→∞ 1 k→∞ 3k − 2k + 1
3 k→∞ 2 1 3
3− 2 + 3
k2 k k
Since the p-series (p = 2) is convergent, by the Limit Comparison Test, the series
∞ k
is convergent.
P
k=1 3k 3 − k2 + 1
∞ k2
2. Determine whether the series converges.
P
k=1 3k − k + 1
3 2
Solution The given series has all positive terms. We calculate the limit of the ratio of
372 Infinite Sequences and Series
∞ 1
the kth terms of the series and the harmonic series :
P
k=1 k
k2
3k 3 − 2k + 1 = lim k3 1 1
lim = lim = .
k→∞ 1 k→∞ 3k − 2k + 1
3 k→∞ 2 1 3
3− 2 + 3
k k k
Since the harmonic series is divergent, by the Limit Comparison Test, the series
∞ k2
is divergent.
P
k=1 3k − k + 1
3 2
∞ ln k
3. Determine whether the series converges.
P
2
k=1 k
3
Solution The given series has nonnegative terms. Since ln k k 2 as k → ∞, we have
ln k
2 ln k
lim k = lim 1 = 0.
k→∞ 1 k→∞ k 2
3
k2
∞ 1
It is known that the p-series 3 is convergent (p = 2 ), by the Limit Comparison
3
P
k=1 k 2
∞ ln k
Test, the series is convergent.
P
2
k=1 k
∞ ln k
4. Determine whether the series converges.
P
k=1 k
Solution The given series has nonnegative terms. Since 1 ln k as k → ∞, we have
ln k
lim k = lim ln k = ∞.
k→∞ 1 k→∞
k
∞ 1
It is known that the harmonic series is divergent, by the Limit Comparison Test,
P
k=1 k
∞ ln k
the series is divergent.
P
k=1 k
ak+1
1. If lim = L < 1, then the series ak converges.
P
k→∞ ak
ak+1 ak+1
2. If lim = L > 1 or lim = ∞, then the series ak diverges.
P
k→∞ ak k→∞ ak
ak+1
3. If lim = 1, the test is inconclusive.
k→∞ ak
Justification:
ak+1
1. If lim = L < 1, we take any number r such that L < r < 1. Thus, there is K
k→∞ ak
such that when k ≥ K,
ak+1
< r − L =⇒ −(r − L) < ak+1 − L < r − L
ak − L ak
ak+1
=⇒ <r
ak
=⇒ ak+1 < r · ak .
Putting k successively equal to K, K + 1, K + 2, . . . in the inequality, we obtain
aK+1 < r · aK ,
aK+2 < r · aK+1 < r2 · aK ,
aK+3 < r · aK+2 < r3 · aK ,
..
.
so that
aK+k < rk · aK , for all k ≥ 1.
∞
Since |r| = r < 1, the geometric series aK rk converges. By the Comparison Test,
P
k=1
∞ ∞
the series ak converges. Hence, ak converges.
P P
k=K+1 k=1
∞ 1 ∞ 1
3. Consider the p-series with p = 1 and with p = 2 > 1. The former is
P P
2
k=1 k k=1 k
divergent and the latter is convergent. For both series, we have
ak+1
lim = 1.
k→∞ ak
ak+1
Hence, the Ratio Test is inconclusive if lim = 1.
k→∞ ak
∞ bk
1. Determine whether the series converges, where b > 0.
P
k=1 k!
Solution The given series has all positive terms. Since, for any b > 0,
bk+1
(k + 1)! b
lim = lim = 0,
k→∞ bk k→∞ k + 1
k!
∞ bk
by the Ratio Test, the series is convergent for any positive b.
P
k=1 k!
∞ k!
2. Determine whether the series converges.
P
k
k=1 k
Solution The given series has all positive terms. The ratio of two consecutive terms is
(k + 1)!
(k + 1)k+1 1 1
= = k .
k! (k + 1) k
1
kk 1+
kk k
x k
1 1
Since e = lim 1+ , we have e = lim 1 + , so that
x→∞ x k→∞ k
(k + 1)!
(k + 1)k+1 1 1
lim = = < 1.
k→∞ k!
1
k e
kk lim 1 +
k→∞ k
∞ k!
By the Ratio Test, the series is convergent.
P
k
k=1 k
6.4 Convergence Tests for Nonnegative Series 375
>> syms b k
>> assume (b , ' positive ') % b > 0
>> assume (k , ' positive ') % k > 0
>> assumeAlso (k , ' integer ') % k is also an integer
>> a ( k ) = b ^ k / factorial ( k ) ;
>> ratio_a = simplify ( a ( k + 1) / a ( k ) ) ;
>> limit ( ratio_a ,k , inf )
ans =
Note that we can set assumptions on symbolic objects using commands assume and
assumeAlso. To calculate factorial in MATLAB, the command factorial is used.
Moreover, the command simplify is used for symbolic simplification, so that the cal-
culation of the limit for the factorial ratio becomes feasible.
∞ k
ak+1 X b
The result above shows that lim = 0 < 1, then the series is convergent.
k→∞ ak k!
k=1
∞
X k!
2. .
kk
k=1
Solution
>> syms k
>> assume (k , ' positive ') % k > 0
>> assumeAlso (k , ' integer ') % k is also an integer
>> a ( k ) = factorial ( k ) / k ^ k ;
>> ratio_a = simplify ( a ( k + 1) / a ( k ) ) ;
>> limit ( ratio_a ,k , inf )
ans =
exp ( -1)
∞
ak+1 X k!
From the result above, we see that lim = e−1 < 1, so that the series is
k→∞ ak kk
k=1
convergent.
376 Infinite Sequences and Series
√
1. If lim k ak = L < 1, then the series ak converges.
P
k→∞
√ √
2. If lim ak = L > 1 or lim ak = ∞, then the series ak diverges.
P
k k
k→∞ k→∞
√
3. If lim k ak = 1, the test is inconclusive.
k→∞
Justification:
√
1. If lim k ak = L < 1, we take any number r such that L < r < 1. Thus, there is K
k→∞
such that when k ≥ K,
√ √
| k ak − L| < r − L =⇒ −(r − L) < k ak − L < r − L
√
=⇒ k ak < r
=⇒ ak < rk .
When |r| < 1, the geometric series r converges. By the Comparison Test, the series
P k
∞ ∞
ak converges. Hence, ak converges.
P P
k=K k=1
∞1 1 ∞
3. Consider the p-series with p = 1 and with p = 2 > 1. The former is
P P
k k 2
k=1 k=1
divergent and the latter is convergent. For both series, we have
√
lim k
ak = 1.
k→∞
√
Hence, the Root Test is inconclusive if lim k ak = 1.
k→∞
6.4 Convergence Tests for Nonnegative Series 377
k
∞ 3k − 1
1. Determine whether the series converges.
P
k=1 4k + 1
Solution The given series has all positive terms. It is easy to have
1
3−
s
k
3k − 1 3k − 1 k = 3 < 1.
lim = lim = lim
k
∞
−k2
k
2. Determine whether the series converges.
P
k=1 k+1
x
1
Solution The given series has all positive terms. Since e = lim 1 + , we have
x→∞ x
k
1
e = lim 1 + , so that
k→∞ k
s
−k2 k k
k+1 1
k
lim = lim = lim 1 + = e > 1.
k
∞
−k2
k
By the Root Test, the series is divergent.
P
k=1 k+1
>> syms k
>> assume (k , ' positive ') % k > 0
>> assumeAlso (k , ' integer ') % k is also an integer
>> a ( k ) = ((3* k - 1) /(4* k + 1) ) ^ k ;
>> root_a = ( a ( k ) ) ^(1/ k ) ;
>> limit ( root_a ,k , inf )
ans =
378 Infinite Sequences and Series
3/4
∞ k
ak+1 3 X 3k − 1
The result above shows that lim = < 1, then the series is
k→∞ ak 4 4k + 1
k=1
convergent.
2
∞ −k
X k
2. .
k+1
k=1
Solution
>> syms k
>> assume (k , ' positive ') % k > 0
>> assumeAlso (k , ' integer ') % k is also an integer
>> a ( k ) = ( k /( k + 1) ) ^( - k ^2) ;
>> root_a = ( a ( k ) ) ^(1/ k ) ;
>> limit ( root_a ,k , inf )
ans =
exp (1)
2
∞ −k
ak+1 X k
We see from the result above that lim = e > 1, so that the series
k→∞ ak k+1
k=1
is divergent.
Alternating Series
An alternating series is a series whose terms are alternately positive and negative. The
following are two examples of alternating series:
∞
1 1 1 1 1 X (−1)k−1
1− + − + − + ··· = ,
2 3 4 5 6 k
k=1
∞ √
√ √ √ √ √ X
−1 + 2− 3+ 4− 5+ 6 − ··· = (−1)k
2 3 4 5 6 k
k.
k=1
6.5 Convergence Tests for General Series 379
∞
In general, an alternating series ak has its kth term in the form
P
k=1
ak = (−1)k−1 bk or ak = (−1)k bk ,
converges if
Justification:
First consider the even partial sums:
s2 = b1 − b2 ≥ 0, since b1 ≥ b2
s4 = s2 + (b3 − b4 ) ≥ s2 , since b3 ≥ b4
..
.
s2n = s2n−2 + (b2n−1 − b2n ) ≥ s2n−2 since b2n−1 ≥ b2n
Also,
s2n = b1 − (b2 − b3 ) − (b4 − b5 ) − · · · − (b2n−2 − b2n−1 ) − b2n ≤ b1 .
So, {s2n } is increasing and bounded above. Hence, it is convergent by the Monotonic Sequence
Theorem. Denote s = lim s2n . Now we compute the limit of the odd partial sums:
n→∞
Since both the even and odd partial sums converge to s, we have lim sn = s and so the
n→∞
series is convergent.
1
where bk = satisfies
k
bk ≥ bk+1 > 0 and lim bk = 0.
k→∞
>> syms k
>> assume (k , ' positive ') % k > 0
>> assumeAlso (k , ' integer ') % k is also an integer
>> b ( k ) = 1/ k ;
>> limit ( b ( k ) ,k , inf )
ans =
>> Delta_b = b ( k ) - b ( k + 1) ;
>> isAlways ( Delta_b > 0)
ans =
logical
Note that the command isAlways can be used to test whether a mathematical statement is
true or not. If the mathematical statement is true, then the result will be 1; if it is false,
then the result will be 0.
From the above result, we see that lim bk = 0 and bk > bk+1 . Therefore, according to the
∞
X 1
Alternating Series Test, the series (−1)k−1 bk where bk = is convergent.
k
k=1
then
|Rn | = |s − sn | ≤ bn+1 .
Justification:
s2 = b1 − b2 ≥ 0, since b1 ≥ b2
s4 = s2 + (b3 − b4 ) ≥ s2 , since b3 ≥ b4
..
.
s2n = s2n−2 + (b2n−1 − b2n ) ≥ s2n−2 since b2n−1 ≥ b2n
Similarly, the odd partial sums {s2n+1 } form a decreasing sequence. Because we know that
both {s2n } and {s2n+1 } converge to s, we get
It follows that
|Rn | = |s − sn | ≤ |sn+1 − sn | = bn+1 .
6.61 Example:
1. How many terms of the series must be used to obtain an approximation that is within
10−4 of the exact value of the series?
2. What is the approximation value?
Solution Write
∞ n
X (−1)k X (−1)k
= + Rn .
k! k!
k=0 k=0
1. Using the bound on the remainder in the Alternating Series Test, we have
1
|Rn | < .
(n + 1)!
1
Thus, to ensure that |Rn | < 10−4 , we need to choose n so that < 10−4 , or
(n + 1)!
7 (−1)k
n > 7. Hence, the finite series gives an approximation that is within 10−4 of
P
k=0 k!
the exact value of the series.
382 Infinite Sequences and Series
2. Using the bounds on the series in the Alternating Series Test, we have
1 1
s7 − < s < s7 + ,
8! 8!
7 (−1)k
where s7 = . By using a calculator, we have s7 ≈ 0.36786, which has 5th
P
k=0 k!
decimal place accuracy. Thus,
Taking the average of these two bounds as our approximation of s, we find that s ≈
0.36787.
∞ (−1)k
For comparison, = e−1 = 0.3678794412 · · · . We see that our approximation
P
k=0 k!
indeed is within 10−4 of the exact value of the series.
Justification:
It is clear that
0 ≤ ak + |ak | ≤ 2|ak |, for all k.
If
P ak is absolutely convergent, then 2|ak | is convergent. By the Comparison Test,
P P
(ak + |ak |) is convergent. Thus,
X X X
ak = (ak + |ak |) − |ak |
is convergent.
6.5 Convergence Tests for General Series 383
∞ 1
1. The p-series , with p = 2, is convergent, so the alternating series
P
2
k=1 k
∞
X (−1)k−1 1 1 1
=1− + − + ···
k2 4 9 16
k=1
is absolutely convergent.
∞ (−1)k−1
2. The alternating harmonic series is convergent by the Alternating Series
P
k=1 k
∞ 1 ∞ (−1)k−1
Test, but the harmonic series = is divergent, so the alternating
P P
k=1 k k
k=1
harmonic series is conditionally convergent.
There are some fundamental differences between absolutely convergent series and condi-
tionally convergent series.
Riemann discovered a striking result, known as the Riemann Rearrangement Theorem. It
says that for any given number α, a conditionally convergent series may be rearranged in its
terms so that the rearranged series converges to α.
384 Summary
Summary
If lim f (x) = L and f (n) = an when n is an integer, then lim an = L. The same result
x→∞ n→∞
holds when L = ∞ or −∞.
Suppose {an } and {bn } are convergent sequences and c is a constant. Then the following
hold.
385
an lim an
5. lim = n→∞ if lim bn 6= 0.
n→∞ bn lim bn n→∞
n→∞
h ip
6. lim apn = lim an if p > 0 and an > 0.
n→∞ n→∞
For any real numbers p > 0, q > 0, r > 0, and b > 1, the following asymptotic relations
hold: as n → ∞,
lnq n np np lnr n bn n! nn .
lim rn = 1, if r = 1;
n→∞
diverges, if r ≤ −1 or r > 1.
1. If ak converges and c is a real number, then the series cak converges and
P P
X X
cak = c ak .
X X X
(ak ± bk ) = ak ± bk .
∞ ∞
3. If N is a positive integer, then ak and ak either both converge or both diverge.
P P
k=1 k=N
In general, changing a finite number of terms in a convergent series does not change its
convergence, although it does change the value of the series.
Suppose f is a continuous, positive, decreasing function on [1, ∞). Let ak = f (k) and
∞ ∞
suppose ak = s is convergent. Denote Rn = s − sn = ak . Then
P P
k=1 k=n+1
ˆ ∞ ˆ ∞
1. f (x) dx ≤ Rn ≤ f (x) dx;
n+1 n
ˆ ∞ ˆ ∞
2. sn + f (x) dx ≤ s ≤ sn + f (x) dx.
n+1 n
ak
lim = c.
k→∞ bk
1. If 0 < c < ∞ (that is, c is a finite positive number), then ak and bk either both
P P
converge or both diverge.
ak+1
1. If lim = L < 1, then the series ak converges.
P
ak
k→∞
ak+1 ak+1
2. If lim = L > 1 or lim = ∞, then the series ak diverges.
P
k→∞ ak k→∞ ak
388 Summary
ak+1
3. If lim = 1, the test is inconclusive.
k→∞ ak
√
1. If lim k ak = L < 1, then the series ak converges.
P
k→∞
√ √
2. If lim ak = L > 1 or lim ak = ∞, then the series ak diverges.
P
k k
k→∞ k→∞
√
3. If lim k ak = 1, the test is inconclusive.
k→∞
converges if
then
|Rn | = |s − sn | ≤ bn+1 .
7
Series of Functions
Taylor Polynomials
√
7.2 Example: linear approximation and quadratic approximation for x
√
Find the linear approximation and √the quadratic approximation for x at x = 1. Then
use them to approximate the value of√ 1.03.
Solution For the function f (x) = x, we have
1 3
f 0 (x) = 12 x− 2 , f 00 (x) = − 14 x− 2 .
Thus, the linear approximation and the quadratic approximation at x = 1 are, respectively,
Let f be a function with f 0 , f 00 , . . . , and f (n) defined at a. The nth-order Taylor poly-
nomial for f with its center at a is
Pn (a) = f (a), Pn0 (a) = f 0 (a), Pn00 (a) = f 00 (a), ..., Pn(n) (a) = f (n) (a),
Then
f 00 (a) f (n) (a)
Pn (x) ≡ Tn (x) = f (a) + f 0 (a)(x − a) + (x − a)2 + · · · + (x − a)n .
2! n!
Justification:
Write Pn as
Pn (x) = c0 + c1 (x − a) + · · · + cn (x − a)n .
The equation Pn (a) = f (a) gives c0 = f (a). Differentiating the expression of Pn and evalu-
ating at x = a gives Pn0 (a) = c1 , so that c1 = f 0 (a). In general, differentiating the expression
(k) f (k) (a)
of Pn for k times and evaluating at x = a gives Pn (a) = ck · k!, so that ck = . Hence,
k!
f 00 (a) f (n) (a)
Pn (x) = f (a) + f 0 (a)(x − a) + (x − a)2 + · · · + (x − a)n = Tn (x).
2! n!
Thus, the first few Taylor polynomials for f (x) = ex centered at 0 are:
T0 (x) = f (0) = 1,
T1 (x) = f (0) + f 0 (0)x = 1 + x,
f 00 (0) 2 x2
T2 (x) = f (0) + f 0 (0)x + x =1+x+ ,
2! 2!
f 00 (0) 2 f 000 (0) 3 x2 x3
T3 (x) = f (0) + f (0)x +
0
x + x =1+x+ + ,
2! 3! 2! 3!
f 00
(0) f 000
(0) f (4)
(0) x2 x3 x4
T4 (x) = f (0) + f 0 (0)x + x2 + x3 + x4 = 1 + x + + + .
2! 3! 3! 2! 3! 4!
y
y = T4 (x)
7
y = T3 (x)
x
6 y=e
5
y = T2 (x)
4
2 y = T1 (x)
y = T1 (x)
y = T0 (x)
x
−1 O 1
Using the Taylor polynomial T4 , we get the approximation to e0.1 (to 8th decimal places):
T4 (0.1) ≈ 1.10517083.
f (x) − Tn (x)
If f (n) (a) exists, then lim = 0, or equivalently, by using little-o notation,
x→a (x − a)n
n
X f (k) (a)
f (x) = Tn (x) + o(|x − a|n ) = (x − a)k + o(|x − a|n ), as x → a.
k!
k=0
7.1 Approximating Functions with Polynomials 395
Justification:
By applying l’Hospital’s Rule, we have
f (n) (a)
f (x) − Tn (x) f (x) − Tn−1 (x) − (x − a)n
lim = lim n!
x→a (x − a)n x→a (x − a)n
f (x) − Tn−1 (x) f (n) (a)
= lim −
x→a (x − a)n n!
H f (x) − Tn−1 (x) f (a) H
0 0 (n)
= lim − = ···
x→a n(x − a)n−1 n!
(n−1)
H f (n−1) (x) − Tn−1 (x) f (n) (a)
= lim −
x→a n(n − 1) · · · 2(x − a) n!
f (n−1) (x) − f (n−1) (a) f (n) (a)
= lim −
x→a n(n − 1) · · · 2(x − a) n!
1 f (n−1) (x) − f (n−1) (a) f (n) (a)
= · lim −
n! x→a x−a n!
1 f (a)
(n)
= · f (n) (a) − = 0.
n! n!
From the conclusion that f (x) = Tn (x) + o(|x − a|n ) (as x → a), we know that Tn (x)
approximates f (x) as x → a and the accuracy improves as n increases. However, this
does not imply that the sequence {Tn (x)} approaches f (x) as n → ∞. In fact, generally
f (x) 6= lim Tn (x).
n→∞
Tn (x) = 0 + 0 · x + · · · + 0 · xn = 0.
By Applying l’Hospital’s Rule, we can see that as x → 0,
>> syms x
>> f ( x ) = exp ( x ) ;
>> taylor ( f ( x ) ,x ,0 , ' Order ' ,4 + 1) % centered at 0 , order 4 ...
plus one constant term
ans =
Since the first term of the Taylor polynomial is a constant, the Taylor polynomial of order
4 for f (x) = ex has 5 terms. In other words, the value of ‘Order’ in the command taylor
is the required order of the Taylor polynomial plus 1.
where x is a variable and the ck ’s are constants called the coefficients of the series.
7.2 Represent Functions by Power Series 397
For any given function f , if f (n) (a) (n ≥ 0) all exist, then the Taylor series for f at a is
defined as
∞
X f (k) (a)
(x − a)k .
k!
k=0
The series is defined formally, since the series may not converge for some x at which f is
defined.
1
As an example, consider the function f (x) = . It has the following power series
1+x
(centered at 0):
1 − x + x2 − x3 + x4 − x5 + · · · .
In fact, we can have by induction that
(−1)n n!
f (n) (x) = ,
(1 + x)n
so that f (n) (0) = (−1)n n!. Thus, the Taylor series for f at 0 is
∞ ∞ ∞
X f (k) (0) X (−1)k k! X
xk = xk = (−1)k xk .
k! k!
k=0 k=0 k=0
It is clear that the function f is defined everywhere except at x = −1, but the series only
converges for |x| < 1.
∞
X f (k) (a)
f (x) = lim Tn (x) = (x − a)k , x ∈ I.
n→∞ k!
k=0
Justification:
It is clear that {Tn (x)} are the partial sums of the series
∞
X f (k) (a) f 00 (a) f (k) (a)
(x − a)k = f (a) + f 0 (a)(x − a) + (x − a)2 + · · · + (x − a)k + · · · .
k! 2! k!
k=0
Thus, we have
∞
X f (k) (a)
f (x) = (x − a)k .
k!
k=0
where z is, in general, a complex number. Alternatively, if the signal x[n] is defined only for
n ≥ 0, the one-sided Z-transform is defined as
∞
X
X(z) = x[n]z −n .
n=0
The Z-transform has been applied widely in science and engineering fields, e.g., probability
theory, digital signal processing (DSP) and control systems.
The Fourier series can represent periodic signals as sums of complex exponentials (or, sine
functions and cosine functions). Given a continuous-time periodic signal x(t), its continuous-
time Fourier series is defined as
∞
2π
X
x(t) = ak ej T kt
k=−∞
where ak is the Fourier series coefficient determined by x(t), and T is the period of x(t). From
the above definition, we see that the Fourier series can represent signals by their harmonics
2π
ej T kt .
The Fourier series has many applications in electrical engineering, signal processing, image
processing, acoustics, optics, etc. For example, since the Fourier series can represent signals
by their harmonics, it is thus very useful for the signals which can be naturally described by
harmonics, e.g., music signals.
Moreover, for a linear time-invariant (LTI) system with frequency response H(jω), if the
7.2 Represent Functions by Power Series 399
∞
2π
X
input is given by x(t) = ak ej T kt
, then the output is
k=−∞
∞
2π
2π
X
y(t) = ak H j k ej T kt .
T
k=−∞
Since the amplitude of each component is scaled by H j 2π T k , as seen above, the output of
the LTI system is thus a “filtered” version of the input. In other words, the Fourier series
motives a new representation of a system as a filter. This is useful for many systems, such
as the speech synthesis system.
Remainder Formulas
7.15 Theorem: integral form of the remainder
Justification:
We prove the remainder formula by induction.
For n = 0, the formula gives
ˆ
1 x
(x − t)0 f 0 (t) dt = f (x) − f (a) = f (x) − T0 (x) = R0 (x).
0! a
So, the formula is true for n = 0.
Suppose the formula holds for n = k:
ˆ
1 x
Rk (x) = (x − t)k f (k+1) (t) dt, x ∈ I.
k! a
Then, by integration by parts, we get
ˆ x
1
(x − t)k+1 f (k+2) (t) dt
(k + 1)! a
x ˆ
1 1 x
= (x − t)k+1 f (k+1) (t) + (x − t)k f (k+1) (t) dt
(k + 1)! t=a k! a
f (k+1) (a)
= Rk (x) − (x − a)k+1
(k + 1)
f (k+1) (a)
= f (x) − Tk (x) − (x − a)k+1
(k + 1)
= f (x) − Tk+1 (x) = Rk+1 (x).
400 Series of Functions
If f (n+1) is continuous in an open interval I that contains a, then there is c between a and
x such that
f (n+1) (c)
Rn (x) = (x − a)n+1 .
(n + 1)!
This formula is called the Lagrange remainder of Taylor series.
Justification:
Let x ∈ I be a fixed number.
If x > a, on the interval [a, x], the function f (n+1) has its minimum and maximum at s1
and s2 :
m = f (n+1) (s1 ), M = f (n+1) (s2 ),
respectively. Since m ≤ f (n+1) (t) ≤ M on [a, x], we have
ˆ ˆ ˆ
m x 1 x M x
(x − t)n dt ≤ (x − t)n f (n+1) (t) dt ≤ (x − t)n dt,
n! a n! a n! a
so that ˆ x
m(x − a) n+1
≤ (n + 1) (x − t)n f (n+1) (t) dt ≤ M (x − a)n+1 ,
a
or equivalently, ˆ
(n + 1) x
m≤ (x − t)n f (n+1) (t) dt ≤ M.
(x − a)n+1 a
M
|Rn (x)| ≤ |x − a|n+1 , x ∈ I.
(n + 1)!
7.2 Represent Functions by Power Series 401
∞
X f (k) (a)
f (x) = (x − a)k , x ∈ I.
k!
k=0
Justification:
(c)
(n+1)
f M
|Rn (x)| = (x − a)n+1 n+1
≤ (n + 1)! |x − a| , x ∈ I.
(n + 1)!
then lim Rn (x) = 0. Hence, by the convergence theorem of the Taylor series,
n→∞
∞
X f (k) (a)
f (x) = (x − a)k , x ∈ I,
k!
k=0
Solution Let f (x) = ex . For all n, since f (n) (x) = ex , we have f (n) (0) = e0 = 1. Thus,
n n
X f (k) (0) X xk
Tn (x) = xk =
k! k!
k=0 k=0
Thus, for n ≥ 1,
n
X (−1)k 2k+1
T2n+1 (x) = T2n+2 (x) = x .
(2k + 1)!
k=0
where c is between 0 and x. For any fixed x, it is easy to see that f (n) (x) is either
± sin x or ± cos x. Thus, we have
(c) ≤ 1,
(n+1)
f
so that
1 1
− |x|n+1 ≤ Rn (x) ≤ |x|n+1 .
(n + 1)! (n + 1)!
Since |x|n+1 (n + 1)! as n → ∞, by the Squeeze Theorem, lim Rn (x) = 0. Hence,
n→∞
by the convergence theorem of Taylor series, we have
∞
X (−1)k 2k+1 x3 x5 x7
sin x = x =x− + − 7 + ··· , x ∈ R.
(2k + 1)! 3! 5! x
k=0
∞ xk
By the Ratio Test, the series √ is absolutely convergent, so it is convergent.
P
k=0 k!
∞
4. The power series xk converges for x ∈ (−1, 1) and diverges for x ∈ (−∞, −1]∪[1, ∞).
P
k=0
In fact, for x ∈ (−1, 1), the power series is a convergent geometric series. For x ∈
(−∞, −1] ∪ [1, ∞), the limit of kth term xk is not zero: lim xk 6= 0. By the Divergence
k→∞
Test, the power series is divergent.
∞ (−1)k xk
5. The power series converges for x ∈ (−1, 1] and diverges for x ∈ (−∞, −1]∪
P
k=0 k + 1
(1, ∞).
In fact, for any fixed x ∈ R,
(−1)k+1 xk+1
k+2 (k + 1)|x|
lim = lim = |x|.
(−1) x
k k k+2
k→∞ k→∞
k+1
404 Series of Functions
By the Ratio Test, the series is absolutely convergent for |x| < 1 and divergent for
|x| > 1. Hence, the series is convergent for x ∈ (−1, 1) and divergent for x ∈ (−∞, −1)∪
(1, ∞).
∞ 1
For x = −1, the power series is the divergent harmonic series .
P
k=1 k
∞ (−1)k−1
For x = 1, the power series is the convergent alternating harmonic series .
P
k=1 k
∞
k
k
6. The power series (x + 1)k converges for x ∈ (−2, 0) and diverges for
P
k=0 k+1
x ∈ (−∞, −2] ∪ [0, ∞).
In fact, for any fixed x ∈ R,
v
k
k · |x + 1|
u
u k
lim tk
(x + 1)k = lim = |x + 1|.
k+1 k→∞ k + 1
k→∞
By the Root Test, the series is absolutely convergent for |x + 1| < 1 and divergent
for |x + 1| > 1. Hence, the series is convergent for x ∈ (−2, 0) and divergent for
x ∈ (−∞, −2) ∪ (0, ∞).
For x = −2 or x = 0, since
k
k 1 1
lim (x + 1)k = lim k = 6= 0,
k→∞ k + 1 k→∞ 1 e
1+
k
When 0 < R < ∞, the theorem says nothing about the convergence of the
series at the endpoint points |x − a| = R (i.e., x = a ± R) of the interval.
Generally, the interval of convergence cannot be obtained from the radius of
convergence.
Justification:
1. Compute the radius of convergence R by using the Ratio Test (or sometimes the Root
Test) by
1 1
c
R= = lim k or R = .
lim k |ck |
p
ck+1 k→∞ ck+1
lim k→∞
k→∞ ck
2. The Ratio and Root Tests are inconclusive when x is an endpoint of the interval of
convergence. Apply some other test to determine whether the series is convergent or
406 Series of Functions
divergent at an endpoint.
1. Determine the radius of convergence and the interval of convergence of the power series
∞ x2k
.
P
k=0 (k + 1)
k
Solution Since s
x2k 1
lim (k + 1)k = |x| k→∞
k 2
lim = 0,
k→∞ k+1
by the Root Test, for all x, the power series absolutely converges, so it converges. Thus,
the radius of convergence is R = ∞ and the interval of convergence is (−∞, ∞).
2. Determine the radius of convergence and the interval of convergence of the power series
∞ k(x + 1)k
.
P
k=0 k+1
Solution
by the Ratio Test, when |x + 1| < 1, the power series converges; when |x + 1| > 1,
it diverges. Thus, the radius of convergence is R = 1.
So, the series converges if −2 < x < 0; diverges if x < −2 or x > 0.
(b) Determine whether the power series is convergent at the endpoints.
∞ (−1)k k
At the left endpoint x = −2, the series is . Since
P
k=0 k + 1
(−1)k k
lim = lim k = 1 6= 0,
k→∞ k + 1 k→∞ k + 1
(−1)k k
so that lim 6= 0. From the Divergence Test, the series is divergent .
k→∞ k + 1
∞ k
At the right endpoint x = 0, the series is . Again from the Divergence
P
k=0 k + 1
Test, it is divergent from the Divergence Test.
∞ k(x + 1)k
Hence, for the power series , the radius of convergence R = 1 and the
P
k=0 k+1
interval of convergence is (−2, 0).
7.3 Properties of Power Series 407
3. Determine the radius of convergence and the interval of convergence of the power series
∞ (x − 2)k
.
P
√
k=0 k+1
Solution
by the Ratio Test, when |x − 2| < 1, the power series converges; when |x − 2| > 1,
it diverges. Thus, the radius of convergence is R = 1.
So, the series converges if 1 < x < 3; diverges if x < 1 or x > 3.
(b) Determine whether the power series is convergent at the endpoints.
∞ (−1)k
At the left endpoint x = 1, the series is , which is an alternating series.
P
√
k=0 k+1
1
Let bk = √ . Then, {bk } is a positive decreasing sequence and lim bk = 0.
k+1 k→∞
By the Alternating Series Test, this series is convergent.
∞ 1
At the right endpoint x = 3, the series is . Since
P
√
k=0 k+1
1
√
lim k√+ 1 = 1,
k→∞ k
∞ 1
and the p-series √ is divergent (p = 12 ), by the Limit Comparison Test, the
P
k=0 k
∞ 1
series is divergent.
P
√
k=0 k+1
∞ (x − 2)k
Hence, for the power series , the radius of convergence R = 1 and the
P
√
k=0 k+1
interval of convergence is [1, 3).
Determine the radius of convergence and the interval of convergence of the power series
∞ k(x + 1)k
.
P
k=0 k+1
Solution
First, we compute the radius of convergence by the Ratio Test.
408 Series of Functions
>> syms k x
>> assume (k , ' positive ') % k >0
>> assumeAlso (k , ' integer ') % k is also an integer
>> a ( k ) = k *( x + 1) ^ k /( k + 1) ;
>> ratio_a = simplify ( abs ( a ( k + 1) / a ( k ) ) ) ;
>> L = limit ( ratio_a ,k , inf )
L =
abs ( x + 1)
According to the Ratio Test, when |x + 1| < 1, the power series is convergent; when |x + 1| >
1, it is divergent. Thus, the radius of convergence is R = 1.
Moreover, from the result above, we can know that the series converges if −2 < x < 0, and
diverges if x < −2 or x > 0. To determine the interval of convergence, we need to determine
whether the power series is convergent at the endpoints x = −2 and x = 0, which is shown
in the following:
a_left =
(( -1) ^ k * k ) /( k + 1)
lim_a_left =
a_right =
k /( k + 1)
lim_a_right =
1. Sum and Difference: (ck ± dk )xk converges to f (x) ± g(x) in I, that is,
P
∞
X ∞
X ∞
X
(ck ± dk )xk = ck xk ± dk xk , x ∈ I.
k=0 k=0 k=0
∞
ck xk
X
ak xk = k=0
∞ ,
X
k=0 k
dk x
k=0
where
k
c0 1 X
a0 = , ak = ck − dj ak−j for k ≥ 1.
d0 d0 j=1
1. The product can be found by a vertical set-up. For instance, for the power series
representations
ex = 1 + x + 21 x2 + 16 x3 + · · · , x ∈ R,
cos x = 1 − 1 2
2! x + 1 4
4! x − ··· , x ∈ R,
410 Series of Functions
to compute the Maclaurin series for ex cos x, we collect like terms just as for polynomials:
1 + x + 21 x2 + 16 x3 + · · ·
× 1 − 12 x2 + ···
1 + x + 21 x2 + 16 x3 + · · ·
− 12 x2 − 12 x3 − · · ·
..
+ .
1+x − 31 x3 − · · ·
Thus,
ex cos x = 1 + x − 13 x3 − · · · , x ∈ R.
2. The quotient can be found by a vertical set-up. For instance, for the power series
representations
sin x = x − 3! x +
1 3 1 5
5! x − · · · , x ∈ R,
cos x = 1 − 2! x +
1 2 1 4
4! x − · · · , x ∈ R,
sin x
to compute the Maclaurin series for tan x = , we use a procedure like long division:
cos x
x + 13 x3 + 2 5
15 x + ···
1 − 12 x2 + 1 4
24 x − ··· x − 16 x3 + 1
120 x
5
− ···
x− 1 3
2x + 1 5
24 x − ···
1 3
3x − 1 5
30 x + ···
1 3
3x − 1 5
6x + ···
2 5
15 x + ···
2 5
15 x + ···
···
Thus,
tan x = x + 13 x3 + 2 5
15 x + ··· , x ∈ (− π2 , π2 ).
The Maclaurin series for the tangent function tan x has a smaller interval of convergence
due to the fact that the denominator cos x becomes zero at x = ± π2 .
∞ xk
1. Given two power series f (x) = (x ∈ (−∞, ∞)) and =
P
g(x)
k=0 k!
7.3 Properties of Power Series 411
∞ x2k
(−1)k (x ∈ (−∞, ∞)), find the power series for the product of these two power
P
k=0 (2k)!
series, i.e., f (x)g(x).
Solution
>> syms x k
>> assume (k , ' integer ') % k is an integer
>> a ( k ) = x ^ k / factorial ( k ) ;
>> b ( k ) = ( -1) ^ k * x ^(2* k ) / factorial (2* k ) ;
>> f ( x ) = symsum ( a ( k ) ,k ,0 , inf )
f(x) =
exp ( x )
g(x) =
cos ( x )
>> prod_term = f ( x ) * g ( x )
prod_term =
exp ( x ) * cos ( x )
prod_series =
It is shown that, up to the order of 5, the product of these two series can be written as
f (x)g(x) = 1 + x − 13 x3 − 61 x4 − 1 5
30 x + ··· , x ∈ R.
∞ x2k+1
2. Given two power series f (x) = (−1)k (x ∈ (−∞, ∞)) and g(x) =
P
k=0 (2k + 1)!
∞ x2k
(−1)k (x ∈ (−∞, ∞)), find the power series for the quotient of these two
P
k=0 (2k)!
f (x)
power series, i.e., .
g(x)
Solution
412 Series of Functions
>> syms x k
>> assume (k , ' integer ') % k is an integer
>> a ( k ) = ( -1) ^ k * x ^(2* k + 1) / factorial (2* k + 1) ;
>> b ( k ) = ( -1) ^ k * x ^(2* k ) / factorial (2* k ) ;
>> f ( x ) = symsum ( a ( k ) ,k ,0 , inf )
f(x) =
sin ( x )
g(x) =
cos ( x )
>> quot_term = f ( x ) / g ( x )
quot_term =
sin ( x ) / cos ( x )
quot_series =
It is shown that, up to the order of 5, the quotient of these two series can be written as
f (x)
= x + 13 x3 + 2 5
15 x + ··· .
g(x)
Note that the denominator g(x) = cos x becomes 0 when x = ± π2 . Hence, the power
series for the quotient is convergent when x ∈ − 2 , 2 .
π π
∞
1. f 0 (x) = c1 + 2c2 (x − a) + 3c3 (x − a)2 + · · · = kck (x − a)k−1 .
P
ˆ k=1
(x − a)2 (x − a)3 ∞ (x − a)k+1
f (x) dx = C + c0 (x − a) + c1 + c2 + ··· = C + .
P
2. ck
2 3 k=0 k+1
The radii of convergence of the these power series are both still R.
so that
∞
1 X
= (−1)k xk = 1 + x + x2 + x3 + · · · , x ∈ (−1, 1).
1−x
k=0
so that
1 + x2
1 + 3x2 + 5x4 + 7x6 + · · · = , x ∈ (−1, 1).
(1 − x2 )2
so that
∞
1 X
= (−1)k xk = 1 − x + x2 − x3 + · · · , for x ∈ (−1, 1).
1+x
k=0
x2 x3 x4
ln(1 + x) = C + x − + − + ··· , for x ∈ (−1, 1).
2 3 4
By putting x = 0 on both of the last equality, we get C = 0. Hence, for x ∈ (−1, 1),
we have
∞
X xk x2 x3 x4
ln(1 + x) = (−1)k−1 =x− + − + ··· .
k 2 3 4
k=1
At the endpoints x = −1, the Maclaurin series is the divergent harmonic series. At
the other endpoint x = 1, the Maclaurin series is the convergent alternating harmonic
series. We can get the Maclaurin series for the function ln(1 + x):
∞
X xk x2 x3 x4
ln(1 + x) = (−1)k−1 =x− + − + ··· , for x ∈ (−1, 1].
k 2 3 4
k=1
∞ ∞
If ck converges and f (x) = ck xk (−1 < x < 1), then lim f (x) = ck .
P P P
k=0 x→1− k=0
ˆ
dx
2. Notice that = tan−1 x + C. So, to find the Maclaurin series for the function
1 + x2
1
tan−1 x, we may start with the Maclaurin series for the function :
1+x
1
= 1 − x + x2 − x3 + · · · , x ∈ (−1, 1).
1+x
Substituting x by x2 gives
1
= 1 − x2 + x4 − x6 + · · · , x ∈ (−1, 1).
1 + x2
Integrating the equality gives
By putting x = 0 on both of the last equality, we get C = 0. Hence, for x ∈ (−1, 1),
we have
∞
X x2k+1
tan−1 x = (−1)k = x − 13 x3 + 15 x5 − 71 x7 + · · · .
2k + 1
k=0
7.3 Properties of Power Series 415
At each of the endpoints x = ±1, the Maclaurin series is a convergent alternating series,
by Alternating Series Test. We can get the Maclaurin series for the function tan−1 x:
∞
X x2k+1
tan−1 x = (−1)k = x − 31 x3 + 51 x5 − 17 x7 + · · · , for x ∈ [−1, 1].
2k + 1
k=0
Again, the equality holds at both endpoints due to the same result stated above.
∞
!0 ∞
!0
X X
Find the power series for x k
− (−1) x
k k
, x ∈ (−1, 1).
k=0 k=0
Solution
>> syms x k
>> assume (k , ' integer ') % k is an integer
>> a(k) = x^k;
>> b ( k ) = ( -1) ^ k * x ^ k ;
>> term1 = symsum ( a ( k ) ,k ,0 , inf ) ;
>> term2 = symsum ( b ( k ) ,k ,0 , inf ) ;
>> term1_diff = diff ( term1 , x )
term1_diff =
term2_diff =
Delta_term_diff_series =
14* x ^6 + 10* x ^4 + 6* x ^2 + 2
∞
!0 ∞
!0
X X
It is shown that, up to the order of 6, the power series for x k
− (−1) x
k k
can
k=0 k=0
416 Series of Functions
be written as
∞
!0 ∞
!0
X X
x k
− (−1) x
k k
= 2 + 6x2 + 10x4 + 14x6 + · · · , x ∈ (−1, 1).
k=0 k=0
>> syms x k
>> assume (k , ' integer ') % k is an integer
>> a ( k ) = ( -1) ^ k * x ^ k ;
>> int_fun = symsum ( a ( k ) ,k ,0 , inf ) ;
>> int_term = int ( int_fun , x ) ;
>> int_series = taylor ( int_term ,x , ' ExpansionPoint ' ,0 , ' Order ' ,5)
int_series =
1 ∞
= xk = 1 + x + x2 + x3 + · · · , x ∈ (−1, 1), R = 1.
P
1.
1 − x k=0
∞ xk x x2 x3
ex = =1+ + + + ··· , x ∈ (−∞, ∞), R = ∞.
P
2.
k=0 k! 1! 2! 3!
∞ x2k+1 x3 x5 x7
sin x = (−1)k =x− + + ··· , x ∈ (−∞, ∞), R = ∞.
P
3. −
k=0 (2k + 1)! 3! 5! 7!
∞ x2k x2 x4 x6
cos x = (−1)k =1− + + ··· , x ∈ (−∞, ∞), R = ∞.
P
4. −
k=0 (2k)! 2! 4! 6!
∞ x2k+1 x3 x5 x7
tan−1 x = (−1)k =x− + + ··· , x ∈ [−1, 1], R = 1.
P
5. −
k=0 2k + 1 3 5 7
7.3 Properties of Power Series 417
∞ xk x2 x3 x4
ln(1 + x) = (−1)k−1 =x− + + ··· , x ∈ (−1, 1], R = 1.
P
6. −
k=1 k 2 3 4
∞ α(α − 1) 2 α(α − 1)(α − 2) 3
α k
(1 + x)α = x = 1 + αx + x + x + · · · , at least for
P
7.
k=0 k 2! 3!
x ∈ (−1, 1), R = 1.
2(2 − 1) x 4 2 ( 2 − 1)( 2 − 2)
1 x 2 1 1 1 1 1 x 6
=a 1+ 2
· + · + · + ···
1! a 2! a 3! a
2(2 − 1) −3 4 ( − 1)( 12 − 2) −5 6
1 1 1 1 1
=a+ 2
· a−1 x2 + ·a x + 2 2 · a x + ··· .
1! 2! 3!
Justification:
1. We know that it is legitimate to differentiate the infinite series term by term at any
number x satisfying |x − a| < R. Thus, for each k, k = 0, 1, 2, . . . , we differentiate and
substitute x = a to have
f (k) (a) = 2 · 3 · 4 · · · k · ck = k! · ck ,
so that
f (k) (a)
ck = , k ≥ 0.
k!
n
2. By part 1, we get Tn (x) = ck (x − a)k . Thus,
P
k=0
∞
(x − a)n+1 · cn+k (x − a)k
P
f (x) − Tn (x) k=0
lim = lim = 0.
x→a (x − a)n x→a (x − a)n
n
3. By part 1, we get Tn (x) = ck (x − a)k . Thus,
P
k=0
∞
X
f (x) = ck (x − a)k = lim Tn (x).
n→∞
k=0
Thus,
f (2019) (0) = (−1)1009 · 2018! = −2018!.
7.3 Properties of Power Series 419
According to the theorem of analytic function, the coefficient of the term with order k is
given by
f (k) (0)
ck = , k ≥ 0.
k!
Hence, we have f (2019) (0) = 2019!c2019 . To calculate f (2019) (0), we thus only need to calculate
c2019 , which is shown as follows:
>> syms x
>> f ( x ) = atan ( x ) ;
>> f_series = taylor ( f ( x ) ,x , ' ExpansionPoint ' ,0 , ' Order ' ,2019 ...
+ 1) ; % expand f ( x ) up to order 2019
>> c_array = coeffs ( f_series ) ; % find all the coefficients ...
of the series , the coefficient of the term with the ...
highest order is the last element of the array
>> ind = length ( c_array ) ; % the location of the coefficient ...
for x ^2019 in the array
>> c = c_array ( ind ) % the value of the last coefficient , ...
i . e . , the one for x ^2019
c =
-1/2019
In the MATLAB code above, the command coeffs can return all the coefficients of a poly-
nomial, and the command length can return the length of a vector.
We see from the result above that c2019 = − 2019
1
. Therefore, we have
x3 − 6x cos(x2 ) + 6 sin x
Find lim .
x→0 x5
Solution The limit has the indeterminate form 00 . Although we may apply l’Hospital’s
Rule, alternatively we use the technique of Taylor series. In fact, near x = 0, we have
sin x = x − 3! x + 5! x + · · ·
1 3 1 5
,
cos(x ) = 1 −
2
2! (x ) + · · · ,
1 2 2
so that, as x → 0,
sin x = x − 61 x3 + 1
120 x
5
+ o(|x|5 ),
cos(x2 ) = 1 − 21 x4 + o(|x| ),
4
Hence,
x3 − 6x cos(x2 ) + 6 sin x
lim 5
x 1 4
x→0
x − 6x 1 − 2 x + o(|x|4 ) + 6 x − 61 x3 + 1
+ o(|x|5 )
3
5
120 x
= lim
x→0 x5
x + o(|x| )
61 5 5
= lim 20 = 61
20 .
x→0 x5
The last limit has the indeterminate form 00 . We use the technique of Taylor series. In fact,
near t = 0, we have
sin(t4 ) = t4 + · · · ,
2
e−t = 1 + 1! (−t )
1 2
+ ··· ,
7.4 Applications of Taylor Series 421
so that, as t → 0+ ,
sin(t4 ) = t4 + o(|t|4 ),
2
e−t = 1 − t2 + o(|t|2 ),
Hence,
2
sin(t4 ) − t2 e−t + t2
lim+
t→0 t4
t + o(|t|4 ) − t2 1 − t2 + o(|t|2 ) + t2
4
= lim+
t→0 t4
2t + o(|t| )
4 4
= lim+ = 2.
t→0 t4
Therefore, h i
2
lim x4 sin x−4 − x2 e−1/x + x2 = 2.
x→∞
Thus,
ˆ 1 1
x3 x5 x7
2
e−x dx = + + · · ·
x− −
0 3 · 1! 5 · 2! 7 · 3! x=0
∞
1 1 1 X (−1)k
=1− + − + ··· = .
3 · 1! 5 · 2! 7 · 3! (2k + 1) · k!
k=0
This shows that the definite integral can be expressed as a convergent alternating series, with
1
bk = satisfying:
(2k + 1) · k!
0 < bk+1 < bk , lim bk = 0.
k→∞
422 Series of Functions
Using the bound on the remainder in the Alternating Series Test, we have
ˆ
n
1
−x2
X (−1)k 1
|Rn | = e dx − < .
0 (2k + 1) · k! (2n + 3) · (n + 1)!
k=0
1
Thus, to ensure that |Rn | < 10−4 , we need to choose n so that < 10−4 , or
(2n + 3) · (n + 1)!
6 (−1)k
n > 6. Hence, the finite series gives an approximation that is within 10−4
P
k=0 (2k + 1) · k!
of the exact value of the series.
Using the bounds on the series in the Alternating Series Test, we have
ˆ 1
1 2 1
s6 − < e−x dx < s6 + ,
15 · 7! 0 15 · 7!
6 (−1)k
where s6 = . By using a calculator, we have s6 ≈ 0.74684, which has 5th
P
k=0 (2k + 1) · k!
decimal place accuracy. Thus,
Solve the differential equation y 0 (t) = y(t)−1, subject to the initial value condition y(0) = 3.
Solution We assume the solution has a power series solution of the form
∞
X
y(t) = ck tk = c0 + c1 t + c2 t2 + c3 t3 + · · · ,
k=0
c1 = c0 − 1 =⇒ c1 = 2. since c0 = 3
2c2 = c1 =⇒ c2 = 1. since c1 = 2
We repeat the above process by differentiating the equation once more then putting t = 0 on
the resulted equation. Recursively, we get:
1 1 1
c3 = , c4 = , c5 = , ....
3 4·3 5·4·3
Thus, we obtain an “formal” solution:
t3 t4 t5
y(t) = 3 + 2t + t2 + + + + ···
3 4·3 5·4·3
The formal solution can be re-written as (formally!)
t2 t3 t4 t5
y(t) = 1 + 2 1 + t + + + + + · · · .
2! 3! 4! 5!
We recognize that the right-hand side is actually the Maclaurin series of the function 1 + 2et .
Finally, we can verify that the formally obtained solution is indeed the true solution of the
original problem, since
Summary
• Let Tn be the Taylor polynomial of order n for f at a. The term Rn (x) = f (x) − Tn (x)
is called the remainder of the Taylor series. The latter refers the following “formal”
power series of f :
Pn (a) = f (a), Pn0 (a) = f 0 (a), Pn00 (a) = f 00 (a), ..., Pn(n) (a) = f (n) (a),
Then
f 00 (a) f (n) (a)
Pn (x) ≡ Tn (x) = f (a) + f 0 (a)(x − a) + (x − a)2 + · · · + (x − a)n .
2! n!
f (x) − Tn (x)
If f (n) (a) exists, then lim = 0, or equivalently, by using little-o notation,
x→a (x − a)n
n
X f (k) (a)
f (x) = Tn (x) + o(|x − a|n ) = (x − a)k + o(|x − a|n ), as x → a.
k!
k=0
425
∞
X f (k) (a)
f (x) = lim Tn (x) = (x − a)k , x ∈ I.
n→∞ k!
k=0
If f (n+1) is continuous in an open interval I that contains a, then there is c between a and
x such that
f (n+1) (c)
Rn (x) = (x − a)n+1 .
(n + 1)!
This formula is called the Lagrange remainder of Taylor series.
M
|Rn (x)| ≤ |x − a|n+1 , x ∈ I.
(n + 1)!
∞
X f (k) (a)
f (x) = (x − a)k , x ∈ I.
k!
k=0
1. Compute the radius of convergence R by using the Ratio Test (or sometimes the Root
Test) by
1 1
c
R= = lim k or R = .
lim
p
ck+1 k→∞ ck+1 k
|ck |
lim k→∞
k→∞ ck
2. The Ratio and Root Tests are inconclusive when x is an endpoint of the interval of
convergence. Apply some other test to determine whether the series is convergent or
divergent at an endpoint.
1. Sum and Difference: (ck ± dk )xk converges to f (x) ± g(x) in I, that is,
P
∞
X ∞
X ∞
X
(ck ± dk )xk = ck xk ± dk xk , x ∈ I.
k=0 k=0 k=0
f (x)
converges to , that is,
g(x)
∞
X
∞
ck xk
X k=0
ak xk = ∞ ,
X
k=0 k
dk x
k=0
where
k
c0 1 X
a0 = , ak = ck − dj ak−j for k ≥ 1.
d0 d0 j=1
ˆ k=1
(x − a)2 (x − a)3 ∞ (x − a)k+1
f (x) dx = C + c0 (x − a) + c1 + c2 + ··· = C + .
P
2. ck
2 3 k=0 k+1
The radii of convergence of the these power series are both still R.
1 ∞
= xk = 1 + x + x2 + x3 + · · · , x ∈ (−1, 1), R = 1.
P
1.
1 − x k=0
∞ xk x x2 x3
ex = =1+ + + + ··· , x ∈ (−∞, ∞), R = ∞.
P
2.
k=0 k! 1! 2! 3!
∞ x2k+1 x3 x5 x7
sin x = (−1)k =x− + + ··· , x ∈ (−∞, ∞), R = ∞.
P
3. −
k=0 (2k + 1)! 3! 5! 7!
∞ x2k x2 x4 x6
cos x = (−1)k =1− + + ··· , x ∈ (−∞, ∞), R = ∞.
P
4. −
k=0 (2k)! 2! 4! 6!
∞ x2k+1 x3 x5 x7
tan−1 x = (−1)k =x− + + ··· , x ∈ [−1, 1], R = 1.
P
5. −
k=0 2k + 1 3 5 7
428 Summary
∞ xk x2 x3 x4
ln(1 + x) = (−1)k−1 =x− + + ··· , x ∈ (−1, 1], R = 1.
P
6. −
k=1 k 2 3 4
∞ α(α − 1) 2 α(α − 1)(α − 2) 3
α k
(1 + x)α = x = 1 + αx + x + x + · · · , at least for
P
7.
k=0 k 2! 3!
x ∈ (−1, 1), R = 1.
f (k) (a)
ck = , k ≥ 0.
k!
f (x) − Tn (x)
2. lim = 0, or equivalently,
x→a (x − a)n
n
X f (k) (a)
f (x) = Tn (x) + o(|x − a|n ) = (x − a)k + o(|x − a|n ), as x → a.
k!
k=0
After typing in the command and pressing “Enter” (in Windows) or “return” (in Mac), the
calculation will be carried out.
Next to the command window, there are two other windows, namely, “Current Folder”
window and “Workspace” window, as shown in the following figure.
In particular, the “Current Folder” window on the left enables us to view, create, open,
move, and rename files and folders in the current folder. For the “Workspace” window on
the right, it enables us to view and interactively manage each variable or object used in
MATLAB. For example, we can edit the content a variable directly in the workspace by right
clicking the scalar and selecting the “Edit Value”, as shown in the following figure.
431
Note that if we click the “Close” option under the triangle menu, the “Current Folder” or
“Workspace” window will be closed.
The MATLAB commands can be put into one file called m-file (or script file), and then
we can instruct MATLAB to execute these commands.
To create a m-file, we simply need to click the “New” option from the “HOME” menu and
select “Script”, as shown in the following figure.
432 Appendix: Introduction to MATLAB
To open an existing m-file, we simply need to click the “Open” option from the “HOME”
menu and select the file required from the directory, as shown in the following figure.
To save an m-file, we can click the “Save” option from the “EDITOR” menu, as shown in
the following figure, and choose a suitable destination from the directory for the m-file. We
can also save an existing m-file to another destination by clicking the “Save As" option, and
then choose a suitable destination from the directory. Note that the m-file should be saved
with a “.m” extension.
433
In the m-file, unlike in the command window, there are no double arrows after which the
command should be typed in. Moreover, all the commands in the m-file will not be executed
before clicking the “Run” button in the “EDITOR” menu which is shown in the figure above.
After clicking the “Run” button, the result will be shown if there is no error; otherwise, the
error information will be displayed in the command window.
To explain how to assign a value and when to use the semicolon in MATLAB, we first
provide some examples as follows. Specifically, the following examples show the calculations
of cos(1) + 1 in the command window.
ans =
1.5403
r1 =
1.5403
r2 =
434 Appendix: Introduction to MATLAB
1.5403
We note that “=” means “assign a value” in MATLAB (The symbol “==” represents “equal”
in MATLAB). If no variable is specified, then the answer of cos(1)+1 is assigned to the default
variable ans, as can be seen from the first command of the MATLAB code above. Note that
in MATLAB, the number “1” in cos(1) is in radians (not degrees). If a certain variable is
specified, e.g., r1 in the second command, then the value of cos(1) + 1 is assigned to r1 after
executing this command.
Next, we explain the use of the semicolon (i.e., “;”). Specifically, if no semicolon is used
after a command, then the result of this command will be displayed directly after executing
this command; while if a semicolon is used after a command, then the result of this command
will not be displayed, as can be seen from the last two commands of the MATLAB code above.
In MATLAB, comments are written after %, and MATLAB does not attempt to compute
the commenst. For example, in the MATLAB code below, “Change the axis limits so
that both the x-axis and the y-axis range from -3 to 3” are the comments.
In MATLAB, there is extensive documentation explaining the use of all its built-in func-
tions. To check the use of a function, we simply need to type in help function name after
>> in the command window. For example, in the following figure, two commands, namely,
help cos and help plot, are typed in to check the use of cos and plot, respectively.
435
vec1 =
1 3 5 7 9
vec2 =
1 3 5 7 9
vec =
1 2 3 4 5
436 Appendix: Introduction to MATLAB
The MATLAB code above defines two vectors named vec1 and vec2, respectively.
There are 5 elements in both of the vectors, namely, 1, 3, 5, 7 and 9. In particular,
vec1 starts at 1 (i.e., the initial value is 1), the increment from the previous value (i.e.,
the step) is 2, and it stops at 9.
However, sometimes the vector does not stop at the terminator specified in the com-
mand. With the value of each element changing from the value of the previous ele-
ment by adding an increment, the vector stops at a value which is not exceeding the
terminator but closest to the terminator. For example, vec2 stops at 9 instead of 10.
Note that if the increment is not specified in the command, the default increment is
1, as can be seen from the third command above.
2. linspace
vec3 =
1 3 5 7 9
vec4 =
From the MATLAB code above, we see that the command linspace(x1,x2,N) defines
an N -element vector starting at x1 and stopping at x2. In this way, the increment
x2 − x1
equals to .
N −1
Note that if we use the command linspace(x1,x2), then a 100-element vector with
initial value x1 and ending value x2 will be generated.
437
Operator Meaning
+ Matrix addition
- Matrix subtraction
* Matrix multiplication
.* Element-by-element multiplication
./ Element-by-element division
ˆ Matrix exponentiation
.ˆ Element-by-element exponentiation
We see from the above table that some operators for matrices are the same with the ones
for scalars, but some are different and require an additional . before the scalar operator.
>> x = -1:0.01:1;
>> y = x .^2;
>> figure % create a figure window
>> plot (x ,y , 'r ') % graph is in red
>> xlabel ( 'x ') % X - axis label
>> ylabel ( 'y = x ^2 ') % Y - axis label
>> grid % add grid lines
Note that by clicking the third icon, we can save the figure. Moreover, after clicking the fifth
icon, i.e., the arrow, we can choose the “Property Editor” option from the “View” menu, as
highlighted in the following figure.
Then, a “Property Editor” window will appear as follows, and we can edit the figure, e.g.,
change the font, etc.
439
440 Appendix: Introduction to MATLAB
Index