0% found this document useful (0 votes)
34 views154 pages

ELE00038C 2023 24 Part II

This document provides an overview of the Engineering Mathematics course ELE00038C to be taught during the 2023-2024 academic year at the University of York. The course will introduce mathematical tools relevant to engineering problems through lectures, independent study of course notes, and problem solving workshops. Students will be assessed through regular quizzes and a final exam. Topics will include differentiation, integration, differential equations, vectors, and more. The purpose is to develop practical mathematical skills for engineering applications.

Uploaded by

timoiivula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views154 pages

ELE00038C 2023 24 Part II

This document provides an overview of the Engineering Mathematics course ELE00038C to be taught during the 2023-2024 academic year at the University of York. The course will introduce mathematical tools relevant to engineering problems through lectures, independent study of course notes, and problem solving workshops. Students will be assessed through regular quizzes and a final exam. Topics will include differentiation, integration, differential equations, vectors, and more. The purpose is to develop practical mathematical skills for engineering applications.

Uploaded by

timoiivula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 154

Engineering Mathematics

Part II
2023-2024

School of Physics, Engineering & Technology


University of York

[ELE00038C] J. J. Bissell
3

Preface
The purpose of this course is to introduce those mathematical tools that are
most relevant to solving practical problems in engineering and the physical
sciences. Where feasible, core concepts will be motivated using ‘real-life’ con-
texts; however, to develop competence and fluency we will often need to ‘drill’
technique using examples that are in themselves somewhat abstract.

Although our main goal might be practical application, it is important to under-


stand that mathematics underpins any serious attempt to describe the world,
and provides unparalleled insights into its beauty. So let us enjoy it!

Course delivery

Delivery of first year mathematics (ELE00038C) will be a mixture of in-person


lectures, and independent study based on a comprehensive set of course notes.
Material in these notes should be followed according to the weekly schedule
posted on the Virtual Learning Environment (VLE) - you will need to check
this schedule regularly.

Mathematics is (and always has been) a subject that is best learned by doing,
and our emphasis will be on active participation through problem solving. This
approach will require more effort, but it should also be more effective, and
ultimately more rewarding.

Lectures

Your timetable should include four slots each week. Although these are listed
as ‘lectures’, they will—as far as possible—be run more like workshops, with
lots of examples and exercises, with a basic structure as follows:

1. A short introduction to a new mathematical topic or method.

2. Active problem solving, with opportunities to ask questions.

3. Repeat.

In this way I hope to maximise our overall contact time, and help to set the
pace of learning. Remember to bring pencil and paper with you.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


4

Workshops

In addition to the lecture sessions, I will be holding a weekly workshop (as per
your timetable). These workshops will mainly involve practicing techniques by
solving problems on the course exercise sheets, but they can also be used as
an opportunity for you to ask me further questions about course material.

In previous years students have also set-up and used their own online forum to
discuss course content (e.g., via Discord). I encourage this kind of collaborative
engagement; however, remember that you are all coming from different back-
grounds, with different life experiences, so please be respectful of one-another.

Exercise sheets

Almost all of the techniques that we will be studying in this course can be mas-
tered by practice, and it is essential that you work on course exercise sheets
throughout term. Our ultimate goal is skilled creative work in applied con-
texts; however, to reach that point we must first hone our craft, and this will
often mean working on more abstract problems. As a rule-of-thumb, keep
mathematically fit by solving at least 10 exercise problems each week.

How to use these notes

These notes have been written as an independent guide, and (in principle)
you should be able to learn the course content by studying each section, and
completing the worked examples, and course exercises. Reading mathematics
requires active participation, so keep pencil and paper to hand to check the
steps in an argument. For example, a mathematical statement like

x2 + 3x + 2
f (x) = , (x 6= −2) ⇒ f (x) = x + 1
x+2
might not seem obvious; however, if you have a pencil and paper to hand, then
you can confirm that it is correct by noting that

x2 + 3x + 2 (x + 1)(x + 2)
f (x) = = = x + 1. (4.1)
x+2 (x + 2)

In general, therefore, reading these notes will require application - do not be


surprised if you need to deduce some of the steps in an argument by yourself.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


5

Assessment

The course will be assessed by two components with the following weightings:

• 20% continuous assessment by fortnightly multiple choice quizzes (MCQs),


with five quizzes in total, each worth 4%:
– Week 02 : Quiz 01 (Differentiation).
– Week 04 : Quiz 02 (Integration).
– Week 06 : Quiz 03 (Complex Numbers).
– Week 08 : Quiz 04 (Ordinary Differential Equations).
– Week 10 : Quiz 05 (Vectors and Vector Algebra).

• 80% end of course assessment by a closed book, written examination.

Further information about the format and timings of the multiple choice quizzes
is summarised on the Virtual Learning Environment.

Will it be on the exam.?

Unless explicitly marked ‘(optional)’ any section in these notes could be ex-
amined. However, it would not be a very fair examination if I were to set very
difficult problems, or ask for long, and technical derivations. Clearly I cannot
tell you what will be on the exam., but I can tell you that I will try to be fair.
The best guide to the sorts of questions you might be asked in an examination
is to look at past papers (see the course wiki-pages). If you can solve most of
the course exercises, then you will do very well in the exam. - so practice!

Further reading

The following texts are recommended as supplementary reading:

• J. Gilbert and C. Jordan, Guide to Mathematical Methods, 2nd Edition, Palgrave


Macmillan (2002).
• E. Kreyszig, Advanced Engineering Mathematics, 7th Edition, Wiley (1993).
• K. F. Riley, M. P. Hobson, and S. J. Bence, Mathematical Methods for Physics and
Engineering, 2nd Edition, Cambridge University Press (2002).

The simplest of these is probably Gilbert and Jordan, but the other two texts
will also be useful for second year mathematics and beyond.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


6

Rules of Maths Club

1. The first rule of Maths Club is: you do to talk about Maths Club.

2. The second rule of Maths Club is: you do not talk about Maths Club.

3. Third rule of Maths Club: If someone yells “stop!”, goes limp, taps out,
or fails to draw a diagram, then the maths is over.

4. Fourth rule: All angles are in radians.

5. Fifth rule: One line of mathematics at a time people, no skipping steps.

6. Sixth rule: The maths is bare knuckle. No shirt, no shoes, no calculators.

7. Seventh rule: The maths will go on as long as it has to.

8. The eighth and final rule: If this is your first time at Maths Club, then
you have to math.

Why we are here

It has always taken a certain amount of skill to navigate university life, but
things have arguably become more difficult over recent years. Let us try to
remember, then, that fundamentally we are here as a community of scholars to
engage joyfully with the process of learning and discovery. So let’s treat each
other with goodwill, and give it our best shot.

I look forward to seeing how we get on.

J. J. Bissell
(Summer 2023)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Contents

5 Ordinary Differential Equations 11

5.1 What is a Differential Equation? . . . . . . . . . . . . . . . . . 12

5.1.1 Discharging a capacitor . . . . . . . . . . . . . . . . . 12

5.1.2 Charging a capacitor . . . . . . . . . . . . . . . . . . . 14

5.1.3 Mass on a spring . . . . . . . . . . . . . . . . . . . . . 16

5.2 Vocabulary and Definitions . . . . . . . . . . . . . . . . . . . 18

5.3 First-Order Differential Equations . . . . . . . . . . . . . . . . 19

5.3.1 Separable equations . . . . . . . . . . . . . . . . . . . 20

5.3.2 Linear eqns with constant coefficients (homogeneous) . 24

5.3.3 Linear eqns with constant coefficients (inhomogeneous) 26

5.3.4 Linear eqns & the method of undetermined coefficients 27

5.3.5 Linear equations (most general form) . . . . . . . . . . 33

5.3.6 Change of variables . . . . . . . . . . . . . . . . . . . 37

5.3.7 Bernoulli’s differential equation . . . . . . . . . . . . . 41

5.4 Second-Order Linear Differential Equations . . . . . . . . . . . 44

5.4.1 Homogeneous second-order linear equations . . . . . . . 45

5.4.2 Reduction of order (optional) . . . . . . . . . . . . . . 53

5.4.3 Inhomogeneous second-order linear equations . . . . . . 56

5.5 Transient Solutions and Steady-State Solutions . . . . . . . . . 62

7
8 CONTENTS

6 Vectors and Vector Algebra 65

6.1 Vector Notation . . . . . . . . . . . . . . . . . . . . . . . . . 66

6.2 Vector Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . 67

6.2.1 Addition and subtraction . . . . . . . . . . . . . . . . 68

6.2.2 Scalar multiplication . . . . . . . . . . . . . . . . . . . 69

6.2.3 Unit vectors . . . . . . . . . . . . . . . . . . . . . . . 70

6.3 Basis Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

6.3.1 Cartesian basis . . . . . . . . . . . . . . . . . . . . . . 72

6.3.2 Vector magnitude . . . . . . . . . . . . . . . . . . . . 75

6.4 Scalar Product . . . . . . . . . . . . . . . . . . . . . . . . . . 76

6.4.1 Scalar product by components . . . . . . . . . . . . . . 77

6.4.2 Projection of vectors . . . . . . . . . . . . . . . . . . . 78

6.5 Vector Product . . . . . . . . . . . . . . . . . . . . . . . . . . 80

6.5.1 Vector product by components . . . . . . . . . . . . . 81

6.5.2 Area of a parallelogram . . . . . . . . . . . . . . . . . 84

6.5.3 Physical quantities as vector products . . . . . . . . . . 85

6.6 Geometrical Applications . . . . . . . . . . . . . . . . . . . . . 86

6.6.1 Equation of a line . . . . . . . . . . . . . . . . . . . . 86

6.6.2 Perpendicular distance to a line . . . . . . . . . . . . . 87

6.6.3 Perpendicular distance between skew lines . . . . . . . 88

6.6.4 Equation of a plane . . . . . . . . . . . . . . . . . . . 89

6.6.5 Perpendicular distance to a plane . . . . . . . . . . . . 90

6.7 Triple Products . . . . . . . . . . . . . . . . . . . . . . . . . . 92

6.7.1 Scalar triple product . . . . . . . . . . . . . . . . . . . 92

6.7.2 Volume of a parallelepiped . . . . . . . . . . . . . . . . 93

6.7.3 Co-planarity and linear dependence . . . . . . . . . . . 94

6.7.4 Vector triple product . . . . . . . . . . . . . . . . . . . 96

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


CONTENTS 9

7 Matrices and Linear Algebra 97

7.1 Matrices and linear equations . . . . . . . . . . . . . . . . . . 98

7.2 Definitions and Special Matrices . . . . . . . . . . . . . . . . . 100

7.2.1 Column matrices and row matrices . . . . . . . . . . . 101

7.2.2 Square matrices . . . . . . . . . . . . . . . . . . . . . 102

7.2.3 Identity (unit) matrix . . . . . . . . . . . . . . . . . . 103

7.2.4 Transpose of a matrix . . . . . . . . . . . . . . . . . . 105

7.3 Basic Matrix Operations . . . . . . . . . . . . . . . . . . . . . 106

7.3.1 Equality of matrices . . . . . . . . . . . . . . . . . . . 106

7.3.2 Addition and subtraction . . . . . . . . . . . . . . . . 106

7.3.3 Zero matrix . . . . . . . . . . . . . . . . . . . . . . . 107

7.3.4 Scalar multiplication . . . . . . . . . . . . . . . . . . . 108

7.3.5 Summary of basic matrix operations . . . . . . . . . . . 109

7.4 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . 110

7.4.1 Multiplying row and column matrices (inner product) . . 110

7.4.2 Multiplying general matrices . . . . . . . . . . . . . . . 111

7.4.3 Properties of matrix multiplication . . . . . . . . . . . 113

7.4.4 Multiplication and systems of equations . . . . . . . . . 118

7.5 Determinants . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

7.5.1 Determinant of a 2 × 2 matrix . . . . . . . . . . . . . 119

7.5.2 Introducing determinants of n × n matrices . . . . . . . 120

7.5.3 Minors of a matrix . . . . . . . . . . . . . . . . . . . . 120

7.5.4 Cofactors of a matrix . . . . . . . . . . . . . . . . . . 122

7.5.5 Definition of the determinant of an n × n matrix . . . . 124

7.5.6 Properties of determinants . . . . . . . . . . . . . . . . 127

7.6 Inverse of a Matrix . . . . . . . . . . . . . . . . . . . . . . . . 131

7.6.1 Inverse of a 2 × 2 matrix . . . . . . . . . . . . . . . . 132

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


10 CONTENTS

7.6.2 Determinant method for an n × n matrix . . . . . . . . 134

7.6.3 Elementary row operations (an interlude) . . . . . . . . 137

7.6.4 Gaussian elimination method . . . . . . . . . . . . . . 138

7.6.5 Inverses of products . . . . . . . . . . . . . . . . . . . 143

7.7 Systems of Linear Equations . . . . . . . . . . . . . . . . . . . 143

7.7.1 Solution by the inverse matrix method (2 × 2) . . . . . 144

7.7.2 Solution by the inverse matrix method (3 × 3) . . . . . 146

7.7.3 Systems of linear equations with changing inputs . . . . 148

7.7.4 Solution by Gaussian elimination (row reduction) . . . . 150

7.7.5 Parametric solutions for linearly dependent systems . . . 152

7.7.6 Inconsistent (contradictory) systems . . . . . . . . . . . 154

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 Engineering Mathematics
J. J. Bissell

Ordinary Differential Equations

A differential equation is an equation containing a derivative; for example,


Newton’s second law, F = dp/dt is a differential equation relating the force
F on a body to the derivative of its momentum p(t) with respect to time t. A
differential equation that contains ordinary derivatives (rather than, say, partial
derivatives) is known as an ordinary differential equation (ODE); Newton’s
second law F = dp/dt is an example of an ordinary differential equation.

Differential equations are important in engineering and the physical sciences


because any problem involving the rate-of-change of one quantity with respect
to another is described mathematically by relationships between derivatives.
Consequently, virtually all natural phenomena can be modelled by differential
equations. In this section we introduce some of the most important ordinary
differential equations that arise in engineering and scientific contexts. By the
end of the section you should be able to. . .

Learning outcomes:

◦ Explain how differential equations arise in engineering and scientific contexts.


◦ Determine the order of a differential equation.
◦ Integrate simple first-order differential equations by separating the variables.
◦ Use differentiation to check the solution to a differential equational.
◦ Write down the general solution to the first-order linear differential equation.
◦ Use changes of variables to simplify non-linear problems.
◦ Solve first and second-order linear equations with constant coefficients.
◦ Apply the method of undetermined coefficients to inhomogeneous equations.
◦ Identify the transient and steady-state solutions to a linear equation.

These learning outcomes must be reinforced by completing course exercises.

11
12 Section 5 : Ordinary Differential Equations

5.1 What is a Differential Equation?

A differential equation is an equation containing derivatives; such equations


are ubiquitous in science and engineering contexts due to the prevalence of
problems that concern the rate-of-change (derivative) of one quantity with
respect to another. In this section we illustrate how differential equations arise
in an electrical context (§5.1.1 and §5.1.2), and a mechanical context (§5.1.3).

5.1.1 Discharging a capacitor

Figure 5.1 depicts a capacitor of capacitance C holding a charge Q; the ca-


pacitor is connected in series with a resistor of resistance R, in an open circuit
controlled by a switch. At some time t = 0 the switch is closed, and the
capacitor is allowed to discharge through the resistor; in this way a current

dQ
I= (5.1)
dt
begins to flow through the circuit. The subsequent decay in charge Q on the
capacitor may be modelled by a differential equation.
To see how this works, observe that the potential difference vR across the
resistor is
dQ
vR = IR = R , (5.2)
dt
whereas the potential difference vC across the capacitor is (by definition)

Q
vC = . (5.3)
C
When the circuit is complete (t > 0) these potential differences are related by

vR + vC = 0. (5.4)

Thus, substituting equations (5.2) and (5.3) into equation (5.4) we obtain

dQ Q
R + = 0. (5.5)
dt C
It is common to write this equation in the simplified form
 
dQ 1
+ Q = 0, where τ = RC (5.6)
dt τ

is a characteristic timescale in RC-circuits known as the time constant.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 13

Figure 5.1: Capacitor C in series with a resistor R, i.e., an RC-circuit.

Equation (5.6) describes a relationship between the charge Q on the capacitor


at time t, and the first-order derivative of Q with respect to t, i.e., dQ/dt; for
this reason it is called a first-order differential equation for Q.

If some function Q(t) can be found such the left-hand-side of equation (5.6) is
equal to the right-hand-side when Q = Q(t), then we say that Q(t) satisfies
the equation, or is a solution to the differential equation. We shall see in
§5.3.1 that equation (5.6) can be integrated to give the solution

Q(t) = ke−t/τ , (5.7)

where k is an arbitrary constant that arises from the integration. The arbi-
trary constant k means that equation (5.7) represents a family of solutions,
where each possible value for k corresponds to a different member of the family.

Because solution (5.7) involves an arbitrary constant, it is known as the general


solution to the differential equation. Given particular boundary conditions,
the value of the constant can be fixed to give a particular solution.

Boundary conditions may be thought of as conditions on a solution beyond


the basic requirement that the solution satisfies the differential equation. For
example, if the charge Q(t) on the capacitor at time t = 0 takes the value Q0 ,
then the solution (5.7) must satisfy the boundary condition Q(0) = Q0 , i.e.,

Q(0) = ke−0/τ = Q0 , which is satisfied if and only if Q0 = k. (5.8)

In this way the particular solution to the differential equation (5.6) that
satisfies the boundary condition Q(0) = Q0 is

Q(t) = Q0 e−t/τ . (5.9)

(see figure 5.2). A boundary condition that depends on some kind of initial
value is typically referred to as an initial condition.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


14 Section 5 : Ordinary Differential Equations

0.8

0.6

0.4

0.2

0
0 0.5 1 1.5 2 2.5

Figure 5.2: Exponential decay of the charge Q on a capacitor in an RC-circuit.

Example 5.1 The function Q(t) = ke−t/τ is proposed as a trial solution to


the equation  
dQ 1
+ Q = 0. (5.10)
dt τ
Verify that the trial solution Q(t) = ke−t/τ satisfies the differential equation.

I Solution: Substituting Q = Q(t) = ke−t/τ into equation (5.10) we have


     
d −t/τ 1 −t/τ 1 −t/τ 1
ke−t/τ = 0. (5.11)

ke + ke =− ke +
dt τ τ τ

Thus, the left-hand-side of equation (5.10) is equal to the right-hand-side when


Q = Q(t), i.e., Q(t) = ke−t/τ is a solution to equation (5.10). J

5.1.2 Charging a capacitor

Now consider the problem of charging the capacitor by connecting it in series


to a voltage source vS . In this case the relevant circuit is depicted in figure
5.3. The capacitor initially holds no charged, so that Q(0) = 0.

The voltage source is ‘turned-on’ at t = 0 to yield a constant voltage V , i.e.,



0 for t < 0
vS (t) = (5.12)
V for t ≥ 0.

For t ≥ 0, therefore, the potential difference across the resistor and capacitor
is balanced by V , that is,
vR + vC = V. (5.13)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 15

Figure 5.3: Capacitor C in series with a resistor R, and voltage source vS .

Substituting equations (5.2) and (5.3) into equation (5.13) we obtain

dQ Q
R + = V. (5.14)
dt C
It is convenient to write this equation in the simplified form
   
dQ 1 1
+ Q= Q∞ , (5.15)
dt τ τ

where the constants τ and Q∞ are defined by

τ = RC and Q∞ = CV. (5.16)

As with equation (5.6), equation (5.15) describes a relationship between the


charge Q on the capacitor at time t, and the first-order derivative of Q with
respect to t; for this reason it is called a first-order differential equation.
We shall see in Example 5.5 that the general solution to this equation is

Q(t) = Q∞ + ke−t/τ , (5.17)

where k is an arbitrary constant (cf. equation (5.51)). For this solution to


be consistent with the initial condition that capacitor is uncharged, we must
determine a value for k that gives Q(0) = 0. This means that we require

Q(0) = Q∞ + ke−0/τ = Q∞ + k = 0, that is, k = −Q∞ . (5.18)

Putting this value for k back into our general solution (5.17) yeilds

Q(t) = Q∞ (1 − e−t/τ ) (5.19)

as the particular solution to equation (5.15) that satisfies the initial condition
Q(0) = 0. This particular solution is plotted in figure 5.4.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


16 Section 5 : Ordinary Differential Equations

1.25

0.75

0.5

0.25

0
0 1 2 3 4 5

Figure 5.4: Charge Q(t) on a capacitor approaching its limiting value Q∞ .

The solution (5.19) describes how the charge Q(t) on the capacitor increases
from Q(0) = 0 with increasing time t. For example, if we charge the capacitor
for period of time greatly exceeding the time constant τ , that is, for a time

t  τ, or equivalently t/τ  1, (5.20)

then we find that Q(t) approaches the value Q∞ (see figure 5.4). This idea
may be formalised mathematically using a limit, viz.

Q∞ (1 − e−t/τ ) = Q∞ .
 
lim Q(t) = lim (5.21)
(t/τ )→∞ (t/τ )→∞

Here the limit models (t/τ )  1 by letting (t/τ ) → ∞.

5.1.3 Mass on a spring

In the previous sections we saw how RC-circuits can be modelled using equa-
tions involving first-order derivatives, i.e., by first-order differential equations.
We now consider a mechanical context which gives rise to an equation involving
a second-order derivative, that is, a second-order differential equation.

To this end consider a mass m attached to a spring with spring constant k, such
as that depicted schematically in figure 5.5. If the mass is displaced through a
distance x then the restoring force FH is given by Hooke’s law

FH = −kx. (5.22)

If we further suppose that the mass is attached to a viscous dash-pot, then the

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 17

Figure 5.5: Mass m on a spring with constant k, damped by viscous drag (coefficient c).

drag force Fv on the mass is proportional to its velocity dx/dt, that is,

dx
Fv = −c , (5.23)
dt
where c is a constant of proportionality. Now the acceleration of the mass is
d2 x/dt2 , so according to Newton’s second law we have

d2 x
F =m = Fh + Fv , (5.24)
dt2
with F as the net force. Thus, substituting for Fh and Fv by equations (5.22)
and (5.23), we obtain
d2 x dx
m 2 = −kx − c . (5.25)
dt dt
It is common to rearrange this equation to the form
r
d2 x dx k c
2
+ 2γ0 + ω02 x = 0, with ω0 = , and γ0 = . (5.26)
dt dt m 2m

Equation (5.26) relates the displacement x of the mass to the first-order and
second-order derivatives, dx/dt and d2 x/dt2 respectively; for this reason it is
called a second order differential equation for x.

The solutions to equation (5.26) describe the displacement x(t) of the mass
as a function of time t. For example, if ω0 > γ0 then it may be shown that
the general solution to equation (5.26) is
q
−γ0 t
x(t) = e [A cos(ωt) + B sin(ωt)] , where ω = ω02 − γ02 , (5.27)

and A and B are arbitrary constants.1 Observe that the trigonometric terms
are multiplied by an exponential factor, and so describe oscillations with a
decaying amplitude, or damped oscillations (see Exercise 5.24, and figure 5.7).

1
The general solution to a second-order differential equation always involves two arbitrary con-
stants because ‘undoing’ a second-derivative effectively corresponds to two integrations.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


18 Section 5 : Ordinary Differential Equations

5.2 Vocabulary and Definitions

It will be clear from our discussion in §5.1 that the field of differential equations
is replete with a large and technical vocabulary; this vocabulary helps to simplify
the study of differential equations by emphasising common properties, and
methods of solution. Below we summarise the jargon encountered so far.

Definition 5.1 An ordinary differential equation (ODE) expresses a


relationship between a dependent variable y(x) and its derivatives (y 0 ,
y 00 , y 000 , etc.), and an independent variable x. The order of a differential
equation refers to the highest order derivative in the equation.

The solution of a differential equation is a function y = f (x) that


satisfies the equation. The general solution to an nth-order differential
equation is the solution containing n arbitrary constants.

A particular solution to a differential equation is a solution with


the arbitrary constants fixed to satisfy given boundary conditions. For
problems involving time t dependence, boundary conditions given at an
initial time t = 0 are called initial conditions.

The requirement that the general solution to an nth-order differential equation


contains n arbitrary constants shall not be proved here; however, it is perhaps
intuitive to the extent that n integrations of an nth-order derivative dn y/dxn
will introduce n arbitrary constants. [We shall not worry about uniqueness.]
Example 5.2 For each following differential equations state: (i) the order of
the equation, (ii) the dependent variable, and (iii) the independent variable.
(a) The capacitor discharge equation of §5.1.1, namely
 
dQ 1
+ Q = 0, where τ is a constant. (5.28)
dt τ

(b) A linear differential equation of the form

x3 y 000 (x) + xy 0 (x) + y = sin(x), (5.29)

where y 000 (x) ≡ d3 y/dx3 and y 0 (x) ≡ dy/dx.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 19

(c) The mass-spring oscillator equation of §5.1.3, that is,

dx d2 x
ẍ(t) + 2γ0 ẋ(t) + ω02 x(t) = 0, where ẋ ≡ , ẍ ≡ , (5.30)
dt dt2
and ω0 and γ0 are constants.

I Solution: We consider each of the equations in turn:

(a) This is a first-order differential equation because the highest-order derivative


is dQ/dt. The dependent variable is Q(t), and the independent variable is t.

(b) The highest order derivative in this equation is the third-order derivative
y 000 (x) ≡ d3 y/dx3 , making this a third-order ordinary differential equation. The
dependent variable is y(x), and the independent variable is x.

(c) This is a second-order ordinary differential equation because the highest


order derivative ẍ(t) ≡ d2 x/dt2 is second-order. The dependent variable is
x(t), and the independent variable is t. J

In the following sections we consider methods for solving ordinary differential


equations, beginning with first-order equations.

5.3 First-Order Differential Equations

The general form of a first-order differential equation can be written in two


ways. The normal form of a first-order differential equation is

dy
= F (x, y), (5.31)
dx
where F (x, y) is a function of x and y. The differential form of a first-order
differential equation is

A(x, y)dx + B(x, y)dy = 0, (5.32)

where A(x, y) and B(x, y) are functions of x and y. The relationship between
these two forms may be seen by rearranging equation (5.32) as

dy A(x, y)
=− , (5.33)
dx B(x, y)

which is in the form of equation (5.31) with F (x, y) = −A(x, y)/B(x, y).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


20 Section 5 : Ordinary Differential Equations

Example 5.3 Express the first-order differential equation

dy 4x + y 2
=− (5.34)
dx 2xy

in differential form.

I Solution: Rearranging equation (5.34) to differential form we have

(4x + y 2 )dx + (2xy)dy = 0, (5.35)

which is in the general form (5.31) with A = (4x + y 2 ) and B = 2xy. J

Definition 5.2 The general form of a first-order ordinary differential equa-


tion is
dy
= F (x, y), (5.36)
dx
where F (x, y) is a function of x and y. This equation may be expressed
equivalently in differential form as

A(x, y)dx + B(x, y)dy = 0, (5.37)

where A(x, y) and B(x, y) are functions of x and y.

First-order differential equations may be further classified into a range of sub-


classes, e.g., separable differential equations, and linear differential equations.

5.3.1 Separable equations

A separable first-order differential equation is an equation that can be written


in the form
dy f (x)
=− , (5.38)
dx g(y)
where f (x) is a function of x only, and g(y) is a function of y only. The
differential form of a separable differential equation is thus

f (x)dx + g(y)dy = 0. (5.39)

Because the first term in this equation involves x only, and the second term
involves y only, we say that the variables x and y have been separated.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 21

Definition 5.3 The general form of a first-order separable differential


equation is

dy f (x)
=− , i.e., g(y)dy = −f (x)dx, (5.40)
dx g(y)

where f (x) is a function of x only, and g(y) is a function of y only. The


general solution y(x) to a separable equation may be found by evaluating
Z Z
g(y)dy = − f (x)dx (5.41)

to obtain a relationship between x and y.

Example 5.4 Find the general solution to the first-order differential equation

dy
= 3x2 + cos x. (5.42)
dx
What is the particular solution that satisfies the boundary condition y(π) = 0?

I Solution: Equation (5.42) may be written in the separable form

dy = 3x2 + cos x dx.



(5.43)

Integrating this equation to obtain the general solution we have


Z Z
3x2 + cos x dx, y(x) = x3 + sin x + c, (5.44)

dy = that is,

where c is an arbitrary constant.

The particular solution is the solution with c fixed to match our boundary
condition y(π) = 0. Substituting y(π) = 0 into the general solution gives

y(π) = π 3 + sin π + c = 0 ⇒ c = −π 3 . (5.45)

In this way we have


