Академический Документы
Профессиональный Документы
Культура Документы
Matrices
Dr Eddie Ly
1
2 Matrices
Contents
1 Introduction 3
3 Gaussian Elimination 12
4 Inverse of a Matrix 14
5 Determinant of a Matrix 16
7 Review Questions 24
1 Introduction
[ ]
x y z is a row matrix or row vector,
x
y is a column matrix or column vector, and
z
a11 a12 a13
a21 a22 a23 is a 3 × 3 matrix (3 rows and 3 columns).
a31 a32 a33
A square matrix has an equal number of rows and columns. The general m × n matrix is
a11 a12 a13 · · · · · · a1n
( )
a21 a22 a23 · · · · · · a2n
[ ]
A = aij mn = a31 a32 a33 · · · · · · a3n .
..
.. .. .. .. ..
.
. . . . .
am1 am2 am3 · · · · · · amn
The element a23 is the element in second row and third column of matrix A. The
dimension (or order) of a matrix is the number of rows by the number of columns.
Two matrices are said to be equal if they have the same order and all corresponding
elements are equal. For example,
[ ] [ ]
a11 a12 b11 b12
A= and B =
a21 a22 b21 b22
both have the same order (i.e. 2×2 matrix) and are equal if a11 = b11 , a12 = b12 , a21 = b21
and a22 = b22 , or aij = bij for i, j = 1, 2.
4 Matrices
If A = [aij ]mn and B = [bij ]mn (both matrices must have the same order) then
[ ] [ ]
A + B = aij + bij mn = bij + aij mn = B + A.
AB ̸= BA.
If two matrices are not conformable (not able to be multiplied), then their product is
undefined.
EXAMPLE
1 2 0 a
If A =
2 −1 2 , find all solutions x = b of Ax = −3x.
0 2 1 c
solution
1 2 0 a a
Ax = −3x ⇒
2 −1 2 b = −3 b .
0 2 1 c c
a + 2b = −3a ⇒ 2a + b = 0
2a − b + 2c = −3b ⇒ a+b+c=0
2b + c = −3c ⇒ b + 2c = 0
The first and third equations give a = c = − 21 b, and inserting into the second
equation gives − 21 b + b − 12 b = 0, which is true for all real values of b. Hence,
− 12 1
x = b 1 = − b −2 .
2
−2 1
1
note:
If all operations are defined, then
A(B + C) = AB + AC,
(B + C)A = BA + CA,
A(BC) = (AB)C.
6 Matrices
(A − B)(A + B) = A2 + AB − BA − B 2
̸= A2 − B 2 ,
(A + B)2 = (A + B)(A + B)
= A2 + AB + BA + B 2
̸= A2 + 2AB + B 2 ,
(AB)2 = ABAB
̸= A2 B 2 .
The ith row of AT is the ith column of A, and the jth column of AT is the jth row of
A.
note:
(A + B)T = AT + B T if A and B have the same order,
( T )T
A = A,
EXAMPLE [ ] [ ] [ ]
1 2 0 −1 5 1
Given A = ,B= and C = , show that
3 4 2 1 1 3
solution
[ ] [ ] [ ]
1 2 0 −1 1 1
A+B = + , =
3 4 2 1 5 5
[ ][ ] [ ]
1 1 5 1 6 4
(A + B)C = = ,
5 5 1 3 30 20
[ ][ ] [ ]
1 2 5 1 7 7
AC = = ,
3 4 1 3 19 15
[ ][ ] [ ]
0 −1 5 1 −1 −3
BC = = ,
2 1 1 3 11 5
[ ] [ ] [ ]
7 7 −1 −3 6 4
⇒ AC + BC = + =
19 15 11 5 30 20
= (A + B)C.
[ ][ ] [ ]
1 2 0 −1 4 1
AB = = ,
3 4 2 1 8 1
[ ][ ] [ ]
4 1 5 1 21 7
(AB)C = = ,
8 1 1 3 41 11
[ ][ ] [ ]
1 2 −1 −3 21 7
⇒ A(BC) = =
3 4 11 5 41 11
= (AB)C.
[ ]T [ ]
T 4 1 4 8
(AB) = = ,
8 1 1 1
[ ]T[ ]T [ ][ ] [ ]
0 −1 1 2 0 2 1 3 4 8
⇒ B T AT = = =
2 1 3 4 −1 1 2 4 1 1
= (AB)T .
8 Matrices
Note that
A + 0 = 0 + A = A (identity under matrix addition)
and
A0 = 0A = 0.
EXAMPLE
2 −3 −5 −1 3 5
Given A =
−1 4 5 and B = 1 −3 −5 , we have
1 −3 −4 −1 3 5
2 −3 −5 −1 3 5
AB = −1 4 5 1 −3 −5
1 −3 −4 −1 3 5
0 0 0
= 0 0 0
0 0 0
= 0.
The unit matrix I n (or I when the order is known) is a square matrix of order n × n with
entries of 1’s down the main diagonal and 0’s everywhere else. For example,
1 0 0 0 0 0
0 1 0 ··· 0···
0 0 1 ··· ··· 0
In =
.
. ··· 0
..
0 0 ···
0 0 ··· ···
...
0
0 0 0 0 0 1
A square matrix in which all off-diagonal elements are zero. If both A and B are diagonal
matrices of the same order, then A + B and AB are also diagonal, and AB = BA.
For example,
a11 0 0
A=
0 a22 0 where a11 , a22 , a33 ̸= 0.
0 0 a33
A lower triangular matrix is a square matrix where all elements above the main diagonal
are zero, such as
ℓ11 0 0
L=
ℓ21 ℓ22 0 .
ℓ31 ℓ32 ℓ33
10 Matrices
An upper triangular matrix is a square matrix where all elements below the main diagonal
are zero. For example,
u11 u12 u13
U =
0 u22 u23
.
0 0 u33
EXAMPLE
Matrix A is anti-symmetric, since
0 1 2 0 −1 −2
A= −1 0 3 and A T
= 1
0 −3 = −A.
−2 −3 0 2 3 0
P P T = P T P = I.
The columns (rows) of an orthogonal matrix are mutually orthogonal unit vectors. For
example,
1 −2 −2
1
P = 2 2 −1 .
3
2 −1 2
A square matrix A is said to be invertible (or non-singular ) if there exists a square matrix
B such that
AB = BA = I.
The matrix B is then called the inverse of A, denoted by A−1 , and its inverse is unique.
Lecture Notes – MATH2118 Further Engineering Mathematics C 11
EXAMPLE [ ]
2 −5
Consider matrix A = . The inverse of A is
−1 −3
[ ]
−1 3/11 −5/11
A = ,
−1/11 −2/11
since
[ ][ ]
2 −5 3/11 −5/11
AA−1 =
−1 −3 −1/11 −2/11
[ ]
1 0
=
0 1
= I.
remarks:
Note that not every square matrix has an inverse. If |A| = 0 then A−1 cannot exist, since
P −1 AP = I.
12 Matrices
3 Gaussian Elimination
x1 + 2x2 + x3 = 0,
2x1 + 2x2 + 3x3 = 3,
−x1 − 3x2 = 2.
The coefficients of the unknowns (the symbols used for the unknowns are not important)
together with the right-hand-side constants are all that is needed when determining the
solution. Rewrite the system of equations in an augmented matrix form shown below,
1 2 1 0 R1
2 2 3 3
R2
−1 −3 0 2 R3
step 1:
Eliminate x1 from R2 and R3 . We define multipliers,
a21 2 a31 −1
m21 = = = 2 and m31 = = = −1,
a11 1 a11 1
and substract m21 R1 from R2 , and substract m31 R1 from R3 :
1 2 1 0
0 −2 1 3 R2 − 2R1
0 −1 1 2 R3 + R1
step 2:
Eliminate x2 from R3 by substracting 12 R2 from R3 :
1 2 1 0
0 −2 1 3
0 0 21 12 R3 − 12 R2
All elements below the main diagonal are zero, this matrix is said to be in row-echelon
form.
step 3:
Work backwards from the last to first equation:
1
x
2 3
= 1
2
⇒ x3 = 1
−2x2 + x3 = 3 ⇒ x2 = −1
x1 + 2x2 + x3 = 0 ⇒ x1 = 1
Gaussian elimination is the most efficient means of solving a system of linear equations.
Lecture Notes – MATH2118 Further Engineering Mathematics C 13
EXAMPLE
Determine the solutions (if they exist) of the following system of equations,
x1 + 2x2 + 3x3 = 2,
4x1 + 5x2 + 6x3 = 8,
7x1 + 8x2 + 9x3 = 13.
solution
Write this system of equations in an augmented matrix form,
1 2 3 2 1 2 3 2
4 5 6 8 ∼ 0 −3 −6 0
R2 − 4R1
7 8 9 13 0 −6 −12 −1 R3 − 7R1
1 2 3 2
∼
0 1 2 0
− 3 R2
1
0 0 0 −1 R3 − 2R2
The last row of this matrix implies 0x1 + 0x2 + 0x3 = −1, which is clearly impos-
sible. Hence, this system has no solution; such systems of equations are said to be
inconsistent.
EXAMPLE
Determine the solutions (if they exist) of the following system of equations,
x1 + 2x2 + 3x3 = 2,
4x1 + 5x2 + 6x3 = 8,
7x1 + 8x2 + 9x3 = 14.
solution
1 2 3 2 1 2 3 2
4 5 6 8 ∼ 0 −3 −6 0
R2 − 4R1
7 8 9 14 0 −6 −12 0 R3 − 7R1
1 2 3 2
∼ 0 1 2 0
− 3 R2
1
0 0 0 0 R3 − 2R2
14 Matrices
The last row of zeros indicates that the last equation in the system is redundant.
Working backward from R2 to R1 , where x3 can take any value, we have
x2 + 2x3 = 0 ⇒ x2 = −2x3
x1 + 2x2 + 3x3 = 2 ⇒ x1 = 2 − 2x2 − 3x3 = 2 + x3
or
(x1 , x2 , x3 ) = (2, 0, 0) + α(1, −2, 1); α ∈ R.
4 Inverse of a Matrix
If the matrix A is non-singular, i.e. |A| ̸= 0, then its inverse A−1 may be found in the
following way:
[ ]
(1) Write down A with the unit matrix I in an augmented matrix form, i.e. A| I .
[ ]
(2) Perform a sequence of elementary row operations on A | I until A becomes I.
[ ]
(3) By then matrix I will have been converted into the inverse matrix A−1 , i.e. I | A−1 .
note:
[ ]
a b
For a 2 × 2 matrix, A = , its matrix inverse can be found using the following
c d
formula [ ]
1 d −b
A−1 = where |A| = ad − bc.
|A| −c a
This is only for a 2 × 2 matrix.
Lecture Notes – MATH2118 Further Engineering Mathematics C 15
EXAMPLE
1 1 0
If A =
1 0 1 , find A−1 using elementary row operations.
0 1 1
solution
1 1 0 1 0 0
1 0 1 0 1 0
0 1 1 0 0 1
1 1 0 1 0 0
∼ 0 −1 1 −1 1 0
R2 − R1
0 1 1 0 0 1
1 0 1 0 1 0 R1 + R2
∼ 0 −1 1 −1 1 0
0 0 2 −1 1 1 R3 + R2
2 0 0 1 1 −1 2R1 − R3
∼ 0 −2 0 −1 1 −1 2R2 − R3
0 0 2 −1 1 1
1
1 0 0 1 1
− 12 2 R1
2 2
∼0 1 0 1
− 12 1 − 1 R2
2 2 2
0 0 1 − 12 1
2
1
2
1
R
2 3
Inverse of A:
1 1 −1
1
A −1
= 1 −1 1
.
2
−1 1 1
5 Determinant of a Matrix
To each square matrix there is associated a number called the determinant of a matrix.
For example, for n × n matrix A,
a11 a12 ··· a1n
···
a21 a22 · · · · · · a2n
. .. ...
..
det A = A = .. . ··· . .
. ..
. .. ..
. . ··· . .
an1 an2 · · · · · · ann
[ ]
a11 a12
For a 2 × 2 matrix, A = , the 2 × 2 determinant is
a21 a22
a
11 12
a
detA = = a11 a22 − a21 a12 .
a21 a22
The minor of a11 is obtained from the original determinant by deleting the row and column
which contains a1 , etc. Note the sequence of signs + − + associated with the coefficients
a11 , a12 and a13 , respectively. Alternatively, we can expand the determinant across the
second or third rows, or even down any of the columns.
+ − +
− + −
+ − +
Lecture Notes – MATH2118 Further Engineering Mathematics C 17
For example,
0 0 0 a a a
a21 a22 a23 = 0 22 a 23
− 0
21 a 23
+ 0
21 a22
= 0.
a32 a33 a31 a33 a31 a32
a31 a32 a33
(4) Interchanging two columns (rows) of a determinant changes the sign of the deter-
minant.
(5) The determinant is unaltered if a scalar multiple of one row (column) is added to
another row (column).
(6) Interchanging the rows and columns of a determinant does not alter its value,
T
A = |A|.
(7) If A is the matrix obtained from matrix A by replacing the jth column (row), vector
Aj , by kAj , then |Ā| = k |A|. For example,
ka
11 ka 12
= ka11 a22 − ka12 a21
a21 a22
EXAMPLE
2 −3
= (2 × 3) − (−4 × −3)
−4 3
= 6 − 12
= −6.
EXAMPLE
Expanding along the last column gives
−1 3 1 2 5 −1 3 −1 3
2 5 0 = 1 + 0 − 1
3 2 3 2 2 5
3 2 −1
= (4 − 15) + 0 − (−5 − 6)
= 0.
Consider any linear transformation A, which operates on the column vector v. If the
condition
Av = λv
is satisfied for λ (a scalar), then we have a situation where the transformation A does not change
the direction of v. The vector V is called an eigenvector of A, and the scalar λ is called
an eigenvalue of A; λ may be zero, real or complex value.
Av = λv = λIv,
which is the characteristic equation of the matrix A (nth degree polynomial for n × n
matrix A). Hence, there are n real or complex eigenvalues (roots of its characteristic
equation) for an n × n matrix including repeated roots.
Lecture Notes – MATH2118 Further Engineering Mathematics C 19
EXAMPLE
1 −2 7
Determine the eigenvalues and eigenvectors of A =
0 −1 3 .
0 0 2
solution
Computing A − λI:
1 −2 7 1 0 0
A − λI = 0 −1
3 − λ 0 1 0
0 0 2 0 0 1
1−λ −2 7
= 0 −1 − λ 3.
0 0 2−λ
Characteristic equation:
1 − λ −2 7
A − λI = 0 −1 − λ 3
0 0 2−λ
1−λ −2
= 0 − 0 + (2 − λ)
0 −1 − λ
[ ]
= (2 − λ) (1 − λ)(−1 − λ) − 0
= −(2 − λ)(1 − λ)(1 + λ).
For λ = −1,
1−λ −2 7 a 2 −2 7 a 0
0 −1 − λ 3 0 3
b = 0 b = 0 .
0 0 2−λ c 0 0 3 c 0
Expanding this matrix equation gives
2a − 2b + 7c = 0,
3c = 0,
3c = 0.
20 Matrices
Thus, c = 0 and a = b,
1
v = a
1 .
0
A possible eigenvector is (1, 1, 0).
Eigenvector for λ = 1:
1−λ −2 7 a 0 −2 7 a 0
0 −1 − λ 3
b = 0 −2 3 b = 0
0 0 2−λ c 0 0 1 c 0
−2b + 7c = 0,
−2b + 3c = 0,
c = 0.
Eigenvector for λ = 2:
1−λ −2 7 a −1 −2 7 a 0
0 −1 − λ 3 b = 0 −3 3 b = 0
.
0 0 2−λ c 0 0 0 c 0
This gives
−a − 2b + 7c = 0,
−3b + 3c = 0,
0 = 0.
note:
The λi appear in the same order along the diagonal as the order of the eigenvector xi in
the column of P . Note that P is singular if A does not have distinct eigenvalues.
EXAMPLE
The eigenvectors of the last example are
1 1 5
x1 =
1 , x2 =
0
and x3 =
1
0 0 1
solution
1 −2 7
Recalling that A = 0 −1 3
. Computing inverse of P as follows,
0 0 2
1 1 5 1 0 0 R2 → R1
1 0 1 0 1 0
1 0 1 0 1 0 ∼ 1 1 5 1 0 0 R1 → R2
0 0 1 0 0 1 0 0 1 0 0 1
22 Matrices
1 0 1 0 1 0
∼0 1 4 1 −1 0 R2 − R1
0 0 1 0 0 1
1 0 0 0 1 −1 R1 − R3
∼0 1 0 1 −1 −4 R2 − 4R3
0 0 1 0 0 1
0 1 −1
Thus, the inverse is P −1 =
1 −1 −4 .
0 0 1
Check: Verifying P P −1 = I,
1 1 5 0 1 −1 1 0 0
P P = 1 0 1 1 −1 −4 = 0 1 0
−1
= I.
0 0 1 0 0 1 0 0 1
Hence,
0 1 −1 1 −2 7 1 1 5
P −1 AP =
1 −1 −4 0 −1 3 1 0 1
0 0 1 0 0 2 0 0 1
0 −1 1 1 1 5
= 1 −1 −4
1 0 1
0 0 2 0 0 1
−1 0 0
= 0 1 0
0 0 2
λ1 0 0
= 0 λ2 0
0 0 λ3
= D.
Lecture Notes – MATH2118 Further Engineering Mathematics C 23
EXAMPLE [ ]
1 2
Find the eigenvalues of A = .
2 −2
solution
Evaluating A − λI first,
1 − λ 2
A − λI =
2 −2 − λ
= (1 − λ)(−2 − λ) − 4
= −2 − λ + 2λ + λ2 − 4
= λ2 + λ − 6
= (λ + 3)(λ − 2).
Setting A − λI = 0 gives the eigenvalues of A,
λ1 = −3 and λ2 = 2.
24 Matrices
7 Review Questions
(a)
x1 − 2x2 + 3x3 = 5,
2x1 + x2 − 5x3 = −7,
4x1 − 3x2 + 2x3 = 5.
(b)
(a)
x1 + x2 + x3 + 2x4 − x5 = 0,
2x1 − x2 − x3 + x4 + 2x5 = 0,
x1 + 3x2 − 2x3 + x4 + x5 = 0.
(b)
x1 − 2x2 + x3 − x4 = 0,
2x1 + 4x2 − 3x3 = 0,
3x1 + 2x2 + 2x3 − x4 = 0.
3 2 −2
[3] If A =
−1 −4 1
, show that A + 2A − A − 2I = 0.
3 2
2 −4 −1
[4] Determine the inverse (if it exists) of each of the following matrices:
0 1 1
(a) 1 0 1
;
1 1 0
1 2 3
(b) 4 5 6 ;
7 8 9
Lecture Notes – MATH2118 Further Engineering Mathematics C 25
−1 1 1 1
1 −1 11
(c)
.
1 1 −1 1
1 1 1 −1
[5] By solving [ ][ ] [ ]
a b x y 1 0
=
c d z w 0 1
(where ad − bc ̸= 0) for x, y, z and w, show that
[ ]−1 [ ]
a b 1 d −b
= .
c d ad − bc −c a
[ ]
−3 −7
Hence, write down the inverse of A = .
2 8
[6] Determine the eigenvalues and a set of three linearly independent eigenvectors for
each of the following matrices A:
1 −2 7
(a)
0 −1 3 ;
0 0 2
3 2 4
(b)
2 0 2 .
4 2 3
26 Matrices
Vector Calculus
Dr Eddie Ly
1
2 Vector Calculus
Contents
1 Introduction 3
3 Vector Fields 7
3.2 Divergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6 Scalar Potential 18
7 Review Questions 24
1 Introduction
Physical quantities such as temperature, pressure, density, electric field and magnetic field
are functions of position in that they vary throughout space (and time). A scalar function
defined throughout some region is called a scalar field, while a vector function defined
throughout some region is called a vector field.
∂ϕ ∂ϕ ∂ϕ
grad ϕ = ∇ϕ = i+ j+ k,
∂x ∂y ∂z
where i, j and k are unit vectors in the x, y and z-direction, respectively. Note that
∇ϕ, which is often written as grad ϕ, is a vector function, and ∂
, ∂
∂x ∂y
and ∂
∂z
are partial
derivative operators with respect to the variable x, y and z, respectively. For example, if
∂f
f (x, y, z) = x2 yz, then ∂x
= fx = (2x)yz; that is, differentiating function f with respect
to x only while keeping all other variables fixed.
EXAMPLE
If ϕ(x, y, z) = x2 + 3xyz − y 2 , determine ∇ϕ at the point P (1, −2, 5).
solution
Gradient of the scalar function ϕ(x, y, z),
∂ϕ ∂ϕ ∂ϕ
∇ϕ = i+ j+ k
∂x ∂y ∂z
= (2x + 3yz)i + (3xz − 2y)j + 3xyk.
EXAMPLE
Determine
(1) ∇r3 ,
(2) ∇(1/r) and
(3) ∇ ln r.
solution
√
Note that r = r(x, y, z) = xi + yj + zk and r = |r| = x2 + y 2 + z 2 .
x
= .
r
∂r y ∂r z
Similarly, = and = . Thus,
∂y r ∂z r
( ) ∂ ( 3) ∂ ( 3) ∂ ( 3)
∇ r3 = r i+ r j+ r k
∂x ∂y ∂z
∂r ∂r ∂r
= 3r2 i + 3r2 j + 3r2 k
∂x ∂y ∂z
Lecture Notes – MATH2118 Further Engineering Mathematics C 5
x y z
= 3r2 i + 3r2 j + 3r2 k
r r r
( )
xi + yj + zk
= 3r2
r
r
= 3r2
r
= 3rr
= 3|r|r since r = |r|.
∂ ∂ ∂
∇(1/r) = (1/r)i + (1/r)j + (1/r)k
∂x ∂y ∂z
( ) ( ) ( )
∂ 1 ∂r ∂ 1 ∂r ∂ 1 ∂r
= i+ j+ k
∂r r ∂x ∂r r ∂y ∂r r ∂z
1x 1y 1z
=− i − j − k
r2 r r2 r r2 r
−(xi + yj + zk)
=
r3
r
=− 3
r
1 r
=− 2
r r
r̂
= − 2,
|r|
r
where r̂ = is an unit vector of r.
|r|
(3) Applying the chain rule provides
∂ ( ) ∂ ( ) ∂ ( )
∇(ln r) = ln r i + ln r j + ln r k
∂x ∂y ∂z
( ) ( ) ( )
∂ ∂r ∂ ∂r ∂ ∂r
= ln r i+ ln r j+ ln r k
∂r ∂x ∂r ∂y ∂r ∂z
1 x 1 y 1 z
= · i+ · j+ · k
r r r r r r
xi + yj + zk
=
r2
r 1
= ·
r r
r̂
= .
|r|
6 Vector Calculus
dϕ
= ∇ϕ · û
du
In the above expressions, û is an unit vector of u and the operator “ · ” represents the
dot product operation. Since the maximum value of cos θ is one, and occurs when θ = 0,
we can conclude that
• At any given point, ∇ϕ is the maximum directional derivative ;
EXAMPLE
If the temperature of a body at the point (x, y, z) is
determine the direction in which the temperature increases most rapidly at the point
P (1, 2, 1).
solution
The temperature increases most rapidly in the direction of ∇T . Now,
∂T ∂T ∂T
∇T = i+ j+ k
∂x ∂y ∂z
3 Vector Fields
If v(x, y, z) is defined at each point of a region R, then v is said to form a vector field
over R. Some examples of vector field are
• motion of a wind or fluid, since a vector (both speed and direction) can be assigned
at each point representing the velocity of a particle at the point;
• electric intensity and magnetic intensity are vector functions, which depend on time
as well as position;
• laminar flow of blood in an artery, where cylindrical layers of blood flow faster near
the centre of the artery.
∂ ∂ ∂
∇=i +j +k
∂x ∂y ∂z
3.2 Divergence
The dot (scalar) product of the gradient operator ∇ and a vector function F is called the
divergence of F (or div F ). To be specific, if
div F = ∇ · F
( )
∂ ∂ ∂ ( )
= i +j +k · F1 i + F2 j + F3 k
∂x ∂y ∂z
∂F1 ∂F2 ∂F3
= + + .
∂x ∂y ∂z
Note that div F produces a scalar function as a result.
EXAMPLE
Determine the divergence of
( )
(1) F = e3x yzi + x sin yj + z 2 + 5 k ;
(2) F = yzi + xzj + xyk ;
xi + yj
(3) F = 2 .
x + y2
solution
div F = ∇ · F
( ) (
∂ ∂ ∂ ( ) )
= i +j +k · e3x yzi + x sin yj + z 2 + 5 k
∂x ∂y ∂z
∂ ( 3x ) ∂ ( ) ∂ ( 2 )
= e yz + x sin y + z +5
∂x ∂y ∂z
= 3e3x yz + x cos y + 2z.
Lecture Notes – MATH2118 Further Engineering Mathematics C 9
div F = ∇ · F
( )
∂ ∂ ∂ ( )
= i +j +k · yzi + xzj + xyk
∂x ∂y ∂z
∂ ∂ ∂
= (yz) + (xz) + (xy)
∂x ∂y ∂z
=0+0+0
= 0.
div F = ∇ · F
( ) ( )
∂ ∂ ∂ x y
= i +j +k · 2 i+ 2 j + 0k
∂x ∂y ∂z x + y2 x + y2
( ) ( )
∂ x ∂ y
= +
∂x x2 + y 2 ∂y x2 + y 2
( ) ( )
(1) x2 + y 2 − x(2x) (1) x2 + y 2 − y(2y)
= +
(x2 + y 2 )2 (x2 + y 2 )2
( 2 ) ( )
y − x2 + x2 − y 2
=
(x2 + y 2 )2
= 0 provided (x, y) ̸= (0, 0).
EXAMPLE
Determine the divergence of F = r2 r.
solution
√
Let r = xi + yj + zk, then r = |r| = x2 + y 2 + z 2 . Then,
div F = ∇ · F
( )
= ∇ · r2 r
( )
∂ ∂ ∂ ( )
= i +j +k · xr2 i + yr2 j + zr2 k
∂x ∂y ∂z
∂ (( 2 2 2
)) ∂ (( 2 2 2
)) ∂ (( 2 2 2
))
= x x +y +z + y x +y +z + z x +y +z
∂x ∂y ∂z
10 Vector Calculus
( ) ( ) ( )
= x2 + y 2 + z 2 + x(2x) + x2 + y 2 + z 2 + y(2y) + x2 + y 2 + z 2 + z(2z)
( ) ( )
= 3 x2 + y 2 + z 2 + 2 x2 + y 2 + z 2
( )
= 5 x2 + y 2 + z 2
= 5r2
= 5r · r
F = r2 xi + r2 yj + r2 zk.
Divergence of F :
( )
∂ ∂ ∂ ( )
div F = i +j +k · r2 xi + r2 yj + r2 zk
∂x ∂y ∂z
∂ ( 2 ) ∂ ( 2 ) ∂ ( 2 )
= r x + r y + r z .
∂x ∂y ∂z
Appling the product rule to the above relation gives
∂ ( 2 ) ∂ ( 2) ∂
r x =x r + r2 (x)
∂x ∂x ∂x
∂r
= x(2r) + r2 (1)
∂x
x ∂r ∂ √ 2 x
= 2xr + r2 since = x + y2 + z2 =
r ∂x ∂x r
2 2
= 2x + r .
remarks
The last example describes a special case of the “product” rule for the divergence operator.
If ϕ(x, y, z) is a scalar function and
div ϕF = ∇ · ϕF
( )
∂ ∂ ∂ ( )
= i +j +k · ϕF1 i + ϕF2 j + ϕF3 k
∂x ∂y ∂z
∂ ( ) ∂ ( ) ∂ ( )
= ϕF1 + ϕF2 + ϕF3
∂x ∂y ∂z
( ) ( ) ( )
∂F1 ∂ϕ ∂F2 ∂ϕ ∂F3 ∂ϕ
= ϕ + F1 + ϕ + F2 + ϕ + F3
∂x ∂x ∂y ∂y ∂z ∂z
( ) ( )
∂ϕ ∂ϕ ∂ϕ ∂F1 ∂F2 ∂F3
= F1 + F2 + F3 +ϕ + +
∂x ∂y ∂z ∂x ∂y ∂z
| {z } | {z }
= F ·∇ϕ = ϕ∇·F
= F · ∇ϕ + ϕ∇ · F .
For example, in the last example, let ϕ = r2 (scalar function) and F = r. Since the
divergence is a derivative operator, rules of differentiation must be obeyed. Thus,
div ϕF ̸= ϕ div F ,
be the steady fluid velocity at any point P (x, y, z). Then, for per unit volume and per
unit time at point P ,
• div (ρv) represents the net mass outflow, where ρ(x, y, z) is the fluid density.
Considering the net mass outflow through a small box of infinitesimal length ∆x, ∆y and
∆z (control volume) containing point P in the x-direction as shown below,
12 Vector Calculus
P
∆z z
y
∆y
x
x − 12 ∆x ∆x x + 12 ∆x
we have
ρu x+ ∆x − ρux− ∆x
≈ 2 2
(∆x∆y∆z)
∆x
∂
→ (ρu)(∆x∆y∆z) as ∆x → 0.
∂x
Combining this with the net mass outflow in the y and z-direction, and letting
∆V = ∆x ∆y ∆z,
Thus, the net mass outflow per unit time, per unit volume at P is represented by
∆M
= ∇ · (ρv)
∆V
= div (ρv).
The cross (vector) product of ∇ and a vector function F is called the curl of F (or
curl F ). If
F (x, y, z) = F1 (x, y, z)i + F2 (x, y, z)j + F3 (x, y, z)k,
curl F = ∇ × F
i j k
= ∂x
∂ ∂
∂y
∂
∂z
F1 F2 F3
( ) ( ) ( )
∂F3 ∂F2 ∂F3 ∂F1 ∂F2 ∂F1
= − i− − j+ − k.
∂y ∂z ∂x ∂z ∂x ∂y
EXAMPLE
Determine the curl of
(1) F = 2xyi + yz 2 j + x3 zk ;
(2) F = yzi + xzj + xyk ;
(3) F = r2 r.
solution
curl F = ∇ × F
i j k
= ∂x ∂ ∂
∂y
∂
∂z
2xy yz 2 x3 z
∂ ∂ ∂ ∂ ∂ ∂
= i ∂y2 3∂z − j ∂x 3∂z + k ∂x ∂y2
yz x z 2xy x z 2xy yz
curl F = ∇ × F
i j k
= ∂x
∂ ∂
∂y
∂
∂z
yz xz xy
∂ ∂ ∂ ∂ ∂ ∂
= i ∂y ∂z − j ∂x ∂z + k ∂x ∂y
xz xy yz xy yz xz
This is a irrotational vector field, since curl of F is a zero vector; that is,
∇ × F = 0.
curl F = ∇ × F
i j k
= ∂x∂ ∂
∂y
∂
∂z
2
r x r y r2 z
2
∂ ∂ ∂ ∂ ∂ ∂
= i 2∂y 2∂z − j 2∂x 2∂z + k 2∂x 2∂y
r y r z r x r z r x r y
The curl of a vector function v is related to the amount of rotation associated with v.
Consider a particle P rotating about O in the xy-plane at constant radius a and angular
speed ω (rad/sec) as shown below,
y
O
r
a
P
x
curl v = ∇ × v
i j k
= ∂x∂ ∂ ∂
∂y ∂z
−ωy ωx 0
∂ ∂ ∂ ∂ ∂ ∂
∂y ∂z ∂x ∂y
= i − j ∂x ∂z
+k
ωx 0 −ωy 0 −ωy ωx
= 0i − 0j + (ω + ω)k
= 2ωk
= 2ω.
16 Vector Calculus
The result, curl v = ∇ × v = 2ω indicates that curl v is twice the angular velocity vector.
In general, curl v measures the amount of rotation or vorticity of v. Hence, the term
irrotational is used for vector fields having curl v = 0.
Let F (x, y, z) and G(x, y, z) be vector functions, and ϕ(x, y, z) a scalar function. Assum-
ing all of the derivatives implied below exist, we have the following indentities involving
divergence and curl operations,
(1) ∇ · ∇ × F = 0 ;
(2) ∇ × ∇ϕ = 0 ;
(3) ∇ · (F + G) = ∇ · F + ∇ · G ;
(4) ∇ × (F + G) = ∇ × F + ∇ × G ;
(5) ∇ · ϕF = ϕ∇ · F + F · ∇ϕ ;
(6) ∇ × ϕF = ϕ∇ × F + ∇ϕ × F ;
(7) ∇ · (F × G) = G · ∇ × F − F · ∇ × G ;
(11) ∇ × (∇ × F ) = ∇(∇ · F ) − ∇2 F .
∇2 = ∇ · ∇
( ) ( )
∂ ∂ ∂ ∂ ∂ ∂
= i+ j+ k · i+ j+ k
∂x ∂y ∂z ∂x ∂y ∂z
∂ ∂ ∂ ∂ ∂ ∂
= + +
∂x ∂x ∂y ∂y ∂z ∂z
∂2 ∂2 ∂2
= + + .
∂x2 ∂y 2 ∂z 2
Lecture Notes – MATH2118 Further Engineering Mathematics C 17
EXAMPLE
Verify Identity (1): ∇ · ∇ × F = 0 (divergence of the curl of a vector function is
always zero).
solution
Let
F (x, y, z) = F1 (x, y, z)i + F2 (x, y, z)j + F3 (x, y, z)k,
then
curl F = ∇ × F
i j k
= ∂x
∂ ∂
∂y
∂
∂z
F1 F2 F3
( ) ( ) ( )
∂F3 ∂F2 ∂F3 ∂F1 ∂F2 ∂F1
=i − −j − +k − ,
∂y ∂z ∂x ∂z ∂x ∂y
⇒ div curl F = ∇ · ∇ × F
( ) ( ) ( )
∂ ∂F3 ∂F2 ∂ ∂F3 ∂F1 ∂ ∂F2 ∂F1
= − − − + −
∂x ∂y ∂z ∂y ∂x ∂z ∂z ∂x ∂y
∂ 2 F3 ∂ 2 F2 ∂ 2 F3 ∂ 2 F1 ∂ 2 F2 ∂ 2 F1
= − − + + −
∂x∂y ∂x∂z ∂y∂x ∂y∂z ∂z∂x ∂z∂y
= 0,
EXAMPLE
Verify Identity (2): ∇ × ∇ϕ = 0 (curl of the gradient of a scalar function is always
zero).
solution
If ϕ(x, y, z) is a scalar function, then
∂ϕ ∂ϕ ∂ϕ
∇ϕ = i+ j+ k,
∂x ∂y ∂z
and
curl ∇ϕ = ∇ × ∇ϕ
i j k
= ∂x
∂ ∂
∂y
∂
∂z
∂ϕ ∂ϕ ∂ϕ
∂x ∂y ∂z
18 Vector Calculus
( ) ( 2 ) ( 2 )
∂ 2ϕ ∂ 2ϕ ∂ ϕ ∂ 2ϕ ∂ ϕ ∂ 2ϕ
=i − −j − +k −
∂y∂z ∂z∂y ∂x∂z ∂z∂x ∂x∂y ∂y∂x
= 0,
assuming pairs of mixed partial derivatives are equal. Thus, if F is the gradient of
a scalar function, F = ∇ϕ, then ∇ × F = 0 (irrotational).
6 Scalar Potential
• ∇ × F = 0 (irrotational) ;
That is, if
∇ × F = 0,
then there will exist a scalar potential function ϕ associated with F , and F is said to be
conservative or irrotational in the region R.
If a scalar potential for F exists, it means that the information contained in the three
components of F actually derives from a single scalar function ϕ. This property leads
to significant saving in computational cost for certain problems. For example, potential
flows over an aircraft wing in subsonic, transonic and supersonic speed regime.
To find the scalar potential associated with F , we must first check that
curl F = ∇ × F = 0,
∇ϕ = F
EXAMPLE
Verify that the vector field
( )
F = (2x + sin y)i + x cos y + z 2 j + 2yzk
∂ϕ
= 2x + sin y,
∂x
∂ϕ
= x cos y + z 2 ,
∂y
∂ϕ
= 2yz.
∂z
Integrating the above relations provides
ϕ(x, y, z) = x2 + x sin y + yz 2 + c,
EXAMPLE
Verify that the vector field,
Equating ∇ϕ to F :
∂ϕ
= y + z,
∂x
∂ϕ
= z + x,
∂y
∂ϕ
= x + y.
∂z
There are two ways of proceeding from here.
method 1:
As usual, we integrate to get
ϕ = xy + xz + f (y, z),
ϕ = yz + xy + g(x, z),
ϕ = xz + yz + h(x, y).
ϕ(x, y, z) = xy + xz + yz + c,
method 2:
∂ϕ
Integrating the first equation, ∂x
= y + z, gives
ϕ = xy + xz + f (y, z),
Lecture Notes – MATH2118 Further Engineering Mathematics C 21
where f (y, z) is an arbitrary function not depending on the variable x. That is,
∂f
∂x
= 0. Differentiating this relation with respect to the variable y provides
∂ϕ ∂f
=x+ .
∂y ∂y
Comparing this equation with the second equation yields
∂ϕ ∂f ∂f
=z+x=x+ ⇒z= ,
∂y ∂y ∂y
which means that f (y, z) = yz + g(z). Thus,
ϕ = xy + xz + yz + g(z).
ϕ(x, y, z) = xy + xz + yz + c.
∇ × F = 0 with F = ∇ϕ,
and solenoidal,
∇ · F = 0,
then the associated scalar potential function ϕ satisfies
∇ · F = ∇ · ∇ϕ
= ∇2 ϕ
∂2ϕ ∂2ϕ ∂2ϕ
= + + 2
∂x2 ∂y 2 ∂z
= 0.
This is the famous Laplace’s equation. Any function ϕ satisfies Laplace’s equation is a
harmonic function.
22 Vector Calculus
EXAMPLE
Find a scalar function f (x, y, z) such that the vector function,
is both irrotational and solenoidal. Find a scalar potential ϕ(x, y, z) such that
F = ∇ϕ.
solution
Requiring F to be solenoidal,
∂f ∂f
div F = 6y + − 6y = = 0.
∂y ∂y
Hence, f must be a function of x and z only. Next, requiring F to be irrotational,
i j k
∇ × F = ∂
∂x
∂
∂y
∂
∂z
2z + 6xy f (x, z) 2x − 6yz
( ) ( )
∂f ( ) ∂f
= i −6z − −j 2−2 +k − 6x
∂z ∂x
= 0.
∂f ∂f
Thus, = 6x and = −6z. Integrating these two relations provides
∂x ∂z
f (x, z) = 3x2 + g(z),
f (x, z) = −3z 2 + h(x).
where c is a constant.
If F (x, y, z) represents a force field, then the scalar potential ϕ(x, y, z) has the dimensions
of energy, and is related to the potential energy V (x, y, z) by
V = −ϕ.
For example, the force due to gravity acting on a body of mass m near to the earth’s
surface is governed by
F = −mgk.
Since F is constant, it is clear that curl F = 0, so that a scalar potential ϕ exists. Equating
∇ϕ to F , we have
∂ϕ ∂ϕ ∂ϕ
= 0, = 0 and = −mg.
∂x ∂y ∂z
A consistent solution is
ϕ(x, y, z) = −mgz + constant.
Since the gravitational potential energy of such a body is given by V = mgz + c, then
V = −ϕ (up to an additive constant).
24 Vector Calculus
7 Review Questions
[1] (a) Find the divergence and curl of the vector field,
( ) ( )
V (x, y, z) = 2xeyz i + x2 zeyz + 3y 2 z j + y 3 + x2 yeyz k.
is irrotational.
(b) Find a scalar potential function for this field.
(a) Determine ∇ · G.
(b) Determine ∇ × G.
(c) Is G solenoidal? is G irrotational?
[6] Find the directional derivative of ϕ = z 4 +x2 y 3 at the point (2, −1, 1) in the direction
6i + 2j + 3k.
(b) Using the results obtained in part (a), or otherwise, evaluate div (r/r).
[9] Find a unit normal vector to the paraboloid defined by z(x, y) = 4x2 + y 2 at the
point (2, 3, 25).
[10] The vector field G and the scalar field ϕ are defined by
( ) ( )2 ( )
G = 4zy 2 + 2x − 5 i + 2z 2 − 3x + y j + 3xy + 2z k
and
ϕ(x, y, z) = xz 2 − 4xy 2 ,
respectively. Compute
(a) ∇ · G ;
(b) ∇ × G ;
(c) ∇ϕ ;
(d) curl grad ϕ.
V = ∇ × A.
A(x, y, z) = x2 y 2 ez i + xyez j + x2 y 3 z 4 k
( y) ( y )
− 2x cos(y + z) − 2x cos(y + z) j + 2x cos(y + z) − 2x cos(y + z) k
= 0.
√
(b) ϕ(x, y, z) = x2 sin(y + z) + 2z 3 y + c, where c is a constant.
( ) ( ) ( )
x x y y 1 1
[3] (a) ∇F = − 2 + 2 i − − 2 + 2 j + − k=0
z z z z z z
xy x3
(b) ϕ(x, y, z) = + + cos y + sin z + c, where c is a constant.
z 3
[4] (a) ∇ · G = 0
(b) ∇ × G = 0
n = ∇F
= 2xi + 2yj + (10 − 2z)k
= 8i + 6j + 10k at point P.
n 1
Thus, n̂ = = √ (4i + 3j + 5k).
|n| 50
[6] ∇ϕ = 2xy 3 i + 3x2 y 2 j + 4z 3 k = −4i + 12j + 4k at point (2, −1, 1).
Directional derivative is ∇ϕ · û = 12/7.
[11] (a) ∇ × H = 0
∂ϕ ∂ϕ ∂ϕ
(b) = 2 + 2xyz ; = 4 + x2 z ; = 2z + x2 y.
∂x ∂y ∂z
Scalar potential function: ϕ(x, y, z) = 2x + 4y + z 2 + x2 yz + c, where c is a
constant.
( )
(c) curl ϕH = ϕ∇ × H + ∇ϕ × H = ϕ 0 + H × H = 0.
Dr Eddie Ly
1
2 Ordinary Differential Equations
Contents
1 Introduction 3
4 Review Questions 19
1 Introduction
EXAMPLE
di
L + Ri = E(t)
dt
d2 θ
I + mgh · sin θ = 0
dt2
• Mechanical vibrations:
d2 x dx
m 2
+ c + kx = 0
dt dt
Differential equations are classified according to type, order and linearity. If an equation
contains any ordinary derivatives of one or more dependent variables, with respect to a
single independent variable, it is then said to be an ordinary differential equation. The
order of the highest derivative in a differential equations is called the order of the equation.
dn y dn−1 y dy
an (x) n
+ an−1 (x) n−1
+ · · · + a1 (x) + a0 (x)y = g(x).
dx dx dx
Note the power of each term involving y is one, and each coefficient an depends only on
the independent variable x. An equation that is not linear is said to be nonlinear.
EXAMPLE
• Separable type:
dy
= F (x) · G(y)
dx
• First-order linear type:
dy
+ p(x)y = q(x)
dx
EXAMPLE
Solve yy ′ = x.
solution
dy x
= provided y ̸= 0
dx y
⇒ y dy = x dx
1 2 1 2
⇒ y = x + c0
2 2
⇒ y = x2 + c
2
(putting c = 2c0 )
Lecture Notes – MATH2118 Further Engineering Mathematics C 5
EXAMPLE
Solve y ′ + 2y = 4 subject to y(0) = 0.
solution
dy
= 4 − 2y
dx
∫ ∫
dy
⇒ = dx
4 − 2y
1
⇒ − ln|4 − 2y| = x + c
2
⇒ ln|4 − 2y| = −2(x + c)
⇒ 4 − 2y = e−2(x+c) since e−(x+c) > 0
1
⇒ y = 2 − e−2(x+c)
2
1
= 2 + Ae−2x with A = − e−2c
2
Applying the condition y(0) = 0:
0 = 2 + Ae0 ⇒ A = −2
EXAMPLE
The mass M of a radioactive substance is initially 10 g, and 20 years later its mass
is 9.6 g. Given that the rate of decay of a radioactive substance is proportional to
the mass of that substance present at any time t, in how many years will the mass
be halved (half-life) ?
Governing equation:
−dM
∝M (M in grams and t in years)
dt
dM
⇒ = −kM where k is a proportionality constant.
dt
6 Ordinary Differential Equations
⇒ ln|M | = −kt + c
⇒ M (t) = e−kt+c
= Ae−kt where A = ec = constant.
dy
a1 (x) + a0 (x)y = g(x).
dx
Rewriting this equation as
dy a0 (x) g(x)
+ y= provided a1 (x) ̸= 0
dx a1 (x) a (x)
| {z } | 1{z }
= p(x) = q(x)
dy
⇒ + p(x)y = q(x) ←− linear in both y & y ′ , coefficient of y ′ is 1. (1)
dx
Lecture Notes – MATH2118 Further Engineering Mathematics C 7
To solve this differential equation, we multiply both sides of (1) by some function I(x),
such that the left-hand-side term becomes an exact derivative,
dy
I(x) + I(x)p(x)y = I(x)q(x), (2)
dx
and
d( ) dy dI
Iy = I +y . (3)
dx dx dx
We want the left-hand-side of (2) same as the left-hand-side of (3):
d( ) dy dI dy
Iy = I +y =I + Ipy
dx dx dx dx
dI
⇒ = Ip
dx
dI
⇒ = p dx
I
Thus,
∫ ∫
dI
= p(x) dx
I(x)
∫
⇒ ln I(x) = p(x) dx
∫
⇒ I(x) = e p(x) dx
∫ ∫
⇒ I(x) = e p(x) dx
since e p(x) dx
> 0 for all x (4)
= integrating factor
EXAMPLE
Solve xy ′ − 4y = x6 ex .
solution
Rewrite this equation such that the coefficient of y ′ is 1:
dy 4
− y = x5 ex ←− p(x) = −4/x, q(x) = x5 ex
dx x
Integrating factor I(x):
∫
p(x) dx
I(x) = e
∫
= e−
4
x
dx
8 Ordinary Differential Equations
= e−4 ln|x|
−4
= eln|x|
1
= 4 provided x ̸= 0.
x
d
Thus, (Iy) = Iq becomes
dx
( )
d y x5 ex
=
dx x4 x4
= xex
∫
y
⇒ 4
= xex dx
x
∫
⇒ y = x xex dx
4
∫
= xe − ex dx
x
= xex − ex + c.
General solution:
( )
y(x) = x4 xex − ex + c
= x4 (x − 1)ex + cx4 .
EXAMPLE
Salt solution containing 2 g/lt of salt flows into a tank initially filled with 50 lt
of water containing 10 g of salt. If the solution enters the tank at 5 lt/min, the
concentration is kept uniform by stirring, and the mixture flows out at the same
rate, find the amount of salt in the tank after 10 mins.
solution
Suppose there are Q g of salt in the tank after t mins. Since 5 lt of salt solution
enter and leave the tank each minute, the tank will contain 50 lt of solution at any
Q
time t. Therefore, the solution concentration will be 50
g/lt, and since it flows out
at 5 lt/min, the rate of outflow is Q
50
×5 = Q
10
g/min, while the inflow rate is 2 g/lt
× 5 lt/min = 10 g/min.
Lecture Notes – MATH2118 Further Engineering Mathematics C 9
= 100et/10 + c
⇒ Q = 100 + ce−t/10
When t = 0, Q = 10 g:
Thus,
Q(t) = 100 − 90e−t/10 .
After 10 mins (t = 10):
Homogeneous equation:
d2 y dy
a 2
+ b + cy = 0
dx dx
Let y1 (x) and y2 (x) be solutions of this equation. According to the superposition principle,
the linear combination,
y(x) = C1 y1 (x) + C2 y2 (x),
where C1 and C2 are arbitrary constants, is also a solution of such homogeneous equation.
All solutions are either exponential functions, or are constructed out of exponential func-
tions. If we try a solution of the form
y(x) = emx
• b2 − 4ac > 0 ;
• b2 − 4ac < 0 ;
• b2 − 4ac = 0 ;
b
Characteristic equation has two equal real roots m1 = m2 = − giving
2a
EXAMPLE
Solve 2y ′′ − 5y ′ − 3y = 0.
solution
Solve for the characteristic equation:
2m2 − 5m − 3 = 0
⇒ (2m + 1)(m − 3) = 0
⇒ m = −1/2, 3
General solution:
y(x) = C1 e−x/2 + C2 e3x .
EXAMPLE
Solve y ′′ − 10y ′ + 25y = 0.
solution
From the characteristic equation:
m2 − 10m + 25 = (m − 5)2 = 0 ⇒ m1 = m2 = 5,
EXAMPLE
Solve y ′′ + y ′ + y = 0.
solution
Characteristic equation:
m2 + m + 1 = 0
√
−1 ± 1 − 4(1)(1)
⇒ m=
√2
−1 ± i 3
=
2
= α ± iβ.
√
1 3
Identifying α = − and β = , the general solution is
2 2
[ (√ ) ( √ )]
−x/2
y(x) = e C1 cos 2 x + C2 sin 23 x .
3
EXAMPLE
Solve y ′′ − 4y ′ + 13y = 0, subject to y(0) = −1 and y ′ (0) = 2.
solution
Characteristic equation:
m2 − 4m + 13 = 0
√
4± 16 − 52
⇒ m=
2
4 ± 6i
=
2
= 2 ± 3i
General solution: [ ]
y(x) = e2x C1 cos(3x) + C2 sin(3x)
The condition y(0) = −1 implies that
−1 = e0 (C1 · 1 + C2 · 0)
= C1
[ ]
⇒ y(x) = e2x C2 sin(3x) − cos(3x)
⇒ C2 = 4/3
Particular solution: [ ]
4
y(x) = e 2x
sin(3x) − cos(3x) .
3
d2 y dy
a 2
+ b + cy = g(x),
dx dx
where a, b, c are constants, and g(x) is continuous is said to be a particular integral of
the equation.
(1) Solve the associated homogeneous equation to get the complementary function,
denoted by yC (x),
d2 yC dyC
a 2
+b + cyC = 0.
dx dx
(2) Find the particular integral, yP (x), of the nonhomogeneous equation.
(3) Add yC (x) and yP (x) to form the general solution of the nonhomogeneous equation,
(i) a constant k,
(ii) a polynomial in x,
or finite sums and products of these functions, it is usually possible to find yP (x) by the
method of undetermined coefficients. Other techniques, such as variation of parameters,
are available for more general g(x).
14 Ordinary Differential Equations
EXAMPLE
Solve y ′′ + 8y ′ = 24.
solution
Solving yC′′ + 8yC′ = 0 for the complementary function:
Try yP = A (constant),
yP′ = 0,
yP′′ = 0,
⇒ yP′′ + 8yP′ = 0 + 0 = 24 −→ No solution!
Since there is a constant in yC , namely C1 , and there is also a constant term (A) in
the proposed yP , this will not work! Instead, multiple yP by x, and try again,
Try yP = Ax,
yP′ = A,
yP′′ = 0,
⇒ yP′′ + 8yP′ = 0 + 8A = 24
⇒ A=3
⇒ yP = 3x.
General solution:
y(x) = yC + yP
= C1 + C2 e−8x + 3x
check:
y = C1 + C2 e−8x + 3x,
y ′ = −8C2 e−8x + 3,
y ′′ = 64C2 e−8x ,
( )
⇒ y ′′ + 8y ′ = 64C2 e−8x + 8 −8C2 e−8x + 3
= 64C2 e−8x − 64C2 e−8x + 24
Lecture Notes – MATH2118 Further Engineering Mathematics C 15
= 24
= g(x) as required!
EXAMPLE
Determine the solution of y ′′ − 2y ′ − 3y = 8e3x , subject to y(0) = y ′ (0) = 0.
solution
Characteristic equation:
m2 − 2m − 3 = 0
⇒ (m − 3)(m + 1) = 0
⇒ m = −1, 3.
Complementary function:
yC = C1 e−x + C2 e3x .
Particular integral:
Also,
Applying condition, x = 0, y = 0:
0 = C1 + C2 ⇒ C2 = −C1 .
Applying condition, x = 0, y ′ = 0:
1 1
0 = −C1 + (2 + 3C2 ) = 2 + 4C2 ⇒ C2 = − , C1 = −C2 = .
2 2
Particular solution:
1 1( )
y(x) = e−x + 4x − 1 e3x .
2 2
EXAMPLE
Solve y ′′ − 2y ′ − 3y = sin x.
solution
Complementary function (from previous example):
yC = C1 e−x + C2 e3x .
Particular integral:
This requires
−4A + 2B = 1 ⇒B= 1
2
+ 2A
−2A − 4B = 0 ⇒ 2A = −4B = −2 − 8A ⇒ 10A = −2
EXAMPLE
Solve y ′′ + 2y ′ + 2y = −10xex + 5 sin x.
solution
Characteristic equation:
m2 + 2m + 2 = 0
√
−2 ±
4−8
⇒ m=
2
−2 ± 2i
=
2
√
= −1 ± i where i = −1.
Complementary function:
Here
g(x) = −10xex + 5 sin x,
and
g ′ (x) = −10ex − 10xex + 5 cos x,
indicates that the particular integral should take the following form,
5A = −10 ⇒ A = −2,
4A + 5B = 0 ⇒ 5B = −4A = 8 ⇒ B = 8/5,
C − 2D = 5 ⇒ C = 5 + 2D,
2C + D = 0 ⇒ D = −2C = −10 − 4D ⇒ D = −2, C = 1.
18 Ordinary Differential Equations
Particular integral is
8
yP (x) = −2xex + ex + sin x − 2 cos x.
5
General solution is
( )
y(x) = e−x (C1 cos x + C2 sin x) + sin x − 2 cos x + 8/5 − 2x ex .
Lecture Notes – MATH2118 Further Engineering Mathematics C 19
4 Review Questions
[7] Determine the general solution of each of the following differential equations:
(a) y ′′ − y ′ − 6y = 0,
(b) y ′′ + 2y ′ + 10y = 0,
(c) y ′′ − 9y = 0,
20 Ordinary Differential Equations
(d) y ′′ − 9y ′ = 0.
[9] Determine the general solution of each of the following differential equations:
(a) y ′′ − y ′ − 2y = 4 cosh(2x),
(b) y ′′ + 2y ′ + y = ex cos x,
(c) y ′′ − 3y ′ + 2y = 6xe−x .
[11] A body of unit mass moves along the x-axis under the action of
If the body starts from rest at the origin, and ω > λ, obtain x(t) for the following
two cases:
√
(a) b = ω 2 − λ2 ,
√
(b) b ̸= ω 2 − λ2 .
[12] The angular displacement θ(t) of a rigid body pendulum oscillating about a fixed
axis is governed by
d2 θ
= −mgh · sin θ,
I
dt2
where m, g, h and I are constants. For small oscillations (that is, when θ is small),
we can use sin θ ≈ θ. Show that for small oscillations, the motion is simple harmonic
√
in nature with period 2π I/(mgh).
Lecture Notes – MATH2118 Further Engineering Mathematics C 21
d2 i di i
L 2
+ R + = E0 ω cos(ωt).
dt dt C
di
If R2 C < 4L, determine i(t) for the case when i(0) = 0 and dt
(0) = 0.
dy
− 3y = e5x + e3x cos(2x),
dx
which satisfies y(0) = 0.
dN
= kN − Q,
dt
where k is the difference between the birth and death rates, and Q is the emigration
rate. Both k and Q are assumed to be positive constants.
(a) Solve this differential equation subject to the initial condition N (0) = N0 .
(b) Show that in the case Q > kN0 , the population crashes (i.e. N = 0) at time
( )
1 Q
t = log .
k Q − kN0
22 Ordinary Differential Equations
[3] y 2 = x2 + cx
[4] θ ≈ 20.6◦ C
E0 ( )
−Rt/L
[5] i(t) = 2 2 ωLe + R sin(ωt) − ωL cos(ωt)
ω L + R2
sin x
[6] y(x) = +1
x2
[7] (a) y(x) = ae3x + be−2x
( )
(b) y(x) = e−x a cos(3x) + b sin(3x)
(c) y(x) = ae3x + be−3x
(d) y(x) = a + be9x
1
[14] y(x) = 2
+ 12 e5x + 12 e3x sin(2x)
Lecture Notes – MATH2118 Further Engineering Mathematics C 23
Infinite Series
Dr Eddie Ly
1
2 Infinite Series
Contents
1 Introduction 3
2 Convergent Series 3
4 Alternating Series 15
5 Review Questions 20
1 Introduction
∑
∞
an = a1 + a2 + a3 + · · · + an + an+1 + · · ·
n=1
∑∞ ∑
is called an infinite series, or simply a series. Often, we can write n=1 an as an ).
The an , n = 1, 2, 3, . . ., are called the terms of the series; an is called the general term.
∑
Associated with every infinite series an , there is a sequence of partial sums {Sn } whose
terms are defined by
S1 = a 1 ,
S2 = a1 +a2 = S1 + a2 ,
|{z}
= S1
S3 = a1 + a2 +a3 = S2 + a3 ,
| {z }
= S2
∑
n
Sn = am
m=1
= a1 + a2 + a3 + · · · + an−1 +an
| {z }
= Sn−1
2 Convergent Series
∑∞
An infinite series n=1 an is said to be convergent if the sequence of partial sums {Sn }
converges. That is,
∑
n
lim Sn = lim am = L.
n→∞ n→∞
m=1
The number L is the sum of the series. If lim Sn = L does not exist, the series is said to
n→∞
be divergent.
4 Infinite Series
EXAMPLE
∑ 1
Show that the series is convergent.
(n + 4)(n + 5)
solution
Considering the general term of the series:
1
an =
(n + 4)(n + 5)
1 1
= − .
n+4 n+5
The nth partial sum of the series is
[ ] [ ] [ ] [ ]
1 1 1 1 1 1 1 1
Sn = − + − + − +···+ −
5 6 6 7 7 8 n+4 n+5
| {z } | {z } |{z} | {z }
1 1
= − .
5 n+5
Since
( )
1 1
lim Sn = lim −
n→∞ n→∞ 5 n+5
= 1/5
= L,
remark:
Because of the manner in which the general term of this sequence of partial sums “col-
lapses” to two terms, this series known as a telescoping series.
EXAMPLE
∑ ( )
Show that the series ln 1 + 1/n is divergent.
solution
Partial sum:
∑n ( )
1
Sn = ln 1 +
m=1
m
∑n ( )
m+1
= ln
m=1
m
∑n ( )
= ln(m + 1) − ln m
m=1
Lecture Notes – MATH2118 Further Engineering Mathematics C 5
( )
= (ln 2 − ln 1) + (ln 3 − ln 2) + (ln 4 − ln 3) + · · · + ln(n) − ln(n − 1)
( )
+ ln(n + 1) − ln n
= − ln 1 + ln(n + 1)
= ln(n + 1) since ln 1 = 0.
EXAMPLE
∑ 3
If Sn denotes the nth partial sum of , show that
(3n − 2)(3n + 1)
1
Sn = 1 − .
3n + 1
Deduce that the series converges. What is its sum ?
solution
Partial sum:
∑
n
3
Sn =
m=1
(3m − 2)(3m + 1)
∑n ( )
1 1
= −
3m − 2 3m + 1
(
m=1
) ( ) ( ) ( )
1 1 1 1 1 1 1 1
= − + − + − + − +···
1 4 4 7 7 10 10 13
| {z } | {z } | {z } | {z }
( ) ( )
1 1 1 1
+ − + −
3n − 5 3n − 2 3n − 2 3n + 1
| {z } | {z }
1
=1− .
3n + 1
As n → ∞, Sn → 1 since 1
3n+1
→ 0. Hence, the series converges to the sum of
L = lim Sn = 1.
n→∞
6 Infinite Series
∑
∞
arn = a + ar + ar2 + ar3 + · · · + arn−1 + arn + · · ·
n=0
∑
n−1
Sn = arm
m=0
= a + ar + ar2 + + · · · + arn−1
( )
1 − rn
=a if r ̸= 1,
1−r
a
where r is the common ratio. The series converges for |r| < 1 since lim Sn = . Note
n→∞ 1−r
that rn → 0 as n → ∞ for |r| < 1, and diverges for |r| ≥ 1.
EXAMPLE
∑
Determine the nth partial sum of (3/4)n+1 , and determine if the series converges.
solution
Series:
∞ ( )n+1
∑ ( )2 ( )3 ( )4 ( )n
3 3 3 3 3 3
= + + + + ··· + + ··· .
n=0
4 4 4 4 4 4
lim Sn = L = 3.
n→∞
If an is the general terms of a series, and Sn is the corresponding sequence of partial sums,
then an = Sn − Sn−1 (since Sn = Sn−1 + an ).
Now, if the series converges to a number L, we have lim Sn = L, and lim Sn−1 = L.
n→∞ n→∞
This implies that
( )
lim an = lim Sn − Sn−1
n→∞ n→∞
=L−L
= 0.
That is,
∑
∞
if an converges, then lim an = 0.
n→∞
n=1
∑
On the other hand, if lim an = 0, we cannot deduce that the series an converges. We
n→∞
can at least say that if lim an ̸= 0, then the series must diverge.
n→∞
EXAMPLE
∑ n
Consider the series . Rewriting the general term of the series as
n−1
n
an =
n−1
(n − 1) + 1
=
n−1
1
=1+ .
n−1
Since
( )
1
lim an = lim 1 +
n→∞ n→∞ n−1
=1
̸= 0,
EXAMPLE
∑ 4n − 1
Consider the infinite series .
5n + 3
4n − 1
Here an = . It follows from the test for a divergent series that this series
5n + 3
must diverge, since
4n − 1 4 − 1/n
lim an = lim = lim = 4/5 ̸= 0.
n→∞ n→∞ 5n + 3 n→∞ 5 + 3/n
EXAMPLE
∑ 1
Consider the p-series, . Since
n4
1
lim an = lim
n→∞ n→∞ n4
= 0,
we cannot conclude whether this series converges or diverges by the nth term test
for divergence.
(1) Sn increases without bound. That is, Sn → ∞ as n → ∞, and the series must
diverge.
Sn
(2) The partial sums are bounded above by some constant K, such that Sn < K for
all n. Hence, Sn must approach to some limit (≤ K), and the series must converge
(monotonic convergence theorem).
Lecture Notes – MATH2118 Further Engineering Mathematics C 9
Sn
K
∑∞ ∑∞
• If n=1 bn converges, then n=1 an converges.
(If the larger series converges, the smaller series must converge).
K X
bn
X
an
∑∞ ∑∞
• If n=1 an diverges, then n=1 bn diverges.
(If the smaller series diverges, the larger series must diverge).
X
bn
X
an
n
10 Infinite Series
• Geometric series:
∑ a
arn converges to if |r| < 1, and diverges if |r| ≥ 1.
1−r
• p-series:
∑ 1 1 1 1
p
= 1 + p + p + ··· + p + ···
n 2 3 n
converges if p > 1, and diverges if p ≤ 1.
∑1
If p = 1, the divergent series is called harmonic series.
n
EXAMPLE
∑ n
Test for convergence of .
n3 +4
solution
We observe that
n n 1
< 3 = 2 since n3 + 4 > n3 for all n.
n3 +4 n n
∑ 1
Because the larger series (p-series, p = 2 > 1) converges, then the smaller
∑ n n2
series must converge by the comparison test.
n3 + 4
EXAMPLE
∑ ln(n + 2)
Test for convergence of .
n
solution
Since ln(n + 2) > 1 for n ≥ 1, we have
ln(n + 2) 1
> .
n n
∑1
Since the smaller series (p-series, n = 1) is a divergent harmonic series, then
n
∑ ln(n + 2)
by the comparison test the larger series must diverge.
n
Lecture Notes – MATH2118 Further Engineering Mathematics C 11
EXAMPLE
∑ 100 + cos(5n)
Consider the series .
n3
solution
Since cos(5n) ≤ 1, we have
Then,
The limit comparison test is often applicable to series for which the comparison test is
inconvenient.
EXAMPLE
∑ n
Test for convergence of .
(8n5 + 7)1/3
solution
n
For large n values, the general term of this series an = “behaves” like
(8n5 + 7)1/3
n n 1
= = 2/3 .
(n5 )1/3 n 5/3 n
12 Infinite Series
∑ ∑ 1
Let bn = be the test series, we have
n2/3
( )
an n n2/3
lim = lim ×
n→∞ bn n→∞ (8n5 + 7)1/3 1
n5/3
= lim
n→∞ (8n5 + 7)1/3
( )1/3
n5
= lim
n→∞ 8n5 + 7
( )1/3
1
= lim
n→∞ 8 + 75
n
( )1/3
= 1/8
= 1/2.
∑
Here, c = 1/2 > 0, and both series either converge or diverge. Since bn =
∑ 1 ∑ n
is a divergent p-series (p = 2/3 < 1), then must diverge
n2/3 (8n5 + 7)1/3
by the limit comparison test.
∑ n3 + 5n − √n + 2
EXAMPLE
Ratio test is useful when an involves factorials and nth powers of a constant or n.
∑
Suppose an is a positive term series, such that
an+1
lim = L.
n→∞ an
Then,
• if L = 1, the ratio test is inconclusive (no indication of whether the series converges
or diverges).
EXAMPLE
∑ 5n
Test for convergence of .
n!
solution
5n
Here an = , then
n!
5n+1
an+1 =
(n + 1)!
5n 5
= ,
(n + 1) n!
( )
an+1 5n 5 n!
⇒ lim = lim × n
n→∞ an n→∞ (n + 1) n! 5
5
= lim
n→∞ n + 1
=0
= L.
EXAMPLE
∑ nn
Test for convergent of .
n!
solution
nn
Here an = . Then,
n!
(n + 1)n+1
an+1 =
(n + 1)!
(n + 1)(n + 1)n
=
(n + 1) n!
(n + 1)n
= ,
n!
( )
an+1 (n + 1)n n!
⇒ lim = lim × n
n→∞ an n→∞ n! n
( n + 1 )n
= lim
n→∞ n
( )n
= lim 1 + 1/n
n→∞
= e.
EXAMPLE
∑ 2n
Test for convergence of .
(2n)!
solution
2n
Here an = . Then,
(2n)!
2n+1
an+1 =
(2n + 2)!
2n+1
=
(2n + 2)(2n + 1)(2n)!
2n
= ,
(n + 1)(2n + 1)(2n)!
( )
an+1 2n (2n)!
⇒ lim = lim × n
n→∞ an n→∞ (n + 1)(2n + 1)(2n)! 2
1
= lim
n→∞ (n + 1)(2n + 1)
= 0.
EXAMPLE
∑ 1
The ratio test will give inconclusive answer when applied to a p-series :
np
an+1 np
lim = lim
n→∞ an n→∞ (n + 1)p
( )p
n
= lim
n→∞ n + 1
( )p
1
= lim 1 −
n→∞ n+1
= 1p
= 1 = L for all p values.
4 Alternating Series
where an > 0 for n = 1, 2, 3, . . ., and the terms are alternately positive and negative, is
said to be an alternating series. For example,
∑
∞
(−1)n+1 1 1 1
=1− + − + ··· ;
n=1
n 2 3 4
∑
∞
ln n ln 2 ln 3 ln 4 ln 5
(−1)n n
= − + − + ··· ;
n=2
2 4 8 16 32
∑
∞
cos(nπ) ∑∞
(−1)n 1 1 1 1
2
= 2
=1− + − + + ··· .
n=0
n +1 n=0
n +1 2 5 10 17
If lim an = 0 and an+1 < an for all n, then the series converges.
n→∞
16 Infinite Series
EXAMPLE
∑ (−1)n+1
Show that the alternating harmonic series converges.
n
solution
1 1
Here an = , and an+1 = . We have
n n+1
1
lim an = lim = 0,
n→∞ n→∞ n
and
1 1
< ⇒ an+1 < an for all n.
n+1 n
Since lim an = 0 and an+1 < an for all n (an is monotonically decreasing to zero),
n→∞
it follows that the alternating harmonic series converges.
EXAMPLE
∑ √
n+1 n
Test for convergence of (−1) .
n+1
solution
√ √
n n+1
Here an = and an+1 = . To show that the terms of the series satisfy
n+1 n+2 √
n
the condition an+1 < an , we let f (n) = an = . From
n+1
( √ )
′ df d n
f (n) = =
dn dn n + 1
√
√1
2 n
(n + 1) − n (1)
=
(n + 1)2
1
(n + 1) − n
= 2√
n(n + 1)2
1
(1 − n)
= √2
n(n + 1)2
−(n − 1)
= √ ,
2 n(n + 1)2
we can see that f ′ (n) < 0 for n > 1. That is, function f (n) decreases for n > 1.
Thus, an+1 < an is true for n > 1. Also,
√
n
lim an = lim = 0.
n→∞ n→∞ n + 1
EXAMPLE
∑ 2n + 1
Consider (−1)n+1 .
3n − 1
solution
Since
2n + 1
lim an = lim
n→∞ n→∞ 3n − 1
2 + n1
= lim
n→∞ 3 − 1
n
= 2/3
̸= 0,
The error of the series is less than the absolute value of the (n + 1)th term of the series.
proof:
∑
If bn = an + |an |, then bn ≤ 2|an |. Since |an | converges, it follows from the comparison
∑ ∑( ) ∑
test that bn must converge. Furthermore, bn − |an | converges, since both bn and
∑ ∑ ∑ ∑( )
|an | converge. Therefore, an converges, since an = bn − |an | .
EXAMPLE
∑ (−1)n+1
The alternating series is absolutely convergent, since
n2
∑ (−1)n+1 ∑ 1
n2 = n2
is a convergent p-series (with p = 2 > 1).
18 Infinite Series
EXAMPLE
∑ (−1)n+1
Test for convergence of .
n2 + 1
solution
The series
∑ ∑ (−1)n+1
|an | =
n2 + 1
∑ 1
=
n2 + 1
∑ 1
is absolutely convergent by the comparison test with the test series (p-series
n2
with p = 2 > 1), since
1 1
2
> 2 for n ≥ 1.
n n +1
Therefore, this series converges by the absolute convergence theorem.
EXAMPLE
∑ 1 + 2 sin(n)
Show that is convergent.
n2
solution
Consider the series:
∑ 1 + 2 sin(n) ∑ |1 + 2 sin(n)|
= (positive term series).
n2 n2
Noting that
1 + 2 sin(n) ≤ 3 since |sin(n)| ≤ 1,
then
1 + 2 sin(n) 3
≤ .
n2 n2
But, the series
∑ 3 ∑ 1
= 3
n2 n2
∑ |1 + 2 sin(n)|
is a convergent p-series (p = 2 > 1), and by the comparison test
n2
∑ 1 + 2 sin(n)
also converges. This implies that is absolutely convergent. Hence,
n2
∑ 1 + 2 sin(n)
converges by the absolute convergence theorem.
n2
Lecture Notes – MATH2118 Further Engineering Mathematics C 19
EXAMPLE
∑ (−1)n+1
Consider the alternating harmonic series, .
n
1 1
Let an = . Then, an+1 = , and
n n+1
1 1
< since n + 1 > n for n > 0.
n+1 n
Hence an+1 < an for n > 0. Also,
1
lim an = lim = 0.
n→∞ n→∞ n
5 Review Questions
∑
∞
3
[1] If Sn denotes the nth partial sum of , show that
m=1
(3m − 2)(3m + 1)
1
Sn = 1 − .
3n + 1
Deduce that the series converges. What is its sum ?
∑
∞
3m − 2
[2] If Sn denotes the nth partial sum of , show that
m=1
m(m + 1)(m + 2)
1 4
Sn = 1 + − .
n+1 n+2
Deduce that the series converges. What is its sum ?
[3] Determine the nth partial sum of each of the following series, and hence determine
whether the series converges:
∑∞
(−1)m+1
(a) ;
m=1
m(m + 2)
∑
∞
( )n+1
(b) 3/4 ;
n=0
n+1
Sn = log 2 + log .
n+2
Deduce that the series converges. What is its sum ?
[5] Use the comparison test to determine which of the following series converge:
∑ n
(a) ;
100n2 + 1
∑ 1
(b) √ ;
n n3 + 1
∑ m
(c) ;
(m + 2)(m + 1)
∑ k+2
(d) √ ;
k (k + 1)2
∑ 2k + 3
(e) .
k2 + 5
Lecture Notes – MATH2118 Further Engineering Mathematics C 21
∑( 5 )n(n + 2 )
(g) ;
6 n+1
∑ (m + 2)!
(h) ;
m! m2
∑ 3k k!
(i) ;
kk
∑ m
(j) .
2m2
Lecture Notes – MATH2118 Further Engineering Mathematics C 23
[1] lim Sn = 1
n→∞
[2] lim Sn = 1
n→∞
[ ( )]
[3] (a) Sn = 1
2
1
2
+ (−1) n 1
n+2
− 1
n+1
; series converges with a sum of 1/4.
( )
(b) Sn = 3 1 − (3/4) ; series converges with a sum of 3.
n
( )
(c) Sn = 56 1 − (−2/3)n ; series converges with a sum of 6/5.
(b) Convergent
(c) Divergent
(d) Convergent
(e) Divergent
(b) Divergent
(c) Convergent
(d) Convergent
(e) Convergent
(f) Convergent
(g) Convergent
(b) Divergent
(c) Convergent
(d) Convergent
Power Series
Dr Eddie Ly
1
2 Power Series
Contents
1 Introduction 3
2 Interval of Convergence 3
4 Taylor Series 9
5 Binomial Series 16
7 Review Questions 24
1 Introduction
∑
∞
c0 + c1 x + c2 x + · · · + cn x + · · · =
2 n
cn xn
n=0
where cn are constants depending on n, is called a power series in x. This series is just a
particular case of the more general form,
∑
∞
c0 + c1 (x − a) + c2 (x − a) + · · · + cn (x − a) + · · · =
2 n
cn (x − a)n
n=0
which is called a power series in x − a. These two series converge to c0 when x = 0 and
x = a, respectively.
EXAMPLE
The power series
∑
∞
1 + x + x + ··· + x + ··· =
2 n
xn
n=0
is a geometric series with r = x. Thus, the series converges for |r| = |x| < 1. That
is, for −1 < x < 1.
2 Interval of Convergence
The set of all real numbers x for which a power series converges is said to be its interval
of convergence. A power series in x − a may converge
r, ∞ or 0.
4 Power Series
radius of
convergence
divergence divergence
r
( · · · · · · · · · · · · · · · · · · · ·)·
0 a−r a a+r
convergence
EXAMPLE
∑
∞
xn
Find the interval of convergence for .
n=0
2n (n + 1)2
solution
Absolute convergence theorem:
a
n+1 xn+1 2n (n + 1)2
lim
= lim n+1 ×
n→∞ an n→∞ 2 (n + 2)2 xn
x(n + 1)2
= lim
n→∞ 2(n + 2)2
( )2
|x| n+1
= · lim
2 n→∞ n + 2
( )
|2| 1 + n1 2
= · lim
2 n→∞ 1 + n2
| {z }
=1
|x|
= .
2
The series is absolutely convergent for L = 12 |x| < 1, or |x| < 2. That is, the series
converges for −2 < x < 2. When x = ±2, the ratio test fails since 12 |x| = 1. We
must perform separate checks of the series for convergence at these endpoints.
At x = 2:
∑ 2n ∑ 1 ∑ 1
= < since n + 1 > n,
2n (n + 1)2 (n + 1)2 n2
1 1 1
lim = 0 and < for n ≥ 1.
n→∞ (n + 1)2 (n + 2)2 (n + 1)2
| {z } | {z }
= an+1 = an
Hence, the interval of convergence is a closed interval [−2, 2]. The radius of conver-
gence, R = 2. The series diverges if |x| > 2 (for x > 2 and x < −2).
EXAMPLE
∑
∞
xn
Find the interval of convergence for .
n=0
n!
solution
Absolute convergence theorem:
a n+1
n+1 x n!
lim = lim × n
n→∞ an n→∞ (n + 1)! x
xn · x · n!
= lim
n→∞ (n + 1)n! · xn
x
= lim
n→∞ n + 1
( )
1
= |x| · lim
n→∞ n + 1
| {z }
=0
= 0.
Since L = 0 < 1, this series converges for all x values. Hence, the interval of
convergence is (−∞, ∞), and the radius of convergence, R = ∞.
EXAMPLE
∑
∞
(x − 5)n
Find the interval of convergence for .
n=0
n 3n
solution
Absolute convergence theorem:
a
n+1 (x − 5)n+1 n · 3n
= lim ×
an n→∞ (n + 1)3n+1 (x − 5)n
(x − 5) n
= lim
n→∞ 3(n + 1)
( )
|x − 5| n
= · lim
3 n→∞ n + 1
6 Power Series
( )
|x − 5| 1
= · lim
3 n→∞ 1 + 1
| {z n }
=1
|x − 5|
= .
3
The series converges absolutely if 13 |x − 5| < 1, that is, 2 < x < 8.
At x = 2:
∑ (x − 5)n ∑ (−3)n ∑ (−1)n
= = ,
n3n n3n n
which is a convergent series by the alternating series test, since
1 1 1
lim = 0 and < for n ≥ 1,
n→∞ n n+1 n
monotonically decreasing to zero.
At x = 8:
∑ (x − 5)n ∑ 3n ∑1
= = ,
n 3n n 3n n
which is the divergent harmonic series.
Hence, the interval of convergence is [2, 8), and the radis of convergence is 3. The
given series diverges for x < 2 and x ≥ 8.
EXAMPLE
∑
∞
Find the interval of convergence for n!(x + 10)n .
n=0
solution
Absolute convergence theorem:
a
n+1 (n + 1)! (x + 10)n+1
lim = lim
n→∞ an n→∞ n! (x + 10)n
= lim (n + 1)(x + 10)
n→∞
= |x + 10| · lim (n + 1)
n→∞
∞ for x ̸= −10
= .
0 for x = −10
The series diverges for all real numbers x, except for x = −10. At x = −10, we
obtain a convergent series consisting of all zeros. The radius of convergence is zero.
Lecture Notes – MATH2118 Further Engineering Mathematics C 7
= c0 + c1 x + c2 x2 + c3 x3 + · · · + cn xn + · · · .
d
Note that the latter series starts at n = 1 since c0 = 0. A power series can be
dx
differentiated term-by-term:
d d d d d
f ′ (x) = c0 + c1 x + c2 x2 + c3 x3 + · · · + cn xn + · · ·
dx dx dx dx dx
= c1 + 2c2 x + 3c3 x + · · · + ncn x
2 n−1
+ ···
∑∞
= ncn xn−1 .
n=1
∑
The radius of convergence of this series is the same as that of cn xn . Similarly,
d ′
f ′′ (x) = f (x)
dx
∑∞
= n(n − 1)cn xn−2
n=2
It follows that a function represented by a power series for |x| < r possesses derivatives
of all orders in the interval.
8 Power Series
Just as a power series can be differentiated term-by-term within its interval of convergence,
it can also be integrated term-by-term:
∫ ∫ ∑
∞
f (x)dx = cn xn dx
∫ n=0
( )
= c0 + c1 x + c2 x2 + · · · + cn xn + · · · dx
( c1 c2 cn n+1 )
= c0 x + x2 + x3 + · · · + x + ··· + C
2 3 n+1
∑∞
cn
= xn+1 + C,
n=0
n + 1
∑
where C is an integration constant. If f (x) = cn xn converges to an interval (−r, r),
then
∫ ∫ ∑
∞
f (x)dx = cn xn dx
n=0
∞ ∫
∑
= cn xn dx
n=0
∑∞
cn
= xn+1 + C.
n=0
n+1
∑
The radius of convergence will be the same as that of cn xn .
EXAMPLE
Find a power series representation for ln(1 + x) for |x| < 1, and approximate ln(1.2)
to four decimal places.
solution
1
The power series for is given by
1+t
1
= 1 − t + t2 − t3 + · · · + (−1)n tn + · · ·
1+t
∑∞
= (−1)n tn for |t| < 1.
n=0
= ln(1 + x) − ln(1)
= ln(1 + x).
Hence,
x2 x3 xn+1
ln(1 + x) = x − + − · · · + (−1)n + ···
2 3 n+1
∑∞
(−1)n n+1
= x for |x| < 1.
n=0
n+1
Substituting x = 0.2 (valid since x = 0.2 satisfy |x| < 1) in the above series provides
(0.2)2 (0.2)3 (0.2)4 (0.2)5 (0.2)6
ln(1.2) = 0.2 − + − + − + ···
2 3 4 5 6
≈ 0.1823.
This is an alternating series. If the sum of the series is denoted by L, we know from
the theory for alternating series that
Sn − L ≤ an+1 .
The above answer of 0.1823 is accurate to four decimal places, since for the fifth
partial sum,
( ) ( )
S5 − L ≤ a6 = 1.067 10−5 < 5 10−5 .
4 Taylor Series
there is a relationship between the coefficients cn and the derivatives of f (x). That is,
f (a) = c0 ,
f ′ (a) = 1 · c1 ,
f ′′ (a) = 2 · 1 · c2 = 2! c2 ,
f ′′′ (a) = 3 · 2 · 1 · c3 = 3! c3 ,
f (n) (a)
cn = for n ≥ 0
n!
and
∑
∞ ∑
∞
f (n) (a)
f (x) = cn (x − a) =
n
(x − a)n for |x − a| < r.
n=0 n=0
n!
When n = 0, f (0) (a) = f (a) and 0! = 1. This series is called the Taylor series for f (x)
at x = a (named in honor of the English mathematician Brook Taylor (1685–1731), who
published this result in 1715).
∑
∞
f (n) (0)
f (x) = xn
n=0
n!
is called the Maclaurin series for f (x) (named after the Scottish mathematician, and
former student of Isaac Newton, Colin Maclaurin (1698–1746)).
Lecture Notes – MATH2118 Further Engineering Mathematics C 11
EXAMPLE
Find the Taylor series expansion for ln x about x = 1.
solution
The derivatives of f (x) = ln(x) are
f (x) = ln x,
1
f ′ (x) = ,
x
−1
f ′′ (x) = 2 ,
x
2!
f ′′′ (x) = 3 and so on,
x
(n − 1)!
f (n) (x) = (−1)n−1 .
xn
Here a = 1, we have after inserting x = 1 into the above derivatives,
f (1) = 0,
f ′ (1) = 1,
f ′′ (1) = −1,
f ′′′ (1) = 2!, and so on,
f (n) (1) = (−1)n−1 (n − 1)!.
1
= |x − 1| · lim
1
n→∞ 1 +
n
= |x − 1|.
The series converges when |x − 1| < 1, (i.e. for 0 < x < 2).
For the endpoints, at x = 0, we have
∑
∞
(−1)n−1 ∑
∞
(−1)2n (−1)−1
n
(−1) =
n=1
n n=1
n
∑
∞
1
=− ,
n=1
n
This theorem also known as the Generalised Mean Value Theorem. Let f (x) be a function
such that f (n+1) (x) exists for |x − a| < r, then
where
f ′ (a) f ′′ (a) f (n) (a)
Pn (x) = f (a) + (x − a) + (x − a)2 + · · · + (x − a)n
1! 2! n!
is called the nth degree Taylor polynomial of f (x) at x = a (note that Taylor polynomials
do not exist for every function), and
f (n+1) (c)
Rn (x) = (x − a)n+1 ,
(n + 1)!
where a < c < x, is called the Lagrange form of the remainder, or error, involved in
approximating f (x) by Pn (x) (theory due to the French mathematician, Joseph Louis
Lagrange (1736–1813)).
Lecture Notes – MATH2118 Further Engineering Mathematics C 13
The series expansion for f (x) will only be valid for those values of x for which Rn → 0 as
n → ∞; that is, for x values which the power series converges. Hence,
Pn (x) = f (x) − Rn (x),
and so
lim Pn (x) = lim f (x) − lim Rn (x).
n→∞ n→∞ n→∞
If Rn (x) → 0 as n → ∞, then the sequence of partial sums converges to lim f (x) = f (x).
n→∞
EXAMPLE
Represent f (x) = cos x by a Maclaurin series.
solution
For Maclaurin series, a = 0:
∑∞
f (n) (a)
f (x) = (x − a)n
n=0
n!
∑
∞
f (n) (0)
= xn
n=0
n!
x2 x3
= f (0) + f ′ (0)x + f ′′ (0) + f ′′′ (0) + · · · .
2! 3!
For f (x) = cos x, we have
f (x) = cos x,
f ′ (x) = − sin x,
f ′′ (x) = − cos,
f ′′′ (x) = sin x, and so on.
Thus, for x = 0,
f (0) = 1,
f ′ (0) = 0,
f ′′ (0) = −1,
f ′′′ (0) = 0, and so on.
Hence,
x2 x4 x6
f (x) = 1 − + − + ···
2! 4! 6!
∑∞
(−1)n 2n
= x .
n=0
(2n)!
This series contains even powers of x, since cos x is an even function.
14 Power Series
= 0.
lim Rn (x) = 0.
n→∞
x2 x4 x6 (−1)n 2n
cos x = 1 − + − + ··· + x + ···
2! 4! 6! (2n)!
is a valid representation of cos x.
note
Some important Maclaurin series:
x2 x3 ∑
∞
xn
x
e =1+x+ + + ··· = for all x,
2! 3! n=0
n!
x2 x4 x6 ∑
∞
(−1)n
cos x = 1 − + − + ··· = x2n for all x,
2! 4! 6! n=0
(2n)!
Lecture Notes – MATH2118 Further Engineering Mathematics C 15
x3 x5 x7 ∑∞
(−1)n
sin x = x − + − + ··· = x2n+1 for all x,
3! 5! 7! n=0
(2n + 1)!
x2 x4 x6 ∑∞
x2n
cosh x = 1 + + + + ··· = for all x,
2! 4! 6! n=0
(2n)!
x3 x5 x7 ∑
∞
x2n+1
sinh x = x + + + + ··· = for all x,
3! 5! 7! n=0
(2n + 1)!
x2 x3 x4 ∑∞
(−1)n n+1
ln(1 + x) = x − + − + ··· = x for x ∈ (−1, 1].
2 3 4 n=0
(n + 1)
When the value of x is close to the number a (x ≈ a), the Taylor polynomial Pn (x) of
a function f (x) at x = a can be used to approximate the functional value of f (x). The
error in this approximation is
f (x) − Pn (x) = Rn (x).
EXAMPLE
Approximate e−0.2 by P3 (x), and determine the accuracy of the approximation.
solution
Because the value of x = −0.2 is close to x = 0, we use the Taylor polynomial P3 (x)
of f (x) = ex at a = 0. Since f (x) = f ′ (x) = f ′′ (x) = f ′′′ (x) = ex , we have
f ′ (0) f ′′ (0) 2 f ′′′ (0) 3
P3 (x) = f (0) + x+ x + x
1! 2! 3!
x2 x3
=1+x+ + .
2 6
Then,
(−0.2)2 (−0.2)3
P3 (−0.2) = 1 + (−0.2) + +
2 3
≈ 0.81867.
4
R3 (−0.2) < (−0.2) ≈ 10−4
24
5 Binomial Series
(1 + x)2 = 1 + 2x + x2 ;
(1 + x)3 = 1 + 3x + 3x2 + x3 .
The expansion of (1 + x)α into the above form is called binomial series. Applying the
absolute ratio test provides
α(α − 1)(α − 2) · · · (α − n + 1) n
an = x ,
n!
α(α − 1)(α − 2) · · · (α − n + 1)(α − n) n+1
an+1 = x ,
(n + 1)!
a
n+1 α(α − 1)(α − 2) · · · (α − n + 1)(α − n)xn+1 · n!
⇒ = lim
an n→∞ (n + 1)! · α(α − 1)(α − 2) · · · (α − n + 1)xn
(α − n)x
= lim
n→∞ n+1
α − n
= |x| · lim
n→∞ n + 1
α/n − 1
= |x| · lim
n→∞ 1 + 1/n
= |x| · |−1|
= |x|.
Lecture Notes – MATH2118 Further Engineering Mathematics C 17
Thus, for |x| < 1, that is on the interval (−1, 1), the binomial series defines an infinitely
differentiable function f (x). Hence, we have the binomial series (Maclaurin series for
(1 + x)α ):
∑
∞
(1 + x)α = cn xn
n=0
α(α − 1) 2 α(α − 1)(α − 2) 3 α(α − 1)(α − 2)(α − 3) 4
= 1 + αx + x + x + x ···
2! 3! 4!
α(α − 1) · · · (α − n + 1) n
+ x + ··· for |x| < 1.
n!
EXAMPLE
√
Find a power series representation for 1 + x.
solution
For |x| < 1, we have
√
1 + x = (1 + x)α (here α = 12 )
( ) ( )( 1 ) ( )( 1 )( 1 )
1 1 1
− 1 1 1
− 1 − 2 1 1
− 1 − 2 − 3
=1+ x+ 2 2 x2 + 2 2 2
x3 + 2 2 2 2
x4
2 2! 3! 4!
( ) ( )
1 1
− 1 · · · 12 − n + 1 n
+ ··· + 2 2
x + ···
n!
1 1 1 5 4 7 5
= 1 + x − x2 + x3 − x + x − ··· .
2 8 16 128 256
EXAMPLE
In Einstein’s theory of relativity, the mass of a particle moving at a velocity v,
relative to an observer is given by
m0
m= √ ,
1 − v 2 /c2
where m0 is the rest mass and c is the speed of light. Many of the results from
classical physics do not hold for particles, such as electrons, which may move close
to the speed of light. Kinetic energy is no longer K = 12 m0 v 2 , but
( )
K = m − m0 c 2 .
m0
If we identify α = −1/2 and x = −v 2 /c2 in m = √ , we have |x| < 1 since
1 − v 2 /c2
no particle can surpass the speed of light, i.e. v < c. Hence, K can be written as
( )
m0
K= √ − m0 c 2
1 − v 2 /c2
18 Power Series
( )
= m0 c2 (1 + x)−1/2 − 1 with x = −v 2 /c2
(( ) )
1 3 5
= m0 c2 1 − x + x2 − x3 + · · · − 1
2 8 16
( 2 )
v 3v 4 5v 6
= m0 c 2
+ + 6 + ··· .
2c2 8c4 6c
In the case where v ≪ c, terms beyond the first in the series are negligible. This
leads to the well-known result
v2
K ≈ m0 c2 ·
2c2
1
= m0 v 2 .
2
Power series can be added or subtracted, term-by-term for those values of x for which
both series converge. Suppose
∑
∞
f (x) = cn xn = c0 + c1 x + c2 x2 + · · · + cn xn + · · · for |x| < r1 ,
n=0
and
∑
∞
g(x) = dn xn = d0 + d1 x + d2 x2 + · · · + dn xn + · · · for |x| < r2 ,
n=0
where r1 and r2 are the corresponding radius convergence, then
∑
∞ ∑
∞
f (x) ± g(x) = cn x ±n
dn xn
n=0 n=0
∑
∞
( )
= cn ± dn xn
n=0
= (c0 + d0 ) ± (c1 + d1 )x ± (c2 + d2 )x2 ± · · · ± (cn + dn )xn + · · · for |x| < min(r1 , r2 ).
EXAMPLE
Find a power series representation for cosh θ. Hence, obtain estimate for cosh(1/2).
solution
( )
Using the relation cosh θ = 1
2
eθ + e−θ , and the series expansion for ex ,
∑
∞
xn
ex =
n=0
n!
x2 x3 x4
=1+x+ + + + ··· for all x,
2! 3! 4!
we have
1( θ )
cosh θ = e − e−θ
2(
( ) ( ))
1 θ2 θ3 θ4 θ2 θ3 θ4
= 1+θ+ + + + ··· + 1 − θ + − + + ···
2 2! 3! 4! 2! 3! 4!
θ2 θ4 θ6
=1+ + + + ··· for all θ
2! 4! 6!
∑∞
θ2n
= .
n=0
(2n)!
Alternative method:
1( θ −θ
)
cosh θ = e − e
2( )
1 ∑ θn ∑ (−θ)n
∞ ∞
= +
2 n=0 n! n=0 n!
∑
∞
θn + (−θ)n
=
n=0
2n!
( )
∑∞
1 + (−1)n θn
=
n=0
2n!
∑
∞
θn 0 for odd n
= for even n, since 1 + (−1)n =
n! 2 for even n
n=0
∑∞
θ2n
= .
n=0
(2n)!
For θ = 1/2:
∑
∞
(1/2)2n
cosh(1/2) =
n=0
(2n)!
(1/2)2 (1/2)4 (1/2)6
=1+ + + + ···
2! 4! 6!
≈ 1.1276 .
20 Power Series
Suppose
∑
∞
f (x) = cn x n
n=0
and follow by substituting the power series expansion for g(x) into this expression.
EXAMPLE
Using the standard series from the Concise Collection of Formulae, determine the
2 /2
first few terms of the power series for ex .
solution
Using the power series expansion for et :
∑
∞
tn
t
e =
n=0
n!
t2 t3 t4
=1+t+ + + + ··· for all t,
2! 3! 4!
we have upon substituting t = 21 x2 ,
( 1 2 )2 ( 1 2 )3 ( 1 2 )4
2 ( ) x x x
ex /2 = 1 + 12 x2 + 2 + 2 + 2 + ···
2! 3! 4!
x2 x4 x6 x8 √
=1+ + + + + · · · for 12 x2 < 1 or |x| < 2 .
2 8 48 384
Suppose
∑
∞
f (x) = cn x n
n=0
and
∑
∞
g(x) = dn xn
n=0
then
( )( )
f (x) × g(x) = c0 + c1 x + c2 x2 + c3 x3 + · · · d0 + d1 x + d2 x2 + d3 x3 + · · ·
( ) ( )
= c0 d0 + c0 d1 + c1 d0 x + c2 d0 + c1 d1 + c0 d2 x2
( )
+ c0 d3 + c1 d2 + c2 d1 + c3 d0 x3 + · · · for |x| < min(r1 , r2 ).
EXAMPLE
Using the standard series from the Concise Collection of Formulae, determine the
first few terms of the power series for ex cos x.
solution
Using the power series expansions for ex and cos x, we have
( )( )
x2 x3 x4 x2 x4 x6
x
e cos x = 1 + x + + + + ··· 1 − + − + ···
2! 3! 4! 2! 4! 6!
( ) ( ) (1 )
= 1 + x(1) + x2 − 12 + 12 + x3 − 12 + 16 + x4 24 − 14 + 24
1
+ ···
x3 x4
=1+x− − + ··· for all x.
3 6
The series expansion for ex cos x is valid for all x, since both the series expansions
for ex and cos x are valid for all x.
Suppose
∑
∞
f (x) = cn x n
n=0
and
∑
∞
g(x) = dn xn
n=0
c0 + c1 x + c2 x2 + c3 x3 + · · · + cn xn + · · ·
( )
= q0 + q1 x + q2 x2 + q3 x3 + · · · + qn xn + · · ·
( )
× d0 + d1 x + d2 x2 + d3 x3 + · · · + dn xn + · · · ,
and expanding the right-hand-side and equating coefficients of like terms. Note that the
resulting power series may not converge for |x| < min(r1 , r2 ) as there is an added compli-
cation, and problems may occur whenever the denominator is zero.
EXAMPLE
Using the standard series from the Concise Collection of Formulae,
∫ 1 determine the
first few terms of the power series for tanh x. Hence, evaluate tanh x dx.
0
solution
Using the power series expansions for sinh x and cosh x, we have
x3 x5 x7
sinh x = x + + + + ··· for all x,
3! 5! 7!
x2 x4 x6
cosh x = 1 + + + + ··· for all x,
2! 4! 6!
sinh x
⇒ tanh x =
cosh x
x3 x5 x7
x+ 3!
+ 5!
+ 7!
+ ···
=
1+ x2
2!
+ x4
4!
+ x6
6!
+ ···
= q0 + q1 x + q2 x2 + q3 x3 + · · · + qn xn + · · · .
This requires
x3 x5 x7
x+ + + + ···
6 120 5040
( ) ( )
x2 x4 x6
= q0 + q1 x + q2 x + q3 x + · · · + qn x + · · · × 1 +
2 3 n
+ + + ···
2 24 720
( ) ( ) (1 )
= q0 + q1 x + 12 q0 + q2 x2 + 12 q1 + q3 x3 + 24 q0 + 12 q2 + q4 x4
(1 ) ( 1 )
+ 24 q1 + 12 q3 + q5 x5 + 720 q0 + 241
q2 + 12 q4 + q6 x6
( 1 )
+ 720 q1 + 241
q3 + 12 q5 + q7 x7 + · · ·
Lecture Notes – MATH2118 Further Engineering Mathematics C 23
q0 = 0,
q1 = 1,
q2 = − 21 q0 = 0,
q3 = 1
6
− 12 q1 = − 31 ,
q4 = − 24
1
q0 − 12 q2 = 0,
q5 = 1
120
− 1
q
24 1
− 12 q3 = 2
15
,
q6 = − 720
1
q0 − 1
q
24 2
− 12 q4 = 0,
q7 = 1
5040
− 1
q
720 1
− 1
q
24 3
− 12 q5 = − 315
17
.
Hence,
x3 2x5 17x7
tanh x = x − + − + ··· for all x.
3 15 315
Integrating tanh x,
∫ 1 ∫ 1( )
x3 2x5 17x7
tanh x dx = x− + − + · · · dx
0 0 3 15 315
[ 2 ]x=1
x x4 x6 6 17x8
= − + x −
2 12 45 2520 x=0
121
=
280
≈ 0.4321.
Exact Answer:
∫ 1 ∫ 1
sinh x
tanh x dx = dx
0 0 cosh x
[ ]x=1
= ln|cosh x|
x=0
( ) ( )
= ln cosh 1 − ln cosh 0
( )
= ln cosh 1 − ln(1) since cosh 0 = 1
≈ 0.4338.
The relative difference between the approximate and exact answers is 0.378.
24 Power Series
7 Review Questions
√
[1] Determine the Taylor polynomial of degree three for f (x) = x at x = 4.
√
Hence, estimate 4.2.
Pn (a) = f (a), Pn′ (a) = f ′ (a), Pn′′ (a) = f ′′ (a), ..., Pn(n) = f (n) (a).
Show that
f ′′ (a) f (3) (a) f (n) (a)
a0 = f (a), a1 = f ′ (a), a2 = , a3 = , ··· , an = .
2! 3! n!
[6] Determine the radius of convergence R for each of the following power series:
∑ nxn
(a) ;
2n+1
∑ (x − 1)n+1
(b) ;
n 3n−1
∑ xn
(c) (−1)n √ ;
n+1
∑ 2n−1 xn
(d) ;
n3
∑ (n!)2
(e) xn ;
(2n)!
∑ ( )
n n+1
(f) (−1) xn .
n+2
Lecture Notes – MATH2118 Further Engineering Mathematics C 25
∑
∞
( )n
[7] (a) Use the geometric series −x2 to obtain the expansion
n=0
x3 x5
arctan x = x − + − ··· + ··· for |x| < 1.
3 5
[8] Assuming that the power series for sin x and cos x hold for all complex numbers,
show that
√
sin(iθ) = i sinh θ and cos(iθ) = cosh θ, where i = −1 .
[9] Using the Binomial Theorem, determine power series expansions and radius of con-
vergence for each of the following functions:
√
(a) 1 − x;
(b) (1 + 2x)−3 ;
1
(c) √3
;
1 + 3x3
( )−2
(d) 1 + 2x2 .
[12] Using the standard series from the Concise Collection of Formulae, determine the
first few terms of the power series for
( )
(a) exp − 12 x2 ;
(b) ex cos x ;
26 Power Series
( )
(c) log 1 + ex .
[14] Use the first four terms of appropriate power series to obtain estimates of
∫ 1
dx
(a) √ ;
0 1 − 14 x4
∫ 1/10 x
e −1
(b) dx ;
0 x
∫ 1/2 √
1
(c) 1 + x3 dx ;
0 2
∫ 1/5
sin x
(d) dx.
0 x
[15] Using the binomial and exponential series, show that
e−x 4
√ = 1 + x2 + x3 + · · · if |x| < 1/2.
1 − 2x 3
∫ 1/5
e−x
Hence, obtain an approximate value for √ dx.
0 1 − 2x
[16] Use the series,
x2 x4 x6
cos x = 1 − + − + ··· for all x,
2! 4! 6!
and
α(α − 1) 2 α(α − 1)(α − 2) 3
(1 + x)α = 1 + αx + x + x + ··· if |x| < 1,
2! 3!
to find the first four terms of the power series for
√
1 − x · cos x.
[6] (a) R = 2
(b) R = 3
(c) R = 1
(d) R = 1/2
(e) R = 4
(f) R = 1
[15] 0.2032
√ x 5x2 3x3
[16] 1 − x · cos x ≈ 1 − − + + ··· ;
2 8 16
∫ 1/10
√
1 − x · cos x dx ≈ 0.0973.
0
Introduction to MATLAB
Dr Eddie Ly
BEng(Hons), BAppSc, PhD RMIT
School of Mathematical & Geospatial Sciences (SMGS)
College of Science, Engineering & Health (SHE)
RMIT University, Melbourne, Australia
Summer Course 2015
Student Edition:
EDU >>
It is not possible to perform calculations with variables that have not been
assigned a value.
Normally, MATLAB displays the output below the command. The output is
suppressed by ending the command with a semicolon (;). For example,
>> s = 2*3;
>>
The value of 6 has been assigned to the variable s, but will not be
displayed on the screen.
If a command is longer than one line, you can end the line with three
periods and press [Enter]. You can then continue on the following line.
>> s = 1+2+…
3+4
>> s =
10
^ Exponentiation x^y
* Multiplication x*y
/ Right Division x/y
\ Left Division y/x
+ Addition x+y
- Subtraction x-y
The name of a variable has to start with a letter. After that, the name can
consist of an arbitrary number of letters and numbers.
The Command Workspace lists all used variables, and indicates to which
class the variables belong. If necessary, you can remove variables by
using this workspace (browser).
Refers to the names and values of any variables in use in the current work
session.
For example, force, Force, FORCE and force_x are all different variables.
Dr Eddie Ly
BEng(Hons), BAppSc, PhD RMIT
School of Mathematical & Geospatial Sciences (SMGS)
College of Science, Engineering & Health (SEH)
RMIT University, Melbourne, Australia
Summer Course 2015
To create a row vector, enter the elements of the vector inside a pair of
square brackets [ ], separating the elements with a space or comma.
>> [a,b(2)]
ans =
1 2 3 5
>> [a(1:2),b]
ans =
1 2 4 5 6
Syntax: x = [a:s:b]
The increment s can be negative. If s>0 then a<b, and if s<0, a>b.
>> [8:-2:0]
ans =
8 6 4 2 0
Syntax: linspace(a,b,n)
where a = lower limit
b = upper limit
n = number of points (default n=100)
Example:
>> linspace(1,2,6)
ans =
1.0000 1.2000 1.4000 1.6000 1.8000 2.0000
Syntax: logspace(a,b,n)
where a = lower limit, 10^a
b = upper limit, 10^b
n = number of points (default n=50)
Example:
>> logspace(0,2,4)
ans =
1.0000 4.6416 21.5443 100.0000
Method 1:
Enter matrix row by row, separating the elements in a given row with
spaces or commas, and separating the rows with semicolons. For example,
>> [1,2,3; 4,5,6]
ans =
1 2 3
4 5 6
1 2 3
represents the matrix, 4 5 6
Command [x y] combines the row vectors x and y to form a larger row vector.
For example,
>> x = [1,2,3];
y = [7,8,9];
>> r = [x y]
r =
1 2 3 7 8 9
Command [x;y] combines the two vectors to form a matrix. For example,
>> M = [x; y]
M =
1 2 3
7 8 9
PART 2 OF 8 MATH2118 Further Eng Maths C 12
Matrix M can also be created by (without creating new arrays first):
>> M = [[1,2,3];[7,8,9]]
M =
1 2 3
7 8 9
Example:
>> A = [1,2,3; 4,5,6;];
x = [7,8,9];
>> M = [A; x]
M =
1 2 3
4 5 6
7 8 9
ARRAY EDITOR
Array indices are the row and column numbers of an element in an array.
Examples (x is a vector, A is a matrix):
x(2) refers to the second element of x
x(:) refers to all the row or column elements of x
x(2:4) refers to the second to fourth elements of x, i.e. x(2), x(3) and x(4)
A(2,3) refers to the element in row 2 and column 3 of A
A(:,1) refers to all the elements in column 1 of A
A(2,:) refers to all the elements in row 2 of A
A(:,2:4) refers to all the elements in columns 2 thru 4 of A,
i.e. A(:,2), A(:,3) and A(:,4)
A(2:3,1:2) refers to all the elements in rows 2 and 3, that are also in
columns 1 and 2 of A
Example:
>> A = [1,2,3; 4,5,6]
A =
1 2 3
4 5 6
>> min(A)
ans =
1 2 3
>> [y,k] = min(A)
>> [y,k] = max(A)
stores the minimum or maximum values in the row vector y and their indices in the row
vector k.
Example:
>> A = [1,2,3; 4,5,6];
>> size(A)
ans =
2 3
>> length(A)
ans =
3
MATLAB command find(A) generates an array containing the indices of the non-zero
elements of the array A (row-wise then column-wise).
Example:
>> A = [-1,0,2; 3,4,0; 0,0,2]
ans =
-1 0 2
3 4 0
0 0 2
>> find(A)
ans =
1
2
5
7
9
PART 2 OF 8 MATH2118 Further Eng Maths C 26
Multidimensional Arrays
MATLAB 6 (or higher) supports multidimensional arrays.
Type >> help datatypes for more information.
A three-dimensional array has the dimension m x n x q.
A four-dimensional array has the dimension m x n x q x r, etc.
The first two dimensions are the row and column, and third, fourth, etc., are
called pages. For example, type A(2,3,2) refers to the element in the row
2, column 3 of page 2.
Multidimensional arrays can be created by extending two-dimensional
arrays, or by concatenating arrays using the cat command.
MATLAB command ndims(A) can be used to check the number of
dimensions of matrix A.
Example:
21
2 2 2 4
2A 3 4
2 2 8 16
Example:
11
22 1 4
AA 3 4
3 4 27 256
The same result can be obtained by matrix product of a row vector a and column vector b.
That is,
b1
a1 a2 a3 b2 a1b1 a 2 b2 a3b3
b3
Example:
>> a = [-1,2,-3];
b = [2,-6,9];
cross(a,b)
ans =
0 3 2
MATLAB commands:
zeros(n) creates an n x n null matrix, i.e. n x n matrix of zeros
zeros(m,n) creates an m x n null matrix
zeros(size(A)) creates a null matrix having the same dimension as the matrix A
Example:
>> zeros(2)
ans =
0 0
0 0
Property: 0A = A0 = 0
Example:
>> eye(2)
ans =
1 0
0 1
Property: IA = AI = A
Examples:
>> ones(2)
ans =
1 1
1 1
>> ones(2,3)
ans =
1 1 1
1 1 1
If the polynomials are of different degrees, add zeros to the coefficient array of the
lower-degree polynomial.
To multiply a polynomial by a scalar, simply multiply the coefficient array by that scalar.
For example, 3 f ( x ) 3( x 2 x 1) 3 x 2 3 x 3
In MATLAB:
>> f = [1,-1,1];
3*f
ans =
3 -3 3
>> conv(f,g)
ans =
-1 3 0 -1 3
>> f = [1,-2,5,-3];
g = [1,-3,1];
[q,r] = deconv(f,g)
q =
1 1
r =
0 0 7 -4
That is, f x 1 7 x 4 .
g x 3x 1
2
This command computes the coefficient of the polynomial whose roots are specified by the
vector r.
For example, for repeated roots of 1, i.e. x = 1,1, the required polynomial is
x 1x 1 x 12 x 2 2 x 1
In MATLAB:
>> r = [1,1];
poly(r)
ans =
1 -2 1
This command computes the roots of a polynomial specified by the coefficient array a.
The result is a column vector containing the polynomial’s roots.
In MATLAB:
>> roots([1,-2,1])
ans =
1
1
>> f = [1,-2,1];
x = [-1,0,1];
polyval(f,x)
ans =
4 1 0
Dr Eddie Ly
BEng(Hons), BAppSc, PhD RMIT
School of Mathematical & Geospatial Sciences (SMGS)
College of Science, Engineering & Health (SEH)
RMIT University, Melbourne, Australia
Summer Course 2015
However, for more larger and complex problems, especially where problems
involved repeating a number of calculations over and over again, the
problem must be “coded” or “converted” into a computer program.
Note:
The equal to ‘==‘ operator consists of two equal signs, not a single equal sign.
A single equal sign represents the assignment, or replacement operator, in MATLAB.
Examples:
>> 2<6 >> 3 == 4
ans = ans =
1 0
>> x 0 1 1
x = >> t >= 1
0 ans =
1 1 1
The relational operators have equal precedence among themselves, and MATLAB
evaluates them in order from left to right.
NOT Operator
~ ~A returns an array the same dimension as A containing elements of one where
element of A is zero, and zero where A is nonzero. The NOT symbol is called the
tilde.
Example:
>> B = [2,0,1,5,0];
>> ~B
ans =
0 1 0 0 1
Example:
>> A = [1,0,2,0,4];
B = [2,0,1,5,0];
>> A&B
ans =
1 0 1 0 0
>> 6&7 >> 0&0
ans = ans =
1 0
>> c&d
??? Undefined function or variable ’c’.
Example:
>> A = [1,0,2,0,4];
B = [2,0,1,5,0];
>> A|B
ans =
1 0 1 1 1
>> 6|7 >> 0|0
ans = ans =
1 0
>> c|d
??? Undefined function or variable ’c’.
Example:
>> A = [1,0,2,0,4];
B = [2,0,1,5,0];
xor(A,B)
ans =
0 0 0 1 1
PART 6 OF 8 MATH2118 Further Eng Maths C 9
TRUTH TABLE
1 = truth
0 = false
>> X = [1,1,0,0]’;
Y = [1,0,1,0]’;
TT = [X, Y, ~X, X|Y, X&Y, xor(X,Y)]
TT =
1 1 0 1 1 0
1 0 0 1 0 1
0 1 1 1 0 1
0 0 1 0 0 0
Example:
To enter the relation 1< x <2 in MATLAB, enter:
>> (1<x) & (x<2)
Example:
Compute the square root of c if c is a positive number.
if c>0
sqrt(c)
end
if logical expression
statement group 1
else
statement group 2
end
When the test (if logical expression) is performed for an array, the test
returns a value of true only if all the elements of the logical expression are
nonzero !
PART 6 OF 8 MATH2118 Further Eng Maths C 17
Example:
Given a real number x, compute the square root of x. If x<0, return only the positive complex root.
if x >= 0
sqrt(x)
else
sqrt(abs(x))*I
end
Example:
if x >= 0
disp(’A non-negative number’)
else
disp(’A negative number’)
end
MATLAB command findstr (stands for ‘find string’) finds the locations
of certain characters of a given string.
Examples:
>> findstr(uni,’M’)
ans =
2
>> findstr(uni,’i’)
ans =
8 13
That is, the letter ‘i’ (lower case ‘i’) occurs in the 8th and 13th columns of
the string named ‘uni’.
Command: strcmp
Use this command to compare two string variables.
Syntax: strcmp(’string1’,’string2’)
returns one if string1 is same as string2, and zero otherwise.
These commands convert the given string variable to all lowercase or all uppercase letters
(useful for accepting keyboard inputs involving letters).
Example:
rerun = input(’Try again (Y/N)?’, ’s’);
if (isempty(rerun))|(upper(rerun)==’Y’)
rerun = ’Y’
else
rerun = ’N’
end
Note:
The command isempty(x) returns a 1 if the array x is empty, and 0 otherwise.
for-loop
Repetitions where the number of passes is known in advance.
while-loop
Repetitions terminate when a specified condition is satisfied, and number of
passes is not known in advance.
Syntax:
for loop_variable = m:s:n
statements
………
statements
end
Note:
The loop_variable can be a scalar (most common type), vector or matrix.
x = (for k=1)
2
x = (for k=1+2=3)
6
x = (for k=3+2=5)
10
x = (for k=5+2=7)
14
x = (for k=7+2=9)
18
Note: (m:s:n)
(1) Step value, s, can be negative. For example, k=10:-2:1 produces k=10,8,6,4,2
(2) If s is omitted, s=1 by default.
(3) If s>0, the loop only executed if m<n since m:s:n
(4) If s<0, the loop only executed if m>n.
(5) If m=n, only one pass will be performed.
WARNING:
If s is not an integer, round-off errors can cause the loop to execute a different number of passes
than intended.
Use break command to terminate the looping process before the loop_variable reaches
its terminating value without stopping the entire program.
Example:
>> for k=1:2:10 | k = 1;
x = 50-k^2; | x = 5-1^2 = 49 (>10; cont)
if (x <= 10) | k = 1+2 = 3;
break | x = 50-3^2 = 41 (>10; cont)
else | k = 3+2 = 5;
y = sqrt(x) | x = 50-5^2 = 25 (>10; cont)
end; | k = 5+2 = 7;
end; | x = 50-7^2 = 1 (<10; stop!)
Note:
We can use the while-loop structure to perform the same task.
Suppose we want to just skip the pass where an error can occur (for
example, taking square root of a negative number), and continue executing
the loop for the remaining passes. We cannot use the break command,
because it will stop the execution of the loop rather than skipping the pass.
str2 =
RMIT
>> length(str2)
ans =
4
Example:
>> x = [0:2:8];
y = x.^2
y =
0 4 16 36 64
Syntax:
while logical expression
statements
………
statements
end
Example:
>> x = 32;
while (x>1)
x = x/2
end;
x =
16
x =
8
x =
4
x =
2
x =
1
PART 6 OF 8 MATH2118 Further Eng Maths C 37
For the while-loop to function properly, the following two conditions must occur:
(1) The loop_variable must have a value before the while statement
is executed;
(2) The loop_variable must be changed somehow by the statements.
The statements are executed once during each pass, using the current value
of the loop_variable. The looping continues until the logical expression is false.
Note:
Always make sure that the loop_variable has a value assigned to it before
the start of the loop.
Syntax:
switch input expression (scalar or string)
case value_1
statement_group_1
case value _2
statement_group_2
.. .. ..
otherwise
statement_group_n
end
If the input expression is a string, then it is equal to the case value if strcmp returns a
one (for true).
Only the first matching case is executed. If no match occurs, the statements for the
otherwise statement are executed. The otherwise statement is optional, and if
omitted the execution continues with the statements after the end statement if no match
exists.