y(x) = x3 + sin x − π 3 (5.46)

as the particular solution that satisfies the boundary condition y(π) = 0. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


22 Section 5 : Ordinary Differential Equations

Example 5.5 In §5.1.2 we showed that the charge Q(t) on a capacitor in an


RC-circuit can be modelled by the first-order differential equation
   
dQ 1 1
+ Q= Q∞ , (5.47)
dt τ τ

where τ and Q∞ are constants. Determine the general solution this equation.
What is the particular solution that satisfies the initial condition Q(t) = 0?

I Solution: By rearranging equation (5.47) we have

dQ (Q − Q∞ )
=− . (5.48)
dt τ
This is a separable differential equation; thus, separating the variables we have
Z Z  
1 1
dQ = − dt. (5.49)
(Q − Q∞ ) τ

Evaluating the integrals give the general solution

Q(t) − Q∞ = e−(t/τ )+c , (5.50)



loge Q(t) − Q∞ = −(t/τ ) + c, i.e.,

where c is an arbitrary constant. It is convenient to write this solution in the


form
Q(t) = Q∞ + ke−t/τ , where k = ec (5.51)

is an arbitrary constant. For this solution (5.51) to satisfy the initial condition
Q(0) = 0 we require

Q(0) = Q∞ + ke−0/τ = Q∞ + k = 0, (5.52)

that is,
k = −Q∞ . (5.53)

Thus, selecting k = −Q∞ in equation (5.51), we have

Q(t) = Q∞ 1 − e−t/τ .

(5.54)

as the particular solution that satisfies the initial condition Q(0) = 0. J


Our examples above involved solutions for which the independent variable could
be written as an explicit function of the independent variable, but this is not
always possible. Indeed, often solutions to differential equations are best ex-
pressed by implicit functions (see Example 5.6).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 23

Example 5.6 Determine the general solution to the first-order differential


equation
dy x
=− . (5.55)
dx y
Sketch example solutions by choosing values for the arbitrary constants.

I Solution: Equation (5.55) is a separable differential equation. Separating


the variables we have
Z Z
ydy = −xdx ⇒ ydy = − xdx. (5.56)

Evaluating the integrals we obtain the general solution

y 2 = −x2 + c, that is x 2 + y 2 = a2 , (5.57)

where we have written the arbitrary constant as c = a2 for convenience.

Notice here that the general solution in equation (5.57) is given by an implicit
relationship between x and y, i.e., by an implicit function

f (x, y) = x2 + y 2 = a2 = constant. (5.58)

The general solution contains all possible solutions to the differential equation,
with particular values for the constant a corresponding to particular solutions.
In this case each of the solutions to the differential equation is a circle of radius
a. Example solutions are plotted as a family of solution curves in figure 5.6,
where each member of the family corresponds to different value of a. J

-1

-2

-3
-3 -2 -1 0 1 2 3

Figure 5.6: Example solutions to equation (5.55), i.e., a family of circles.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


24 Section 5 : Ordinary Differential Equations

5.3.2 Linear equations with constant coefficients (homogeneous)

The general form of the so-called homogeneous first-order linear differential


equation with constant coefficients is

dy
a1 + a0 y = 0, (5.59)
dx
where a1 and a0 are constants. This is a very frequently occurring differential
equation in science and engineering. Indeed, the capacitor discharge equation
of §5.1.1, namely  
dQ 1
+ Q = 0, (5.60)
dt τ
is a homogeneous first-order linear differential equation with constant coeffi-
cients a1 = 1 and a0 = (1/τ ).
The solution to equation (5.59) may be found by separation of variables, i.e.,
    Z   Z  
1 a0 1 a0
dy = − dx ⇒ dy = − dx. (5.61)
y a1 y a1

Thence, evaluating the integrals we obtain the general solution

loge y = − (a0 /a1 ) x + c ⇒ y(x) = cc e−(a0 /a1 )x (5.62)

where c is an arbitrary constant. It is convenient to write this solution in the


form
y(x) = Ceλx , where λ = − (a0 /a1 ) (5.63)

and C = ec is an arbitrary constant. J

Result 5.1 The general form of the homogeneous first-order linear differ-
ential equation with constant coefficients a0 and a1 is

dy
a1 + a0 y = 0. (5.64)
dx
This equation has general solution

y(x) = Ceλx , where λ = −(a0 /a1 ), (5.65)

and C is an arbitrary constant.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 25

dy
Example 5.7 Determine the general solution to 2 + 4y = 0.
dx
I Solution: This is a homogeneous first-order linear equation with constant
coefficients a0 = 4 and a1 = 2. Hence, by Result 5.1, the general solution is

y(x) = Ceλx = Ce−2x , (5.66)

where C is an arbitrary constant, and we used λ = −(a0 /a1 ) = −2. J


Example 5.8 Determine the general solution to ẋ = 3x, where ẋ ≡ dx/dt.

I Solution: This equation can be written as

dx
− 3x = 0. (5.67)
dt
This, is a homogeneous first-order linear equation with constant coefficients
a0 = −3 and a1 = 1. Hence, by Result 5.1, the general solution is

x(t) = Ceλt = Ce3t , (5.68)

where C is an arbitrary constant, and we used λ = −(a0 /a1 ) = 3. J


Example 5.9 Find the general solution to the capacitor discharge equation
 
dQ 1
+ Q = 0, where τ is a constant. (5.69)
dt τ

What is the particular solution that satisfies the initial condition Q(t) = Q0 .

I Solution: Equation (5.69) is a homogeneous first-order linear equation with


constant coefficients a0 = (1/τ ) and a1 = 1. Hence, by Result 5.1, the
general solution is
Q(t) = ke−t/τ , (5.70)

where k is a constant. The particular solution is the solution with k fixed to


match our boundary condition Q(0) = Q0 , that is, we require

Q(0) = ke−0/τ = Q0 , i.e., k = Q0 . (5.71)

Hence, setting k = Q0 in equation (5.70), we have

Q(t) = Q0 e−t/τ (5.72)

as the particular solution that satisfies the initial condition Q(0) = Q0 . J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


26 Section 5 : Ordinary Differential Equations

5.3.3 Linear eqns with constant coefficients (inhomogeneous)

The general form of a first-order linear differential equation with constant


coefficients a0 and a1 is

dy
a1 + a0 y = φ(x), (5.73)
dx
where φ(x) is a function of x. This equation is said to be homogeneous if
φ(x) = 0, in which case it may be solved by separating variables (see §5.3.2).
Otherwise, if φ(x) 6= 0, then equation (5.73) is said to be inhomogeneous.
Inhomogeneous equations cannot usually be solved by separating the variables.
We shall study a powerful method of solving a generalised form of equation
(5.73) in §5.3.5. Here we shall simply assert that the general solution is

y(x) = yc (x) + yp (x), (5.74)

where yc (x) and yp (x) are two functions defined as follows.

• The complementary function yc (x) is the solution to

dyc
a1 + a0 yc = 0. (5.75)
dx
In this way the complementary function may be found using Result 5.1.

• The particular integral yp (x) is a solution to equation (5.73), i.e.,

dyp
a1 + a0 yp = φ(x), (5.76)
dx
that does not contain any arbitrary constants. We explore how to deter-
mine yp (x) using the method of undetermined coefficients in §5.3.4.

That y(x) = yc (x) + yp (x) is a solution to equation (5.73) follows because

dy d
a1 + a0 y = a1 (yc + yp ) + a0 (yc + yp )
dx dx
dyc dyp
= a1 + a0 yc + a1 + a0 yp = φ(x) (5.77)
| dx{z } | dx {z }
=0 =φ(x)

as required. That y = yc + yp is the general solution follows from the fact that
it is the solution to a first-order differential equation (an equation of order 1)
containing a single (i.e., 1) arbitrary constant (see Definition 5.1).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 27

In summary, therefore, we have the following outline method for solving inho-
mogeneous first-order linear differential equations:

Method 5.1 The general form of a first-order linear differential equation


with constant coefficients a0 and a1 is

dy
a1 + a0 y = φ(x). (5.78)
dx
One way of obtaining the general solution to this equation is as follows:

(1) Find the complementary function yc (x) by solving

dyc
a1 + a0 yc = 0, (5.79)
dx
e.g., by separating the variables, or using Result 5.1.

(2) Find the particular integral yp (x) by solving

dyp
a1 + a0 yp = φ(x) (5.80)
dx
using the method of undetermined coefficients (see §5.3.4).

(3) The general solution to equation (5.78) is then

y(x) = yc (x) + yp (x). (5.81)

Particular solutions may be found to match relevant boundary conditions.

5.3.4 Linear equations & the method of undetermined coefficients

The method of undetermined coefficients is way of finding the particular inte-


gral yp (x) using a trial function. The trial function is chosen to resemble φ(x),
but contains unknown (undetermined) coefficients, as in table 5.1. The values
of the coefficients are then fixed (determined) to ensure that yp (x) satisfies

dyp
a1 + a0 yp = φ(x). (5.82)
dx
This method is best illustrated by example (see, e.g., Examples 5.10 and 5.12).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


28 Section 5 : Ordinary Differential Equations

Form of inhomogeneity φ(x) Trial for particular integral yp (x)

c0 k0

c1 x + c0 (c0 can be zero) k1 x + k0

c2 x2 + c1 x + c0 (c1 and c0 can be zero) k2 x2 + k1 x + k0

an nth-degree polynomial an nth-degree polynomial

A cos(ωx) + B sin(ωx) (A or B can be zero) a cos(ωx) + b sin(ωx)

c0 eγx k0 eγx

linear combination of the above corresponding combination of above

product of the above corresponding product of above

Table 5.1: Trial forms for the particular integral yp (x) given φ(x), where the coefficients
c0 , c1 , c2 , A, B, ω, γ, and k0 , k1 , k2 , a, b are constants. Note: If any term in the proposed
trial form for yp (x) is already present in the complementary function yc (x), then multiply
yp (x) by xm , where m is the lowest integer power such that no coincidence occurs.

Example 5.10 Use Method 5.1 to determine the general solution to the in-
homogeneous equation
dy
2 + 4y = 8x. (5.83)
dx
You may wish to refer to the trial functions listed in table 5.1.

I Solution: We follow the three-step procedure outlined in Method 5.1.


◦ Step (1): The complementary function yc (x) is the solution to the homo-
geneous equation
dyc
2 + 4yc = 0. (5.84)
dx
By Example 5.7 we know that the solution to this equation is

yc (x) = Ce−2x , (5.85)

where C is an arbitrary constant.


◦ Step (2): The particular integral yp (x) is the solution to the inhomogeneous
equation
dyp
2 + 4yp = φ(x), where φ(x) = 8x. (5.86)
dx
We shall solve this equation using the method of undetermined coefficients.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 29

Since the form of the inhomogeneity φ(x) = 8x is linear in x, we shall use a


trial solution that is also linear in x (see table 5.1), i.e.,

yp (x) = k1 x + k0 , (5.87)

where k1 and k0 are coefficients to be determined. Putting this trial solution


into equation (5.86) we require

d  
2 k1 x + k0 + 4 k1 x + k0 = 4k1 x + (2k1 + 4k0 ) = 8x. (5.88)
dx
For 4k1 x + (2k1 + 4k0 ) = 8x to be true for all x it is necessary that

4k1 = 8 and (2k1 + 4k0 ) = 0 ⇒ k1 = 2 and k0 = −1. (5.89)

Thus, using these values in equation (5.87), the particular integral is

yp (x) = 2x − 1. (5.90)

◦ Step (3): By equations (5.85) and (5.87), the general solution is

y(x) = yc (x) + yp (x) = Ce−2x + 2x − 1, (5.91)

where C is an arbitrary constant. J

Example 5.11 The charge Q(t) on a capacitor at time t satisfies


   
dQ 1 1
+ Q= Q∞ , where τ and Q∞ are constants. (5.92)
dt τ τ

The capacitor is initially uncharged, giving the initial condition Q(0) = 0.


Use Method 5.1 to determine an explicit expression for Q(t) as a function of t.

I Solution: Notice that we solved this problem in Exercise 5.5 by separating


the variables. Here we adopt the trial solution approach of Method 5.1.

◦ Step (1): The complementary function Qc (t) is the solution to


 
dQc 1
+ Qc = 0. (5.93)
dt τ

Hence, by Result 5.1, we have

Qc = ke−t/τ , where k is an arbitrary constant. (5.94)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


30 Section 5 : Ordinary Differential Equations

◦ Step (2): The particular integral Qp (t) is the solution to


   
dQp 1 1
+ Qp = φ(t), where φ(t) = Q∞ . (5.95)
dt τ τ

We shall solve this equation using the method of undetermined coefficients.


Since the form of the inhomogeneity is a constant φ(t) = Q∞ /τ , we shall try
a solution that is also a constant, i.e.,

xp (t) = k0 , (5.96)

where k0 is a coefficient to be determined (see table 5.1). Putting this trial


solution into equation (5.95) we require
     
d 1 1
k0 + k0 = Q∞ ⇒ k0 = Q∞ , (5.97)
dt τ τ
such that xp (t) = Q∞ . (5.98)

◦ Step (3): By equations (5.94) and (5.98), the general solution is

Q(t) = ke−t/τ + Q∞ . (5.99)

For this solution to satisfy Q(0) = 0 we require k = −Q∞ . Hence,

Q(t) = −Q∞ e−t/τ + Q∞ = Q∞ (1 − e−t/τ ) (5.100)

is the particular solution satisfying the initial condition Q(0) = 0. J


Example 5.12 Use Method 5.1 to determine the general solution to

dx 13
− 3x = 3
cos (2t). (5.101)
dt
You may wish to refer to the trial functions listed in table 5.1.

I Solution: We follow the each of the steps in turn.


◦ Step (1): The complementary function xc (t) is the solution to

dxc
− 3xc = 0. (5.102)
dt
By Example 5.8 we know that the solution to this equation is

xc (t) = Ce3t , where C is an arbitrary constant. (5.103)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 31

◦ Step (2): The particular integral xp (t) is the solution to

dxp 13
− 3xp = φ(t), where φ(t) = 3
cos(2t). (5.104)
dt
We shall solve this equation using the method of undetermined coefficients.
Since the form of the inhomogeneity is a trigonometric function φ(t) = 133
cos(2t),
we shall try a solution that is also based on trigonometric functions, i.e.,

xp (t) = a cos(2t) + b sin(2t), (5.105)

where a and b are coefficients to be determined (see table 5.1). Putting this
trial solution into equation (5.104) we require

d   13
a cos(2t) + b sin(2t) − 3 a cos(2t) + b sin(2t) = 3
cos(2t), (5.106)
dt
whereupon evaluating the derivative we find

13
(2b − 3a) cos(2t) − (2a + 3b) sin(2t) = 3
cos(2t). (5.107)

For this equation to be true for all t, it is necessary that

13
(2b − 3a) = 3
and (2a + 3b) = 0. (5.108)

These equations may be solved simultaneously to give a = −1 and b = 23 ;


thus, putting these values into equation (5.105), the particular integral is

xp (t) = − cos(2t) + 23 sin(2t). (5.109)

◦ Step (3): By equations (5.103) and (5.109), the general solution is

x(t) = xc (t) + xp (t)


= Ce3t − cos(2t) + 23 sin(2t), (5.110)

where C is an arbitrary constant. J


Note: As described in the caption to table 5.1, care must be taken if the
proposed form for the trial solution yp (x) contains terms that already exist
in the complementary function yc (x). Indeed, if any term in the trial form
for yp (x) is present in the complementary function yc (x), then it is necessary
to multiply yp (x) by xm , where m is the lowest integer power such that no
coincidence with yc (x) occurs. This procedure is best illustrated by example.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


32 Section 5 : Ordinary Differential Equations

Example 5.13 Use Method 5.1 to determine the general solution to the in-
homogeneous equation
dy
2 + 4y = e−2x . (5.111)
dx
You may wish to refer to the trial functions listed in table 5.1.

I Solution: We follow the three-step procedure outlined in Method 5.1.

◦ Step (1): The complementary function yc (x) is the solution to

dyc
2 + 4yc = 0, that is, yc (x) = Ce−2x , (5.112)
dx
where we used our solution to Example 5.7, with C as an arbitrary constant.

◦ Step (2): The particular integral yp (x) is the solution to

dyp
2 + 4yp = φ(x), where φ(x) = e−2x . (5.113)
dx
We shall solve this equation using the method of undetermined coefficients.

Since φ(x) = e−2x , a first glance at table 5.1 suggests a using trial solution
yp (x) = ke−2x , where k is a coefficient to be determined (see §5.3.4). However,
the complementary function yc (x) already includes a term in e−2x ; thus, to
avoid coincidental terms between yp and yc , we multiply yp (x) = ke2x by x
(the lowest power of x such that no coincidence occurs), and instead try

yp (x) = kxe−2x . (5.114)

Putting this trial solution into equation (5.113) we require

d
kxe−2x + 4 kxe−2x = 2ke−2x = e−2x , k = 12 . (5.115)
 
2 i.e.,
dx
Thus, the particular integral is

yp (x) = 12 xe−2x . (5.116)

◦ Step (3): By equations (5.112) and (5.116), the general solution is

y(x) = yc (x) + yp (x) = ( 12 x + C)e−2x , (5.117)

where C is an arbitrary constant. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 33

5.3.5 Linear equations (most general form)

The most general form of a first-order linear differential equation is

dy
a1 (x) + a0 (x)y = φ(x), (5.118)
dx
where the coefficients a1 (x) and a0 (x) are functions of x (which can be con-
stants). By dividing through by a1 (x), these equations are usually written

dy
+ P (x)y = Q(x), (5.119)
dx
where P (x) and Q(x) are functions of x (see, e.g., Examples 5.14 and 5.15).
To determine the general solution to equation (5.119) we introduce a function
µ(x) known as an integrating factor, which we define by
Z
z(x)
µ(x) = e , where z(x) = P (x)dx. (5.120)

The purpose of this integrating factor is to transform equation (5.119) into a


form that can be integrated. To see how this works, observe that
Z 
dµ d z d z dz z d
= (e ) = (e ) =e P (x)dx = ez P (x) (5.121)
dx dx dz dx dx

i.e., µ(x) has been defined in such a way that

1 dµ 1 dµ
P (x) = z
= . (5.122)
e dx µ dx

Thus, putting equation (5.122) into equation (5.119) we have

dy y dµ
+ = Q(x), (5.123)
dx µ dx

such that multiplication through by µ yields

dy dµ
µ +y = µ(x)Q(x). (5.124)
dx dx
The left-hand-side of this equation can be written as the derivative of µy, i.e,

d dy dµ
(µy) = µ +y = µ(x)Q(x), (5.125)
dx dx dx
where we used the product rule for differentiating.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


34 Section 5 : Ordinary Differential Equations

Now, the integral of the derivative of µy is simply µy, that is,


Z  
d
µ(x)y(x) = (µy) dx; (5.126)
dx

hence, integrating equation (5.125) we have


Z   Z
d
µ(x)y(x) = (µy) dx = µ(x)Q(x)dx. (5.127)
dx

Thus, dividing through by µ, the general solution to equation (5.119) is


Z
1 R
y(x) = µ(x)Q(x)dx, where µ(x) = e P (x)dx . (5.128)
µ(x)

Of course, any general solution to a first-order differential equation must include


an arbitrary constant; here the constant arises when evaluating the integral.

Definition 5.4 The general form of a first-order linear differential


equation is
dy
+ P (x)y = Q(x), (5.129)
dx
where P (x) and Q(x) are functions of x only. The general solution to
this equation is
Z
1 R
y(x) = µ(x)Q(x)dx, where µ(x) = e P (x)dx (5.130)
µ(x)

is a function known as the integrating factor for the equation.

Example 5.14 Determine the general solution to the first-order equation

dy
x + y = x sin (x). (5.131)
dx
Find the particular solution that satisfies the boundary condition y(π) = 2.

I Solution: Equation (5.131) can be written as

dy 1
+ P (x)y = Q(x), with P (x) = and Q(x) = sin(x), (5.132)
dx x
which is the general form of a first-order linear differential equation.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 35

According to Definition 5.4, the general solution to equation (5.132) is therefore


Z
1 R 1
y(x) = µ(x) sin(x)dx, where µ(x) = e ( x )dx (5.133)
µ(x)

is the integrating factor for the equation. Now


Z  
1
dx = loge x, (5.134)
x

so it follows that the integrating factor is


1
µ(x) = e ( x )dx = eloge (x) = x,
R
(5.135)

such that equation (5.133) may be written as


Z
1
y(x) = x sin(x)dx. (5.136)
x

To complete the solution we must evaluate the integral on the right-hand-side.


Integrating by parts we choose

dv du
u = x and = sin x, with = 1 and v = − cos x,
dx dx
(5.137)
since this gives
Z Z Z
dv du
x sin xdx = u dx = uv − v dx (5.138)
dx dx
Z
= −x cos x + cos xdx = −x cos x + sin x + c,

where c is an arbitrary constant. Thus, putting equation (5.138) into equation


(5.136) we obtain the general solution

sin x − x cos x + c
y(x) = , (5.139)
x
where c is an arbitrary constant.
For the solution to satisfy the boundary condition y(π) = 2 we require

sin(π) − π cos(π) + c π+c


y(π) = = = 2. i.e. c = π. (5.140)
π π
The particular solution to equation (5.131) that satisfies the boundary con-
dition y(π) = 2 is therefore y(x) = (sin x − x cos x + π)/x. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


36 Section 5 : Ordinary Differential Equations

Example 5.15 Determine the general solution to the first-order equation

dv
x + 2v = x cos (x3 ). (5.141)
dx

Find the particular solution that satisfies the boundary condition v(π 1/3 ) = 0.

I Solution: Equation (5.141) can be written as

dv 2
+ P (x)v = Q(x), with P (x) = and Q(x) = cos(x3 ), (5.142)
dx x
which is the general form of a first-order linear differential equation.

According to Definition 5.4, the general solution to equation (5.142) is therefore


Z
1 R 2
v(x) = µ(x) cos(x3 )dx, where µ(x) = e ( x )dx (5.143)
µ(x)

is the integrating factor for the equation. Since


Z  
2
dx = 2 loge x = loge (x2 ), (5.144)
x

it follows that the integrating factor is


2
µ(x) = e ( x )dx = eloge (x ) = x2 ,
R 2
(5.145)

such that equation (5.143) may be written as


Z
1
v(x) = 2 x2 cos(x3 )dx. (5.146)
x

To complete the solution we must evaluate the integral on the right-hand-side,


which may be done by substitution. In particular, if we define

du 1
u(x) = x3 , such that = 3x2 , i.e., du = x2 dx, (5.147)
dx 3
then we have
Z Z
2 3 1 1
x cos(x )dx = (cos u)du = sin(u) + c
3 3
1
= sin(x3 ) + c, (5.148)
3
where c is an arbitrary constant.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 37

Putting equation (5.148) into equation (5.146), therefore, we obtain the gen-
eral solution to equation (5.141)

sin(x3 ) + 3c
v(x) = , (5.149)
3x2
where c is an arbitrary constant.

For the solution to satisfy the boundary condition v(π 1/3 ) = 0 we require

sin(π) + 3c c
v(π 1/3 ) = 2/3
= 2/3 = 0, i.e., c = 0. (5.150)
3π π
Thus, selecting c = 0 in equation (5.149) we have

sin(x3 )
v(x) = . (5.151)
3x2
as the particular solution to equation (5.141) that satisfies the boundary
condition v(π 1/3 ) = 0. J

5.3.6 Change of variables

A differential equation given in terms of one dependent variable can often


be transformed into a differential equation in terms of another by making a
substitution. In this way it is sometimes possible to convert an equation that
is not easy to solve into one that can be solved using routine methods. This
procedure is known as making a change of variables,

In this section we illustrate this idea by considering equations of the form

dy
= h(y/x), (5.152)
dx
where h(y/x) is a function of (y/x), such as equation (5.160) below. In
particular, we shall show that equations of this kind can be transformed into
separable differential equations using the substitution

v = y/x, that is, y = vx. (5.153)

To see how this substitution works, observe by the product rule that

dy d dv
= (vx) = x + v. (5.154)
dx dx dx
Engineering Mathematics : ELE00038C J.J.B. 2023-2024
38 Section 5 : Ordinary Differential Equations

Hence, putting equations (5.153) and (5.154) into equation (5.152) we have

dv y
x + v = h(v), where v= . (5.155)
dx x
By separating the variables, and integrating we then obtain
Z Z
1 1
dv = dx, with y = vx. (5.156)
h(v) − v x

These integrals define a relationship between x and v, that can then be used
to deduce the general solution to the differential equation y(x) = vx.

Result 5.2 A differential equation of the form

dy
= h(y/x), (5.157)
dx
where h(y/x) is a function of (y/x), may be solved using the substitution

y dy dv
v= for which =x + v. (5.158)
x dx dx
Making a change of variables in this way yields a separable equation in v
and x that may be solved to obtain the general solution y(x) = xv(x).

Example 5.16 Determine the general solution to

dy x
x =y− . (5.159)
dx sin(y/x)

What is the particular solution that satisfies the boundary condition y(2) = π.

I Solution: Equation (5.16) may be written in the form

dy y 1
= h(y/x) where h(y/x) = − (5.160)
dx x sin(y/x)

is a function of (y/x). With reference to Result 5.2 we will attempt to solve


this equation using the substitution

dy dv
y = vx, for which =x + v. (5.161)
dx dx
Engineering Mathematics : ELE00038C J.J.B. 2023-2024
Section 5 : Ordinary Differential Equations 39

Making this substitution for dy/dx and y = vx in equation (5.160) we have

dv 1 dv 1
x +v =v− , i.e., x =− . (5.162)
dx sin v dx sin v
This equation is separable, as may be seen by writing

1
− sin vdv = dx (5.163)
x
Integrating this equation we find
Z Z
1
− sin vdv = dx ⇒ cos(v) = loge x + c, (5.164)
x

where c is an arbitrary constant. Thus, re-substituting for v = y/x, the general


solution to equation (5.159) is

cos(y/x) = loge x + c. (5.165)

For the solution to satisfy the boundary condition y(2) = π we require y = π


when x = 2, i.e.,

cos(π/2) = loge 2 + c that is, c = − loge 2. (5.166)

The particular solution to equation (5.159) that satisfies the boundary con-
dition y(2) = π is therefore

cos(y/x) = loge (x/2), (5.167)

where we used the fact that loge x − loge 2 = loge (x/2). J

Example 5.17 Determine the general solution to y 0 (x) = y/(x − y). What is
the particular solution that satisfies the boundary condition y(3) = 1?

I Solution: The differential equation of interest may be written as

dy (y/x)
= , (5.168)
dx 1 − (y/x)

where the right-hand-side is a function of (y/x). With reference to Result 5.2


we will attempt to solve this equation using the substitution

dy dv
y = vx, for which =x + v. (5.169)
dx dx
Engineering Mathematics : ELE00038C J.J.B. 2023-2024
40 Section 5 : Ordinary Differential Equations

Making this substitution for dy/dx and y = vx in equation (5.168) we have

dv v
x +v = , (5.170)
dx 1−v
which may be rearranged to give

v2
   
dv 1 1 1
x = , that is, − dv = dx. (5.171)
dx 1−v v2 v x

Hence, integrating up the separated equation we find


Z   Z  
1 1 1 1
− dv = dx ⇒ − − loge v + c = loge x, (5.172)
v2 v x v

where c is an arbitrary constant. Re-substituting for v = y/x then yields the


general solution
x x
− − (loge y − loge x) + c = loge x, i.e., + loge y = c. (5.173)
y y

For the solution to satisfy y(3) = 1 we require y = 1 when x = 3, that is,

3 + loge 1 = c ⇒ c = 3. (5.174)

Thus, setting c = 3 in the general solution (5.173), we have


x
+ loge y = 3 (5.175)
y

as the particular solution that satisfies the boundary condition y(3) = 1. J


r  r 
dy y y
Example 5.18 Determine the general solution to = 1+ .
dx x x
I Solution: With reference to Result 5.2 we will attempt to solve this equation
using the substitution y = vx. Making this substitution our equation becomes
Z Z
dv 1/2 −1/2 1
x + v = v + v, ⇒ v dv = dx, (5.176)
dx x

that is, v = 12 loge x + c, where c is an arbitrary constant. Thence, re-
substituting for v = y/x we obtain the general solution
√ √ 1
y= x( 2 loge x + c), (5.177)

where c is an arbitrary constant. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 41

5.3.7 Bernoulli’s differential equation

The Bernoulli differential equation (or Bernoulli’s equation) is a special kind of


non-linear first-order equation of the form

dy
+ p(x)y = q(x)y n , (5.178)
dx
where p(x) and q(x) are functions of x only, and n is a constant.

If n = 0, then the Bernoulli equation is a first-order linear equation, and may


be solved using the methods in §5.3.5. If n = 1, then the Bernoulli equation
is a separable equation, and may be solved using the methods in §5.3.1.

Otherwise, if n 6= 0, 1, then the Bernoulli equation can be transformed into a


first-order linear differential equation by the making the substitution

v = y (1−n) , where n 6= 0, 1. (5.179)

To see how this substitution works, observe by the chain rule that

dv d  (1−n)  d  (1−n)  dy dy
= y = y = (1 − n)y −n , (5.180)
dx dx dy dx dx

that is,
dy y n dv
= . (5.181)
dx (1 − n) dx
Putting this expression into equation (5.178) we have

y n dv
+ p(x)y = q(x)y n , (5.182)
(1 − n) dx

Hence, dividing by y n , and substituting v = y (1−n) , we obtain

1 dv dv
+ p(x)y (1−n) = q(x), i.e., + P (x)v = Q(x), (5.183)
(1 − n) dx dx

where we have defined P (x) and Q(x) by

P (x) ≡ (1 − n)p(x) and Q(x) ≡ (1 − n)q(x). (5.184)

Equation (5.183) is a first-order linear differential equation in v, and may there-


fore be solved for v(x) according to Definition 5.4. Once v(x) is found, the
general solution for y(x) is obtained by re-substitution with y(x) = v 1/(1−n) .

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


42 Section 5 : Ordinary Differential Equations

Definition 5.5 The Bernoulli differential equation is a non-linear first-


order differential equation of the form

dy
+ p(x)y = q(x)y n , (5.185)
dx
where p(x) and q(x) are functions of x only, and n is a constant. If n 6= 0, 1,
then this equation may be transformed into a first-order linear differential
equation in v(x) by making the substitution

dy y n dv
v = y (1−n) for which = . (5.186)
dx (1 − n) dx

The general solution y(x) to equation (5.185) is then

y(x) = v 1/(1−n) , (5.187)

where v(x) is may be found using the method described in Definition 5.4.

Example 5.19 Determine the general solution to the first-order Bernoulli equa-
tion define by  
dy 1
− y = 3xy 2 . (5.188)
dx x
What is the particular solution that satisfies the boundary condition y(2) = 1?

I Solution: Observe according to Definition 5.5 that equation (5.188) is of


Bernouilli type with n = 2. We therefore try the substitution

v = y (1−2) = y −1 (5.189)

for which the chain rule gives

dv d  −1  1 dy dy dv 1 dv
= y =− 2 , ⇒ = −y 2 = − 2 . (5.190)
dx dx y dx dx dx v dx

Thus, substituting equations (5.189) and (5.190) into equation (5.188) we find
 
1 dv 1 1 1
− 2 − = 3x 2 . (5.191)
v dx x v v

After multiplying through by −v 2 , this equation may be written in the general

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 43

form of a first-order linear differential equation, viz.

dv 1
+ P (x)v = Q(x), with P (x) = and Q(x) = −3x. (5.192)
dx x
According to Definition 5.4, the general solution to this equation is
Z
1 R
v(x) = µ(x)Q(x)dx, where µ(x) = e P (x)dx (5.193)
µ(x)

is the integrating factor. Evaluating µ(x) we have


1
R R
P (x)dx dx
µ(x) = e =e x = eloge x = x. (5.194)

Hence, the general solution for v(x) is

c − x3
Z Z
1 1
v(x) = µ(x)Q(x)dx = −3x2 dx = , (5.195)
µ(x) x x

where c is an arbitrary constant. Since v = y −1 , it follows that the general


solution to the Bernoulli equation (5.188) is

1 x
y(x) = = . (5.196)
v(x) c − x3

For this solution to satisfy the boundary condition y(2) = 1 we therefore require

2 2
y(2) = 3
= =1 ⇔ c = 10. (5.197)
c−2 c−8
Hence, selecting c = 10, the particular solution to the Bernoulli equation
(5.188) that satisfies the boundary condition y(2) = 1 is
x
y(x) = . (5.198)
10 − x3
Note: We check this solution by differentiating, viz.

3x3
 
dy d x 1
= = + . (5.199)
dx dx 10 − x3 10 − x3 (10 − x3 )2

Since y(x) = x/(10 − x3 ), this equation may be written as


 
dy y 2 dy 1
= + 3xy that is, − y = 3xy 2 , (5.200)
dx x dx x

which is our original Bernoulli equation (5.188) as required. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


44 Section 5 : Ordinary Differential Equations

5.4 Second-Order Linear Differential Equations

We now consider a very important class of equation known as a second-order


linear differential equation with constant coefficients. The general form
of such an equation is

d2 y dy
a2 + a 1 + a0 y = φ(x), (5.201)
dx2 dx
where the coefficients a0 , a1 , . . . , an are constants, and φ(x) is a function of x
only (cf. first-order linear equations in §5.3.3). Such an equation is said to be
homogeneous if φ(x) = 0; otherwise it is said to be inhomogeneous.

Second-order differentials are ubiquitous in science and engineering because


they describe oscillating systems, and vibrations. For example, the mass-spring
oscillator equation of §5.1.3, that is,

d2 x dx
2
+ 2γ0 + ω02 x = 0, (5.202)
dt dt
is a homogenous second-order linear differential equation with constant coeffi-
cients a0 = ω02 , a1 = 2γ0 , and a0 = 1.

Similarly, the equation for a damped oscillator driven by a force F (t), that is

d2 x dx F (t)
2
+ 2γ0 + ω02 x = , (5.203)
dt dt m
where m is a constant, is an inhomogeneous second-order equation with con-
stant coefficients a0 = ω02 , a1 = 2γ0 , and a0 = 1.

Definition 5.6 The general form of second-order linear differential equa-


tion with constant coefficients is

d2 y dy
a2 + a 1 + a0 y = φ(x), (5.204)
dx2 dx
where the coefficients a0 , a1 and a2 are constants, and φ(x) is a function
of x only. Such an equation is said to be homogeneous if φ(x) = 0;
otherwise it is said to be inhomogeneous.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 45

5.4.1 Homogeneous second-order linear equations

The homogeneous second-order linear differential equation with constant coef-


ficients is
d2 y dy
a2 2 + a1 + a0 y = 0. (5.205)
dx dx
It does not look easy to integrate this equation, so we shall look for solutions
by means of a trial function. Let us suppose as with the first-order equation
(see Result 5.1) that solutions take the form

y(x) = Ceλx , (5.206)

where λ and C are constants. We need to determine the values that these
constant must take for y(x) = Ceλx to satisfy equation (5.205).
When C = 0 the trial solution y = Ceλx clearly satisfies equation (5.205)
because the left-hand-side vanishes trivially. The solution y = 0 is called the
trivial solution.
For non-trivial solutions we need y = Ceλx to satisfy equation (5.205) with
C 6= 0, that is, we require

d2 λx
 d λx
 λx

a2 Ce +a 1 Ce +a 0 Ce = 0. (5.207)
dx2 | {z } dx | {z } | {z }
y y y

Upon evaluating the derivatives this equation becomes

a2 λ2 Ceλx + a1 λCeλx + a0 Ceλx = (a2 λ2 + a1 λ + a0 )Ceλx = 0. (5.208)

Since Ceλx 6= 0 for any value of x, we therefore require

(a2 λ2 + a1 λ + a0 ) = 0. (5.209)

This equation is called the auxiliary quadratic, and its roots are the values
that λ must take for y(x) = Ceλx to be a solution to equation (5.205). No
condition is placed on the value of C, meaning that C is an arbitrary constant.
Let us label the roots of the auxiliary quadratic λ1 and λ2 . Then it follows
that there is a solution for each root, say

y1 (x) = C1 eλ1 x , and y2 (x) = C2 eλ2 x , (5.210)

where C1 and C2 are arbitrary constants.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


46 Section 5 : Ordinary Differential Equations

Now observe that because y1 and y2 are both solutions to the differential
equation (5.205) we have

d2 y1 dy1
a2 2 + a1 + a0 y1 = 0 (5.211a)
dx dx
d2 y2 dy2
and a2 2 + a1 + a0 y2 = 0. (5.211b)
dx dx
Adding these equations together we obtain

d2 y dy
a2 2 + a1 + a0 y = 0, where y = y1 + y2 . (5.212)
dx dx
Hence, the linear combination

y(x) = y1 + y2 = C1 eλ1 x + C2 eλ2 x (5.213)

is also a solution to equation (5.205). This solution has different implications


depending on the nature of the roots λ1 and λ2 .
• If the auxiliary quadratic has distinct roots (λ1 6= λ2 ), then

y(x) = C1 eλ1 x + C2 eλ2 x (5.214)

is a solution to a second-order (order 2) equation containing two (2)


arbitrary constants C1 and C2 . It therefore follows by Definition 5.1 that
this solution is the general solution to equation (5.205).
• If the auxiliary quadratic has a double root λ = λ1 = λ2 , then the
solution in equation (5.213) is a disguised form of

y(x) = Ceλx , where C = C1 + C2 (5.215)

is a single arbitrary constant. Since this solution contains only one ar-
bitrary constant, it cannot be the general solution (see Definition 5.1).
Indeed, in this case it may be shown that the general solution is actually

y(x) = C1 xeλx + C0 eλx , (5.216)

where C1 and C0 are arbitrary constants (see §5.4.2).


The origins of these two kinds of general solution (5.215) and (5.216) are
considered rigorously in §5.4.2; here we shall simply assert that they provide
the following method for solving homogeneous second-order equations.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 47

Method 5.2 The general form of the homogeneous second-order linear


differential equation with constant coefficients is

d2 y dy
a2 2 + a1 + a0 y = 0, (5.217)
dx dx
where the coefficients a2 , a1 and a0 define an auxiliary quadratic

a2 λ2 + a1 λ + a0 = 0. (5.218)

After solving for the roots λ1 and λ2 of this quadratic, the general
solution y(x) to the second-order equation (5.217) is found as follows:

(i) If the auxiliary quadratic has distinct roots (λ1 6= λ2 ), then

y(x) = C1 eλ1 x + C2 eλ2 x , with λ1 6= λ2 , (5.219)

where C1 and C2 are arbitrary constants (see Result 5.3).

(ii) If the auxiliary quadratic has a double root (λ1 = λ2 ), then

y(x) = (C1 x + C0 )eλx , with λ = λ1 = λ2 , (5.220)

where C0 and C1 are arbitrary constants (see Result 5.3).

(iii) In the case of distinct complex conjugate roots λ± = σ ± ωj, with


real constants σ, ω ∈ R, equation (5.219) may be written equivalently as

y(x) = eσx A cos(ωx) + B sin(ωx) ,



(5.221)

where A and B are arbitrary constants (see Example 5.22).


Particular solutions may be found to match relevant boundary conditions.

Example 5.20 Find the general solution to the second-order equation

d2 y dy
2
−2 − 15y = 0. (5.222)
dx dx
Which solution satisfies the boundary conditions y(0) = 3 and y 0 (0) = −1?

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


48 Section 5 : Ordinary Differential Equations

I Solution: We proceed according to Method 5.2. Since the coefficients of


the differential equation are a2 = 1, a1 = −2, and a0 = −15, the auxiliary
quadratic a2 λ2 + a1 λ + a0 = 0 is

λ2 − 2λ − 15 = 0, that is (λ − 5)(λ + 3) = 0; (5.223)

the roots of the auxiliary quadratic are therefore λ1 = 5 and λ2 = −3. Because
these are distinct roots (λ1 6= λ2 ), we have by Method 5.2 that the general
solution to the homogeneous second order equation (5.222) is

y(x) = C1 eλ1 x + C2 eλ2 x = C1 e5x + C2 e−3x , (5.224)

where C1 and C2 are constants.


To determine the values that these constants must take to satisfy the boundary
conditions y(0) = 3 and y 0 (0) = −1 we proceed as follows. Substituting the
first of our boundary conditions into equation (5.224) we require

y(0) = C1 + C2 = 3. (5.225)

Differentiating equation (5.224) we find

d
y 0 (x) = C1 e5x + C2 e−3x = 5C1 e5x − 3C2 e−3x ,

(5.226)
dx
such that our second boundary condition gives

y 0 (0) = 5C1 − 3C2 = −1. (5.227)

Equations (5.225) and (5.227) can be solved simultaneously to obtain C1 = 1


and C2 = 2; putting these values into the general solution (5.224) gives

y(x) = e5x + 2e−3x (5.228)

as the particular solution satisfying y(0) = 3 and y 0 (0) = −1. J


Example 5.21 Determine the general solution to the homogeneous second
order equation

dx d2 x
ẍ(t) − 4ẋ(t) + 4x(t) = 0, where ẋ ≡ and ẍ ≡ 2 (5.229)
dt dt
is Newton’s notation for time-derivatives. Hence determine the particular so-
lution that satisfies the initial conditions x(0) = 0 and ẋ(0) = 2.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 49

I Solution: We proceed using Method 5.2. The coefficients of the differential


equation are a2 = 1, a1 = −4, and a0 = 4, so the auxiliary quadratic is

a2 λ2 + a1 λ + a0 = λ2 − 4λ + 4 = 0, that is (λ − 2)2 = 0, (5.230)

which yields a double root λ1 = λ2 = λ = 2. Hence, by Method 5.2, the


general solution to equation (5.229) is

x(t) = (C1 t + C0 )eλt = (C1 t + C0 )e2t , (5.231)

where C1 and C0 are arbitrary constants.

The constants C1 and C0 may be fixed to match our initial conditions x(0) = 0
and ẋ(0) = 2 as follows. Beginning with x(0) = 0 we obtain

x(0) = C0 = 0, (5.232)

such that equation (5.231) can be written

x(t) = C1 te2t . (5.233)

Differentiating this expression we have

d
C1 te2t = C1 e2t + 2C1 te2t ,

ẋ(t) = (5.234)
dt
such that our initial condition ẋ(0) = 2 gives

ẋ(0) = C1 = 2. (5.235)

Thus, with C0 = 0 and C1 = 2, the particular solution to equation (5.229)


that satisfies the initial conditions is x(t) = 2te2t . J

Example 5.22 Suppose that a second-order equation has general solution

y(x) = C+ eλ+ x + C− eλ− x , with λ± = σ ± jω, (5.236)

where C+ , C− , σ, and ω are constants, and σ, ω ∈ R (i.e., λ+ and λ− are


complex conjugates). Show that this solution may be written equivalently as

y(x) = eσx A cos(ωx) + B sin(ωx) ,



(5.237)

where A and B are arbitrary constants.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


50 Section 5 : Ordinary Differential Equations

I Solution: Because λ± = σ ± jω we may express equation (5.236) as

y(x) = C+ e(σ+jω)x + C− e(σ−jω)x = eσx C+ e+jωx + C− e−jωx .



(5.238)

Now, according to Euler’s formula ejθ = (cos θ + j sin θ) we may write

C+ e+jωx + C− e−jωx = C+ cos(ωx) + j sin(ωx)


 
(5.239)

+ C− cos(−ωx) + j sin(−ωx)

= C+ cos(ωx) + j sin(ωx)

+ C− cos(ωx) − j sin(ωx)
= (C+ + C− ) cos(ωx) + (C+ − C− )j sin(ωx).

Thus, by defining A = (C+ + C− ) and B = (C+ − C− )j we have

C+ e+jωx + C− e−jωx = A cos(ωx) + B sin(ωx),



(5.240)

which upon substitution into equation (5.238) yields

y(x) = eσx A cos(ωx) + B sin(ωx) .



(5.241)

Equations (5.236) and (5.237) are therefore equivalent. J

Example 5.23 Determine the general solution to the homogeneous second-


order differential equation y 00 (x) + 9y(x) = 0. What is the particular solution
that satisfies the boundary conditions y(0) = 2 and y( π2 ) = 1?

I Solution: The auxiliary quadratic associated with y 00 (x) + 9y(x) = 0 is

λ2 + 9 = 0, that is, λ± = ±3j. (5.242)

The roots of this quadratic are therefore complex conjugates λ± = σ ± jω,


with σ = 0, and ω = 3. Hence, by Method 5.2, the general solution is

y(x) = A cos(3x) + B sin(3x) . (5.243)

For this solution to satisfy the boundary conditions y(0) = 2 and y( π2 ) = 1 we


require
y(0) = A = 2 and y( π2 ) = −B = 1, (5.244)

i.e., A = 2 and B = −1. The particular solution that satisfies the boundary
conditions y(0) = 2 and y( π2 ) = 1 is thus y(x) = 2 cos(3x) − sin(3x) . J


Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 51

Example 5.24 An experiment is performed on a damped mass-spring system


whose displacement x(t) is described by the second-order differential equation

ẍ(t) + 2ẋ(t) + 17x(t) = 0, (5.245)

where ẋ ≡ dx/dt and ẍ ≡ d2 x/dt2 is Newton’s notation (cf. §5.1.3).


(a) Show that the general solution to this equation is

x(t) = e−t A cos(4t) + B sin(4t) ,



(5.246)

where A and B are arbitrary constants.


(b) Determine the particular solution x(t) that satisfies the boundary condi-
√ √
tions x(0) = 3 and ẋ(0) = (4 − 3). Sketch this solution.

I Solution: (a) The auxiliary quadratic associated with equation (5.245) is

λ2 + 2λ + 17 = 0. (5.247)

The roots of this equation are a complex conjugate pair, viz.



−2 ± 22 − 4 × 1 × 17
λ± = = −1 ± 4j. (5.248)
2×1

Hence, by Method 5.2, the general solution to equation (5.245) is

x(t) = e−t A cos(4t) + B sin(4t) ,



(5.249)

where A and B are arbitrary constants.


(b) To determine the particular solution we need to fix values for A and B that
√ √
satisfy the boundary conditions x(0) = 3 and ẋ(0) = (4 − 3).
By equation (5.249), the first of these boundary conditions gives

x(0) = e−0 A cos(0) + B sin(0) = A = 3.

(5.250)

To use our boundary condition ẋ(0) = (4 − 3) we need to know the form of
ẋ(t); by differentiating equation (5.249) we find that this is

dx d −t 
ẋ(t) = = e [A cos(4t) + B sin(4t)]
dt dt
= e [−4A sin(4t) + 4B cos(4t)] − e−t [A cos(4t) + B sin(4t)]
−t

= −4e−t [A sin(4t) − B cos(4t)] − x(t). (5.251)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


52 Section 5 : Ordinary Differential Equations
√ √
Thus, by our boundary conditions x(0) = 3 and ẋ(0) = (4 − 3) , we have
√ √
ẋ(0) = 4B − x(0) = 4B − 3 = (4 − 3), i.e., B = 1. (5.252)

Hence, putting A = 3, and B = 1 into the general solution (5.249), the
particular solution that satisfies the boundary conditions is

x(t) = e−t

3 cos(4t) + sin(4t) . (5.253)

Here the trigonometric functions describe time-dependent oscillations, while the


common factor of e−t means that the amplitude of these oscillations decays
exponentially. Such solutions are called damped oscillations (see figure 5.7).

Comments: Notice that the compound angle formulae gives

cos (4t − π/6) = cos(4t) cos(π/6) + sin(4t) sin(π/6) (5.254)



3 1 
= cos(4t) + sin(4t) ,
2 2
that is,
√ 
2 cos (4t − π/6) = 3 cos(4t) + sin(4t) . (5.255)

Thus, the particular solution (5.253) can be expressed in the form

x(t) = 2e−t cos (4t − π/6) . (5.256)

Expressing the solution in this way highlights the exponential envelope 2e−t
governing the attenuation of the oscillation amplitude (see figure 5.7). J

-1

-2
0 0.25 0.5 0.75 1

Figure 5.7: Damped oscillations of a mass on a spring as described by equation (5.256).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 53

5.4.2 Reduction of order (optional)

We now solve the homogeneous second-order linear differential equation

d2 y dy
a2 2 + a1 + a0 y = 0 (5.257)
dx dx

without appealing to the trial solution y(x) = Ceλx . To do this we proceed


using a method called reduction of order as follows.

In Example 5.25 it is shown that the roots λ1 and λ2 of the auxiliary quadratic

a2 λ2 + a1 λ + a0 = 0 (5.258)

are related to the coefficients of equation (5.257) according to


   
a1 a0
(λ1 + λ2 ) = − and λ1 λ2 = . (5.259)
a2 a2

Thus, after dividing through by a2 , we may write equation (5.257) as

d2 y dy
2
− (λ1 + λ2 ) + (λ1 λ2 )y = 0. (5.260)
dx dx
Here the left-hand-side may rearranged into a ‘factorised’ form, viz.
   
d dy dy
− λ2 y − λ1 − λ2 y = 0, (5.261)
dx dx dx

or equivalently

dQ dy
−λ1 Q = 0, where Q(x) is defined by −λ2 y = Q(x). (5.262)
dx dx
Equations (5.262) express the second-order equation (5.257) in terms of two
first-order equations; in particular, if y(x) satisfies the second of these equa-
tions, then y(x) satisfies equation (5.257). We have therefore reduced the or-
der of the problem: rather than try to solve the second-order equation (5.257)
directly, we will solve the first-order equations (5.262).

Beginning with the first of equations (5.262) we have

dQ
− λ1 Q = 0. (5.263)
dx
This is a homogeneous first-order linear differential equation, so its general

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


54 Section 5 : Ordinary Differential Equations

solution is given by
Q(x) = Ceλ1 x (5.264)

where C is an arbitrary constant (see Result 5.1). Putting this solution (5.264)
into the second of equations (5.262) we have

dy
+ P (x)y = Q(x) with P (x) = −λ2 and Q(x) = Ceλ1 x . (5.265)
dx
This is a first-order linear differential equation of the type considered in §5.3.5.
According to Definition 5.4, the general solution to this equation is
Z
1 R
y(x) = µ(x)Q(x)dx, where µ(x) = e P (x)dx (5.266)
µ(x)

is the integrating factor. Evaluating µ(x) we find


R
µ(x) = e− λ2 dx
= e−λ2 x ; (5.267)

hence, substituting for µ(x) and Q(x) in equation (5.266) we have the general
solution Z
y(x) = e λ2 x
Ce(λ1 −λ2 )x dx. (5.268)

Now if λ1 6= λ2 , then the integral in this equation gives the general solution
Z
y(x) = e λ2 x
Ce(λ1 −λ2 )x dx
 
λ2 x C (λ1 −λ2 )x
=e e + C2 ,
(λ1 − λ2 )
C
= eλ1 x + C2 eλ2 x
(λ1 − λ2 )
= C1 eλ1 x + C2 eλ2 x , (5.269)

where C1 = C/(λ1 − λ2 ) and C2 are arbitrary constants. Alternatively, if


λ1 = λ2 = λ, then the integral in equation (5.268) gives the general solution
Z
λx
y(x) = e Ce(λ−λ)x dx
Z
λx
=e Cdx

= eλx (Cx + C0 ), (5.270)

where C and C0 are arbitrary constants.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 55

Hence, summarising our results from equations (5.269) and (5.270), the gen-
eral solution to the homogeneous second-order linear equation (5.257) is

C eλ1 x + C eλ2 x if λ 6= λ
1 2 1 2
y(x) = , (5.271)
(C1 x + C0 )eλx if λ = λ1 = λ2

where C0 , C1 and C2 are arbitrary constants.

Result 5.3 The general form of the homogeneous second-order linear dif-
ferential equation with constant coefficients is

d2 y dy
a2 2 + a1 + a0 y = 0, (5.272)
dx dx
where the coefficients a2 , a1 and a0 define an auxiliary quadratic

a2 λ2 + a1 λ + a0 = 0. (5.273)

By denoting the roots of this quadratic as λ1 and λ2 , the general solution


to equation (5.272) is given by

C eλ1 x + C eλ2 x if λ 6= λ
1 2 1 2
y(x) = , (5.274)
(C1 x + C0 )eλx if λ1 = λ2 = λ

where C0 , C1 and C2 are arbitrary constants.

Example 5.25 Show that if λ1 and λ2 are the roots of the auxiliary quadratic
a2 λ2 + a1 λ + a0 = 0, then (λ1 + λ2 ) = − (a1 /a2 ) and λ1 λ2 = (a0 /a2 ).

I Solution: Dividing a2 λ2 + a1 λ + a0 = 0 through by a2 we have

λ2 + (a1 /a0 ) λ + (a0 /a2 ) = 0. (5.275)

If λ1 and λ2 are the roots of this quadratic, then it may be factorised as

(λ − λ1 )(λ − λ1 ) = 0, that is, λ2 − (λ1 + λ2 ) + λ1 λ2 = 0. (5.276)

Thus, comparing each of the terms in equations (5.275) and (5.276), we have
that (λ1 + λ2 ) = − (a1 /a2 ) and λ1 λ2 = (a0 /a2 ) as required. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


56 Section 5 : Ordinary Differential Equations

5.4.3 Inhomogeneous second-order linear equations

The general form of the inhomogeneous second-order linear differential equa-


tion with constant coefficients a0 , a1 and a2 is

d2 y dy
a2 2
+ a1 + a0 y = φ(x), (5.277)
dx dx
where φ(x) 6= 0. We now explore how to solve equations of this kind using the
method employed for first-order inhomogeneous equations in §5.3.3.
As with first-order inhomogeneous equations, we begin by asserting that the
general solution to equation (5.277) is

y(x) = yc (x) + yp (x), (5.278)

where yc (x) is the complementary function, and yp (x) is the particular in-
tegral. For second-order equations, these two functions are defined as follows:

• The complementary function yc (x) is the solution to the homogeneous


equation
d2 yc dy
a2 2 + a1 + a0 y = 0. (5.279)
dx dx
In this way the complementary function may be found using Method 5.2.

• The particular integral yp (x) is a solution to equation (5.277), i.e.,

d2 y p dyp
a2 2
+ a1 + a0 yp = φ(x), (5.280)
dx dx
that does not contain any arbitrary constants. The particular integral
may be found using the method of undetermined coefficients.

To demonstrate that the function y(x) = yc (x) + yp (x) is indeed a solution to


equation (5.277), we note that

d2 y dy d2 d
a2 2
+ a1 + a0 y = a2 2 (yc + yp ) + a1 (yc + yp ) + a0 (yc + yp ) (5.281)
dx dx dx dx
d2 yc dyc d2 yp dyp
= a2 2 + a1 + a0 yc + a2 2 + a1 + a0 yp = φ(x)
| dx {z dx } | dx {z dx }
=0 =φ(x)

as required. That y = yc + yp is the general solution follows from the fact that
it is the solution to a second-order differential equation (an equation of order
2) containing two (i.e., 2) arbitrary constants (see Definition 5.1).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 57

In summary, then, the outline method for solving inhomogeneous second-order


differential equations is essentially identical to the outline method that we used
for solving inhomogeneous first-order equations (Method 5.1).

Method 5.3 The general solution y(x) to an inhomogeneous second-order


differential equation of the form

d2 y dy
a2 2
+ a1 + a0 y = φ(x) (5.282)
dx dx
may be determined by the following steps:

(1) Find the complementary function yc (x) by solving

d2 yc dyc
a2 2
+ a1 + a0 yc = 0, (5.283)
dx dx
i.e., by following Method 5.2.

(2) Find the particular integral yp (x) by solving

d2 y p dyp
a2 2
+ a1 + a0 yp = φ(x), (5.284)
dx dx
e.g., by the method of undetermined coefficients, see §5.3.4.

(3) The general solution to equation (5.282) is then

y(x) = yc (x) + yp (x). (5.285)

Particular solutions may be found to match relevant boundary conditions.

Finding particular integrals by the method of undetermined coefficients


works the same for second-order equations as for first-order equations (see
§5.3.4). Suitable trial functions are restated for ease of reference in table 5.2.
Example 5.26 Determine the general solution to the second order equation

d2 y dy
2
−2 − 15y = 30x2 − 7x. (5.286)
dx dx
[Hint: You may wish to refer to Example 5.20.]

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


58 Section 5 : Ordinary Differential Equations

Form of inhomogeneity φ(x) Trial for particular integral yp (x)

c0 k0

c1 x + c0 (c0 can be zero) k1 x + k0

c2 x2 + c1 x + c0 (c1 and c0 can be zero) k2 x2 + k1 x + k0

an nth-degree polynomial an nth-degree polynomial

A cos(ωx) + B sin(ωx) (A or B can be zero) a cos(ωx) + b sin(ωx)

c0 eγx k0 eγx

linear combination of the above corresponding combination of above

product of the above corresponding product of above

Table 5.2: Restatement of the trial functions listed in table 5.1. Note: If any term in the
proposed trial form for yp (x) is already present in the complementary function yc (x), then
multiply yp (x) by xm , where m is the lowest integer power such that no coincidence occurs.

I Solution: We adopt the three step process outlined in Method 5.3.

◦ Step (1): The complementary function yc (x) is found by solving

d2 yc dyc
2
−2 − 15yc = 0. (5.287)
dx dx
This equation is identical to the homogeneous equation of Example 5.20, so
we can use the solution (5.224) found therein, i.e.,

yc (x) = C1 e5x + C2 e−3x , where C1 and C2 are constants. (5.288)

◦ Step (2): The particular integral yp (x) may be found by solving

d2 y p dyp
2
−2 − 15yp = φ(x), where φ(x) = 30x2 − 7x. (5.289)
dx dx
We shall solve this equation using the method of undetermined coefficients.

Because φ(x) = 30x2 − 7x is a quadratic, we shall use a trial solution that is


also a quadratic, i.e.,
yp (x) = k2 x2 + k1 x + k0 , (5.290)

where k2 , k1 , and k0 are coefficients to be determined (see table 5.2).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 59

Substituting this trial solution for yp (x) into equation (5.289) we require

d2  2  d  2 
k 2 x + k1 x + k0 − 2 k2 x + k1 x + k0 (5.291)
dx2 dx
− 15 k2 x + k1 x + k0 = 30x2 − 7x,
 2 

that is,

− 15k2 x2 − (4k2 + 15k1 )x + (2k2 − 2k1 − 15k0 ) = 30x2 − 7x. (5.292)

Hence, by comparing coefficients in powers of x, it follows that

−15k2 = 30, −(4k2 +15k1 ) = −7, and (2k2 −2k1 −15k0 ) = 0. (5.293)

These equations can be solved simultaneously for k0 , k1 , and k0 to give

k0 = − 52 , k1 = 1 k2 = −2, (5.294)

meaning that the particular integral is

yp (x) = k2 x2 + k1 x + k0 = −2x2 + x − 52 . (5.295)

◦ Step (3): With reference to equations (5.288) and (5.295), the general
solution to equation (5.286) is

y(x) = yc (x) + yp (x) = C1 e5x + C2 e−3x − 2x2 + x − 25 , (5.296)

where C1 and C2 are arbitrary constants. J

Example 5.27 Determine the general solution to the inhomogeneous second-


order differential equation

y 00 (x) + 9y(x) = 16 cos x − 8 sin x. (5.297)

What is the particular solution that satisfies y(0) = 2 and y( π2 ) = 1?

I Solution: We adopt the three step process outlined in Method 5.3.


◦ Step (1): The complementary function yc (x) is found by solving

yc00 (x) + 9yc (x) = 0. (5.298)

This equation is identical to the homogeneous differential equation of Example

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


60 Section 5 : Ordinary Differential Equations

5.23, so we can use the solution (5.243) found therein, i.e.,

yc (x) = A cos(3x)+B sin(3x), with A and B arbitrary constants. (5.299)

◦ Step (2): The particular integral yp (x) may be found by solving

yp00 (x) + 9yp (x) = φ(x), where φ(x) = 16 cos x − 8 sin x. (5.300)

We shall solve this equation using the method of undetermined coefficients.


Because φ(x) = 16 cos x − 8 sin x is a trigonometric function, we shall use a
trial solution that is also a trigonometric function, i.e.,

yp (x) = a cos x + b sin x, (5.301)

where a and b are coefficients to be determined (see table 5.2).


Substituting this trial solution for yp (x) into equation (5.300) we require

d2
[a cos x + b sin x] + 9 [a cos x + b sin x] = 16 cos x − 8 sin x, (5.302)
dx2
that is,

8a cos x+8b sin x = 16 cos x−8 sin x ⇒ a = 2 and b = −1. (5.303)

Using these values for a and b, the particular integral (5.301) is

yp (x) = 2 cos x − sin x. (5.304)

◦ Step (3): The general solution to equation (5.286) is therefore

y(x) = yc (x) + yp (x) = A cos(3x) + B sin(3x) + 2 cos x − sin x. (5.305)

For this solution to satisfy y(0) = 2 and y( π2 ) = 1 we require

y(0) = A + 2 = 2 and y( π2 ) = −B − 1 = 1, (5.306)

that is, A = 0 and B = −2. Thus, selecting A = 0 and B = −2 in equation


(5.305), we have

y(x) = 2 cos x − sin x − 2 sin(3x). (5.307)

as the particular solution that satisfies y(0) = 2 and y( π2 ) = 1. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 61

Note: As with inhomogeneous first-order linear equations care must be taken


if the proposed form for the trial solution yp (x) contains terms that already
exist in the complementary function yc (x) (see table 5.2).

Example 5.28 Find the general solution to the second order equation

d2 x dx
2
−4 + 4x = 6e2t . (5.308)
dt dt
Hence determine the particular solution that satisfies the boundary conditions
x(0) = −4 and x(1) = e2 . [You may wish to refer to Example 5.21.]

I Solution: As before, we adopt the three step process outlined in Method 5.3.

◦ Step (1): The complementary function xc (t) is found by solving

d 2 xc dxc
2
−4 + 4xc = 0. (5.309)
dt dt
This equation is identical to the homogeneous differential equation of Example
5.21, so we can use the solution (5.231) found therein, i.e.,

xc (t) = (C1 t + C0 )e2t , with arbitrary constants C1 and C0 . (5.310)

◦ Step (2): The particular integral xp (t) is found by solving

d2 xp dxp
2
−4 + 4xp = φ(t), where φ(x) = 6e2t . (5.311)
dt dt
We shall solve this equation using the method of undetermined coefficients.

Because φ(x) = 6e2t is exponential, first inspection of table 5.2 suggests that
we should use a trial function of the form xp (t) = ke2t , where k is a coefficient
to be determined. Notice, however, that the complementary function xc (t)
already includes terms in e2t and te2t , so xp (t) = ke2t is unsuitable.

To avoid coincidental terms between xp (t) and xc (t) we multiply xp (x) = ke2t
by t2 (the lowest power of t such that no coincidence occurs); we therefore try

xp (t) = kt2 e2t . (5.312)

Substituting this trial function into equation (5.311) we require

d2  2 2t  d  2 2t   2 2t 
kt e − 4 kt e + 4 kt e = 6e2t , (5.313)
dt2 dt
Engineering Mathematics : ELE00038C J.J.B. 2023-2024
62 Section 5 : Ordinary Differential Equations

whereupon evaluating the derivatives we have

(4kt2 + 8kt + 2k)e2t − 4(2kt2 + 2kt)e2t + 4kt2 e2t = 2ke2t = 6e2t , (5.314)

i.e., k = 3. Thus, the particular integral is

xp (t) = 3t2 e2t . (5.315)

◦ Step (3): Combining equations (5.310) and (5.315), the general solution
to equation (5.308) is thus

x(t) = xc (t) + xp (t) = (3t2 + C1 t + C0 )e2t . (5.316)

For this solution to satisfy the boundary conditions x(0) = −4 and x(1) = e2
we require

x(0) = C0 = −4, and x(1) = (3 + C1 + C0 )e2 = e2 . (5.317)

These equations may be solved simultaneously to give

C0 = −4, and C1 = 2. (5.318)

Hence, selecting C0 = −4 and C1 = 2 in equation (5.316), we have

x(t) = (3t2 + 2t − 4)e2t (5.319)

as the particular solution that satisfies x(0) = −4 and x(1) = e2 . J

5.5 Transient Solutions and Steady-State Solutions

The solutions to linear differential equations involving time t dependence are


typically made up of two parts:

• A part that vanishes (tends towards zero) as t → ∞; this part of the


solution is called the transient solution.

• A part that remains finite (does not vanish ) as t → ∞; this part of


the solution is called the steady-state solution.

In most practical solutions of interest, the transient solution is the complemen-


tary function, and the steady-state solution is the particular integral.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 5 : Ordinary Differential Equations 63

To illustrate this idea, consider the capacitor charging problem of §5.1.2. We


found earlier that the charge Q(t) on the capacitor at time t is modelled by
   
dQ 1 1
+ Q= Q∞ , where τ and Q∞ are constants, (5.320)
dt τ τ

and the capacitor is initially uncharged with Q(0) = 0. In Example 5.11 we


showed that the solution to this equations is the sum of the complementary
function Qc (t) = −Q∞ e−t/τ and particular integral Qp (t) = Q∞ , that is,

Q(t) = −Q∞ e−t/τ + Q∞ . (5.321)


| {z } |{z}
complementary function Qc (t) particular integral Qp (t)

Because τ is positive, the complementary function vanishes as t → ∞, i.e.,

lim Qc (t) = lim −Q∞ e−t/τ = 0;


 
(5.322)
t→∞ t→∞

this means that Qc (t) is the transient solution. The particular integral,
however, does not vanish; this means that Qp (t) is the steady state solution.

An alternative way of labelling the terms in equation (5.321) is therefore

Q(t) = −Q∞ e−t/τ + Q∞ . (5.323)


| {z } |{z}
transient solution steady-state solution

As necessary, Q(t) converges on the steady-state solution (Q → Q∞ ) in the


limit that t → ∞. This behaviour is depicted graphically in figure 5.8.

0.5

-0.5

-1

0 1 2 3 4 5

Figure 5.8: Transient and steady-state solutions to the capacitor charging problem.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


64 Section 5 : Ordinary Differential Equations

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 Engineering Mathematics
J. J. Bissell

Vectors and Vector Algebra

A large number of physical quantities may specified completely by their mag-


nitude in combination with their relevant units: for example, time t; charge
Q; temperature T ; mass m; and energy E. We call such quantities scalars.
However, there are many other quantities that are specified completely only
when both their magnitude and direction are given. For example, if we wish
to know the effect of applying a force F to a mass m, then we need to know
both the magnitude of the force, and the direction in which the force acts.
Quantities that require both magnitude and direction to be specified completely
are known as vectors, and force F is one example. Others include: velocity v,
acceleration a, and momentum p; electric field E; and magnetic flux density
B. The ubiquity of vector quantities motivates a mathematical treatment of
vectors more generally, one which will provide powerful methods for solving
problems in engineering and the physical sciences. In this section we introduce
vectors, and their algebra; by the end of the section you should be able to. . .
Learning outcomes:
◦ Define the difference between scalar and vector quantities.
◦ Add and subtract vectors, and multiply vectors by scalars.
◦ Express vectors in components form using the Cartesian basis {i, j, k}.
◦ Determine the magnitude of a vector a, and define its unit vector â.
◦ Compute the scalar product a · b (or ‘dot product’) of two vectors a and b.
◦ Use the scalar product to determine the angle θ between two vectors.
◦ Determine the vector projection bk of a vector b onto a vector a.
◦ Compute the vector product a × b (or ‘cross product’) of two vectors.
◦ Apply vectors to solving geometric problems involving lines and planes.
These learning outcomes must be reinforced by completing course exercises.

65
66 Section 6 : Vectors and Vector Algebra

6.1 Vector Notation

We have already commented on the difference between scalars and vectors:


scalars being quantities that are specified completely by their magnitude; while
vectors carry information about both a quantity’s magnitude and direction.
The physical motivation for vectors is well illustrated by Newton’s Second Law
relating the acceleration a of a mass m due to an applied force F, that is,

F = ma. (6.1)

Here the inertial mass m is a scalar quantity having magnitude only; however,
typically we are interested in both the magnitude and direction of the mass’s
acceleration, so we need to know both how large the force is, and the direc-
tion in which it acts. Since direction and magnitude are both essential for
determining resulting motion, force F and acceleration a are vector quantities.
In equation (6.1) force F and acceleration a have been denoted using ‘bold-
type’, and we adopt this convention for vectors throughout. In written work,
however, it is customary to denote vectors by either underlining, or overlining
with arrows; for example, given an arbitrary vector v, we can use the notations

v≡v≡→

v. (6.2)

It is often convenient to depict vectors diagrammatically as arrows, such that


the length of the arrow corresponds to the vector’s magnitude, while the arrow
head indicates directionality. Thus, in a vector diagram the vectors v and
−v are drawn using arrows of the same length, but which point in opposite
directions (see figure 6.1). Notice that two vectors are equal if and only if they
have the same magnitude and point in the same direction.
A vector that is used to specify the distance and direction of a point from some
fixed origin O is called a position vector. For example, figure 6.2 shows two
points A and B whose locations are specified by position vectors a and b: each
vector begins at the origin O, and ends at the respective point.

Figure 6.1: Two vectors v and −v depicted using arrows.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 67

Figure 6.2: Position vectors a and b, a displacement vector c, and an arbitrary path P.

Similarly, a vector which describes the relative displacement from one point to
another is known as a displacement vector. The two points A and B in figure
6.2 are related by the displacement c. A displacement vector from one point
to another is sometimes denoted using an ‘over-arrow’, e.g., the displacement
vectors from (i) A to B, and (ii) B to A can be denoted
−→ −→
(i) AB = c and (ii) BA = −c. (6.3)

In summary, therefore, we have the following definitions:

Definition 6.1 Vectors which describe magnitudes and directions in space


can be categorised into two kinds:

• The position vector of a given point A describes the shortest dis-


tance and direction of A from some fixed origin O.

• The displacement vector from a given point A to another point B


describes the shortest distance and direction from A to B.

Note: If two different pairs of points, say A1 and B1 , and A2 and B2 ,


−−−→ −−−→
have the same relative displacement, then A1 B1 = A2 B2 .

6.2 Vector Algebra

The algebra of vectors is similar to that of scalars, but distinct in certain impor-
tant ways. In the following subsections we discuss the addition and subtraction
of vectors (§6.2.1), and the meaning of multiplying a vector by a scalar (§6.2.2);
we also introduce the idea of the unit vector (§6.2.3).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


68 Section 6 : Vectors and Vector Algebra

6.2.1 Addition and subtraction

If we apply first one displacement vector, and followed by another, then we


can think of the combined effect as a resultant vector (cf. figure 6.3). In so
doing we perform vector addition, which naturally applies to contexts other
than displacements; e.g., the vector sum of forces on a body gives us the total
or resultant force on the body.
Vector addition is said to be commutative, i.e., the order of adding two vectors
a and b is not important (see figure 6.3), viz.

a + b = b + a. (6.4)

Vector addition is also associative, i.e., given a third vector c we have

a + (b + c) = (a + b) + c. (6.5)

Subtraction of vectors operates in a similar fashion to addition, such that

a − b = a + (−b), (6.6)

where −b has the same magnitude as b, but points in the opposite direction.
These properties of vector addition and subtraction are depicted in figure 6.4.
Example 6.1 Figure 6.2 depicts two points A and B with position vectors a
−→ −→
and b; express the vectors AB = c and BA = −c in terms of a and b.
−→ −→
I Solution: The vectors AB = c and BA = −c may be written as

c = −a + b = b − a and − c = −(b − a) = a − b; (6.7)

this may be seen by ‘following’ the directions of the vectors in figure 6.2. J

Figure 6.3: Commutativity of vector addition a + b = b + a.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 69

Figure 6.4: Vector subtraction (a−b), and additive associativity (a+b)+c = a+(b+c).

Note that the subtraction of two equal vectors yields a vector of zero magnitude
called the zero vector, viz.
a − a = 0. (6.8)

The zero-vector 0 is a convenient concept for handling vector quantities, e.g.,


if the net force F on a system has zero magnitude, then we write F = 0.

6.2.2 Scalar multiplication

The magnitude of a vector a is denoted |a| and refers to the vector’s absolute
size (or length), irrespective of direction; for example, given some force vector
F, the magnitude |F| is the size of the force. We also sometimes denote vector
magnitude using plain-type, e.g., we can denote the magnitude of a as

a ≡ |a|. (6.9)

The effect of multiplying a vector a by a scalar λ is to produce a new vector


λa of magnitude |λa| = λa; this vector points in the same direction as a if
λ > 0, and in the direction of −a if λ < 0 (see figure 6.5).

Given two vectors a and b, and two scalars λ and µ, scalar multiplication
satisfies the following properties

λ(µa) = µ(λa), (6.10a)


λ(a + b) = λa + λb, (6.10b)
and (λ + µ)a = λa + µa. (6.10c)

Note that multiplication of a vector by zero yields the zero vector, i.e., 0a = 0.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


70 Section 6 : Vectors and Vector Algebra

Figure 6.5: Multiplication of a vector a by the scalar − 21 produces a vector of magnitude


| − 12 a| = 12 a pointing in the opposite direction to a. A vector â that points in the same
direction as a, but which has magnitude unity, i.e., |â| = 1, is called a unit vector of a.

6.2.3 Unit vectors

Division of a vector a by its own magnitude yields a vector â of magnitude


unity (i.e., 1) that is co-directional to a; we call this vector the unit vector:

Definition 6.2 Let a be a non-zero vector (|a| 6= 0). Then the unit
vector â that points in the same direction as a is defined by

a |a|
â ≡ , where |â| = = 1. (6.11)
|a| |a|

Any non-zero vector can therefore be written in the form a = |a|â, that is,
with its magnitude |a| and direction â separated explicitly (see figure 6.5).

Example 6.2 Let a and b be two vectors that point in opposite directions,
where a has twice the magnitude of b. Write down: (i) the vector a in terms
of b; and (ii) the unit vector of a in terms of the unit vector of b.

I Solution: (i) Since a is twice the magnitude of b, but points in the opposite
direction, we have a = −2b. (ii) By definition, the unit vectors â and b̂ have
magnitude |â| = |b̂| = 1, they are simply antiparallel, i.e., â = −b̂. J
Example 6.3 Let the points A, B, and P have position vectors a, b, and p,
where P is a point that divides AB in the ratio λ : µ, as shown in figure 6.6.
−→
(a) Let c = AB be the vector from A to B; express c in terms of a and b.
−→
(b) Let d = AP be the vector from A to P ; show that d = (|d|/|c|)c.
(c) Determine the ratio |d|/|c|. Hence express d in terms of c, λ, and µ.
(d) Hence demonstrate that
   
µ λ
p= a+ b. (6.12)
λ+µ λ+µ

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 71

Figure 6.6: Point P dividing the line joining A and B in the ratio λ : µ.

I Solution: We consider each part of the solution in turn.

(a) To get to B from A we travel from A to the origin O, and then from the
origin O to B, i.e.,
−→
c = AB = −a + b = (b − a). (6.13)
−→
(b) By the sketch we have that d = AP points in the same direction as
−→
c = AB; this means that the unit vectors d̂ and ĉ are identical, viz.

d c |d|
= d̂ = ĉ = , that is, d= c. (6.14)
|d| |c| |c|

(c) Since P divides AB in the ratio λ : µ, the ratio of the magnitudes of d


and c is given by  
|d| λ
= (6.15)
|c| λ+µ
Hence, combining equations (6.14) and (6.15) we obtain
 
−→ λ
AP = d = c. (6.16)
λ+µ

(d) With reference to the sketch, it follows from equation (6.16) that
   
−→ λ λ
p = a + AP = a + c=a+ (b − a)
λ+µ λ+µ
   
λ λ
= 1− a+ b
λ+µ λ+µ
   
µ λ
= a+ b (6.17)
λ+µ λ+µ

as required, where we used the fact that c = (a − b). J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


72 Section 6 : Vectors and Vector Algebra

6.3 Basis Vectors

In section §6.2.3 we introduced the unit vector as a vector of length unity


with some given direction. Here we explore how this idea may be used to write
vectors in terms of the so-called Cartesian basis vectors {i, j, k}.

6.3.1 Cartesian basis

Let i and j be a unit vectors in the x-y plane which point in the x-direction and
y-direction respectively (see figure 6.7). Then any vector ax that is parallel (or
anti-parallel) to the x-axis may be written as ax = ax i, where ax is a scalar;
ax is positive if ax is parallel to i, and negative if ax is anti-parallel to i.

Likewise, any vector ay that is parallel (or anti-parallel) to the y-axis may be
written in the form ay = ay j, where ay is a scalar; ay is positive if ay is parallel
to j, and negative if ay is anti-parallel to j.

Thus, an arbitrary vector a in the plane may be written in terms of compo-


nents ax and ay in the i and j-directions, viz (see figure 6.7)

a = ax + ay = ax i + ay j, (6.18)

Note that an equivalent notation for a is as the ordered pair (ax , ay ), i.e.,

a = ax i + ay j ≡ (ax , ay ). (6.19)

In general the ordered pair notation corresponds to components of the vector,


not the coordinates of a point. An exception to this rule is the special case of
a position vector r of some point (x, y), in which case r = xi + yj ≡ (ax , ay ).

Figure 6.7: Unit vectors i and j, and an arbitrary vector a = ax i + ay j.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 73

The vectors i and j are perpendicular, this means that the magnitudes of the
components ax and ay are given by

ax = a cos θx and ay = a cos θy , where a = |a| (6.20)

is the magnitude of a, and θx and θy are the angles between a and the x and
y-directions respectively (see figure 6.7). For this reason, cos θx and cos θy are
referred to as the direction cosines of a.
Example 6.4 Let A be the point with position vector a = (5, 2), and let
c = −i − 3j be the displacement vector from A to another point B. If
b = (bx , by ) is the position vector of B, determine the components bx and by .

I Solution: It is often helpful to sketch problems involving vectors; in this case


the vectors of interest can be depicted is as below.

According to the description of b in the problem we have b = a + c, where

a = (5, 2) = 5i + 2j and c = −i − 3j; (6.21)

hence,
b = a + c = (5i + 2j) + (−i − 3j) = 4i − j. (6.22)

In ordered-pair notation, therefore, we may write b = (bx , by ) = (4, −1). J


We can extend this idea to three dimensions by introducing a unit vector k in
the z-direction; then any vector a in Cartesian (x, y, z) space may be written

a = ax i + ay j + az k ≡ (ax , ay , az ), (6.23)

where az is the component of a in the z-direction (see figure 6.8). Notice that

az = a cos θz , (6.24)

with θz as the angle between a and the z-axis, so cos θz is a direction cosine like
cos θx and cos θy . The notation a ≡ (ax , ay , az ) is called an ordered triplet.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


74 Section 6 : Vectors and Vector Algebra

Figure 6.8: Cartesian unit vectors i, j, and k, and a = ax i + ay j.

When a vector a is expressed as in equation (6.23) way we say that it has


been written in Cartesian component form, while the unit vectors i, j, and
k are called the Cartesian basis vectors. The Cartesian basis are mutually
orthogonal (mutually perpendicular), meaning that it is not possible to express
a given unit vector as a linear combination of the other two, i.e.,

i = (1, 0, 0), j = (0, 1, 0), k = (0, 0, 1). (6.25)

We summarise these properties in the following definition.

Definition 6.3 The vectors i, j, and k are unit vectors in the x, y, and z-
directions respectively, and are referred to as the Cartesian basis vectors.
A vector a may be written in the Cartesian form

a = ax i + ay j + az k ≡ (ax , ay , az ), (6.26)

where ax , ay , and az are the components of a. If θx , θy , and θz are the


angles between a and the x, y, and z-directions respectively, then

ax = |a| cos θx , ay = |a| cos θy , az = |a| cos θz , (6.27)

where cos θx , cos θy , and cos θz are called the direction cosines of a.

The vectors i, j, and k are mutually orthogonal (mutually perpendicular);


thus, given two vectors a = ax i + ay j + az k and b = bx i + by j + bz k,

a=b if and only if ax = bx , ay = by , and az = bz . (6.28)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 75

One advantage of expressing vectors in Cartesian form is that addition and sub-
traction may be done by component; thus, given two vectors a = (ax , ay , az ),
and b = (bx , by , bz ) we have

a + b = (ax i + ay j + az k) + (bx i + by j + bz k)
= (ax + bx )i + (ay + by )j + (az + bz )k. (6.29)

Example 6.5 Two particles have velocities v1 = 2i + j + 3k and v2 = 3i − 2k


respectively. Find the velocity u of the first particle relative to the second.

I Solution: Working in component form we have

u = v1 − v2 = (2 − 3)i + (1 − 0)j + (3 − (−2))k = −i + j + 5k. (6.30)

Observe that the magnitude of u is the relative speed u of the particles. J

6.3.2 Vector magnitude

Recall that the magnitude of a vector a is its absolute size a = |a| irrespec-
tive the direction in which it points. In two dimensions this means that the
magnitude of an arbitrary vector a = ax i + ay j is given by
q
a = |a| = a2x + a2y , (6.31)

since the length a is simply the hypotenuse of a right-angled triangle with sides
ax and ay (see figure 6.7). Similarly, in three dimensions the magnitude of a
vector a = ax i + ay j + az k is
q
a = |a| = a2x + a2y + a2z (6.32)

(see figure 6.8). Thus, the components of a vector can be used to compute
the vector’s magnitude according to Pythagoras’s theorem. Notice that this
means that the direction cosines of a vector (see Definition 6.3) satisfy

cos2 θx + cos2 θy + cos2 θz = 1. (6.33)

For position and displacement vectors the magnitude (or length) corresponds
directly to distance. However, for other kinds of vectors we must interpret the
length differently; for example, when given a particle’s velocity vector v the
magnitude |v| s the particle’s speed v = |v|.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


76 Section 6 : Vectors and Vector Algebra

Example 6.6 Calculate the relative speed of the two particles in Example 6.5.

I Solution: By our solution to Example 6.5 we have that the relative velocity
is u = −i + j + 5k; the relative speed is thus
p √
u = |u| = (−1)2 + 12 + 52 = 27, (6.34)

where we used the expression for vector magnitude in equation (6.32). J


Example 6.7 Let a be the vector given by a = 4i + 7j − 4k; compute the
magnitude of a, and hence determine its unit vector â.

I Solution: The magnitude of a = 4i + 7j − 4k is


p √
a = |a| = 42 + 72 + (−4)2 = 81 = 9, (6.35)

meaning that the unit vector in the direction of a is

a 1
â ≡ = (4i + 7j − 4k). (6.36)
|a| 9

Component form thus offers a simple method for determining unit vectors. J

6.4 Scalar Product

It is not possible to multiply a vector by a vector; however, we can perform


certain kinds of pairwise operations between vectors known as products. One
important operation is the scalar product, which we define as follows:

Definition 6.4 The scalar product (or dot product) of two vectors a
and b is denoted a · b, and yields a scalar quantity defined by

a · b = |a||b| cos θ, with 0 ≤ θ ≤ π, (6.37)

where θ is the angle between the two vectors when their ‘tails’ are placed
together (see figure 6.9). The scalar product satisfies

a · b = b · a, and a · (b + c) = a · b + a · c. (6.38)

i.e., it is a commutative product, and distributive over addition.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 77

(a) (b)

Figure 6.9: Scalar projection b cos θ of b onto a when: (a) 0 ≤ θ < π2 ; and (b) π
2 < θ ≤ π.

6.4.1 Scalar product by components

Observe that the scalar product a · b = |a||b| cos θ yields two special cases:

a·b=0 when a and b are perpendicular (θ = π2 ); (6.39a)


a · b = |a||b| when a and b are parallel (θ = 0). (6.39b)

The first of these equations reflects a property known as orthogonality, i.e.,


two vectors a and b are said to be orthogonal if and only if a · b = 0. The
second equation means that the magnitude of a vector a satisfies

a · a = |a|2 , and thence |a| = a · a. (6.40)

In this way any unit vector â satisfies â · â = |â|2 = 1. Hence, because the
Cartesian basis vectors are mutually perpendicular, we have

i · i = j · j = k · k = 1, and i · j = j · k = k · i = 0. (6.41)

This property is known as orthonormality, and yields the following method


for computing scalar products (which we prove in Example 6.8):

Method 6.1 The scalar product of two vectors a = ax i + ay j + az k and


b = bx i + by j + bz k is given by

a · b = |a||b| cos θ = ax bx + ay by + az bz , (6.42)

where θ is the angle between a and b. The magnitude of a vector a is thus


q √
|a| ≡ a2x + a2y + a2z = a · a. (6.43)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


78 Section 6 : Vectors and Vector Algebra

Example 6.8 Show that the scalar product of two vectors a = ax i + ay j + az k


and b = bx i + by j + bz k is given by a · b = ax bx + ay by + az bz .

I Solution: The scalar product is distributive (see Definition 6.4), so by ex-


panding the scalar product of a and b we obtain

a · b = (ax i + ay j + az k) · (bx i + by j + bz k)
= ax bx (i · i) + ax by (i · j) + ax bz (i · k)
+ ay bx (j · i) + ay by (j · j) + ay bz (j · k)
+ az bx (k · i) + az by (k · j) + az bz (k · k)
= ax bx (i · i) + ay by (j · j) + az bz (k · k)
= ax b x + ay b y + az b z ,

where we used the fact that i, j, and k are orthogonal unit vectors to write

i · j = j · k = k · i = 0, and i · i = j · j = k · k = 1 (6.44)

as in equation (6.41). J
Example 6.9 Show that the angle θ between the vectors a = i − 2j + 6k and
b = 8i + 7j + k is given by θ = π2 (i.e., show that the vectors are orthogonal).

I Solution: According to Method 6.1 the scalar product of a and b is

a · b = |a||b| cos θ = (1 × 8) − (2 × 7) + (6 × 1) = 0. (6.45)

Hence, since both |a| = 6 0, we require cos θ = 0, that is, θ = π2 .


6 0 and |b| =

6.4.2 Projection of vectors

The scalar product has many useful geometric applications, including determin-
ing the angle between vectors, and the projection of one vector onto another:

Definition 6.5 Let θ be the angle between two non-zero vectors a and b:

• The scalar projection of b onto a is defined by |b| cos θ.

• The vector projection of b onto a is defined by bk ≡ (|b| cos θ)â.

These definitions are represented as vector diagrams in figures 6.9 and 6.10.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 79

(a) (b)

Figure 6.10: Vector projection bk = (|b| cos θ)â of b onto a when: (a) bk is parallel to
π π
â, i.e., 0 ≤ θ < 2; and (b) bk is antiparallel to â, i.e., 2 < θ ≤ π (cf. figure 6.9).

The projected vector of b onto a describes the amount of b that acts in the
same direction as a. We can similarly define a vector b⊥ to describe the amount
of b that acts at right-angles to a; such a vector must satisfy (cf. figure 6.10)

b = bk + b⊥ , with b⊥ · bk = 0, and |b⊥ | = |b| sin θ. (6.46)



Example 6.10 Consider the vectors a = 4i + 4k, and b = i + 6j + k. Use
the scalar product (see Method 6.1) to determine the following:

(a) The magnitudes of a and b, and the scalar product of a and b.


(b) The angle θ between a and b.
(c) Both: (i) the scalar projection; and (ii) vector projection of b onto a.

I Solution: This problem involves a situation similar to that in figure 6.10.


√ √
(a) According to method 6.1 the magnitudes are |a| = 42 + 42 = 4 2 and
√ √
|b| = 12 + 6 + 12 = 2 2, and the scalar product is

a · b = (4 × 1) + (0 × 6) + (4 × 1) = 8. (6.47)

(b) Thus, by the definition of the scalar product a · b = cos θ|a||b| we obtain

a·b 8 1 π
cos θ = = √ √ = , that is, θ = . (6.48)
|a||b| 4 2×2 2 2 3

(c) By Definition 6.5 we have that: (i) the scalar projection of b onto a is
√ √
given by |b| cos θ = 2 2/2 = 2; and (ii) the vector projection is

√ a 2
bk = (|b| cos θ)â = 2 = √ (4i + 4k) = i + k. (6.49)
|a| 4 2

This method is readily adapted for arbitrary pairs of vectors. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


80 Section 6 : Vectors and Vector Algebra

6.5 Vector Product

Consider two vectors a and b separated by an angle θ ∈ [0, π], as depicted in


figure 6.11. Now extend the thumb of your right-hand, and curl your fingers
in the direction of the angle from a to b: your thumb indicates a direction
perpendicular to both a and b, which we can represent as a unit vector n̂.

The vectors a, b, and n̂ form what is known as a right-handed set {a, b, n̂};
we use this set to define the vector product.

Definition 6.6 Let n̂ be a unit vector perpendicular to both a and b, such


that {a, b, n̂} form a right-handed set (see figure 6.11). Then the vector
product (or cross product) of a and b is denoted a × b, and defined by

a × b = (|a||b| sin θ)n̂, 0 ≤ θ ≤ π, (6.50)

where θ is the angle from a to b. It follows from this definition that

|a × b| = |a||b| sin θ. (6.51)

The vector product is sometimes denoted using the notation a ∧ b.

Now suppose we wish to find b × a; in this case when we curl our fingers in the
direction of the angle θ from b to a our thumb points in the direction opposite
to a × b. Since the magnitude |a||b| sin θ is unchanged, Definition 6.6 implies

b × a = −(a × b). (6.52)

Equation (6.52) demonstrates that the vector product is anti-commutative.

Figure 6.11: Vector product n = a × b of two vectors a and b.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 81

In general it is also possible to demonstrate the following results:

Result 6.1 The following results are useful for treating vector products:

b × a = −(a × b), (6.53a)


(a + b) × c = (a × c) + (b × c), (6.53b)
a × a = 0, (6.53c)
(a × b) × c 6= a × (b × c). (6.53d)

6.5.1 Vector product by components

Observe that the magnitude of the vector product |a × b| = |a||b| sin θ yields
two special cases:

|a × b| = 0 when a and b are parallel (θ = 0), (6.54a)


|a × b| = |a||b| when a and b are perpendicular (θ = π2 ). (6.54b)

Since any vector a is parallel to itself, this means that a × a = 0. Hence, the
Cartesian basis vectors satisfy

i × i = j × j = k × k = 0. (6.55)

Now consider the right-handed set formed by the Cartesian basis vectors shown
in figure 6.12; the definition of the vector product means that

i × j = k, j × k = i, k × i = j, (6.56)

where the directions of the products follow from the right-hand-rule (see figure
6.12), and the magnitudes are all unity, e.g., |i × j| = |i||j| sin( π2 ) = 1.

Figure 6.12: Cartesian basis vectors are a right-handed set {i, j, k} with i × j = k.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


82 Section 6 : Vectors and Vector Algebra

In component form, therefore, the vector product of a and b is

a × b = (ax i + ay j + az k) × (bx i + by j + bz k)
= ax b x i × i + ax b y i × j + ax b z i × k
+ ay b x j × i + ay b y j × j + ay b z j × k
+ az bx k × i + az by k × j + az bz k × k. (6.57)

Thus, noting that i × i = j × j = k × k = 0 by equation (6.55), we have

a × b = ax b y i × j − ax b z k × i
− ay b x i × j + ay b z j × k
+ az b x k × i − az b y j × k
= (ay bz − az by )j × k + (az bx − ax bz )k × i + (ax by − ay bx )i × j,

where we used the fact that i × k = −(k × i), and so forth. Hence, using
equation (6.56) to write j × k = i etc., we obtain

a × b = (ay bz − az by )i + (az bx − ax bz )j + (ax by − ay bx )k. (6.58)

The right-hand-side of this expression may be written in condensed form using


the determinant of a matrix, that is, according to the notation

i j k
(ay bz − az by )i + (az bx − ax bz )j + (ax by − ay bx )k ≡ ax ay az . (6.59)
bx by bz

Determinants are readily evaluated according to Sarrus’s rule by re-writing


the first two columns to the right of the final column, as in figure 6.13, and
considering forward and backward diagonals through the elements. The deter-
minant in equation (6.59) is then the sum of the products along the forward
diagonals, less the sum of the products along backward diagonals.

Figure 6.13: Determinant (ay bz − az by )i + (az bx − ax bz )j + (ax by − ay bx )k.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 83

Result 6.2 The vector product of a and b in component form is

a × b = (ay bz − az by )i + (az bx − ax bz )j + (ax by − ay bx )k. (6.60)

In this way the vector product can be written as the determinant

i j k
a × b = ax ay az . (6.61)
bx by bz

Determinants may be evaluated using Sarrus’s rule (see figure 6.13).

Example 6.11 Let a = 3i + j − k and b = i + 2j + k; evaluate the vector


product a × b, and b × a explicitly using component form.

I Solution: Using the determinant method for the component form we have

i j k
a×b= 3 1 −1
1 2 1
= (1 × 1 − (−1) × 2)i + (−1 × 1 − 3 × 1)j + (3 × 2 − 1 × 1)k
= 3i − 4j + 5k. (6.62)

Likewise,

i j k
b×a= 1 2 1 = −3i + 4j − 5k.
3 1 −1

Hence, we have a × b = −(b × a) as expected. J

A simple consequence of Definition 6.6 is that the vector given by

a×b
n̂ = , (6.63)
|a × b|

is a unit normal to both a and b, with {a, b, n̂} forming a right-handed set.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


84 Section 6 : Vectors and Vector Algebra

Result 6.3 Let a and b be non-parallel vectors, then the unit normal n̂
given by
a×b
n̂ = (6.64)
|a × b|
is a unit vector that is perpendicular to both a and b.


Example 6.12 Determine a unit normal to a = 4i+4k, and b = i+ 6j+k.

I Solution: Using the determinant method we obtain

i j k
√ √
a × b = 4 0 4 = −4 6i + 4 6k, (6.65)

1 6 1
√ √
with magnitude |a × b| = 42 × 6 + 42 × 6 = 8 3. Hence, the unit vector
given by n̂ = (a × b)/|a × b| = √12 (−i + k) is a unit normal to a and b. J

6.5.2 Area of a parallelogram

Figure 6.14 illustrates a parallelogram whose sides are two vectors a and b
separated by the angle θ. Because the height of the parallelogram is |b| sin θ,
while the base has length |a|, the area A of the parallelogram is

A = |a||b| sin θ = |a × b|. (6.66)

Thus, the magnitude of the vector product a × b can be thought of as the


area of a parallelogram whose sides are the vectors a and b.
Example 6.13 Find the area A of the parallelogram with sides given by the
vectors a and b of Example 6.11 (cf. figure 6.14).

Figure 6.14: Parallelogram with sides a and b.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 85

I Solution: The vectors of interest are a = 3i + j − k and b = i + 2j + k. In


Example 6.11 we found that

a × b = 3i − 4j + 5k. (6.67)

It then follows from equation (6.66) that


√ √
A = |a × b| = 32 + 42 + 52 = 5 2. (6.68)

Note: We can define a vector area according to A = a × b; this vector is


normal to the parallelogram, and has magnitude |A| = A. J

6.5.3 Physical quantities as vector products

The vector product has several applications to physical problems involving ro-
tations. For example, consider a force F acting through a point R with position
vector r as in figure 6.15. The moment M of the force about the origin O is
defined by |F| multiplied by its perpendicular distance l⊥ to O; hence,

M = F l⊥ = |r||F| sin θ = |r × F|. (6.69)

Notice also that sense of the moment is as the rotation from r to F; thus, we
can specify both the direction and magnitude of the moment as M, where

M = r × F, with M = |M| = |r × F| = |r||F| sin θ. (6.70)

Other physical applications from mechanics include the angular momentum

L=r×p (6.71)

about the origin of a particle with position r and momentum p.

Figure 6.15: Moment of a force M = r × F as a vector product.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


86 Section 6 : Vectors and Vector Algebra

6.6 Geometrical Applications

Vectors offer a convenient notation for describing geometric objects, and a


powerful set of methods for determining their properties. In this section we
consider applications of vectors to lines and planes, and the distances of points.

6.6.1 Equation of a line

Let A be a point with position vector a = ax i + ay j + az k on a line running


parallel to some vector b = bx i + by j + bz k, as depicted in figure 6.16, then an
arbitrary point r = (x, y, z) on the line may be written as

r(λ) = a + λb, where λ∈R (6.72)

a scalar parameter that is unique to each point on the line. In component form,
therefore, we have

r(λ) = xi + yj + zk = (ax + λbx )i + (ay + λby )j + (az + λbz )k, (6.73)

whereupon comparing coefficients of the unit vectors i, j, and k we obtain

x(λ) = ax + λbx , y(λ) = ay + λby , z(λ) = az + λbz . (6.74)

In this way we see that each component is itself a linear function of λ.


Equation (6.72) is the vector equation for a line, with λ as a parameter. Note
that by eliminating λ from the equations (6.74) we obtain

x − ax y − ay z − az
= = , (6.75)
bx by bz

which is the Cartesian equation for a line in three-dimensional space.

Figure 6.16: Line parallel to b, passing through the point A with position vector a.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 87

6.6.2 Perpendicular distance to a line

Consider the line with equation r(λ) = a + λb described in section §6.6.1,


and suppose that P is a point with position vector p adjacent to the line, as
depicted in figure 6.16. Let c be the displacement vector from a to p, i.e.,

c = (p − a), (6.76)

then the perpendicular (and thus shortest) distance l⊥ from the line to P is

l⊥ = |c| sin θ, (6.77)

where θ is the angle between c and b. Hence, with b̂ = b/|b| as a unit vector
in the direction of b, we have by the definition of the vector product that

l⊥ = |c||b̂| sin θ = |c × b̂| = |(p − a) × b̂|, (6.78)

where we used the fact that |b̂| = 1 for unit vectors.

Example 6.14 Let r be an arbitrary point on the line parallel to b = 2i+j−2k


which passes through a = −i − j + 3k. Determine the perpendicular distance
l⊥ from the point p = −i + 2j + 3k to the line.

I Solution: We proceed by evaluating the terms in equation (6.78). First



observe that the magnitude of b is |b| = 22 + 12 + 22 = 3, such that

1 1
b̂ = b = (2i + j − 2k). (6.79)
3 3
Thus, with
(p − a) = 3j, (6.80)

we have that

i j k
(p − a) × b̂ = 0 3 0 = −2i − 2k. (6.81)
2 1
3 3
− 32

Hence, the perpendicular distance from the point p to the line is


√ √
l⊥ = |(p − a) × b̂| = | − 2i − 2k| = 22 + 22 = 2 2, (6.82)

where we appealed to equation (6.78). J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


88 Section 6 : Vectors and Vector Algebra

6.6.3 Perpendicular distance between skew lines

Let r1 be the line containing a point a1 , and running parallel to b1 , and let r2
be the line containing a point a2 , and running parallel to b2 , then

r1 = a1 + λ1 b1 and r2 = a2 + λ2 b2 , (6.83)

where λ1 and λ2 are scalar parameters (see §6.6.1). In this section we consider
the problem of determining the perpendicular distance d between these two
lines assuming that they are skew (non-parallel), as depicted in figure 6.17.

To do this, first observe that we may define a unit normal n̂ to both lines

b1 × b2
n̂ = . (6.84)
|b1 × b2 |

Now consider a vector c from one line to the other, say

c = (a1 − a2 ), (6.85)

as shown in figure 6.17. The perpendicular distance d between the two lines is
then the magnitude of the scalar projection of c onto n̂, that is,

|(a1 − a2 ) · (b1 × b2 )|
d = |c · n̂| = . (6.86)
|b1 × b2 |

Example 6.15 Determine the minimum distance d between the z-axis, and
the line r1 parallel to b1 = (4i + 3j − k) containing the point a1 = (2i − j).

I Solution: The line r1 may be written as r1 = a1 + λ1 b1 , where λ1 is a


parameter. Now let r2 be a line that coincides with the z-axis, say r2 = λ2 k,
where λ2 is a parameter; in this way we have r2 = a2 + λ2 b2 , with a2 = 0 and
b2 = k. It therefore follows by evaluating equation (6.86) that d = 2. J

Figure 6.17: Skew lines separated by a perpendicular distance (i.e., minimum distance) d.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 89

6.6.4 Equation of a plane

Figure 6.18 depicts a plane with normal n (unit normal n̂) containing a given
point A with position vector a = (ax , ay , az ), and an arbitrary point R with
−→
position vector r = (x, y, z). Notice that the vector AR = (r − a) must lie
completely within the plane, and is therefore perpendicular to n, i.e.,

(r − a) · n = 0; (6.87)

this expression is one way of describing the plane in vector form.


By dividing through by |n|, equation (6.87) can also be written as

(r − a) · n̂ = 0, or equivalently r · n̂ = a · n̂. (6.88)

Furthermore, if θa is the angle between a and n, then the perpendicular distance


d of the plane from the origin is

d = |a| cos θa = |a||n̂|θa = a · n̂, (6.89)

where we used the fact that |n̂| = 1; in this way, equation (6.88) becomes

r · n̂ = d, where d = a · n̂. (6.90)

Hence, if the components of the unit normal are given by n̂ = (u, v, w), then
r · n̂ = ux + vy + wz, and we may express the plane in Cartesian form as

ux + vy + wz = d. (6.91)

Figure 6.18: Plane with normal n, containing the point A with position vector a.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


90 Section 6 : Vectors and Vector Algebra

Now suppose that b and c are also points in the plane, with a, b and c distinct,
then the vectors (b − a) and (c − a) are non-parallel vectors that lie within the
plane. Thus, any point r in the plane may be reached by starting at a, and
moving some distance in the direction (b − a), followed by some distance in
the direction (c − a). In this way we can write the equation for the plane as

r(λ, µ) = a + λ(b − a) + µ(c − a), (6.92)

where λ and µ are two scalar parameters. Since only λ and µ can be varied,
this equation highlights the fact that a plane has two degrees of freedom.

6.6.5 Perpendicular distance to a plane

Now let P be a point adjacent to the plane described in the previous section,
as illustrated in figure 6.18. If we denote the position vector of P as p, then
the displacement from a to p is given by the vector

c = (p − a). (6.93)

Thus, if we denote the angle between c and the unit normal n̂ as θc (see figure
6.18), then the perpendicular distance l⊥ from P to the plane is

l⊥ = |c| cos θc = |c||n̂| cos θc = c · n̂ = (p − a) · n̂. (6.94)

Note that if P is on the same side of the plane as the origin O, then θc > π2 ,
and this expression for l⊥ will give a negative answer.

Example 6.16 Find a unit normal n̂ to the vectors u = i + j and v = j + k.


Hence determine the Cartesian equation for the plane that is parallel to u and
v, and which contains the point a = i + k.

I Solution: Given u = i + j and v = j + k we have

i j k
u × v = 1 1 0 = i − j + k, (6.95)
0 1 1
√ √
and |u × v| = 12 + 12 + 12 = 3. Thus, a unit normal to u and v is

u×v 1
n̂ = = √ (i − j + k). (6.96)
|u × v| 3
Engineering Mathematics : ELE00038C J.J.B. 2023-2024
Section 6 : Vectors and Vector Algebra 91

Clearly any plane with unit normal n̂ will be parallel to both u and v; however,
if the plane must also contain the point a = i + k, then according to equation
(6.88) in §6.6.4 we require

r · n̂ = d, where d = a · n̂ (6.97)

is the perpendicular distance from the plane to the origin, and r = xi + yj + zk


is an arbitrary point in the plane. Computing d we have

1 2
d = a · n̂ = (i + k) · √ (i − j + k) = √ . (6.98)
3 3

Similarly, evaluating r · n̂ we find that

1 2
r · n̂ = (xi + yk + zk) · √ (i − j + k) = √ (x − y + z). (6.99)
3 3

Hence, comparing equations (6.98) and (6.99) we obtain

x−y+z =1 (6.100)

as the equation for the plane in Cartesian form. J

Example 6.17 Let n1 = (i + j) and n2 = (j − k) be the normal vectors


to the planes P1 , and P2 respectively, and let both planes contain the point
a = (0, 2, 0). Determine: (a) the angle θ between the two planes; (b) the
Cartesian equation for each plane; and (c) the planes’ line of intersection.

I Solution: (a) Notice that the angle between the normals is the same as the
angle between the planes. Thus, by the scalar product we have
π
n1 · n2 = 1 = |n1 ||n2 | cos θ = 2 cos θ, that is, θ= . (6.101)
3
(b) Let r = xi + yj + zk be an arbitrary position vector; then by equation
(6.88) of §6.6.4 the equations for the planes P1 and P2 are

r · n1 = a · n1 and r · n2 = a · n2 (6.102)

respectively. Hence, evaluating the scalar products we obtain

x+y =2 and y − z = 2, (6.103)

as the equations for P1 and P2 in Cartesian form.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


92 Section 6 : Vectors and Vector Algebra

(c) The line of intersection of the two planes is the set of points that satisfy
both equations (6.103); since these are two equations in three unknowns, we
must form a parametric solution. Let x = λ, then equations (6.103) give

x = λ, y = 2 − λ, z = −λ, (6.104)

where λ is a scalar parameter; hence, the line of intersection is

r(λ) = λi + (2 − λ)j − λk. (6.105)

Note: An alternative method to determining the line of intersection is to note


that the direction b of the line must be perpendicular to both n1 and n2 ; one
way of ensuring this is to set

b = n2 × n1 = i − j + k. (6.106)

Thus, because a = (0, 2, 0) = 2j is a point of intersection (both planes contain


a), the line of intersection may be written using a scalar parameter µ as

r(µ) = a + µb, (6.107)

(see §6.6.1); this equation is equivalent to equation (6.105). J

6.7 Triple Products

The vector product b × c of two vectors b and c is itself a vector, and can
be combined with a third vector a to form triple products. In this section we
consider the scalar triple product, and the vector triple product.

6.7.1 Scalar triple product

Let b = bx i + by j + bz k, and c = cx i + cy j + cz k, then in component form

b × c = (by cz − bz cy )i + (bz cx − bx cz )j + (bx cy − by cx )k. (6.108)

Thus, taking the scalar product of b × c with a = ax i + ay j + az k we obtain

a · (b × c) = ax (by cz − bz cy ) + ay (bz cx − bx cz ) + az (bx cy − by cx ). (6.109)

This quantity, i.e., a · (b × c), is known as the scalar triple product.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 93

Observe that the right-hand-side of of equation (6.109) may be written in


condensed form using the determinant of a matrix, that is,

ax ay az
a · (b × c) = bx by bz , (6.110)
cx cy cz

where the determinant can be evaluated using Sarrus’s rule (see figure 6.13).
In summary, therefore, we have the following definition:

Definition 6.7 The scalar triple product of three vectors a, b, and c,


is defined as a · (b × c), and may be denoted in square-brackets by

[a, b, c] ≡ a · (b × c). (6.111)

The scalar triple product returns a scalar, and may be evaluated using the
determinant
ax ay az
a · (b × c) = bx by bz . (6.112)
cx cy cz
The scalar triple product satisfies

a · (b × c) = b · (c × a) = c · (a × b), (6.113)

i.e., it is invariant under cyclic permutations of the vectors a, b, and c.

6.7.2 Volume of a parallelepiped

Figure 6.19 depicts a parallelepiped (a prism with parallelogram sides), whose


edges are defined by the vectors a, b, and c. We let θ be the angle between
a and b, and we let φ be the angle between c and the normal n defined by

n = a × b. (6.114)

The base of the parallelepiped is a parallelogram whose sides are the vectors a
and b; thus, according to our discussion in §6.13, the base has area

A = |a × b| = |n|. (6.115)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


94 Section 6 : Vectors and Vector Algebra

Figure 6.19: Parallelepiped defined by vectors a, b, and c.

Now observe that the height h of the parallelepiped is equal to the scalar
projection of c onto the vector n, that is,

h = |c| cos φ (6.116)

(see §6.4.2). Thus, the volume V of the parallelepiped is given by the scalar
triple product of a, b, and c, viz.

V = Ah = |n||c| cos φ = n · c = (a × b) · c = a · (b × c), (6.117)

where we noted that (a × b) · c = a · (b × c) as described in Definition 6.7.

6.7.3 Co-planarity and linear dependence

Equation (6.117) tells us that a geometric interpretation for the scalar triple
product is the volume of a parallelepiped. Thus, if a · (b × c) = 0, then the
parallelepiped whose edges are a, b, and c has volume V = 0, that is, the
vectors a, b, and c must all lie in a plane. In this way the scalar triple product
may be used to test whether vectors are co-planar:

Result 6.4 If the scalar triple product of three vectors a, b, and c is zero,
that is, if
a · (b × c) = 0, (6.118)

then a, b, and c all lie in the same plane, and are said to be co-planar.
Conversely, if
a · (b × c) 6= 0, (6.119)

then a, b, and c do not all lie in the same plane.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 6 : Vectors and Vector Algebra 95

If a set of three vectors are coplanar, then any one vector can be expressed
as a linear combination of the other two. For example, if a, b and c are
coplanar, then we may write a as the linear combination

a = λb + µc, (6.120)

where λ and µ are scalars. In such cases we say that a, b, and c are linearly
dependent. Conversely, if

a · (b × c) 6= 0, (6.121)

then a, b, and c are said to be linearly independent.


Example 6.18 Show that a = (5, 0, 1), b = (1, 2, −1), and c = (2, −1, 1)
are coplanar vectors, and express a as a linear combination of b and c.

I Solution: Evaluating the vector product of b and c we have

i j k
b×c= 1 2 −1 = i − 3j − 5k. (6.122)
2 −1 1

Hence, the scalar product of a, b, and c is zero, viz.

a · (b × c) = (5 × 1) + (0 × −3) + (1 × −5) = 0, (6.123)

meaning that the vectors are coplanar (see Result 6.4).


To write a as a linear combination of b and c we set

a = λb + µc, (6.124)

where λ and µ are scalars to be found. Thus, in component form we have

5i + k = λ(i + 2j − k) + µ(2i − j + k), (6.125)

whereupon equating coefficients we obtain

5 = λ + 2µ, 0 = 2λ − µ, 1 = µ − λ. (6.126)

Equations (6.126) may be solved to give λ = 1, and µ = 2. Finally, substituting


these values into equation (6.124) we find that a can be expressed as a linear
combination of b and c according to a = b + 2c. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


96 Section 6 : Vectors and Vector Algebra

6.7.4 Vector triple product

For the purpose of completeness we now introduce the vector triple product:

Definition 6.8 The vector triple product of a, b, and c is defined by

a × (b × c), (6.127)

and returns a vector perpendicular to a and b × c. It may be shown that

a × (b × c) = (a · c)b − (a · b)c; (6.128)

this identity is known as Lagrange’s formula (see Example 6.19).

Observe that the quantities (a · c) and (a · b) in identity (6.128) are scalars;


the geometric meaning of the identity, therefore, is that a × (b × c) can be
written as a linear combination of b and c. Such a property is what we expect:
because b × c is perpendicular to b and c, the vector a × (b × c) must lie in
the plane containing b and c, that is, a × (b × c), b, and c are coplanar.

Example 6.19 Show that a × (b × c) = (a · c)b − (a · b)c.

I Solution: Evaluating the vector triple product a × (b × c) in component


form, and collecting terms in bx i, by j, bz k, cx i, cy j, and cz k we obtain

a × (b × c) = (ay cy + az cz )bx i − (ay by + az bz )cx i


+ (az cz + ax cx )by j − (az bz + ax bx )cy j
+ (ax cx + ay cy )bz k − (ax bx + ay by )cz j
= (ax cx + ay cy + az cz )bx i − (ax bx + ay by + az bz )cx i
+ (ay cy + az cz + ax cx )by j − (ay by + az bz + ax bx )cy j
+ (az cz + ax cx + ay cy )bz k − (az bz + ax bx + ay by )cz j
= (a · c)bx i + (a · c)by j + (a · c)bz k
− (a · b)cx i − (a · b)cy j − (a · b)cz k
= (a · c)b − (a · b)c (6.129)

as required. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 Engineering Mathematics
J. J. Bissell

Matrices and Linear Algebra

There are many instances in engineering and the physical sciences when it is
necessary to handle large systems of simultaneous linear equations, either by
the nature of the systems themselves (e.g., circuits, and networks), or due to
methods of approximation (e.g., linearised models, and numerical analysis).
The branch of mathematics concerned with the theory of linear equations is
known as linear algebra, and the rectangular arrays of numbers used to rep-
resent such equations are known as matrices. Here we introduce the basic
algebra of matrices, and apply matrix methods to simple problems. Note that
our examples will necessarily involve small systems that can (in principle) be
solved easily using ‘non-matrix’ approaches; however, the point is to illustrate
systematic processes for application to much larger systems where ‘non-matrix’
approaches are impractical. By the end of the section you should be able to. . .
Learning outcomes:
◦ Explain what are meant by the rows and columns of an n × m matrix.
◦ Classify different kinds of square (n × n) matrices, and compute traces.
◦ Write down the transpose AT of a matrix A.
◦ Add and subtract matrices, and multiply a matrix by a scalar.
◦ Perform the matrix multiplication AB of two matrices A and B.
◦ Explain the meaning of the identity (or unit) matrix I.
◦ Compute the determinant of a 2 × 2 matrix.
◦ Use Laplace expansions to find determinants of 3 × 3 and 4 × 4 matrices.
◦ Find the inverse A−1 of a square matrix A by Gaussian elimination.
◦ Compute the inverse of a matrix using the determinant method.
◦ Use matrix methods to solve simple systems of linear equations.
These learning outcomes must be reinforced by completing course exercises.

97
98 Section 7 : Matrices and Linear Algebra

7.1 Matrices and linear equations

To motivate what is meant by a matrix, and why there is a connection between


matrices and systems of linear equations (linear algebra), let us consider a
simple example based on an application to electronic circuits.

Figure 7.1 depicts a circuit comprising three loops, three voltage sources, and
a selection of resistors. One way to analyse this circuit is to associated currents
I1 , I2 , and I3 with each of the three loops. In this way it may be shown (see
Example 7.1) that the loop currents satisfy the following system of equations

5I1 + 0I2 − 2I3 = 1 (7.1a)


0I1 + 9I2 − 3I3 = 3 (7.1b)
−2I1 − 3I2 + 5I3 = 4 (7.1c)

Notice that these equations are formed from three types of quantity: (i) the
unknowns I1 , I2 , and I3 ; (ii) the coefficients which multiply the unknowns;
and (iii) the known constants 1, 2, and 4. We can separate these types of
quantity from each other using rectangular arrays of numbers by writing
    
5 0 −2 I1 1
 0 9 −3   I2  =  3  . (7.2)
    
−2 −3 5 I3 4

Such rectangular arrays of numbers are known as matrices. In particular, this


notation uses three matrices
     
5 0 −2 I1 1
A= 0 9 −3  , x =  I2  , and b =  3  , (7.3)
     
−2 −3 5 I3 4

where A is called the matrix of coeffcients, x is called the matrix of un-


knowns, and b is called the matrix of constants (or matrix of knowns).
Thus, equation (7.2) may be expressed as (see §7.4.4)

Ax = b. (7.4)

This equation is called a matrix equation, and is an extremely concise way


of expressing the information contained within the system of equations (7.1).
We discuss the problem of solving such systems of equations in later sections.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 99

Figure 7.1: Circuit comprising three current loops I1 , I2 , and I3 .

An alternative way of representing the system of equations (7.1) is to combine


the matrices A and b together to form a so-called augmented matrix
 
5 0 −2 1
 0 9 −3 3  (7.5)
 
−2 −3 5 4

The order of rows and columns in this augmented matrix may then be used to
infer properties of the system of equations (7.1). The first, second, and third
rows of the augmented matrix represents the first (7.1a), second (7.1b), and
third (7.1c) equations respectively. Likewise, the entries in the first, second,
and third columns represent the respective coefficients of the first (I1 ), second
(I2 ), and third (I3 ) unknowns. The entries in the final column are then the
known constants from the right-hand-sides of each equation.
Example 7.1 Show that the loop currents in figure 7.1 satisfy equations (7.1).

I Solution: By balancing the voltages in loop 1 we have that

4 = 3 + 2(I1 − I3 ) + 3I1 ⇒ 5I1 − 2I3 = 1 (7.6)

(where we have omitted the units). Similarly, for loop 2 we find

3 = 6I2 + 3(I2 − I3 ) ⇒ 9I2 − 3I3 = 3. (7.7)

Finally, by balancing voltages in loop 3 we obtain

4 = 2(I3 − I1 ) + 3(I3 − I2 ) ⇒ −2I1 − 3I2 + 5I3 = 4. (7.8)

These three equations are identical to equations (7.1) as required. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


100 Section 7 : Matrices and Linear Algebra

7.2 Definitions and Special Matrices

A matrix is a rectangular array of mathematical objects known as elements.


Elements are typically numbers, but they can also be functions. For example,
 
π −1 " # " #
2
 9 11  1 0 cos θ − sin θ
B=
 √ , C= 3 , R(θ) =
 7 7  0 12 3 sin θ cos θ
2 −3
(7.9)
are all matrices; the elements of B and C are numbers, while the elements of
R are trigonometric functions whose values depend on the choice for θ.
The dimensions of a matrix are described in terms of the number of rows and
columns. For example, the matrix B above has 4 rows, and 2 columns, and
is therefore described as a ‘4 by 2’ (4 × 2) matrix. Likewise, C has 2 rows and
3 columns, and is described as a ‘2 by 3’ (2 × 3) matrix. Because R has the
same number of rows as columns, it is called a ‘2 by 2’ (2 × 2) square matrix.
Here we denote matrices using bold type A, or by writing a general matrix
element aij in brackets, i.e., A = [aij ]. Thus, if A is an m × n matrix (a
matrix with m rows and n columns), then we write
 
a11 a12 . . . a1n
 a21 a22 . . . a2n 
 
A = [aij ] = 
 .. .. . . ,
..  (7.10)
 . . . . 
am1 am2 . . . amn

where aij is the element in the ith row and jth column. This notation may be
used to easily identify different elements; for example, given the 3 × 4 matrix
 
2 −1 π 0
A =  35 0 1 1  (7.11)
 
√ 4
7 2 − 7 10

we have a11 = 2, a32 = 2, a21 = 35 , a13 = π, a34 = 10, and so forth.

Example 7.2 Equation (7.9) defines two matrices B and C; (a) write down
the values of the elements b11 , b42 , and b32 ; and (b) c21 , c13 , c22 , and c23 .

I Solution: (a) b11 = π, b42 = −3; (b) c21 = 0, c13 = 32 , c23 = 12 , c23 = 3. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 101

Definition 7.1 A general m × n matrix A has m rows and n columns,


and is a rectangular array of elements (entries) of the form
 
a11 a12 a13 . . . a1n
 a21 a22 a23 . . . a2n 
 
A = [aij ] = 
 .. .. .. . . ,
..  (7.12)
 . . . . . 
am1 am2 am3 . . . amn

where aij denotes a general element in the ith row and jth column. In this
course we denote matrices in bold type A, or by writing a general element
in brackets, i.e., A = [aij ]; other notations include double underlining A.

7.2.1 Column matrices and row matrices

A matrix formed from only one column is called a column vector (or column
matrix). For example, the matrices
 
  x1
1
x2
" #  
11  −2  



c= , A =  3 , x= x3 , (7.13)
 
−9  π  
..

√ 
.

2
 
xm

are all column vectors: c is a 2 × 1 column vector; A of a 4 × 1 column vector;


and x is an m × 1 column vector with elements x1 , x2 ,. . . , xm , where m ∈ N.
Similarly, a matrix formed from only one row is called a row vector (or row
matrix). For example, the matrices
h i h i
r = 5 −2 , and b = b1 b2 . . . bn , (7.14)

are both column vectors: r is a 1 × 2 row vector; and b is an 1 × n row vector


with elements b1 , b2 ,. . . , bn , where n ∈ N. To avoid ambiguity, entries in row
vectors are sometimes separated using commas; thus, r and b can be written

r = [5, −2], and b = [b1 , b2 , . . . , bn ]. (7.15)

This notation is useful when row vectors are written within the body of a text.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


102 Section 7 : Matrices and Linear Algebra

7.2.2 Square matrices

A matrix with the same number of rows m as columns n, that is, n = m, is


called a square matrix of order n. Thus, the general form of a n × n square
matrix is  
a11 a12 . . . a1n
 a21 a22 . . . a2n 
 
A=  .. .. . . .
..  (7.16)
 . . . . 
an1 an2 . . . ann
The leading diagonal of an n × n square matrix is the diagonal containing the
elements a11 , a22 , . . . , ann . The sum of the elements along the leading diagonal
is called the trace of the matrix, and denoted tr(A), i.e.,

tr(A) = a11 + a22 + · · · + ann . (7.17)

Note that the trace of a matrix is only defined for square matrices. The leading
diagonal may be used to define several special types of square matrix:

Upper triangular matrix

An upper triangular matrix U is one for which all the elements below the
leading diagonal are zero, i.e.,
 
u11 u12 u13 . . . u1n
 0 u22 u23 . . . u2n 
 
 
U=  0 0 u33 . . . u3n  , with uij = 0 when i > j. (7.18)
 .. .. .. . . .. 
 . . . . . 
0 0 0 . . . unn

Lower triangular matrix

A lower triangular matrix L is one for which all the elements above the leading
diagonal are zero, that is,
 
l11 0 0 ... 0
 l21 l22 0 ... 0 
 
 
L= l31 l32 l33 . . . 0 , with lij = 0 when i < j. (7.19)
 .. .. .. . .
 
 . . . . 0 

ln1 ln2 ln3 . . . lnn

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 103

Symmetric matrix

A matrix S in which the elements are symmetric about the leading diagonal,
i.e., sij = sji , is known as a symmetric matrix. For example, the 3×3 matrix
 
7 −2 π
√ 
S =  −2 0 3  (7.20)


π 3 11

is symmetric because s12 = s21 , s13 = s31 , and s23 = s32 .

Diagonal matrix

A matrix D is said to be diagonal if all the elements either side of the leading
diagonal are zero, that is,
 
d11 0 0 ... 0
 0 d22 0 ... 0 
 
 
D= 0 0 d33 . . . 0 , with dij = 0 when i 6= j. (7.21)
 .. .. .. . .
 
 . . . . 0 

0 0 0 . . . dnn

7.2.3 Identity (unit) matrix

The identity matrix I (or unit matrix) is a special kind of diagonal matrix for
which all the elements along the leading diagonal are unity (1). For example,
the 2 × 2 and 3 × 3 identity matrices are
 
" # 1 0 0
1 0
I= , and I =  0 1 0 . (7.22)
 
0 1
0 0 1

The elements of the unit matrix are given by the Kronecker delta δij , where

1 if i = j
δij = (7.23)
0 if i 6= j.

Thus, the unit matrix may be written in terms of a general matrix element as

I = [δij ]. (7.24)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


104 Section 7 : Matrices and Linear Algebra

Definition 7.2 The general form of a n × n square matrix A is


 
a11 a12 . . . a1n
 a21 a22 . . . a2n 
 
A=  .. .. ... .
..  (7.25)
 . . . 
an1 an2 . . . ann

The diagonal containing the elements a11 , a22 , . . . , ann is called the leading
diagonal. The trace of a square matrix tr(A) is defined by

tr(A) = a11 + a22 + · · · + ann . (7.26)

Some special types of square matrices A include the following:

◦ An upper triangular matrix has elements aij = 0 when i > j.


◦ A lower triangular matrix has elements aij = 0 when i < j.
◦ A diagonal matrix has elements aij = 0 when i 6= j.
◦ A symmetric matrix has elements aij = aji .
◦ The identity (unit) matrix I is defined by I = [δij ] (see equation (7.23)).

Example 7.3 Classify the following matrices, and (if possible) find their traces:
   
4 4 3 0 0 0 "
2
#
1 1 0 9 3
A =  −1 2 , B =  −3 0 0  , C= ,
   
2 1
0 2 3 4
5 −2 0 4 π 2
 1
  
1 2 6 1
2 " √ #
 0 0 2 0  1 − 2  2 
D=
 √ , E= √ , F=

.

 0 0 −1 2  − 2 2  3 
0 0 0 5 4

I Solution: We consider each of the matrices in turn:


◦ A is a 3 × 3 square matrix with trace tr(A) = 4 + 21 + 0 = 92 .
◦ B is a 3 × 3 lower triangular matrix with trace tr(B) = 0 + 0 + 2 = 2.
◦ C is a 2 × 4 matrix; it is not square, so does not have a trace.
√ √
◦ D is a 4×4 upper triangular matrix with trace tr(D) = 1+0−1+ 5 = 5.
◦ E is a 2 × 2 symmetric with trace tr(E) = 1 + 2 = 3.
◦ F is a 4 × 1 column vector; it is not square, so does not have a trace. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 105

7.2.4 Transpose of a matrix

The transpose of a matrix A is denoted AT , and obtained by switching the


rows and columns of A. For example, given the matrices
 
" # π −1 2 " #
1
−1  9 11 9  1 0 23
B= 2 , C=
 √ ,

D=
9 11  7 7 4  0 12 3
2 −3 4

we have the transpose matrices


   
" # π 9 7 2 1 0
1
9 √
BT = 2 , CT =  −1 11 7 −3  , DT =  0 12  .
   
−1 11 2
2 9 4 4 3
3

Note that if A is an m × n matrix, then AT is an n × m matrix, so in general


A 6= AT . Symmetric matrices are the exception to this rule because: (i) they
are square; and (ii) their elements are symmetric about the leading diagonal.

Definition 7.3 The transpose of a matirx A = [aij ] is denoted AT , and


is the matrix obtained by switching the rows and columns of A, viz.

AT = [aij ]T = [aji ]. (7.27)

A square matrix S is said to be a symmetric matrix if and only if ST = S.

Example 7.4 Find the transpose matrices of the following:


     
−2 7 1 4 −1 5
A =  10 13  , c =  4 , B =  −1 1
2 . (7.28)
     
2
3 4 3 5 2 0

I Solution: The transpose matrices are


" #
−2 10 3
AT = , cT = [1, 4, 3], BT = B, (7.29)
7 13 4

where we noted that B is a symmetric matrix. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


106 Section 7 : Matrices and Linear Algebra

7.3 Basic Matrix Operations

We now introduce the most basic algebraic operations that may be performed
on matrices; these operations are analogous to those in conventional arithmetic.

7.3.1 Equality of matrices

Two matrices A and B are said to be equal if they have the same number of
rows and columns, and if their corresponding elements are equal, that is,

A=B if and only if aij = bij . (7.30)

In some cases this property can be used to deduce the elements of a matrix.

Example 7.5 Deduce the elements of B given that


" # " #
2 −4 b11 b12
A= , B= , and A = B. (7.31)
−1 0 b21 b22

I Solution: The elements of B are b11 = 2, b12 = −4, b21 = −1, b22 = 0. J

7.3.2 Addition and subtraction

Two matrices A = [aij ] and B = [bij ] can be added (or subtracted) to form
a another matrix C = [cij ] if and only if they have the same number of rows
and columns. Indeed, addition (or subtraction) is then accomplished by simply
adding (or subtracting) the corresponding elements, i.e.,

C=A+B means [cij ] = [aij + bij ], (7.32)

Addition and subtraction is not defined if A and B are of different sizes.

Example 7.6 Let A and B be 2 × 3 matrices defined by


" # " #
2 −3 10 1 3 5
A= and B= . (7.33)
9 4 5 −8 4 4

Find the matrices: (a) C = A + B; (b) D = A − B; and (c) E = B − A.

I Solution: We compute each of the matrices in turn.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 107

(a) The matrix C is given by


" # " #
2 −3 10 1 3 5
C=A+B= + (7.34)
9 4 5 −8 4 4
" # " #
(2 + 1) (−3 + 3) (10 + 5) 3 0 15
= = .
(9 − 8) (4 + 4) (5 + 4) 1 8 9

(b) The matrix D is given by


" # " #
2 −3 10 1 3 5
D=A−B= − (7.35)
9 4 5 −8 4 4
" # " #
(2 − 1) (−3 − 3) (10 − 5) 1 −6 5
= = .
(9 + 8) (4 − 4) (5 − 4) 17 0 1

(c) The matrix E is given by


" # " #
1 3 5 2 −3 10
E=B−A= − (7.36)
−8 4 4 9 4 5
" # " #
(1 − 2) (3 + 3) (5 − 10) −1 6 −5
= = .
(−8 − 9) (4 − 4) (4 − 5) −17 0 −1

Notice as expected that the elements of D and E differ by a factor of −1. J

7.3.3 Zero matrix

The zero matrix 0 is a matrix for which all the elements are 0. For instance,
the 1 × 4, 2 × 2 and 2 × 3 zero matrices are
" # " #
h i 0 0 0 0 0
0 0 0 0 , , and
0 0 0 0 0

respectively. Notice that zero matrices can be constructed of any size.

The zero matrix 0 works in an analogous fashion to the way the number 0
works in conventional arithmetic. Hence, for any matrix A we have

A+0=A and A − A = 0. (7.37)

These results follow from the fact that aij + 0 = aij and aij − aij = 0.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


108 Section 7 : Matrices and Linear Algebra

7.3.4 Scalar multiplication

Multiplication of a matrix A = [aij ] by a scalar k is defined by multiplying


each of the elements of A by k, viz.

kA = k[aij ] = [kaij ]. (7.38)

For example, if A is the matrix defined by


 
2 −3
A= 9 0 , (7.39)
 
12 5

then we have
     
2
4 −6 −1 3
−2 3
1
2A =  18 0 , A= 3 0 , −A =  −9 −0  . (7.40)
     
3
5
24 10 4 3
−12 −5

Notice that multiplication by zero yields a zero matrix, i.e., 0A = 0.


Example 7.7 Let A and B be 2 × 3 matrices defined by
" # " #
2 −3 10 1 3 5
A= and B= . (7.41)
9 4 5 −8 4 4

Determine: (a) C = 2A + B; (b) D = 12 (A + B); and (c) E = 3B − A.

I Solution: We compute each of the matrices in turn.


(a) The matrix C is given by
" # " #
2 −3 10 1 3 5
C = 2A + B = 2 + (7.42)
9 4 5 −8 4 4
" # " # " #
4 −6 20 1 3 5 5 −3 25
= + = .
18 8 10 −8 4 4 10 12 14

(b) The matrix D is given by


" # " #
3 15
1 (2 + 1) (−3 + 3) (10 + 5) 0
D = 21 (A + B) = = 2
1
2
9
.
2 (9 − 8) (4 + 4) (5 + 4) 2
4 2
(7.43)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 109

(c) The matrix E is given by


" # " #
1 3 5 2 −3 10
E = 3B − A = 3 − (7.44)
−8 4 4 9 4 5
" # " # " #
3 9 15 2 −3 10 1 12 5
= − = .
−24 12 12 9 4 5 −33 8 7

Notice in part (b) that D = 12 (A + B) = 21 A + 12 B. J

7.3.5 Summary of basic matrix operations

The examples above demonstrate that basic matrix arithmetic is similar to


conventional arithmetic. Indeed, the following results may be shown:

Result 7.1 If A, B, and C are matrices of the same size, then the rules
of commutativity and associativity are respectively

A + B = B + A, (7.45)
(A + B) + C = A + (B + C). (7.46)

Likewise, multiplication by scalars k1 and k2 is distributive, i.e.,

k1 (A + B) = k1 A + k1 B, (7.47)
(k1 + k2 )A = k1 A + k2 A. (7.48)

It may be shown that (see Example 7.8)

(A + B)T = AT + BT . (7.49)

These results may be proved by writing the matrices in component form.

Example 7.8 Prove that (A + B)T = AT + BT .

I Solution: In the general element notation A = [aij ] and B = [bij ] we have

(A + B)T = [aij + bij ]T = [aji + bji ]


= [aji ] + [bji ] = [aij ]T + [bij ]T = AT + BT (7.50)

as required (see Definition 7.3). J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


110 Section 7 : Matrices and Linear Algebra

7.4 Matrix Multiplication

In this section we define the binary operation of multiplying two matrices to-
gether, beginning with row and column matrices.

7.4.1 Multiplying row and column matrices (inner product)

A (1 × n) row vector A and an (n × 1) column vector B can be multiplied


together as the inner product of A and B, denoted AB:

Definition 7.4 Let A = [a1k ] be a (1 × n) row vector, and let B = [bk1 ]


be an (n × 1) column vector, then the inner product of A and B is
 
b11
i b21 
h 
AB = a11 a12 . . . a1n   ..  = a11 b11 + a12 b21 + · · · + a1n bn1 .

 . 
bn1
(7.51)
In this way the inner product returns a scalar (a pure number) rather than
a matrix. Indeed, in summation notation we have
n
X
AB = a11 b11 + a12 b21 + · · · + a1n bn1 = a1k bk1 . (7.52)
k=1

Note: The inner product of A and B is defined such that:

(i) The number of columns of A is equal to the number of rows of B.


(ii) The order of the product is ‘row into column’.

Example 7.9 Find the inner product of A = [1, −2, 0] and B = [4, −5, −6]T .

I Solution: By Definition 7.4, the inner product of A and B is


 
h i 4
AB = 1 −2 0  −5  = (1×4)+(−2×−5)+(0×−6) = 14. (7.53)
 
−6

Here the column vector B has been defined as the transpose of a row vector;
this is a common notation for writing column vectors in the body of text. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 111

Example 7.10 Determine all the possible products of the following vectors:
     
    8 0 5
r= 1 4 , s= 6 7 , a= , b= , c= .
3 9 2

I Solution: The permitted products are


 
  8
ra = 1 4 = (1 × 8) + (4 × 3) = 20, (7.54a)
3
 
  0
rb = 1 4 = (1 × 0) + (4 × 9) = 36, (7.54b)
9
 
  5
rc = 1 4 = (1 × 5) + (4 × 2) = 13, (7.54c)
2
 
  8
sa = 6 7 = (6 × 8) + (7 × 3) = 69, (7.54d)
3
 
  0
sb = 6 7 = (6 × 0) + (7 × 9) = 63, (7.54e)
9
 
  5
sc = 6 7 = (6 × 5) + (7 × 2) = 44, (7.54f)
2

where we used the rule that the product is defined for ‘rows into columns’. J

7.4.2 Multiplying general matrices

The our method for multiplying row and column vectors (the inner product) is
used to define the matrix product as follows:

Definition 7.5 Let A = [aik ] be an (m × n) matrix, and B = [bkj ] be


an (n × p) matrix. Then the matrix product of A and B, denoted AB,
produces an (m × p) matrix C = [cij ] whose elements are given by
n
X
cij = ai1 b1j + ai2 b2j + · · · + ain bnj = aik bkj . (7.55)
k=1

Thus, the element cij is the inner product of the ith row of A with the
jth column of B (see figure 7.2). The matrix product AB is only defined
if the number of columns of A is equal to the number of rows of B.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


112 Section 7 : Matrices and Linear Algebra

Figure 7.2: Geometric representation of a 3 × 4 matrix A = [aik ] multiplying a 4 × 5


matrix B = [bkj ] to produce a 3 × 5 matrix C = [cij ] = AB. The inner productPof the ith
row of A with the jth column of B produces the element cij in C; e.g., c24 = k a2k bk4 .

Example 7.11 Let A and B be the matrices defined by


" # " #
1 4 8 0 5
A= and B= . (7.56)
6 7 3 9 2

Evaluate the matrix product AB. Is it possible to evaluate BA?

I Solution: The product AB is given by


       
  8   0   5
" #" # 1 4 1 4 1 4
1 4 8 0 5  3 9 2 
=
 
      
6 7 3 9 2    8   0   5 
6 7 6 7 6 7
3 9 2
" #
20 36 13
= , (7.57)
69 63 44

where the final line follows from the results in equations (7.54). The product
BA is not defined because the number of columns of B is not equal to the
number of rows of A, i.e., B is a (2 × 3) matrix, and A is a (2 × 2) matrix. J

Example 7.12 Let A and B be the matrices defined by


 
2 0
h i  1 −3 
A= 1 2 0 4 and B= . (7.58)
 
 3 2 
0 1

Evaluate the matrix product AB. Is it possible to evaluate BA?

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 113

I Solution: The matrix product AB is given by


     
2 0
   1    −3   h i
AB =  1 2 0 4  1 2 0 4   = 4 −2 .
     
 
  3   2  
0 1

Since B is a (4 × 2) matrix, and A is a (1 × 4) matrix, BA is not defined. J

7.4.3 Properties of matrix multiplication

Matrix multiplication has several important differences when compared to the


multiplication of pure numbers; we survey some of these proprieties below.

Non-commutativity

Matrix multiplication is non-commutative, that is, in general

AB 6= BA. (7.59)

This property is typically the case even when AB and BA both exist.
Example 7.13 Let A and B be the matrices defined by
 
" # 0 1
2 0 1
A= and B =  −3 1  . (7.60)
 
−1 1 3
2 0

By evaluating the matrix products, verify that AB 6= BA.

I Solution: Evaluating the product AB we have


 
" # 0 1 " #
2 0 1  2 2
AB =  −3 1 = . (7.61)

−1 1 3 3 0
2 0

Evaluating the product AB we have


   
0 1 " # −1 1 3
2 0 1
BA =  −3 1  =  −7 1 0  . (7.62)
   
−1 1 3
2 0 4 0 2

Hence, AB 6= BA; indeed, AB and BA are also different sizes. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


114 Section 7 : Matrices and Linear Algebra

Distributivity

Matrix multiplication is distributive, that is,

A(B + C) = AB + AC (7.63)

provided the products exist.


Example 7.14 Let A, B, and C be the matrices defined by
" # " # " #
2 0 1 −1 0 1
A= , B= , C= . (7.64)
1 1 2 1 −1 1

By evaluating the matrix products, verify that A(B + C) = AB + AC.

I Solution: Evaluating A(B + C) we have


" #" #
2 0 (1 + 0) (−1 + 1)
A(B + C) =
1 1 (2 − 1) (1 + 1)
" #" # " #
2 0 1 0 2 0
= = . (7.65)
1 1 1 2 2 2

Evaluating AB + AC we have
" #" # " #" #
2 0 1 −1 2 0 0 1
AB + AC = +
1 1 2 1 1 1 −1 1
" # " # " #
2 −2 0 2 2 0
= + = . (7.66)
3 0 −1 2 2 2

Hence, comparing equations (7.65) and (7.66), A(B + C) = AB + AC. J


Example 7.15 Let A = [aij ] be an (m × n) matrix, and let B = [bjk ] and
C = [cjk ] both be (n × p) matrices; prove that A(B + C) = AB + AC.

I Solution: Using the general element notation we have by Definition 7.5 that
" n # " n ! n
!#
X X X
A(B + C) = aij (bjk + cjk ) = aij bjk + aij cjk
j=1 j=1 j=1
" n
# " n
#
X X
= aij bjk + aij cjk = AB + AC (7.67)
j=1 j=1

as required. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 115

Associativity

The matrix product obeys the law of associativity

A(BC) = (AB)C, (7.68)

provided that the order of the multiplications is preserved.


Example 7.16 Let A, B, and C be the matrices defined by
" # " # " #
2 0 1 −1 0 1
A= , B= , C= . (7.69)
1 1 2 1 −1 1

By evaluating the matrix products, verify that A(BC) = (AB)C.

I Solution: Evaluating A(BC) we have


" # " #" #!
2 0 1 −1 0 1
A(BC) =
1 1 2 1 −1 1
" #" # " #
2 0 1 0 2 0
= = . (7.70)
1 1 −1 3 0 3

Likewie, evaluating (AB)C we have


" #" #! " #
2 0 1 −1 0 1
(AB)C =
1 1 2 1 −1 1
" #" # " #
2 0 0 1 2 0
= = . (7.71)
1 1 −1 1 0 3

Hence, comparing equations (7.70) and (7.71), A(BC) = (AB)C. J


Example 7.17 Let A = [aij ] be an (m×n) matrix, let B = [bjk ] be an (n×p)
matrices, and let C = [ckl ] be a (p × q) matrix; prove that A(BC) = (AB)C.

I Solution: Using the general element notation we have by Definition 7.5 that
p
" n !# " n p #
X X XX
A(BC) = aij bjk ckl = aij bjk ckl (7.72)
j=1 k=1 j=1 k=1
p p
" n
# " n
! #
XX X X
= aij bjk ckl = aij bjk ckl = (AB)C
k=1 j=1 k=1 j=1

as required. Notice that A(BC) = (AB)C is an (m × q) matrix. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


116 Section 7 : Matrices and Linear Algebra

Identity

Multiplying a matrix A by the identity matrix I leaves A unchanged, i.e.,

IA = AI = A; (7.73)

in this sense I is analogous to unity (1) in the arithmetic of pure numbers.


Example 7.18 Let A be an arbitrary (2 × 2) matrix
" #
a11 a12
A= . (7.74)
a21 a22

By evaluating the matrix products, verify that IA = AI = A.

I Solution: Evaluating the product IA we have


" #" # " #
1 0 a11 a12 (a11 + 0) (a12 + 0)
IA = = =A (7.75)
0 1 a21 a22 (0 + a21 ) (0 + a22 )

as required. Similarly, evaluating AI we have


" #" # " #
a11 a12 1 0 (a11 + 0) (0 + a12 )
AI = = =A (7.76)
a21 a22 0 1 (a21 + 0) (0 + a22 )

as required. J

Zero matrix

It is clear from the Definition 7.5 that the product of a matrix A with an
appropriately sized zero matrix 0 will yield another zero matrix, i.e.,

0A = 0, and A0 = 0. (7.77)

As we illustrate in Example 7.19, however, the matrix equation AB = 0 does


not imply either A = 0 or B = 0.
Example 7.19 Let A and B be the matrices defined by
" # " #
−9 3 1 −2
A= and B= . (7.78)
3 −1 3 −6

By evaluating the matrix products, verify that AB = 0.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 117

I Solution: Evaluating the product AB we have


" #" # " #
−9 3 1 −2 (−9 + 9) (18 − 18)
AB = = = 0. (7.79)
3 −1 3 −6 (3 − 3) (−12 + 12)

This example shows that AB = 0 does not imply either A = 0 or B = 0. J

Transpose

If A is an (m × n) matrix, and if B is an (n × p) matrix, then it may be shown


that
(AB)T = BT AT . (7.80)

This result follows by comparing the entries of (AB)T and BT AT .

Powers

A square matrix A may be multiplied by itself, and for this reason it is useful
to define the ‘square’ and ‘cube of a matrix’, etc.; thus, if k is an integer, then

Ak = AA . . . A} .
| {z (7.81)
k factors

Note in general (AB)2 = (AB)(AB) 6= (AA)(BB) = A2 B2 , and so forth.

Summary of properties

Result 7.2 Matrix multiplication satisfies the following properties

A(B + C) = AB + AC (distributivity) (7.82)


AB 6= BA (in general) (7.83)
A(BC) = (AB)C (associativity) (7.84)
AI = IA = A (identity) (7.85)
AB = 0 does not imply B = 0 (7.86)
(AB)T = BT AT (transpose) (7.87)
A2 = AA (and so forth) (7.88)

Note: These properties differ to those of conventional arithmetic.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


118 Section 7 : Matrices and Linear Algebra

7.4.4 Multiplication and systems of equations

Consider the system of n linear equations in n unknowns x1 , . . . , xn given by

a11 x1 + a12 x2 + . . . + a1n xn = b1 (7.89a)


a21 x1 + a22 x2 + . . . + a2n xn = b2 (7.89b)
.. .. .. .. ..
. . . . .
an1 x1 + an1 x2 + . . . + ann xn = bn . (7.89c)

where the coefficients aij and bi are known quantities. By defining an (n × n)


matrix of coefficients A = [aij ], an (n × 1) matrix of unknowns x, and an
(n × 1) matrix of constants (or matrix of knowns) b, i.e.,
     
a11 a12 . . . a1n x1 b1
 a21 a22 . . . a2n   x2   b2 
     
A=  .. .. . . ,
..  x=  ..  ,
 b=  ..  , (7.90)

 . . . .   .   . 
an1 an2 . . . ann xn bn

the linear system (7.89) may be written using the matrix product as
    
a11 a12 . . . a1n x1 b1
 a21 a22 . . . a2n   x2   b2 
    
  ..  =  ..  , (7.91)
 . .. . . ..     
 . .
 . . .  .   . 
an1 an2 . . . ann xn bn

that is,
Ax = b. (7.92)

This discussion verifies our earlier claim that systems of linear equations can
be represented by matrix equations (see §7.1).

7.5 Determinants

Let x1 and x2 be unknown quantities given by the simultaneous equations

a11 x1 + a12 x2 = b1 (7.93a)


a21 x1 + a22 x2 = b2 , (7.93b)

where the coefficients a11 , a12 , a21 , a22 , and b1 , b2 are known quantities.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 119

System (7.93) may be represented by the matrix equation

Ax = b, (7.94)

with
" # " # " #
a11 a12 x1 b1
A= , x= , and b= . (7.95)
a21 a22 x2 b2

Solving equations (7.93a) and (7.93b) simultaneously for x1 and x2 we have

a22 b1 − a12 b2 a11 b2 − a21 b1


x1 = and x2 = . (7.96)
a11 a22 − a21 a12 a11 a22 − a21 a12

Thus, unique solution for x1 and x2 only exist when (a11 a22 − a21 a12 ) 6= 0.
Because it determines whether equations (7.93a) and (7.93b) have a unique
solution, the quantity (a11 a22 −a21 a12 ) is called the determinant of the matrix
A, and is denoted as either det(A), or ∆, or |A|, i.e.,

a11 a12
det(A) = ∆ = = (a11 a22 − a21 a12 ). (7.97)
a21 a22

In this section we introduce the theory of determinants for square matrices of


arbitrary size, beginning with the determinant of a 2 × 2 matrix.

7.5.1 Determinant of a 2 × 2 matrix

Our discussion above motivates the following definition:

Definition 7.6 Let A be the (2 × 2) matrix


" #
a11 a12
A= . (7.98)
a21 a22

Then the determinant of A is denoted either det(A), or ∆, or |A|, and


is a scalar quantity defined by

a11 a12
det(A) ≡ ∆ ≡ = (a11 a22 − a21 a12 ). (7.99)
a21 a22

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


120 Section 7 : Matrices and Linear Algebra

Example 7.20 Evaluate the determinants of the following matrices:


" # " #
−9 3 4 1
A= and B= . (7.100)
3 −1 2 3

I Solution: By Definition 7.6 the determinants of A and B are

−9 3
det(A) = = (−9 × −1) − (3 × 3) = 0. (7.101)
3 −1

and

4 1
det(B) = = (4 × 3) − (2 × 1) = 10. (7.102)
2 3

respectively. J

7.5.2 Introducing determinants of n × n matrices

The determinant of a matrix is only defined for square matrices. We now


generalise our ideas about the determinant of a 2 × 2 square matrix (Definition
7.6) to an arbitrary n × n square matrix of the form
 
a11 a12 . . . a1n
 a21 a22 . . . a2n 
 
A = [aij ] = 
 .. .. . . .
..  (7.103)
 . . . . 
an1 an2 . . . ann

To this end we must first define the minors and a cofactors of a matrix.

7.5.3 Minors of a matrix

Associated with each element aij of an n × n matrix A = [aij ] is a scalar


quantity Mij known as a minor.

Definition 7.7 The minor Mij associated with each element aij of an
n × n matrix A = [aij ] is the determinant of the (n − 1) × (n − 1) matrix
obtained by striking-out (removing) the ith row and jth column of A. The
matrix of minors of A is the matrix M defined by M = [Mij ].

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 121

Let us illustrate this idea by example.


Example 7.21 Determine all the minors of the matrix
 
5 1 2
A= 4 1 2 . (7.104)
 
−2 −1 −1

I Solution: We compute each of the minors Mij according to Definition 7.7.


The minor M11 is found by striking-out (removing) the first row, and first
column, and evaluating the determinant of the resulting 2 × 2 matrix, viz.

5A 1A 2A


1 2
M11 = 4A 1 2 = = (1 × −1) − (−1 × 2) = 1. (7.105)
−1 −1
−2A −1 −1

Likewise, the minor M12 is found by striking-out the first row, and second
column, and evaluating the determinant of the resulting 2 × 2 matrix, viz.

5A 1A 2A


4 2
M12 = 4 1A 2 = = (4 × −1) − (−2 × 2) = 0. (7.106)
−2 −1
−2 −1A −1

The minor M13 is found by striking-out the first row, and third column, viz.

5A 1A 2A


4 1
M13 = 4 1 2A = = (4×−1)−(−2×1) = −2. (7.107)
−2 −1
−2 −1 −1A

Proceeding in this fashion, the M21 , M22 , and M23 minors are

5A 1 2
1 2
M21 = 4A 1A 2A = = (1 × −1) − (−1 × 2) = 1, (7.108)
−1 −1
−2A −1 −1

5 1A 2
5 2
M22 = 4A 1A 2A = = (5×−1)−(−2×2) = −1, (7.109)
−2 −1
−2 −1A −1

5 1 2A
5 1
M23 = 4A 1A 2A = = (5×−1)−(−2×1) = −3. (7.110)
−2 −1
−2 −1 −1A

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


122 Section 7 : Matrices and Linear Algebra

Finally, the M31 , M32 , and M33 minors are

5A 1 2
1 2
M31 = 4A 1 2 = = (1 × 2) − (1 × 2) = 0, (7.111)
1 2
−2A −1A −1A
5 1A 2
5 2
M32 = 4 1A 2 = = (5 × 2) − (4 × 2) = 2, (7.112)
4 2
−2A −1A −1A
5 1 2A
5 1
M33 = 4 1 2A = = (5 × 1) − (4 × 1) = 1. (7.113)
4 1
−2A −1A −1A

Note: The minors can be collected together as a matrix M, i.e.,


   
M11 M12 M13 1 0 −2
M = [Mij ] =  M21 M22 M23  =  1 −1 −3  . (7.114)
   
M31 M32 M33 0 2 1

This matrix M = [Mij ] is the matrix of minors of A (see Definition 7.7). J

7.5.4 Cofactors of a matrix

Associated with each element aij of an n × n matrix A = [aij ] is a scalar


quantity Cij known as a cofactor.

Definition 7.8 The cofactor Cij associated with each element aij of an
n × n matrix A = [aij ] is a scalar quantity defined by

Cij = (−1)(i+j) Mij , (7.115)

where Mij is the corresponding minor; thus, Cij is a minor with a sign
attached. Notice that the sign (−1)(i+j) is positive if (i + j) is even, and
negative if (i+j) is odd, e.g., for a 3×3 matrix the signs follow the pattern
 
+ − +
 − + −  (7.116)
 
+ − +

The matrix of cofactors of A is the matrix C defined by C = [Cij ].

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 123

Example 7.22 Write down expressions for the minors Mij and cofactors Cij
of the arbitrary 3 × 3 matrix
 
a11 a12 a13
A =  a21 a22 a23  . (7.117)
 
a31 a32 a33

I Solution: By Definition 7.7, the minors are given by

a22 a23 a21 a23 a21 a22


M11 = , M12 = , M13 = ,
a32 a33 a31 a33 a31 a32
a12 a13 a11 a13 a11 a12
M21 = , M22 = , M23 = ,
a32 a33 a31 a33 a31 a32
a12 a13 a11 a13 a11 a12
M31 = , M32 = , M33 = .
a22 a23 a21 a23 a21 a22

By Definition 7.8, the cofactors are Cij = (−1)(i+j) Mij , that is,

C11 = +M11 , C12 = −M12 , C13 = +M13 ,


C21 = −M21 , C22 = +M22 , C23 = −M23 ,
C31 = +M31 , C32 = −M32 , C33 = +M33 .

Notice here that the signs attached to the minors Mij follow the checker-board
pattern depicted in expression (7.116). J

Example 7.23 Find all the cofactors Cij of the matrix A from Example 7.21.

I Solution: In Example 7.21 we found that the minors of A are


   
M11 M12 M13 1 0 −2
M =  M21 M22 M23  =  1 −1 −3  .
   
M31 M32 M33 0 2 1

The corresponding cofactors of A may be listed in a matrix C = [Cij ] as


     
C11 C12 C13 +M11 −M12 +M13 1 0 −2
C =  C21 C22 C23  =  −M21 +M22 −M23  =  −1 −1 3 
     
C31 C32 C33 +M31 −M32 +M33 0 −2 1

The matrix C = [Cij ] is the matrix of cofactors of A (see Definition 7.8).J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


124 Section 7 : Matrices and Linear Algebra

7.5.5 Definition of the determinant of an n × n matrix

The cofactors of an n×n matrix A allow us to define its determinant according


to processes known as a Laplace expansion.

Definition 7.9 The determinant of an n×n matrix A = [aij ] is a unique


scalar associated with A, and is denoted either det(A), or ∆, or |A|, i.e.,

a11 a12 . . . a1n


a21 a22 . . . a2n
det(A) = ∆ = .. .. .. .. . (7.118)
. . . .
an1 an2 . . . ann

If n = 2, then the determinant of A is given by Definition 7.6, i.e.,

a11 a12
det(A) = ∆ = = (a11 a22 − a21 a12 ). (7.119)
a21 a22

If n > 2, then the determinant of A is defined by a Laplace expansion


across any chosen row or column as follows:

◦ The Laplace expansion across a chosen row i is defined by


n
X
det(A) = ai1 Ci1 + ai2 Ci2 + · · · + ain Cin = aik Cik . (7.120)
k=1

Thus, det(A) can be found by multiplying each element in row i by its


corresponding cofactor, and then adding these products together.

◦ The Laplace expansion across a chosen column j is defined by


n
X
det(A) = a1j C1j + a2j C2j + · · · + anj Cnj = akj Ckj . (7.121)
k=1

Thus, det(A) can be found by multiplying each element in column j by


its corresponding cofactor, and then adding these products together.

Note that this definition is unambiguous, i.e., it does not matter which
row (or column) is chosen for the expansion when evaluating det(A).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 125

Example 7.24 Let A be an arbitrary 3 × 3 matrix


 
a11 a12 a13
A =  a21 a22 a23  . (7.122)
 
a31 a32 a33

Write down an expression for the determinant of A by performing a Laplace


expansion across the top row (row i = 1).

I Solution: According to equation (7.120) of Definition 7.9, the Laplace ex-


pansion along the top row (row i = 1) gives

det(A) = a11 C11 + a12 C12 + a13 C13 (7.123)

where C11 , C12 , and C13 are the cofactors associated with the elements along
the top row. Indeed, since

a22 a23 a21 a23 a21 a22


C11 = + , C12 = − , C11 = + ,
a32 a33 a31 a33 a31 a32

(see Example 7.22) we have

a22 a23 a21 a23 a21 a22


det(A) = a11 − a12 + a13 . (7.124)
a32 a33 a31 a33 a31 a32

This result is useful enough to merit commitment to memory. J

Result 7.3 The determinant of an arbitrary 3 × 3 matrix


 
a11 a12 a13
A =  a21 a22 a23  (7.125)
 
a31 a32 a33

can be found by a Laplace expansion across the top row, viz.

a22 a23 a21 a23 a21 a22


det(A) = a11 − a12 + a13 . (7.126)
a32 a33 a31 a33 a31 a32

Note: One, can of course, expand across any row, and it is often easier to
use the row or column that contains the most zeros (cf. Example 7.26).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


126 Section 7 : Matrices and Linear Algebra

Example 7.25 Evaluate the determinant of the 3 × 3 matrix


   
a11 a12 a13 5 1 2
A =  a21 a22 a23  =  4 1 2  (7.127)
   
a31 a32 a33 −2 −1 −1

by: (a) expanding across row i = 1; and (b) expanding across column j = 3.

I Solution: Recall that we computed the cofactors of A in Example 7.23, i.e.,


   
C11 C12 C13 1 0 −2
 C21 C22 C23  =  −1 −1 3 . (7.128)
   
C31 C32 C33 0 −2 1

(a) Expanding across row i = 1 we have by equation (7.120) that

det(A) = a11 C11 + a12 C12 + a13 C13


= (5 × 1) + (1 × 0) + (2 × −2) = 1. (7.129)

(b) Expanding across column j = 3 we have by equation (7.121) that

det(A) = a13 C13 + a23 C23 + a33 C33


= (2 × −2) + (2 × 3) + (−1 × 1) = 1. (7.130)

As expected, det(A) does not depend on our choice of row or column. J

Example 7.26 Evaluate the determinant of the 4 × 4 matrix


   
a11 a12 a13 a14 5 1 2 0
 a21 a22 a23 a24   4 1 2 0 
B= = . (7.131)
   
 a31 a32 a33 a34   0 −3 6 3 
a41 a42 a43 a44 −2 −1 −1 0

I Solution: Column j = 4 has only one non-zero element, making it the easiest
choice for the Laplace expansion. In particular, by equation (7.121) we have

det(B) = a14 C14 + a24 C24 + a34 C34 + a44 C44


= 0 × C14 + 0 × C24 + 3 × C34 + 0 × C44 = 3 × C34 , (7.132)

where C14 , C24 , C34 , and C44 are the cofactors associated with the elements
of column j = 4.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 127

By the definition of the cofactors of B we have

5 1 2
(3+4)
C34 = (−1) M34 = −M34 =− 4 1 2 , (7.133)
−2 −1 −1

where M34 is the minor associated with element a34 . Hence,

5 1 2
det(B) = 3 × C34 =3×− 4 1 2 = −3, (7.134)
−2 −1 −1

where we evaluated the 3 × 3 determinant by our solution to Example 7.25. J

7.5.6 Properties of determinants

It is sometimes possible to simplify the process of evaluating a determinant by


appealing to the following rules, which we state without proof.

Result 7.4 The determinant of a matrix A obeys the following properties:

1. Swapping any two rows (or columns) changes the sign of det(A).

2. If any two rows (or two columns) are equal, then the det(A) = 0.

3. The transpose leaves det(A) unchanged, i.e., det(A) = det(AT ).

4. Multiplying a row (or column) by k scales det(A) by a factor of k.

5. Adding or subtracting rows (or columns) leaves det(A) unchanged.

We discuss these rules with illustrative examples below.

1 Swapping any two rows (or columns) changes the sign of the determinant

Interchanging any two rows (or any two columns) results in the sign of the
determinant being multiplied by (−1). As an example consider

1 2
= (1 × 4) − (3 × 2) = −2. (7.135)
3 4

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


128 Section 7 : Matrices and Linear Algebra

Interchanging rows gives

3 4 1 2
= (3 × 2) − (1 × 4) = 2 = − . (7.136)
1 2 3 4

Likewise, interchanging columns gives

2 1 1 2
= (2 × 3) − (4 × 1) = 2 = − . (7.137)
4 3 3 4

2 If any two rows (or two columns) are equal, then the determinant is zero

This rule is a corollary to rule 1 above, since swapping two identical rows
or columns must: (i) leave the value of the determinant unchanged; and (ii)
multiply the determinant by (−1). These two qualities can only both be true if
the value of the determinant is zero. For example, with two identical columns

1 2 2
4 4 3 4 3 4
3 4 4 =1 −2 +2
6 6 5 6 5 6
5 6 6
= (1 × 0) − (2 × −2) + (2 × −2) = 0. (7.138)

And with two identical rows

9 8 7
8 7 9 7 9 8
9 8 7 =9 −8 +7
5 4 6 4 6 5
6 5 4
= (9 × −3) − (8 × −6) + (7 × −3) = 0. (7.139)

3 The determinant of a matrix is equal to that of its transpose

For any square matrix A, it may be shown that

det(A) = det(AT ). (7.140)

As an example, observe that

1 3 1 2
= = (1 × 4) − (3 × 2) = −2. (7.141)
2 4 3 4

This property is true for square matrices of any size (order).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 129

4 Multiplying a row (or column) by k scales the determinant by a factor of k

It follows from the idea of a Laplace expansion (Definition 7.9) that if all the
elements of a row (or column) are multiplied by a scalar k, then the value of
the determinant will change by a factor of k. For example,

1 2 3 1 2 3
6 12 18 =3 2 4 6 , (7.142)
9 10 11 9 10 11

where we have taken a common factor of k = 3 out of the second row (to see
this, consider the result of performing the Laplace expansion across row i = 2).
This property may be combined with property 2 above to deduce that if any one
row (or column) is a multiple of another row (or column), then the determinant
is zero. For instance, in the following determinant we observe that

1 5 1 1 1 1
3 10 2 =5× 3 2 2 = 0, (7.143)
5 15 3 5 3 3
| {z } | {z }
second column=5×third column second column=third column

where the final equality follows by property 2.

5 Adding or subtracting rows (or columns) leaves the determinant unchanged

Adding (or subtracting) the multiple of one row (or column) to another row
(or column) does not change the determinant. For example, let

1 2 −6
3 2 3 2 3 3
∆= 3 3 2 =1 −2 −6
−1 3 2 3 2 −1
2 −1 3
= (1 × 11) − (2 × 5) + (−6 × −9) = 55, (7.144)

where we performed the Laplace expansion across the top row. Adding twice
the third row to the first row leaves ∆ unchanged, viz.

1 + (2 × 2) 2 + (2 × −1) −6 + (2 × 3) 5 0 0
3 2
3 3 2 = 3 3 2 =5
−1 3
2 −1 3 2 −1 3
= 5 × 11 = ∆. (7.145)

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


130 Section 7 : Matrices and Linear Algebra

This example illustrates how the properties of determinants can be used to


simplify computations. We further illustrate this idea in Example 7.27 below.
Example 7.27 Let A be the the (4 × 4) matrix
 
0 2 6 4
 2 1 3 2 
A= . (7.146)
 
 0 2 6 5 
5 1 3 9

Use the properties of determinants to show that det (A) = 0.

I Solution: It is expedient to perform the Laplace expansion across the first


column due to the zeros contained therein, i.e.,

0 2 6 4    
2 6 4 2 6 4
2 1 3 2
det(A) = = 2 × − 2 6 5  + 5 × − 1 3 2  .
   
0 2 6 5
1 3 9 2 6 5
5 1 3 9
(7.147)
By properties 4 and 2 of Result 7.4 we have that

2 6 4 2 2 4
2 6 5 =3× 2 2 5 = 0. (7.148)
1 3 9 1 1 9
| {z } | {z }
common factor of 3 in second column first column=second column

Likewise, properties 4 and 2 of Result 7.4 imply that

2 6 4 1 3 2
1 3 2 =2× 1 3 2 = 0. (7.149)
2 6 5 2 6 5
| {z } | {z }
common factor of 2 in first row first row=second row

Hence, putting equations (7.148) and (7.148) into equation (7.147) we have

0 2 6 4
2 1 3 2
det(A) = =0 (7.150)
0 2 6 5
5 1 3 9

as required. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 131

7.6 Inverse of a Matrix

In conventional arithmetic, the inverse of a non zero number a 6= 0 is the


reciprocal a−1 = a1 for which
aa−1 = 1. (7.151)

Division is not defined in matrix arithmetic; however, for some (not all) square
matrices A it is possible to find an inverse matrix denoted A−1 such that

AA−1 = A−1 A = I, (7.152)

where I is the identity matrix. It turns out that a necessary and sufficient
condition for a square matrix A to have an inverse A−1 is that det (A) 6= 0.

Definition 7.10 An n × n square matrix A is said to be non-singular if


and only if
det (A) 6= 0, (7.153)

otherwise it is said to be singular. Associated with any non-singular matrix


A is a unique inverse matrix A−1 satisfying

AA−1 = A−1 A = I, (7.154)

where I is the identity matrix; it is in this sense that a non-singular matrix


A is said to be invertible. A singular matrix does not have an inverse.

Example 7.28 Consider the 2 × 2 square matrices A and B defined by


" # " #
4 6 1 −3
A= and B= . (7.155)
1 2 − 21 2

Demonstrate that A and B are both non-singular matrices. By evaluating AB


and BA, show that A and B are inverse matrices of each other.

I Solution: Evaluating the respective determinants we have


" #
4 6 1 −3 1
det(A) = = 2, and det(B) = 1
= . (7.156)
1 2 −2 2 2

Since det(A) 6= 0 and det(B) 6= 0, A and B are non-singular by definiton.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


132 Section 7 : Matrices and Linear Algebra

Evaluating the products AB and BA we have


" #" # " #
4 6 1 −3 1 0
AB = = = I, (7.157)
1 2 − 21 2 0 1

and " #" # " #


1 −3 4 6 1 0
BA = = = I. (7.158)
− 12 2 1 2 0 1

Thus, B = A−1 and A = B−1 are inverse matrices of each other. J

Example 7.29 Prove that the inverse A−1 of an invertible matrix A is unique.

I Solution: Suppose that B and C are two inverses of A, then we have

AB = BA = I and AC = CA = I. (7.159)

Multiplying the first of these equations by C we obtain

CAB = CI = C ⇔ (CA)B = IB = C B = C.⇔


(7.160)
Thus, B and C are both inverses of A if and only if B = C. It follows that
the inverse matrix A−1 is unique. J

7.6.1 Inverse of a 2 × 2 matrix

The inverse of a 2 × 2 matrix can be computed using the following method.

Method 7.1 Let A be a non-singular 2 × 2 matrix


" #
a11 a12
A= , (7.161)
a21 a22

that is, det (A) 6= 0. Then the inverse matrix of A is given by


" #
1 a 22 −a 12
A−1 = . (7.162)
det(A) −a21 a11

Note: If det (A) = 0, then A is singular, and does not have an inverse.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 133

Example 7.30 If possible, find the inverse matrix of the 2 × 2 matrix


" # " #
a11 a12 4 6
A = [aij ] = = . (7.163)
a21 a22 1 2

I Solution: We check that A is invertible by computing the determinant, viz.

4 6
det(A) = = (4 × 2) − (1 × 6) = 2. (7.164)
1 2

Since A is non-singular, i.e., det(A) 6= 0, its inverse is given by Method 7.1:


" # " # " #
1 a 22 −a 12 1 2 −6 1 −3
A−1 = = = .
det(A) −a21 a11 2 −1 4 − 12 2
(7.165)
−1
This expression for A is consistent with our findings in Exercise 7.28. J
Example 7.31 Let A be an arbitrary non-singular 2 × 2 matrix
" #
a11 a12
A = [aij ] = . (7.166)
a21 a22

In Method 7.1 we claimed that the inverse matrix of A is given by


" #
1 a 22 −a 12
A−1 = . (7.167)
det(A) −a21 a11

Verify this claim by showing that A−1 A = I and AA−1 = I.

I Solution: Evaluating A−1 A, we have with det(A) ≡ (a11 a22 − a21 a12 ) that
" #" #
−1 1 a22 −a12 a11 a12
A A=
det(A) −a21 a11 a21 a22
" #
1 (a11 a22 − a21 a12 ) (a22 a12 − a12 a22 )
=
det(A) (a11 a21 − a21 a11 ) (a11 a22 − a21 a12 )
" # " #
1 det(A) 0 1 0
= =
det(A) 0 det(A) 0 1
=I (7.168)

as required. The fact that AA−1 = I may be shown in a similar fashion.


Note: Division by zero is not defined, so A−1 only exists if det(A) 6= 0. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


134 Section 7 : Matrices and Linear Algebra

Example 7.32 Which of the following matrices has an inverse?:


" # " #
1 −3 3 6
B= , C= . (7.169)
− 12 2 2 4

Where possible, determine the inverses of the above matrices.

I Solution: Evaluating the determinants we have

1 −3 1 3 6
det(B) = = , and det(C) = = 0. (7.170)
− 12 2 2 2 4

Thus, B is a non-singular matrix, and has an inverse, whereas C is a singular


matrix, and does not have an inverse. By Method 7.1, the inverse of B is
" # " # " #
1 2 3 2 3 4 6
B−1 = =2 1 = . (7.171)
1/2 21 1 2
1 1 2

This expression for B−1 is consistent with our findings in Exercise 7.28. J

7.6.2 Determinant method for an n × n matrix

In this section we illustrate the determinant method for finding the inverse
of an n × n matrix; this method is computationally intensive, but important for
theoretical reasons. We describe an alternative approach called the Gaussian
elimination method in §7.6.4; this method is more practical for large matrices
in particular. The determinant method is given without proof as follows:

Method 7.2 Let A be a non-singular (invertable) n × n square matrix,


i.e., det(A) 6= 0. If n = 2, then A can be inverted using Method 7.1.
Otherwise, if n > 2, then A may be inverted using the following steps:

1. Check that A is non-singular by confirming that det(A) 6= 0.

2. Find the matrix of minors M = [Mij ] of A (see Definition 7.7).

3. Form the matrix of cofactors C = [Cij ] of A (see Definition 7.8).

4. Form the adjoint matrix adj(A) of A defined by adj(A) ≡ CT .

5. The inverse matrix of A is then given by A−1 = adj(A)/ det(A).

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 135

Example 7.33 Determine whether-or-not the matrix


 
5 1 2
A= 4 1 2  (7.172)
 
−2 −1 −1

has an inverse A−1 . If the inverse A−1 exists, then find it.

I Solution: We proceed using the steps outlined in Method 7.2.


◦ Step 1: Evaluating the determinant of A we have (see Example 7.25)

5 1 2
det(A) = 4 1 2 = 1; (7.173)
−2 −1 −1

thus, A is a non-singular matrix, i.e., it is invertible (see Definition 7.10).


◦ Step 2: The matrix of minors is (see Example 7.21)
   
M11 M12 M13 1 0 −2
M = [Mij ] =  M21 M22 M23  =  1 −1 −3  . (7.174)
   
M31 M32 M33 0 2 1

◦ Step 3: The matrix of cofactors is (see Definition 7.8)


   
+M11 −M12 +M13 1 0 −2
C = [Cij ] =  −M21 +M22 −M23  =  −1 −1 3 . (7.175)
   
+M31 −M32 +M33 0 −2 1

◦ Step 4: By definition, the adjoint matrix adj(A) is (see Method 7.2)


 T  
1 0 −2 1 −1 0
adj(A) = CT =  −1 −1 3  =  0 −1 −2  . (7.176)
   
0 −2 1 −2 3 1

◦ Step 5: The inverse matrix A−1 is thus (see Method 7.2)


   
1 −1 0 1 −1 0
adj(A) 1
A−1 = =  0 −1 −2  =  0 −1 −2  . (7.177)
  
det(A) 1
−2 3 1 −2 3 1

We can check this result by verifying that AA−1 = I. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


136 Section 7 : Matrices and Linear Algebra

Example 7.34 Determine whether-or-not the matrix


 
0 2 4
A= 3 0 1  (7.178)
 
0 0 1

has an inverse A−1 . If the inverse A−1 exists, then find it.

I Solution: We proceed using the steps outlined in Method 7.2.


◦ Step 1: Evaluating the determinant of A we have

0 2 4
det(A) = 3 0 1 = −6; (7.179)
0 0 1

thus, A is a non-singular matrix, i.e., it is invertible (see Definition 7.10).


◦ Step 2: According to Definition 7.7, the matrix of minors is
   
M11 M12 M13 0 3 0
M = [Mij ] =  M21 M22 M23  =  2 0 0 . (7.180)
   
M31 M32 M33 2 −12 −6

◦ Step 3: The matrix of cofactors is thus (see Definition 7.8)


   
+M11 −M12 +M13 0 −3 0
C = [Cij ] =  −M21 +M22 −M23  =  −2 0 0 . (7.181)
   
+M31 −M32 +M33 2 12 −6

◦ Step 4: By definition, the adjoint matrix adj(A) is (see Method 7.2)


 T  
0 −3 0 0 −2 2
adj(A) = CT =  −2 0 0  =  −3 0 12  . (7.182)
   
2 12 −6 0 0 −6

◦ Step 5: The inverse matrix A−1 is thus (see Method 7.2)


   
0 −2 2 0 13 − 13
adj(A) 1
A−1 = = −  −3 0 12  =  12 0 −2  . (7.183)
  
det(A) 6
0 0 −6 0 0 1

We can check this result by verifying that AA−1 = I. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 137

7.6.3 Elementary row operations (an interlude)

It is apparent from the examples above that the process of finding adj(A)
makes determinant method for inverting a matrix A computationally intensive,
especially for large matrices. In the next section we introduce a more efficient
approach called the Gaussian elimination method (§7.6.4); this method
relies on a set of manipulations known as elementary row operations:

Definition 7.11 Let Ri denote the ith row of a matrix, and let k be a
scalar, then the three kinds of elementary row operations are:

swapping rows: Rj ↔Ri (swap rows Ri and Rj )


multiplying rows: kRi →Ri (multiply row Ri by k 6= 0)
adding rows: Ri + kRj →Ri (add k lots of row Rj to row Ri )

[These operations can be achieved by appropriate matrix multiplications.]

Example 7.35 Let A be the 3 × 3 matrix defined by


 
0 1 −2
A =  1 −2 3 . (7.185)
 
2 −4 2

Find a sequence of elementary row operations that will transform A into a


3 × 3 identity matrix I.

I Solution: It is helpful to approach this problem in two stages: first (Stage


1), we transform A into an upper triangular matrix; second (Stage 2), we
transform the upper triangular matrix into I.

◦ Stage 1: Swapping rows R1 and R2 we have


   
0 1 −2 1 −2 3
 1 −2 3  R1 ↔ R2  0 1 −2  (7.186)
   
2 −4 2 2 −4 2

(where the notation R1 ↔ R2 means ‘insert R1 into the row previously occupied

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


138 Section 7 : Matrices and Linear Algebra

by R2 , and vice versa’). Now subtract k = 2 lots of row R1 from R3 to give


   
1 −2 3 1 −2 3
 0 1 −2   0 1 −2  (7.187)
   
2 −4 2 R3 − 2R1 → R3 0 0 −4

(where the notation R3 − 2R1 → R3 means ‘insert R3 − 2R1 into the row
previously occupied by R3 ’). Finally, dividing row R3 by −4, we obtain
   
1 −2 3 1 −2 3
 0 1 −2   0 1 −2  (7.188)
   
0 0 −4 − 41 R3 → R3 0 0 1

(where the notation − 41 R3 → R3 means ‘insert − 41 R3 into the row previously


occupied by R3 ’); A has now been converted into an upper triangular matrix.
◦ Stage 2: Adding 2R3 to R2 , and subtracting 3R3 from R1 we have
   
1 −2 3 R1 − 3R3 → R1 1 −2 0
 0 1 −2  R2 + 2R3 → R2  0 1 0 . (7.189)
   
0 0 1 0 0 1

Thus, adding 2R2 to R1 we have


   
1 −2 0 R1 + 2R2 → R1 1 0 0
 0 1 0   0 1 0  = I. (7.190)
   
0 0 1 0 0 1

The upper triangular matrix has now been converted to a 3 × 3 identity matrix
I; we have thus completed the process of transforming A into I as required.J

7.6.4 Gaussian elimination method

The Gaussian elimination method for determining the inverse A−1 of a matrix
A relies on the following theorem, which we state without proof.

Theorem 7.1 If a sequence of elementary row operations can be found


that transform A into the identity matrix I, then the same sequence of
elementary row operations will transform I into the inverse matrix A−1 .

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 139

It is convenient to perform the necessary sequence of row operations on A


and I simultaneously, and to this end it is common practice to join A and
I together in the form of an augmented matrix [A|I]. Thus, according to
Theorem 7.1, if a sequence of elementary row operations can be found which
drive the left-hand-side (A) of [A|I] towards the identity matrix I, then the
right-hand-side (I) will be driven towards the inverse matrix A−1 , that is,

elementary row operations


[A|I] −−−−−−−−−−−−−−→ [I|A−1 ]. (7.191)

This method for inverting matrices is called the Gaussian elimination method.

Example 7.36 Consider the 3 × 3 matrix defined by


 
0 1 −2
A =  1 −2 3 . (7.192)
 
2 −4 2

Verify that the inverse of A exists, then find it using the Gaussian elimination.

I Solution: The determinant of A is det(A) = 4; since A is non-singular, it


must be invertible (see Definition 7.10).

The augmented matrix of A with the identity matrix I is


 
0 1 −2 1 0 0
[A|I] =  1 −2 3 0 1 0 . (7.193)
 
2 −4 2 0 0 1

To obtain the inverse matrix A−1 using the Gaussian elimination method we
look for a sequence of elementary row operations that will transform the left-
hand-side (A) into the identity matrix I; this same sequence will transform the
the left-hand-side (I) into the inverse matrix A−1 (see Theorem 7.1).

We proceed in two stages using the sequence we found in Example 7.35: first
(Stage 1), we transform A into an upper triangular matrix; second (Stage 2),
we transform the upper triangular matrix into I.

◦ Stage 1: Swapping rows R1 and R2 we have


 
1 −2 3 0 1 0
R1 ↔ R2  0 1 −2 1 0 0 . (7.194)
 
2 −4 2 0 0 1

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


140 Section 7 : Matrices and Linear Algebra

Now subtract k = 2 lots of row R1 from R3 to give


 
1 −2 3 0 1 0
 0 1 −2 1 0 0 . (7.195)
 
R3 − 2R1 → R3 0 0 −4 0 −2 1

Finally, dividing row R3 by −4, we obtain


 
1 −2 3 0 1 0
 0 1 −2 1 0 0 . (7.196)
 
1
− 4 R3 → R3 0 0 1 0 12 − 41

The left-hand-side of the augmented matrix has now been transformed into
upper triangular form.
◦ Stage 2: Adding 2R3 to R2 , and subtracting 3R3 from R1 we have
 
R1 − 3R3 → R1 1 −2 0 0 − 12 4
3

R2 + 2R3 → R2  0 1 0 1 1 − 12  . (7.197)
 
1
0 0 1 0 2
− 41

Thus, adding 2R2 to R1 we have


 
R1 + 2R2 → R1 1 0 0 2 23 − 41
 0 1 0 1 1 − 12  . (7.198)
 
0 0 1 0 12 − 41

The left-hand-side has now been converted to a 3 × 3 identity matrix I, it thus


follows by Theorem 7.1 that the right-hand-side is the inverse matrix A−1 , i.e.,
 
2 32 − 14
A−1 =  1 1 − 12  . (7.199)
 
1 1
0 2 −4

We can check this result by confirming that AA−1 = A−1 A = I. J

Example 7.37 Determine whether-or-not the matrix


 
0 2 4
A= 3 0 1  (7.200)
 
0 0 1

has an inverse A−1 . If A−1 exists, then find it using Gaussian elimination.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 141

I Solution: We know that A is invertible because det(A) 6= 0 (see Example


7.34), so we proceed with the Gaussian elimination using the augmented matrix
 
0 2 4 1 0 0
[A|I] =  3 0 1 0 1 0 . (7.201)
 
0 0 1 0 0 1

◦ Stage 1: (transforming A to upper triangular form) Subtracting row R3 from


row R2 we have
 
0 2 4 1 0 0
R2 − R3 → R2  3 0 0 0 1 −1  . (7.202)
 
0 0 1 0 0 1

Swapping rows R1 and R2 we have


 
3 0 0 0 1 −1
R1 ↔ R2  0 2 4 1 0 0 . (7.203)
 
0 0 1 0 0 1

◦ Stage 2: (conversion to the identity I) Subtracting four lots of row R2 from


row R2 we have
 
3 0 0 0 1 −1
R2 − 4R3 → R2  0 2 0 1 0 −4  . (7.204)
 
0 0 1 0 0 1

1 1
Multiplying row R1 by 3
and row R2 by 2
we have
 
1 1
R
3 1
→ R1 1 0 0 0 − 13
3
1 1
R → R2  0 1 0 0 −2  . (7.205)
 
2 2 2
0 0 1 0 0 1

The left-hand-side of the augmented matrix is now the identity I; by Theorem


7.1, this means that the right-hand-side is the inverse of A, i.e.,
 
0 13 − 13
A−1 =  12 0 −2  . (7.206)
 
0 0 1

This result is consistent with our solution to Example 7.34. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


142 Section 7 : Matrices and Linear Algebra

Examples 7.36 and 7.37 use the Gaussian elimination method in two stages,
where the first stage involves transformation to upper-triangular form. In prac-
tice any suitable sequence is acceptable, as the following example shows.
Example 7.38 Determine whether-or-not the matrix
 
5 1 2
A= 4 1 2  (7.207)
 
−2 −1 −1

has an inverse A−1 . If A−1 exists, then find it using Gaussian elimination.

I Solution: We know that det(A) 6= 0 by Example 7.33, so A is invertible,


and we may proceed with the Gaussian elimination. The augmented matrix of
A with the identity matrix I is
 
5 1 2 1 0 0
[A|I] =  4 1 2 0 1 0 . (7.208)
 
−2 −1 −1 0 0 1

Subtracting row R2 from row R1 we have


 
R1 − R2 → R1 1 0 0 1 −1 0
 4 1 2 0 1 0 . (7.209)
 
−2 −1 −1 0 0 1

Adding R2 to row R3 we have


 
1 0 0 1 −1 0
 4 1 2 0 1 0 . (7.210)
 
R2 + R3 → R3 2 0 1 0 1 1

Subtracting twice R3 from row R2 we obtain


 
1 0 0 1 −1 0
R2 − 2R3 → R2  0 1 0 0 −1 −2  . (7.211)
 
2 0 1 0 1 1

Finally, subtracting twice R1 from row R3 yields


 
1 0 0 1 −1 0
 0 1 0 0 −1 −2  . (7.212)
 
R3 − 2R1 → R3 0 0 1 −2 3 1

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 143

The left-hand-side of the augmented matrix is now the identity matrix I; by


Theorem 7.1 this means that the right-hand-side is the inverse of A, i.e.,
 
1 −1 0
A−1 =  0 −1 −2  . (7.213)
 
−2 3 1

This result is consistent with our solution to Example 7.33. J

7.6.5 Inverses of products

If A and B are both non-singular matrices of the same size, then it may be
shown that
A−1 B−1 = (BA)−1 . (7.214)

This result can sometimes be used to simplify calculations.

7.7 Systems of Linear Equations

Suppose that we have a single linear equation in one unknown x, say

Ax = b (7.215)

where the coefficient A, and constant b are knowns. If A 6= 0, then the solution
x to this equation is given by multiplying through by the inverse A−1 , i.e.,

x = 1x = (A−1 A)x = A−1 (Ax) = A−1 b. (7.216)

Now consider a set of n linear equations represented by the matrix equation

Ax = b, (7.217)

where A is the matrix of coefficients, b is the matrix of knowns, and x is


the matrix of unknowns (see §7.4.4). If det(A) 6= 0, then A is non-singular
(invertible), and the solution x may be found by multiplying through by the
inverse A−1 , i.e.,

x = Ix = (A−1 A)x = A−1 (Ax) = A−1 b, (7.218)

where I is the identity matrix. This procedure for finding the solution to a
system of linear equations is known as the inverse matrix method.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


144 Section 7 : Matrices and Linear Algebra

Theorem 7.2 Consider the system of n linear equations in n unknowns


x1 , . . . , xn represented by the matrix equation

Ax = b, (7.219)

where the matrix of coefficients A = [aij ], matrix of unknowns x, and


matrix of constants (or matrix of knowns) b, are defined by
     
a11 a12 . . . a1n x1 b1
 a21 a22 . . . a2n   x2   b2 
     
A=  .. .. . . ,
..  x=  ..  ,
 b= ..  .

 . . . .   .   . 
an1 an2 . . . ann xn bn

The system of equations (7.219) has a unique solution if and only if

det(A) 6= 0, (7.220)

in which case the unique solution for the unknowns x1 , x2 , . . . , xn is

x = A−1 b. (7.221)

If det(A) = 0, then the system (7.219) does not have a unique solution x.

In the following subsections we consider two methods for solving linear equa-
tions: the inverse matrix method described above, and the method of Gaussian
elimination. Since both these methods are based on expressing the equations
using the the matrix of coefficients A, evaluating the determinant det (A)
provides a simple preliminary check for whether a unique solution exists.

7.7.1 Solution by the inverse matrix method (2 × 2 systems)

Example 7.39 Express the following equations in matrix form:

4x + 6y = −2, (7.222a)
x + 2y = 3. (7.222b)

Without solving the equations explicitly, demonstrate that they have a unique
solution. Find this solution using the inverse matrix method.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 145

I Solution: Equations (7.222) can be expressed in matrix form as

Ax = b, (7.223)

where the matrix of coefficients A, unknowns x, and knowns b are


" # " # " #
4 6 x −2
A= , x= , and b= . (7.224)
1 2 y 3

Since A is det(A) = (4 × 2 − 1 × 6) = 2 6= 0, meaning that A is non-singular


(i.e., invertible); hence, system (7.222) has a unique solution

x = A−1 b. (7.225)

In Exercise 7.30 we found that the inverse of A is


" #
1 −3
A−1 = . (7.226)
− 12 2

It follows that the solution to system (7.222) is


" # " #" # " #
x 1 −3 −2 −11
x= = A−1 b = 1
= , (7.227)
y −2 2 3 7

i.e., the equations are only both satisfied when x = −11 and y = 7. J
A linear equation in two unknowns can be thought of as an equation for a line,
e.g., the equation 2x − y = 1 is the equation for the line y = 2x − 1. In this
way, two linear equations in two unknowns can be interpreted geometrically
as a problem involving two lines. Types of solution can be classified based on
whether the equations are consistent (i.e., have a solution), and whether the
equations are independent (i.e., the equations are not multiples of each other):

• Consistent and independent equations correspond to the intersection


of two non-parallel lines at a unique point, and yield a unique solution.

• Consistent and dependent equations correspond to two identical


lines, and yield infinite solutions (each equation is a multiple of the other).

• Inconsistent equations correspond to two parallel lines, and yield no


solution (the two equations are contradictory).

These types of solution are represented geometrically in figure 7.3.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


146 Section 7 : Matrices and Linear Algebra

(a) (b) (c)

Figure 7.3: Geometric representations of linear equations in two unknowns: (a) indepen-
dent equations have a unique solution, e.g., two lines intersecting at a unique point; (b)
dependent equations have infinite solutions, e.g., two identical lines coinciding along their
length; (c) inconsistent equations have no solution, e.g., parallel lines never intersect.

7.7.2 Solution by the inverse matrix method (3 × 3 systems)

Example 7.40 Express the following equations in matrix form:

5x + y + 2z = 2 (7.228a)
4x + y + 2z = −1 (7.228b)
−2x − y − z = 3 (7.228c)

Without solving the equations explicitly, demonstrate that they have a unique
solution. Find this solution using the inverse matrix method.

I Solution: (a) System (7.233) can be expressed in matrix form as

Ax = b (7.229)

where the matrix of coefficients A, unknowns x, and knowns b are


     
5 1 2 x 2
A= 4 1 2  , x =  y  , and b =  −1 . (7.230)
     
−2 −1 −1 z 3

In Example 7.33 we found that det(A) = 1 6= 0 meaning that A is non-singular


(i.e., invertible); indeed, in Example 7.33 we showed that
 
1 −1 0
A−1 =  0 −1 −2  . (7.231)
 
−2 3 1

Since A is invertible, it follows that the system of equations (7.228) has a

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 147

unique solution given by x = A−1 b, that is,


      
x 1 −1 0 2 3
x =  y  = A−1 b =  0 −1 −2   −1  =  −5  . (7.232)
      
z −2 3 1 3 −4

Thus, equations (7.228) are only all satisfied simultaneously when x = 3,


y = −5, and z = −4. J

A linear equation in three unknown quantities can be represented geometrically


as a plane in three-dimensional space R3 . In this way a system of linear equa-
tions in three unknowns can be interpreted geometrically as a problem involving
the intersection (or otherwise) of three planes (see figures 7.4 and 7.5).

Linear equations are said to be consistent if they have at least one solution;
otherwise they are said to be inconsistent. Furthermore, if any one equation is
a linear combination of the other two, then the equations are said to be linearly
dependent, otherwise they are said to be independent. These different
possibilities for types of solution lead to the following classifications:

• Consistent and independent equations correspond to the intersection


of three planes at a unique point, and yield a unique solution.

• Consistent and dependent equations correspond to three planes in-


tersecting along a line, and yield infinite solutions.

• Inconsistent equations cannot all be satisfied simultaneously (the equa-


tions are contradictory) and yield no solution, e.g., three parallel planes.

These types of solution are represented geometrically in figures 7.4 and 7.5.

(a) (b)

Figure 7.4: Geometric representations of consistent linear equations in three unknowns:


(a) independent equations have a unique solution, e.g., three planes intersecting at a point;
(b) dependent equations have infinite solutions, e.g., three planes intersecting along a line.

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


148 Section 7 : Matrices and Linear Algebra

(a) (b) (c)

Figure 7.5: Geometric representations of inconsistent linear equations in three unknowns.


These representations correspond to systems in which: (a) it is not possible to satisfy any
two equations simultaneously; (b) two pairs of equations can be satisfied simultaneously, but
not all three; (c) any pair of equations can be satisfied simultaneously, but not all three.

7.7.3 Systems of linear equations with changing inputs

Solving a system of equations by the inverse matrix method is often computa-


tionally expensive; however, once the inverse matrix is found, it can sometimes
be applied to a range of systems. This aspect of the inverse matrix method
makes it particularly suitable for handling systems involving changing inputs.

Example 7.41 Figure 7.6 depicts a circuit comprising three current loops I1 ,
I2 , and I3 , and input voltage sources v1 = 4, v2 = 3, and v3 = 4. It may be
shown (cf. Exercise 7.1) that the currents satisfy the equations

5I1 + 0I2 − 2I3 = (v1 − v2 ), (7.233a)


0I1 + 9I2 − 3I3 = v2 , (7.233b)
−2I1 − 3I2 + 5I3 = v3 , (7.233c)

(a) Use the inverse matrix method to find I1 , I2 , and I3 .


(b) How do the currents change if v3 is increased to v3 = 6?

Figure 7.6: Three current loops I1 , I2 , and I3 , and three input voltages v1 , v2 , and v3 .

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 149

I Solution: (a) System (7.233) can be expressed in matrix form as

Ax = b (7.234)

where the matrix of coefficients A, unknowns x, and knowns b are


     
5 0 −2 I1 v1 − v2
A= 0 9 −3  , x =  I2  , b =  v2 . (7.235)
     
−2 −3 5 I3 v3

The determinant of A is

5 0 −2
9 −3 0 9
det(A) = 0 9 −3 =5 −2 = 144. (7.236)
−3 5 −2 3
−2 −3 5

Since det(A) 6= 0, we have that A is non-singular (i.e., invertible); it follows


that the system of equations (7.222) has a unique solution given by x = A−1 b.

Using the methods described in §7.6, it may be shown that


 
1 1 1
4 24 8
A−1 =  1 7 5
. (7.237)
 
24 48 48
1 5 5
8 48 16

With input voltages v1 = 4, v2 = 3, and v3 = 4, such that (v1 − v2 ) = 1, the


matrix of knowns is b = [1, 3, 4]T ; thus, the solution to system (7.222) is
      
1 1 1 7
I1 4 24 8
1 8
x =  I2  = A−1 b =  1 7 5
 3  =  43
, (7.238)
      
24 48 48 48
1 5 5 27
I3 8 48 16
4 16

that is, I1 = 87 , I2 = 43
48
, and I3 = 27
16
.

(b) If the input voltage v3 is increased to v3 = 6, then the matrix of knowns


becomes b = [(v1 − v2 ), v2 , v3 ]T = [1, 3, 6]T . In this case the currents are
      
1 1 1 9
I1 4 24 8
1 8
x =  I2  = A−1 b =  1 7 5
 3  =  53
, (7.239)
      
24 48 48 48
1 5 37 37
I3 8 48 16
6 16

that is, I1 = 89 , I2 = 53
48
, and I3 = 37
16
. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


150 Section 7 : Matrices and Linear Algebra

7.7.4 Solution by Gaussian elimination (row reduction)

Gaussian elimination is a systematic procedure suitable for solving large sets of


linear equations when other approaches (e.g., the inverse matrix method) might
be prohibitively cumbersome. In addition, the Gaussian elimination method can
be used to find parametric solutions to linear equations in those instances when
unique solutions do not exist, and the inverse matrix method would fail:

Method 7.3 The Gaussian elimination method for solving a system of


linear equations Ax = b may be summarised by the following steps:

1. Form the augmented matrix [A|b]; this is shorthand for Ax = b.

2. Perform a set of elementary row operations on [A|b] that convert


its left-hand-side to upper triangular form (triangularisation).

3. Solve the resulting system of equations by back substitution.

Note: If det(A) = 0, then the equations will not have a solution, and
Step 3 will fail. In these cases Step 2 can give rise to two possibilities:

(i) If a row of zeros is obtained, then the equations have an infinite


number of solutions, which can be expressed parametrically.

(ii) If a contradiction is obtained, then the equations have no solution.

Example 7.42 Solve the following equations using Gaussian elimination:

2x + 4y + 2z = 10, (7.240a)
x + 5y + 3z = 4, (7.240b)
−2x − y − 2z = −7. (7.240c)

I Solution: System (7.240) can be expressed in matrix form as Ax = b, where


the matrix of coefficients A, unknowns x, and knowns b are
     
2 4 2 x 10
A= 1 5 3  , x =  y  , and b =  4  . (7.241)
     
−2 −1 −2 z −7

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 151

We now proceed with the Gaussian elimination according to Method 7.3.


◦ Stage 1: (augmented matrix) The augmented matrix of A with b is
 
2 4 2 10
[A|b] =  1 5 3 4 . (7.242)
 
−2 −1 −2 −7

◦ Stage 2 : (triangularisation) We convert the left-hand-side of the augmented


matrix into upper-triangular form using elementary row operations. We tabu-
late this procedure below (for reference purposes, the final column of this table
includes the form of the equations entailed by the augmented matrix):

row operations augmented matrix corresponding equations


 
2 4 2 10 2x + 4y + 2z = 10
 1 5 3 4  x + 5y + 3z = 4
−2 −1 −2 −7 −2x − y − 2z = − 7
1
 
2 R1 → R1 1 2 1 5 x + 2y + z = 5
 1 5 3 4  x + 5y + 3z = 4
−2 −1 −2 −7 −2x − y − 2z = −7
 
1 2 1 5 x + 2y + z = 5
R2 − R1 → R2  0 3 2 −1  3y + 2z = −1
R3 + 2R1 → R3 0 3 0 3 3y + 0z = 3
 
1 2 1 5 x + 2y + z = 5
 0 3 2 −1  3y + 2z = −1
R3 − R2 → R3 0 0 −2 4 − 2z = 4

The left-hand-side of the augmented matrix is now in upper triangular form.


◦ Stage 3: (back substitution) As shown in the table above, the upper triangular
form of the augmented matrix means we have converted the system to

x + 2y + z = 5,
3y + 2z = −1, (7.243)
− 2z = 4.

Here the final equation yields z = −4/2 = −2, the penultimate equation yields
y = (−1 − 2z)/3 = 1, and the first equation yields x = (5 − 2y − z) = 5.
Hence, system (7.240) has the unique solution (x, y, z) = (5, 1, −2).
Note: Gaussian elimination works because the elementary row operations have
the effect of adding or subtracting equations from each other, just as one would
do when solving simultaneous equations by substitution. Gaussian elimination
makes this process systematic, mitigating against computational error. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


152 Section 7 : Matrices and Linear Algebra

7.7.5 Parametric solutions for linearly dependent systems

A system of three linear equations is said to be linearly dependent if any one


equation can be expressed as a linear combination of the other two. Such
equations can be represented geometrically as three planes intersecting along a
line, as depicted in figure 7.4(b), and have an infinite number of solutions cor-
responding to the set of points along the line of intersection. In Example 7.43
we consider how to express solutions to dependent equations parametrically.
Example 7.43 Consider the system of linear equations

2x + y − z = 3, (7.244a)
x − 3y + 2z = 1, (7.244b)
4x − 5y + 3z = 5. (7.244c)

Without solving the equations explicitly, demonstrate that they have do not
have unique solution. Show that the equations have a parametric solution.

I Solution: System 7.244 can be expressed in matrix form as Ax = b, where


the matrix of coefficients A, unknowns x, and knowns b are
     
2 1 −1 x 3
A =  1 −3 2  , x =  y  , and b =  1 . (7.245)
     
4 −5 3 z 5

The determinant of the matrix of coefficients is

2 1 −1
det(A) = 1 −3 2 = 0. (7.246)
4 −5 3

Since A is singular, system (7.244) does not have a unique solution. We shall
look for a set of solutions to system (7.244) using Gaussian elimination.
◦ Stage 1: (augmented matrix) The augmented matrix of A with b is
 
2 1 −1 3
[A|b] =  1 −3 2 1 . (7.247)
 
4 −5 3 5

◦ Stage 2 : (triangularisation) We convert the left-hand-side of the augmented


matrix into upper-triangular form using elementary row operations. Subtracting

Engineering Mathematics : ELE00038C J.J.B. 2023-2024


Section 7 : Matrices and Linear Algebra 153

R1 and 2R2 from R3 we have


 
2 1 −1 3
 1 −3 2 1 . (7.248)
 
R3 − R1 − 2R2 → R3 0 0 0 0

Subtracting 2R2 from R1 we have


 
R1 − 2R2 → R1 0 7 −5 1
 1 −3 2 1 . (7.249)
 
0 0 0 0

Finally, swapping rows R1 and R2 we have


 
1 −3 2 1
R1 ↔ R2  0 7 −5 1 . (7.250)
 
0 0 0 0

The left-hand-side of the augmented matrix is now in upper triangular form.


◦ Stage 3 : (back substitution) The presence of a row of zeros in the augmented
matrix confirms our earlier observation that the equations to not have a unique
solution. Indeed, the augmented matrix corresponds to the set of equations

x − 3y + 2z = 1, (7.251a)
7y − 5z = 1, (7.251b)
0 = 0; (7.251c)

since the final equation is ‘0 = 0’, only two of these equations are meaningful,
which is insufficient information to fix the values of three unknowns.
We can, however, form a parametric solution by setting

z = λ, where λ∈R (7.252)

is a parameter. In this way equation (7.251b) gives

1 + 5λ
7y − 5z = 1 ⇒ y= , (7.253)
7
and equation (7.251a) gives

10 + λ
x − 3y + 2z = 1 ⇒ x= . (7.254)
7
Engineering Mathematics : ELE00038C J.J.B. 2023-2024
154 Section 7 : Matrices and Linear Algebra

Hence, system 7.244 will be satisfied by the parametric solution

10 + λ 1 + 5λ
x= , y= , z = λ, (7.255)
7 7
where λ ∈ R is a parameter that may be chosen freely.
Note: In column matrixform the parametric solution (7.255) may be written
     
10 1
x 7 7
   1 
 y  =  7  + λ  57  , (7.256)
 
z 0 1

i.e., as the vector equation for a line. Geometrically, therefore, system (7.244)
corresponds to three planes intersecting along a solution line, as in figure 7.4(b).
Selecting different values for λ selects different points on the line. J

7.7.6 Inconsistent (contradictory) systems

An inconsistent set of linear equations has no solution, as depicted geomet-


rically in figure 7.5. Attempting to perform Gaussian elimination on a set of
inconsistent equations will lead to a mathematical contradiction.
Example 7.44 Show that the following linear equations have no solution

3x + 2y − z = 4, (7.257a)
5x − y − z = 3, (7.257b)
x + 5y − z = 1. (7.257c)

I Solution: System (7.257) may be represented by the augmented matrix


 
3 2 −1 4
 5 −1 −1 3 . (7.258)
 
1 5 −1 1

Subtracting (2R1 − R2 ) from R3 we have


 
3 2 −1 4
 5 −1 −1 3 . (7.259)
 
R3 − 2R1 + R2 → R3 0 0 0 −4

The final row in this matrix requires 0 = −4, which is a contradiction. It


follows that the system (7.257) has no solution. J

Engineering Mathematics : ELE00038C J.J.B. 2023-2024

You might also like