notes and problem sheets for the course

137
Mathematics for Engineers and Scientists 4 Notes for F1.8XD2 2018 This is a one-semester course building on Mathematics for Engineers and Scientists 1, 2 and 3. There are three main parts of the course: (1) Laplace Transforms: Laplace transforms, inverse Laplace transforms, solving differen- tial equations (DEs) and systems of DEs with Laplace transforms (Chapters 1 & 2). (2) Analytic Geometry: Revision of vector algebra, scalar and vector products, lines and planes, derivatives of scalar and vector functions, directional derivatives, linear approxi- mation of curves, tangent planes, grad, div, and curl (Chapters 3 & 4). (3) Linear Algebra: Systems of linear euations, Gaussian elimination, vectors and matri- ces, matrix algebra, inverse matrices, determinants, eigenvectors and eigenvalues, appli- cations to DEs, diagonalisation of matrices (Chapters 5, 6 & 7). Problems for tutorials can be found at the end of each chapter.

Upload: vuongdung

Post on 02-Jan-2017

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Notes and problem sheets for the course

Mathematics for Engineers andScientists 4

Notes for F1.8XD2

2018

This is a one-semester course building on Mathematics for Engineers and Scientists 1, 2and 3.

There are three main parts of the course:(1) Laplace Transforms: Laplace transforms, inverse Laplace transforms, solving differen-tial equations (DEs) and systems of DEs with Laplace transforms (Chapters 1 & 2).(2) Analytic Geometry: Revision of vector algebra, scalar and vector products, lines andplanes, derivatives of scalar and vector functions, directional derivatives, linear approxi-mation of curves, tangent planes, grad, div, and curl (Chapters 3 & 4).(3) Linear Algebra: Systems of linear euations, Gaussian elimination, vectors and matri-ces, matrix algebra, inverse matrices, determinants, eigenvectors and eigenvalues, appli-cations to DEs, diagonalisation of matrices (Chapters 5, 6 & 7).

Problems for tutorials can be found at the end of each chapter.

Page 2: Notes and problem sheets for the course

2

Page 3: Notes and problem sheets for the course

Contents

1 The Laplace Transform 11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 The Laplace Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2.1 Definitions and notation . . . . . . . . . . . . . . . . . . . . . . . . 11.2.2 Laplace transforms of some simple functions . . . . . . . . . . . . . 21.2.3 Properties of the Laplace transform . . . . . . . . . . . . . . . . . . 51.2.4 First Shift Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2.5 Table of Laplace transforms . . . . . . . . . . . . . . . . . . . . . . 7

1.3 The Inverse Laplace Transform . . . . . . . . . . . . . . . . . . . . . . . . 81.3.1 Using partial fractions . . . . . . . . . . . . . . . . . . . . . . . . . 81.3.2 Finding inverses using the first shift theorem . . . . . . . . . . . . . 101.3.3 Completing the square . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 Solution of Differential Equations Using Laplace Transforms 152.1 Laplace Transforms of Derivatives . . . . . . . . . . . . . . . . . . . . . . . 152.2 Constant-Coefficient Linear Differential Equations . . . . . . . . . . . . . . 16

2.2.1 Solution of first-order differential equations . . . . . . . . . . . . . . 162.2.2 Solution of second-order differential equations . . . . . . . . . . . . 172.2.3 An LCR circuit example . . . . . . . . . . . . . . . . . . . . . . . . 19

2.3 Differential Equations and the Dirac Delta Function . . . . . . . . . . . . . 212.4 Systems of Differential Equations . . . . . . . . . . . . . . . . . . . . . . . 262.5 Summary of Laplace transforms . . . . . . . . . . . . . . . . . . . . . . . . 312.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

3 Geometry 353.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.2 Revision of Vector Operations . . . . . . . . . . . . . . . . . . . . . . . . . 35

3.2.1 Vector addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363.2.2 Multiplication by a scalar . . . . . . . . . . . . . . . . . . . . . . . 373.2.3 Scalar product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373.2.4 Vector product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

3.3 Lines in Three Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . 423.3.1 Parametric equation of a line . . . . . . . . . . . . . . . . . . . . . 423.3.2 Angle between two lines . . . . . . . . . . . . . . . . . . . . . . . . 43

3.4 Equations of a Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.4.1 Non-parametric (Cartesian) equation for a plane . . . . . . . . . . . 43

3

Page 4: Notes and problem sheets for the course

3.4.2 Parametric representation of a plane . . . . . . . . . . . . . . . . . 463.4.3 Plane defined by three point vectors . . . . . . . . . . . . . . . . . . 483.4.4 Two intersecting planes . . . . . . . . . . . . . . . . . . . . . . . . . 493.4.5 Parallel planes and the angle between two planes . . . . . . . . . . 503.4.6 Angle between a line and a plane . . . . . . . . . . . . . . . . . . . 52

3.5 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

4 Vector Differentiation 574.1 Differentiation of Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

4.1.1 Differentiation of sums and products of vectors . . . . . . . . . . . . 584.1.2 Linear approximation of a curve in three dimensions . . . . . . . . . 58

4.2 Gradient of a Scalar Function . . . . . . . . . . . . . . . . . . . . . . . . . 604.2.1 Directional derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 614.2.2 Equations for a tangent plane and normal line . . . . . . . . . . . . 64

4.3 Introduction to div and curl . . . . . . . . . . . . . . . . . . . . . . . . . . 664.4 Summary of Vector Geometry . . . . . . . . . . . . . . . . . . . . . . . . . 704.5 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

5 Systems of Linear Equations 735.1 Linear Equations and Elementary Row Operations . . . . . . . . . . . . . 735.2 Gaussian Elimination: General Case . . . . . . . . . . . . . . . . . . . . . 805.3 Geometric Interpretation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845.4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

6 Matrices 916.1 Vectors and Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916.2 Inverse Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 956.3 Determinants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 976.4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

7 Eigenvalues and Eigenvectors 1057.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1057.2 Algebraic and Geometric Multiplicity of Eigenvalues . . . . . . . . . . . . . 1097.3 Practical Application: Mass-Spring Systems . . . . . . . . . . . . . . . . . 1137.4 Diagonalisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1147.5 Systems of Linear Differential Equations . . . . . . . . . . . . . . . . . . . 1177.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

A Useful Formulæ for F1.8XD2 125

B Partial Fractions 129

C Completing the Square 133

4

Page 5: Notes and problem sheets for the course

Chapter 1

The Laplace Transform

1.1 Introduction

Laplace transforms are an interesting field of mathematics that can be used to solve prob-lems involving differential equations and integro-differential equations. The technique isquite abstract in nature but it allows the solution of differential equations, without theneed to do any integration or differentiation. The processes of integration and differentia-tion are replaced by algebraic manipulation, which is often considered easier to apply thanconcepts taken from calculus. A further advantage of the Laplace transform method forsolving initial value problems that is the initial conditions are incorporated in an entirelynatural way.

The main reason for considering Laplace transforms at this stage is that most engineeringdisciplines engage in a subject called control engineering, where Laplace transforms areused to analyse the response of engineering systems to changes in inputs to the system,whether it be a chemical reactor vessel or an auto-pilot in a plane.

Before we can attempt to solve differential equations using the Laplace transform, weneed to introduce it and consider the Laplace transform and inverse Laplace transformfor a number of simple functions and differential operators.

1.2 The Laplace Transform

1.2.1 Definitions and notation

The Laplace transform of a function,

f(t)

is denoted by

Lf(t) =

∫ ∞

0

e−stf(t) dt . (1.1)

Alternative notation used for the Laplace transform are:

Lf(t) = F (s) or f(s) .

1

Page 6: Notes and problem sheets for the course

From (1.1) we see that the Laplace transform consists of an improper integral (one of theintegration bounds is infinite). In the first instance with an improper integral you have tofocus on whether the integral has a solution or not. For example the Laplace transformof the function

f(t) = eat

only exists if a− s < 0, otherwise the Laplace transform would be∫ ∞

0

e−stf(t) dt =

∫ ∞

0

ebt dt

with b = a− s positive so that the integral is unbounded.

Returning to the terminology used to describe the Laplace transform (1.1), e−st is calledthe kernel of the integral. In the original function, f(t), the independent variable is t,which can be considered a time variable. The function f(t) is considered to exist in thetime domain. The Laplace transform F (s) exists in a frequency domain. s is theindependent variable of the Laplace transform and strictly speaking is a complex variablealthough we shall for the most part only consider it to be real.

1.2.2 Laplace transforms of some simple functions

Consider the function,f(t) = c (1.2)

where c is a constant. The Laplace transform of (1.2) is given by

Lf(t) =

∫ ∞

0

ce−st dt .

As this is an improper integral it should be considered in the limit of the upper boundbeing finite and the limit to infinity taken once the integral is evaluated.

Lf(t) =

∫ ∞

0

ce−st dt = limb→∞

∫ b

0

ce−st dt

where∫ b

0

ce−st dt =[

−c

se−st

]b

0=

c

s

(

−e−sb − (−e0))

=c

s(1− e−sb) .

We can now let b tend to infinity,

limb→∞

c

s(1− e−sb) =

c

s.

To summarise,

Lc =c

s.

This can be considered as a Laplace transform pair,

(

f(t) = c , F (s) =c

s

)

.

2

Page 7: Notes and problem sheets for the course

Worked Examples (Evaluating Laplace transforms by direct integration). Letus consider another example in detail.

Question 1.1. Find the Laplace transform of t.

Solution. From the definition of the Laplace transform,

Lt =

∫ ∞

0

te−st dt = limb→∞

∫ b

0

te−st dt .

Integrating by parts,∫ b

0

udv

dtdt = [uv]b0 −

∫ b

0

du

dtv dt

with u = t so du/dt = 1 and dv/dt = e−st so v = −e−st/s,

∫ ∞

0

te−st dt =

[

− t

se−st

]b

0

+1

s

∫ ∞

0

e−st dt = −b

se−bs +

1

s

∫ ∞

0

e−st dt .

We could evaluate the integral on the right-hand side but we can let b tend to infinitynow and avoid the integration,

limb→∞

∫ ∞

0

te−st dt =1

s

∫ ∞

0

e−st dt =1

sL1 =

1

s2.

So the Laplace transform pair is

(

f(t) = t , F (s) =1

s2

)

.

Exercise 1.1. Use the same approach (i.e. one integration by parts) to show that

(

f(t) = t2 , F (s) =2

s3

)

.

The main point of this section is not the integration process. We are interested in growingour collection of functions that we know the Laplace transform for, although we shall notdo this by integrating the Laplace transform for every function we come across.

For example, inspecting the three Laplace transform pairs given above a pattern is emerg-ing for algebraic terms. The general rule is:

3

Page 8: Notes and problem sheets for the course

General Rule for Laplace transforms of algebraic terms.

Consider the function f(t) = tn.

Its Laplace transform is F (s) =n!

sn=1.

One more example evaluated by direct integration:

Question 1.2. Evaluate the Laplace transform of the function f(t) = ekt.

Solution.

Lekt =

∫ ∞

0

ekte−st dt = limb→∞

∫ b

0

e−(s−k)t dt ,

where

limb→∞

∫ b

0

e−(s−k)t dt =

[

− 1

s− ke−(s−k)t

]

= − 1

s− k

(

e−(s−k)b − e0]b

0,

so

Lekt = limb→∞

− 1

s− k

(

e−(s−k)b − 1]b

0=

1

s− k,

provided that s− k > 0, i.e. s > k.Hence the Laplace transform pair is

(

f(t) = ekt , F (s) =1

s− k

)

.

As you will appreciate from the above examples, deriving Laplace transforms by directintegration is quite a tedious process. To avoid direct integration many ingenious math-ematical tricks and theorems are often used to find Laplace transforms. For exampleconsider the following worked example.

Example 1.1. Evaluate the Laplace transform of the function f(t) = eiat, where a issome real number and i2 = −1.Following the same steps as in Question 1.2, the solution comes to

(

f(t) = eiat , F (s) =1

s− ia

)

.

So why have we done two worked examples that are so very similar? The answer is thatthe second leads onto an additional useful result giving us two extra Laplace transforms.Three Laplace transforms for the price of one!

4

Page 9: Notes and problem sheets for the course

Complex numbers given in exponential form can be represented using Euler’s formula

eiat = cos at+ i sin at .

Reconsidering the Laplace transform of Example 1.1,

Leiat = Lcos at + i sin at = Lcos at + iLsin at . (1.3)

The separation of the Laplace transform into an application of the Laplace transformto the two terms is possible as the Laplace transform is a linear operator. This will bediscussed further below, for now just accept it.Again from Example 1.1,

Leiat =1

s− ia=

1

s− ia× s+ ia

s+ ia=

s+ ia

s2 + a2.

So, from (1.3),

Lcos at + iLsin at =s

s2 + a2+ i

a

s2 + a2. (1.4)

Therefore equating real and imaginary parts of (1.4) gives the following results:Laplace Transforms of Trigonometric Functions:

The Laplace transform pair for cos at:

f(t) = cos at , F (s) =s

s2 + a2.

The Laplace transform pair for sin at:

f(t) = sin at , F (s) =a

s2 + a2.

1.2.3 Properties of the Laplace transform

The Laplace transform is a linear operator which means it has the property that

Lαf(t) + βg(t) = αLf(t)+ βLg(t)

where α and β are constants and f(t) and g(t) are functions.

Question 1.3. Determine L3t+ 2e3t.

Solution. Using the linearity property of the Laplace transform,

L3t+ 2e3t = 3Lt+ 2Le3t .

We can now apply the Laplace transforms derived in the previous section to get

L3t+ 2e3t =3

s2+

2

s− 3.

5

Page 10: Notes and problem sheets for the course

Question 1.4. Determine L5− 3t + 4 sin 2t− 6e4t.

Solution. Using the linearity property of the Laplace transform,

L5− 3t+ 4 sin 2t− 6e4t = 5L1 − 3Lt+ 4Lsin 2t − 6Le4t

and applying the Laplace transforms derived or presented in the previous section,

L5−3t+4 sin 2t−6e4t = 5× 1

s−3× 1

s2+4× 2

s2 + 4−6× 1

s − 4=

5

s− 3

s2+

8

s2 + 4− 6

s− 4.

Another mathematical tool that can be used to grow our collection of Laplace transformsis called the First Shift Theorem.

1.2.4 First Shift Theorem

If f(t) is a function having a Laplace transform F (s), then the function eatf(t) has aLaplace transform given by

Leatf(t) = F (s− a) .

Sometimes F (s− a) is written as [F (s)]s→s−a.

Here are a couple of worked examples using the first shift theorem to derive Laplacetransforms.

Question 1.5. Determine Lte−2t

Solution.

For f(t) = t , Lf(t) = Lt = F (s) =1

s2.

Then by the first shift theorem,

Lte−2t = F (s)s→s+2 =

[

1

s2

]

s→s+2

=1

(s+ 2)2.

Question 1.6. Determine Le−3t sin 2t

Solution.

For f(t) = sin 2t , Lf(t) = Lsin 2t = F (s) =2

s2 + 4.

Then by the first shift theorem,

Le−3t sin 2t = F (s)s→s+3 =

[

2

s2 + 4

]

s→s+3

=2

(s+ 3)2 + 4=

2

s2 + 6s+ 13.

6

Page 11: Notes and problem sheets for the course

1.2.5 Table of Laplace transforms

Deriving a Laplace transform every time a function crops up is a time-consuming process.Remembering the Laplace transforms for all of the functions given above is also not arealistic proposition for most students.

Therefore in the exam the list of Laplace transforms presented in Table 1.1 ishanded out.

The table together with the first shift theorem and the linearity property of the Laplacetransform allows you to determine the Laplace transform of many functions.

Table 1.1: Table of Laplace transforms.

f(t) F (s)

c c/s

t 1/s2

tn n!/sn+1

ekt 1/(s− k)

sin at a/(s2 + a2)

cos at s/(s2 + a2)

t sin at 2as/(s2 + a2)2

t cos at (s2 − a2)/(s2 + a2)2

af(t) + bg(t) aF (s) + bG(s)

f ′(t) sF (s)− f(0)

f ′′(t) s2F (s)− sf(0)− f ′(0)

δ(t− a) e−as

eatf(t) F (s− a)

f(t) =

g(t− a) t > a0 t < a

e−asG(s)

Table 1.1 summarises the results presented in the previous sections. In addition there areLaplace transforms for derivatives and something called the Dirac delta function. These

7

Page 12: Notes and problem sheets for the course

are useful for the solution of differential equations and will be considered in detail in thecoming sections.

Exercise 1.2. Confirm by applying the first shift theorem to the Laplace transform ofteiat that

Lt cos at =s2 − a2

(s2 + a2)2and Lt sin at =

2as

(s2 + a2)2.

1.3 The Inverse Laplace Transform

If Lf(t) = F (s) then the inverse Laplace transform, written as L−1 is L−1F (s) = f(t).

Example 1.2. As Lekt =1

s− k, L−1

1

s− k

= ekt.

Example 1.3. As Lsin at =a

s2 + a2, L−1

a

s2 + a2

= sin at.

1.3.1 Using partial fractions

The most obvious way to find an inverse transformation is to use the table of Laplacetransforms, however some manipulation of ratios of polynomials of the form

p(s)

q(s)(1.5)

is often required. For example they might be represented as partial fractions, see Ap-pendix B if your memory needs jogging.Similar to the Laplace transformation, the inverse Laplace transform is a linear operator,so

L−1αF (s) + βG(s) = αL−1F (s)+ βL−1G(s) .Using partial fractions and the linear property given above we can calculate our firstinverse Laplace transforms that do not appear in the Laplace transform Table 1.1:

Question 1.7. Find

L−1

1

(s+ 3)(s− 2)

.

8

Page 13: Notes and problem sheets for the course

Solution. We are ultimately going to use the table of Laplace transforms but the firstthing to do is represent the Laplace transform using partial fractions:

1

(s+ 3)(s− 2)=

A

(s+ 3)+

B

(s− 2)=

A(s− 2) +B(s+ 3)

(s+ 3)(s− 2)

soA(s− 2) +B(s+ 3) = 1 .

Taking s = 2 then s = −3 gives B = 1/5 and A = −1/5 so

L−1

1

(s+ 3)(s− 2)

=1

5L−1

1

(s− 2)

− 1

5L−1

1

(s+ 3)

.

By inspection of the table of Laplace transforms, the inverse Laplace transform is then

L−1

1

(s+ 3)(s− 2)

=1

5e2t − 1

5e−3t .

Question 1.8. Find

L−1

s+ 1

s2(s2 + 9)

.

Solution. The first thing to do is represent the Laplace transform using partial fractions,

s+ 1

s2(s2 + 9)=

A

s+

B

s2+

Cs+D

s2 + 9=

As(s2 + 9) +B(s2 + 9) + Cs3 +Ds2

s2(s2 + 9)

=(A+ C)s3 + (B +D)s2 + 9As+ 9B

s2(s2 + 9).

Equating terms; 1: 9B = 1; s: 9A = 1; s2: B +D = 0; s3: A+ C = 0.These give A = 1/9, B = 1/9, C = −1/9 and D = −1/9. Then

L−1

s+ 1

s2(s2 + 9)

=1

9L−1

1

s

+1

9L−1

1

s2

− 1

9L−1

s

(s2 + 9)

− 1

9L−1

1

(s2 + 9)

.

The first three terms are easy to evaluate using the table of Laplace transforms,

1

9L−1

1

s

+1

9L−1

1

s2

− 1

9L−1

s

(s2 + 9)

=1

9+

1

9t− 1

9cos 3t ,

while the fourth term requires a little more work,

1

9L−1

1

(s2 + 9)

=3

3× 9L−1

1

(s2 + 9)

=1

27L−1

3

(s2 + 9)

==1

27sin 3t ,

the key point being multiplying the rational function by 3 and dividing by 3 to give aLaplace transform that has the same form as one of the ‘standard’ transforms.This is a common operation in the business of finding inverse Laplace transformsPutting this all together,

L−1

s+ 1

s2(s2 + 9)

=1

9+

1

9t− 1

9cos 3t− 1

27sin 3t ,

9

Page 14: Notes and problem sheets for the course

1.3.2 Finding inverses using the first shift theorem

The first shift theorem applied to a inverse Laplace transform says

L−1 F (s− a) = eatf(t) .

Sometimes the alternative notation is simpler to apply:

L−1 [F (s)]s→s−a = eatf(t) .

We will only do one example in this section. However, you will have ample opportunityto see this technique throughout the rest of these notes.

Question 1.9. Find

L−1

1

(s+ 2)2

.

Solution.

L−1

1

(s+ 2)2

= L−1

[

1

s2

]

s→s+2

= te−2t .

1.3.3 Completing the square

Sometimes a quotient of the form p(s)/q(s) cannot be simplified using partial fractions(without the use of complex numbers). For example consider

2

s2 + 6s+ 13.

The quadratic term s2 + 6s+ 13 has complex roots so cannot be factorised (using purelyreal factors) and therefore partial fractions do not offer a way forward in the next workedexample. The alternative approach is to complete the square, see Appendix C if you haveforgotten how to do this.

Question 1.10. Find

L−1

2

s2 + 6s+ 13

.

Solution. As stated above the quotient cannot be represented as the sum of two partialfractions as the quadratic term s2 + 6s+ 13 has no real roots. The answer is to completethe square:

s2 + 6s+ 13 = (s+ 3)2 + 13− 32 = (s+ 3)2 + 4 .

Hence

L−1

2

s2 + 6s+ 13

= L−1

2

(s+ 3)2 + 4

= L−1

[

2

s2 + 22

]

s→s+3

= e−3t sin 2t .

10

Page 15: Notes and problem sheets for the course

Question 1.11. Find

L−1

s+ 7

s2 + 2s+ 5

.

Solution. Completing the square in the denominator, s2 + 2s+ 5 = (s+ 1)2 + 5− 1 =(s+ 1)2 + 4 so

L−1

s + 7

s2 + 2s+ 5

= L−1

s+ 7

(s+ 1)2 + 4

= L−1

s + 1 + 6

(s+ 1)2 + 4

= L−1

[

s+ 6

s2 + 4

]

s→s+1

= L−1

[

s

s2 + 4

]

s→s+1

+ L−1

[

6

s2 + 4

]

s→s+1

.

(We need to get all the s terms grouped with a “+1” if we are to use the first shifttheorem.)The first term is ready for inversion:

L−1

[

s

s2 + 4

]

s→s+1

= e−t cos 2t .

The second term requires a little manipulation to see the inverse:

L−1

[

6

s2 + 4

]

s→s+1

= 3L−1

[

2

s2 + 4

]

s→s+1

= 3e−t sin 2t .

Putting the two terms together,

L−1

s+ 7

s2 + 2s+ 5

= e−t cos 2t+ 3e−t sin 2t .

Let us consider one more example, applying the same ideas to bed them in.

Question 1.12. Find

L−1

2s− 1

s2 + 6s+ 10

.

Solution. Again we complete the square in the quadratic term, s2 + 6s+ 10 =(s+ 3)2 + 10− 32 = (s+ 3)2 + 1. Then

L−1

2s− 1

s2 + 6s+ 10

= L−1

2s− 1

(s+ 3)2 + 1

= L−1

2(s+ 3)− 7

(s + 3)2 + 1

= 2L−1

s+ 3

(s+ 3)2 + 1

− 7L−1

1

(s+ 3)2 + 1

= 2L−1

[

s

s2 + 1

]

s→s+3

− 7L−1

[

1

s2 + 1

]

s→s+3

= 2e−3t cos t− 7e−3t sin t .

This process, at least initially, has to be done step by step in a slow and methodical way,otherwise silly mistakes might creep into the solution.

11

Page 16: Notes and problem sheets for the course

1.4 Problems

Problem 1.1. Compute the Laplace transforms for the following functions from firstprinciples (i.e. carrying out the integrations!):

(i) c ; (ii) t ; (iii) ekt ;(iv) eiat ; (v) at + b ect ; (vi) e10t sin 2t ;

where a, b, c are constants and i =√−1.

Problem 1.2. Use the table of Laplace transform and the first shift theorem to find theLaplace transforms of the following functions:

(a) 5− 3t ; (d) t2e−4t ;(b) 7t3 − 2 sin 3t ; (e) (t+ 1)2 ;(c) 4t e−2t ; (f) sin2 t .

Problem 1.3. Show that Leatf(t) = F (s− a), i.e., prove the first shift theorem.

Problem 1.4. Show that Ltf(t) = −dF

ds(s) [Hint: Write F (s) using the definition of

Laplace transform, and differentiate the left- and right-hand sides of the expression withrespect to s.]

Problem 1.5. (a) Use the results from Problem 1.1 (iv) to obtain Laplace transformsof functions cos at and sin at.

(b) Use the results from Problem 1.1 (ii) and the first shift theorem to obtain Laplacetransforms of functions t cos at, t sin at.

Problem 1.6. (Advanced.) Show that the Laplace transform of f(t) = tn is F (s) =n!

sn+1. [Hint: Recursively employ integration by parts or use proof by induction.]

Problem 1.7. Use partial fractions, the first shift theorem and the table of Laplacetransforms to find the inverse Laplace transforms for the following functions

(a)1

(s+ 3)(s+ 7); (d)

3s

(s− 1)(s2 − 4);

(b)2s+ 6

s2 + 4; (e)

s

(s− 1)2(s2 + 4);

(c)4s

(s− 1)(s+ 1)2; (f)

s

s2 + 4s+ 8.

12

Page 17: Notes and problem sheets for the course

Answers

2.(e) 2/s3 + 2/s2 + 1/s

2.(f)1

2

(

1

s− s

s2 + 4

)

.

7.(a) 14(e−3t − e−7t)

7.(b) 2 cos 2t+ 3 sin 2t7.(c) et − e−t + 2te−t

7.(d) −et + 32e2t − 1

2e−2t

7.(e) 325et + 1

5tet − 3

25cos 2t− 4

25sin 2t

7.(f) e−2t(cos 2t− sin 2t).

13

Page 18: Notes and problem sheets for the course

14

Page 19: Notes and problem sheets for the course

Chapter 2

Solution of Differential EquationsUsing Laplace Transforms

2.1 Laplace Transforms of Derivatives

Consider the Laplace transform of the derivative of a function,

L

df

dt

=

∫ ∞

0

e−stdf

dtdt .

Applying integration by parts,∫

udv

dtdt = uv −

du

dtv dt ,

with u = e−st, so du/dt = −se−st, v = f and dv/dt = df/dt,∫ ∞

0

e−stdf

dtdt =

[

e−stf(t)]∞0+ s

∫ ∞

0

e−stf(t) dt = (0− f(0)) + sLf(t) .

We havethe Laplace transformation of the first derivative of a function f(t):

L

df

dt

= sF (s)− f(0) .

Similarly the Laplace transformation of a functions second derivative can be found by asecond integration by parts:the Laplace transformation of the second derivative of a function f(t):

L

d2f

dt2

= s2F (s)− sf(0)− f ′(0) .

It has to be said that in the analysis above it is assumed that the function f(t) and itsderivatives are sufficiently nice for the integrals to exist.Note the Laplace transforms of derivatives are included in the table of Laplacetransforms.

15

Page 20: Notes and problem sheets for the course

2.2 Constant-Coefficient Linear Differential Equations

2.2.1 Solution of first-order differential equations

Now that we have the Laplace transforms of derivatives and we can find inverse Laplacetransforms, we can solve differential equations without having to integrate or differentiateanything!

Example 2.1. Consider the initial value problem,

dy

dt− 2y = 2e3t , y(0) = 2 . (2.1)

Take the Laplace transform of both sides of the differential equation:

L

dy

dt− 2y

= L

dy

dt

− 2Ly = L2e3t so

sY (s)− y(0)− 2Y (s) = sY (s)− 2− 2Y (s) =2

s− 3, (2.2)

where Y (s) denotes the Laplace transform of the function y(t).We can now reorganise the above equation (2.2) to make the Laplace transform Y (s) thesubject of the equation:

(s− 2)Y (s) = 2 +2

s− 3=

2(s− 3) + 2

s− 3=

2(s− 2)

s− 3so

Y (s) =2(s− 2)

(s− 2)(s− 3)=

2

s− 3.

Now all we have to do is find the inverse Laplace transform. In this case the inversetransform can be found directly from the table of Laplace transforms,

y(t) = L−1Y (s) = L−1

2

s− 3

= 2e3t.

This is the solution to the initial value problem (2.1).

We have solved our first differential equation using the Laplace transform.

If you review the example given above you will see the Laplace-transform method forsolving differential equations can be separated into three steps:

The Laplace Transform Method.Step 1. Take the Laplace Transform of the given differential equationStep 2. Make the transformed variable (Y (s) above) the subject of the transformedequation.Step 3. Apply the inverse Laplace transform to find y(t).

As you can see from the Example 2.1, the initial value is included in the solution, withouthaving to introduce a constant A and then use the initial value to find the value of A.The Laplace transform method of solving differential equations comes into its own whenconsidering higher-order differential equations.

16

Page 21: Notes and problem sheets for the course

2.2.2 Solution of second-order differential equations

The general inhomogeneous linear second-order constant-coefficient differential equationreads

ad2y

dt2+ b

dy

dt+ cy = f(t) (with a 6= 0) .

Note that by using Laplace transforms, we can solve this equation without the need toseparate the solution into the complementary function (the solution to the homogeneousproblem (i.e. with f(t) ≡ 0) and a particular integral to extend the solution to theinhomogeneous differential equation. The solution of second-order differential equationsfollows a similar line to the solution of first-order differential equations using the Laplace-transform method.

Question 2.1. Solve the second-order differential equation

d2y

dt2+ b

dy

dt+ 6y = 0

subject to the initial values

y(0) = 1 ,dy

dt(0) = 0 .

Solution. Apply the Laplace transform to both sides of the differential equation,

L

d2y

dt2

+ L

5dy

dt

+ L6y = 0 so

s2Y (s)− sy(0)− dy

dt(0) + 5(sY (s)− y(0)) + 6Y (s) = 0 ,

substitute the initial values into the transformed equation,

s2Y (s)− s+ 5(sY (s)− 1) + 6Y (s) = 0 ,

and reorganise the transformed equation such that Y (s) is the subject of the equation,

(s2 + 5s+ 6)Y (s) = s+ 5 , i.e. Y (s) =s+ 5

s2 + 5s+ 6.

We now take the inverse Laplace transform of both sides,

y(t) = L−1Y (s) = L−1

s+ 5

s2 + 5s+ 6

. (2.3)

Considering the right-hand side of (2.3),

s+ 5

s2 + 5s+ 6=

s + 5

(s+ 2)(s+ 3)=

A

s+ 2+

B

s+ 3=

A(s+ 3) +B(s+ 2)

(s+ 2)(s+ 3)

so A(s + 3) + B(s + 2) = s + 5 and putting s = −2 and then s = −3 gives A = 3 andB = −2.Then

y(t) = L−1Y (s) = L−1

3

s+ 2+

(−2)

s+ 3

= 3L−1

1

s+ 2

−2L−1

1

s+ 3

= 3e−2t−2e−3t.

17

Page 22: Notes and problem sheets for the course

Let’s do another worked example, this time inhomogeneous, of degenerate type.

Question 2.2. Solve the second-order differential equation

d2y

dt2+ 5

dy

dt+ 6y = e−2t, (2.4)

subject to the initial data

y(0) = 1 ,dy

dt(0) = −1 .

Solution. Apply the Laplace transform to both sides of the differential equation,

L

d2y

dt2

+ 5L

dy

dt

+ 6Ly = Le−2t so

s2Y (s)− sy(0)− dy

dt(0) + 5(sY (s)− y(0)) + 6Y (s) =

1

s+ 2,

substitute the initial values into the transformed equation,

s2Y (s)− s+ 1 + 5(sY (s)− 1) + 6Y (s) =1

s+ 2,

and reorganise the transformed equation so that Y (s) is the subject of the equation,

(s2 + 5s+ 6)Y (s) = (s+ 2)(s+ 3)Y (s) =1

s+ 2+ s+ 4 =

1 + (s+ 4)(s+ 2)

s+ 2

=s2 + 6s+ 9

s+ 2=

(s+ 3)2

s+ 2

so Y (s) =(s+ 3)2

(s+ 2)2(s+ 3)=

s+ 3

(s+ 2)2.

We can now take the inverse Laplace transform of both sides,

y(t) = L−1Y (s) = L−1

s+ 3

(s+ 2)2

= L−1

(s+ 2) + 1

(s+ 2)2

= L−1

1

s+ 2+

1

(s+ 2)2

= L−1

1

s+ 2

+L−1

1

(s+ 2)2

= e−2t+L−1

[

1

s2

]

s→s+2

= e−2t+e−2tt = e−2t(1+t) .

Question 2.3. Solve the second-order differential equation,

d2y

dt2+ 9y = 0 ,

subject to the initial values, y(0) = 0 anddy

dt(0) = 1.

18

Page 23: Notes and problem sheets for the course

Solution. Apply the Laplace transform to both sides of the differential equation,

L

d2y

dt2

+ L9y = s2Y (s)− sy(0)− dy

dt(0) + 9Y (s) = 0 .

Substitute the initial values into the transformed equation,

s2Y (s)− 1 + 9Y (s) = 0 .

Reorganise the transformed equation so that Y (s) is the subject of the equation,

s2Y (s) + 9Y (s) = 1 so Y (s) =1

s2 + 9.

Take the inverse Laplace transform of both sides,

y(t) = L−1Y (s) = L−1

1

s2 + 9

=1

3L−1

3

s2 + 9

=1

3sin 3t .

2.2.3 An LCR circuit example

Before we move on, let us consider one last worked example. This is an initial valueproblem you might have seen before, but solved then using techniques considered inMathematics for Engineers and Scientists 3.The worked example is a model for an LCR circuit, see Fig. 2.1. An LCR circuit is onethat includes a resistor, a capacitor and an inductor, connected in series with a voltagesource e(t).

e(t)

i(t)

q(t)

C

L R

t = 0

Figure 2.1: An LCR circuit.

Before closing the switch at time t = 0 the charge, q, on the capacitor and the resultingcurrent, i = dq/dt, in the circuit are zero. Applying Kirchhoff’s second law to the circuitgives a second-order inhomogeneous differential equation for the charge on the capacitor,

Ld2q

dt2+R

dq

dt+

1

Cq = e(t) ,

where

q(0) = 0 anddq

dt(0) = 0 .

In the circuit equation given above the different components have the following values,R = 160Ω, L = 1H, C = 10−4F and e(t) = 20V.

19

Page 24: Notes and problem sheets for the course

Substitute the values of the electrical properties into the differential equation:

d2q

dt2+ 160

dq

dt+ 104q = 20 .

Take the Laplace transforms of the differential equation:

L

d2q

dt2

+160L

dq

dt

+104Lq = s2Q(s)−sq(0)− dq

dt(0)+160(sQ(s)−q(0))+104Q(s)

= L20 = 20/s .

Substitute in the initial values:

(s2 + 160s+ 104)Q(s) = 20/s .

Make the Laplace transform of the solution of the differential equation the subject of theequation:

Q(s) =20

s(s2 + 160s+ 104).

To take the inverse Laplace transform of the RHS, it needs to be represented using partialfractions. Note that s2 + 160s + 104 doesn’t have real factors so that we shall have tocomplete the square at some stage.

20

s(s2 + 160s+ 104)=

A

s+

Bs+ C

s2 + 160s+ 104=

A(s2 + 160s+ 104) +Bs2 + Cs

s(s2 + 160s+ 104).

Equating terms, 1: 104A = 20; s: 160A+ C = 0; s2: A+B = 0.These equations have the solution A = 1/500, B = −1/500, C = −160/500 (= −8/25)so

Q(s) =20

s(s2 + 160s+ 104)=

1

500

(

1

s− s+ 160

s2 + 160s+ 104

)

.

We now complete the square,

s2 + 160s+ 10000 = (s+ 80)2 + 3600 = (s+ 80)2 + 602.

Then

Q(s) =1

500

(

1

s− s+ 160

(s+ 80)2 + 602

)

=1

500

(

1

s− s+ 80

(s+ 80)2 + 602− 80

(s+ 80)2 + 602

)

=1

500

(

1

s− s+ 80

(s+ 80)2 + 602− 4

3

60

(s+ 80)2 + 602

)

.

Then

L−1

20

s(s2 + 160s+ 104)

=1

500L−1

1

s− s+ 80

(s+ 80)2 + 602− 4

3

60

(s+ 80)2 + 602

=1

500L−1

1

s−[

s

s2 + 602

]

s→s+80

− 4

3

[

60

s2 + 602

]

s→s+80

=1

500

(

1− e−80t cos 60t− 4

3e−80t sin 60t

)

.

Therefore the solution reads

q(t) = L−1 Q(s) =1

500

(

1− e−80t

(

cos 60t+4

3sin 60t

))

.

20

Page 25: Notes and problem sheets for the course

2.3 Differential Equations and the Dirac Delta Func-

tion

So far we have solved differential equations using the Laplace-transform method withoutthe direct application of techniques taken from calculus. It has offered a number ofadvantages compared to other techniques. We shall consider the application of the Laplacetransform method to a class of differential equations that are not easily solved any otherway.Laplace transforms can be used to solve problems involving an impulsive force or current(i.e., charge), where the impulse is delivered over a short time interval, say (t0, t1),

I(t) =

∫ t1

t0

f(t) dt ,

where I(t) is the total momentum input to the system if f(t) is a force.Suppose that the applied force is given by the function

fε(t) =

1/ε for 0 < t0 < t < t0 + ε0 otherwise

.

The above function should be interpreted as a constant force 1/ε applied over a timeinterval of length ε. By construction,

Iε =

∫ ∞

0

fε(t) dt =

∫ t0+ε

t0

(1/ε) dt = 1

so that the total impulse Iε is the area under the curve fε(t) and is independent of ε.Taking the limit ε → 0,

fε(t) → δ(t− t0)

where δ(t − t0) is called the Dirac delta function. This is a peculiar name for thisconstruct as it does not have all of the properties of a function. For this reason it isa member of a class called generalised functions. The Dirac delta function is zeroeverywhere except at t = t0 where it has a singularity and is therefore undefined. Thesignificant point is the Dirac delta function has the property

∫ ∞

0

δ(t− t0) dt = 1 .

This is important as it represents an impulse of magnitude 1 acting over an infinitelyshort time interval. Another important property of the Dirac delta function is that

∫ ∞

0

δ(t− t0)f(t) dt = f(t0)

(as long as f is continuous at t0). This is called the sifting property of Dirac functionsas it makes it possible to isolate a particular value of a function.

This means the Laplace transform of a Dirac delta function can be evaluated:

21

Page 26: Notes and problem sheets for the course

Lδ(t− a) =

∫ ∞

0

δ(t− a)e−st dt = e−as.

Therefore in principle any differential equation involving an impulse delivered over a veryshort time interval can be solved using Laplace transforms.The last construct we need before we can start solving differential equations involvingDirac delta functions is the second shift theorem.

The Second Shift Theorem.Taking a > 0, if

f(t) =

g(t− a) for t > a0 for t < a

then F (s) = e−asG(s) where G(s) = Lg(t).

This is pretty dry stuff. It will become a little clearer when you see an application of thesecond shift theorem.

Question 2.4. Find the inverse Laplace transform of

F (s) =e−3s

s2.

Solution. By inspection of the second shift theorem in this example, a = 3 andG(s) = 1/s2 so g(t) = L−1G(s) = L−1s−2 = t.Then the second shift theorem implies that

f(t) = L−1F (s) = L−1

e−3s

s2

=

t− 3 for t > 30 for t < 3

.

Another worked example to see how the second shift theorem can be used.

Question 2.5. Find the inverse Laplace transform of

F (s) = e−2s 1

s+ 7.

Solution. Here G(s) = 1/(s + 7) so g(t) = L−1G(s) = L−11/(s+ 7) = e−7t, whilea = 2.Applying the 2nd shift theorem,

f(t) = L−1F (s) =

e−7(t−2) for t > 20 for t < 2

.

22

Page 27: Notes and problem sheets for the course

We now have all of the tools in place to solve problems involving instantaneous impulses.Consider a freely vibrating system without damping. The dynamics of the system aregoverned by a differential equation of the form

d2y

dt2+ ω2y = 0 .

(See Section 2.4 in the first semester of material.) If the system is subjected to an instan-taneous impulse of magnitude b at a time t = a, the second-order differential equation ismodified, to

d2y

dt2+ ω2y = bδ(t− a) .

Example 2.2. Let’s use Laplace transforms to solve the initial value problem

d2y

dt2+ 4y = δ(t− 3) ,

with y(0) = 1 anddy

dt(0) = 0.

We follow the same solution strategy as previous examples looking at solving differentialequations using the Laplace transform method.

Step 1. Take the Laplace transform of the differential equation:

L

d2y

dt2

+ 4Ly = Lδ(t− 3) so

s2Y (s)− sy(0)− dy

dt(0) + 4Y (s) = e−3s .

Step 2. Substitute the initial values into the equation:

s2Y (s)− s+ 4Y (s) = e−3s .

Step 3. Make Y (s) the subject of the equation:

(s2 + 4)Y (s) = s+ e−3s so Y (s) =s

s2 + 4+ e−3s 1

s2 + 4.

Step 4. Find the inverse Laplace transform for Y (s):

L−1Y (s) = L−1

s

s2 + 4

+ L−1

e−3s 1

s2 + 4

,

where L−1

s

s2 + 4

= cos 2t .

23

Page 28: Notes and problem sheets for the course

To find the second inverse Laplace transform,

L−1

e−3s 1

s2 + 4

,

we use the second shift theorem.

L−1

1

s2 + 4

=1

2L−1

2

s2 + 4

=1

2sin 2t ,

therefore the 2nd shift theorem says

L−1

e−3s 1

s2 + 4

=

12sin 2(t− 3) for t > 3

0 for t < 3.

Putting these results together gives the solution,

y(t) = L−1Y (s) =

cos 2t+ 12sin 2(t− 3) for t > 3

cos 2t for t < 3.

See Fig.2.2 for a plot of y(t).

Let’s look at another example before we move on.

Question 2.6. Use Laplace transforms to solve the initial value problem

d2y

dt2+ 6

dy

dt+ 8y = 2δ(t− 7) , y(0) = 0 ,

dy

dt(0) = 6 . (2.5)

Solution. We follow the same solution strategy as in the previous example.Step 1. Take the Laplace transform of the differential equation:

L

d2y

dt2

+ 6L

dy

dt

+ 8Ly = 2Lδ(t− 7) so

s2Y (s)− sy(0)− dy

dt(0) + 6(sY (s)− y(0)) + 8Y (s) = 2e−7s.

Step 2. Substitute the initial values into the equation:

s2Y (s)− 6 + 6sY (s) + 8Y (s) = 2e−7s.

Step 3. Make Y (s) the subject of the equation:

(s2 + 6s+ 8)Y (s) = 6 + 2e−7s so Y (s) =6

s2 + 6s+ 8+

2e−7s

s2 + 6s+ 8.

Step 4. Find the inverse Laplace transform for Y (s). This is a long process in thisexample but provided you take your time you will see the approach is the same as in theprevious example.

L−1Y (s) = L−1

6

s2 + 6s+ 8

+ L−1

2e−7s

s2 + 6s+ 8

.

24

Page 29: Notes and problem sheets for the course

0 1 2 3 4 5 6 7 8−1.5

−1

−0.5

0

0.5

1

1.5

t

y

Figure 2.2: The displacement of a vibrating body subjected to an impulse at t = 3. (Lookcarefully, and you will see that there is a jump of slope at that time.)

To find the inverses we have to represent the quotients using partial fractions, where

s2 + 6s+ 8 = (s+ 2)(s+ 4)

so2

s2 + 6s+ 8=

2

(s+ 2)(s+ 4)=

A

(s+ 2)+

B

(s+ 4)=

A(s+ 4) +B(s+ 2)

(s+ 2)(s+ 4),

giving A(s + 4) + B(s + 2) = 2. Thus, by taking s = −2 and then s = −4, A = 1 andB = −1.

It follows that

2

s2 + 6s+ 8=

1

(s + 2)− 1

(s+ 4)and

6

s2 + 6s+ 8=

3

(s+ 2)− 3

(s+ 4)so

L−1

2

s2 + 6s+ 8

= L−1

1

(s+ 2)

− L−1

1

(s+ 2)

= e−2t − e−4t

and L−1

6

s2 + 6s+ 8

= 3e−2t − 3e−4t.

25

Page 30: Notes and problem sheets for the course

Then, by the second shift theorem,

L−1

2e−7s

s2 + 6s+ 8

=

0 for t < 7e−2(t−7) − e−4(t−7) for t > 7

.

Putting these altogether, we get

y(t) = L−1 Y (s) =

3e−2t − 3e−4t for t < 73e−2t − 3e−4t + e−2(t−7) − e−4(t−7) for t > 7

.

See Fig.2.3 for a graph of the solution.

0 1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

t

y

Figure 2.3: Graph of the solution of the initial value problem (2.5).

2.4 Systems of Differential Equations

The extension of the Laplace transform method for solving differential equations is natural.Recall that for one differential equation the Laplace transform method is a three-stepprocess.

26

Page 31: Notes and problem sheets for the course

The Laplace Transform Method.Step 1. Take the Laplace Transform of the given differential equation.Step 2. Make the transformed variable (Y (s) above) the subject of the transformedequation.Step 3. Apply the inverse Laplace transform to find y(t).

For a system of differential equations the second step is more complicated as it involvesthe solution of a system of (simultaneous) algebraic equations rather than one equation.By way of example consider the following initial value problem.

Question 2.7. Solve the following initial value problem using the Laplace transformmethod:

dx1

dt= x1 + 2x2 ,

dx2

dt= 2x1 − 2x2 , x1(0) = 2 , x2(0) = 1 .

Solution. The first step is to take the Laplace transform of the differential equations:

L

dx1

dt

= Lx1+ 2Lx2 and L

dx2

dt

= 2Lx1 − 2Lx2 so

sX1 − x1(0) = X1 + 2X2 and sX2 − x2(0) = 2X1 − 2X2 .

Substituting the initial values into the equations and reorganising to put all of the un-knowns on one side of the equations,

(s− 1)X1 − 2X2 = 2 , (2.6)

−2X1 + (s+ 2)X2 = 1 . (2.7)

This system is two equations in two unknowns, X1 and X2 can be solved. From (2.6)

X1 = 2(X2 + 1)/(s− 1) . (2.8)

Substituting for X1 in (2.7),

−4

(

X2 + 1

s− 1

)

+ (s+ 2)X2 = 1

which can be rearranged as follows:

(

− 4

s− 1+ (s+ 2)

)

X2 = 1 +4

s− 1=

s+ 3

s− 1,

(−4 + (s+ 2)(s− 1)

s− 1

)

X2 =

(

s2 + s− 6

s− 1

)

X2 =

(

(s− 2)(s+ 3)

s− 1

)

X2 =s+ 3

s− 1,

∴ X2 =1

s− 2.

27

Page 32: Notes and problem sheets for the course

Having found X2 we can substitute into (2.8) to give X1:

X1 = 2

(

1 +1

s− 2

)

1

s− 1= 2

(

s− 1

s− 2

)

1

s− 1=

2

s− 2.

Now that the simultaneous equations have been solved, taking the inverse Laplace trans-forms gives the result:

x1(t) = L−1X1 = L−1

2

s− 2

= 2e2t , x2(t) = L−1X2 = L−1

1

s− 2

= e2t .

What about second-order and inhomogeneous systems?The method is exactly the same. A second-order system example is given below, aninhomogeneous first-order system is left as an exercise.

Question 2.8. Solve the following second-order system using the Laplace-transformmethod:

d2x

dt2+ 2x− y = 0 ,

d2y

dt2− x+ 2y = 0 ,

with x(0) = 4, y(0) = 2,dx

dt(0) =

dy

dt(0) = 0.

Solution. Some of the details of the solution will be omitted as it has essentially thesame steps as Question 2.7.Take the Laplace transform of the differential equations to get

s2X − x(0)s− dx

dt(0) + 2X − Y = 0 ,

s2Y − y(0)s− dy

dt(0)−X + 2Y = 0 .

Substitute for the initial values and rearrange so that the unknowns are on one side

(s2 + 2)X − Y = 4s , (2.9)

−X + (s2 + 2)Y = 2s . (2.10)

From (2.9),Y = (s2 + 2)X − 4s . (2.11)

Substituting for Y in (2.10) and rearranging so that X is the subject of the equation,

X =4s3 + 10s

s4 + 4s2 + 3=

4s3 + 10s

(s2 + 1)(s2 + 3).

Partial fractions gives

2

(s2 + 1)(s2 + 3)=

1

(s2 + 1)− 1

(s2 + 3)

28

Page 33: Notes and problem sheets for the course

so2s

(s2 + 1)(s2 + 3)=

s

(s2 + 1)− s

(s2 + 3)and

2s3

(s2 + 1)(s2 + 3)= s

(

s2

(s2 + 1)− s2

(s2 + 3)

)

= s

(

(s2 + 1)− 1

(s2 + 1)− (s2 + 3)− 3

(s2 + 3)

)

= s

(

1− 1

(s2 + 1)− 1 +

3

(s2 + 3)

)

= s

(

3

(s2 + 3)− 1

(s2 + 1)

)

.

Hence

X =6s

(s2 + 3)− 2s

(s2 + 1)+

5s

(s2 + 1)− 5s

(s2 + 3)=

3s

(s2 + 1)+

s

(s2 + 3).

Substituting these into (2.10) and tidying up the equation gives

Y = s

(

3(s2 + 1) + 1

(s2 + 1)+

(s2 + 3)− 1

(s2 + 3)− 4

)

= s

(

3 +3

(s2 + 1)+ 1− 1

(s2 + 3)− 4

)

=3s

(s2 + 1)− s

(s2 + 3).

Taking the inverse Laplace transforms,

x(t) = L−1X(s) = 3L−1

s

(s2 + 1)

+ L−1

s

(s2 + 3)

= 3 cos t+ cos√3t

and similarly

y(t) = L−1Y (s) = 3 cos t− cos√3t .

There are many examples of systems of differential equations that are formulated asproblems in vibration and circuit simulation. As an example application, a mathematicalmodel for the simulation of a circuit is given here.

Example 2.3. A two-loop circuit is shown schematically in Fig. 2.4.

X

V (t)

i(t) i2(t)

i1(t)R3R1

R2

L2L1

Figure 2.4: A double-loop circuit.

29

Page 34: Notes and problem sheets for the course

Applying Kirchhoff’s 1st law at node X gives

i = i1 + i2 .

Applying Kirchhoff’s 2nd law to the left and right loops in turn then gives the differentialequations

R1(i1 + i2) + L1d

dt(i1 + i2) +R2i1 = V ,

L2di2dt

+R3i2 − R2i1 = 0 .

Initially no current flows: i1(0) = i2(0) = 0.Given that R1 = R3 = 10Ω, R2 = 20Ω, L1 = L2 = 5H and V (t) = 200V, we wish tofind the currents i1 and i2 using the Laplace transform method.We first substitute the numerical values for the constant terms into the differential equa-tions:

10(i1 + i2) + 5d

dt(i1 + i2) + 20i1 = 200 ,

5di2dt

+ 10i2 − 20i1 = 0 .

We divide through by common factors in the differential equations to simplify them:

2(i1 + i2) +di1dt

+di2dt

+ 4i1 = 40 ,

di2dt

+ 2i2 − 4i1 = 0 .

Next we take Laplace transforms:

2I1 + 2I2 + sI1 − i1(0) + sI2 − i2(0) + 4I1 = 40/s ,

sI2 − i2(0) + 2I2 − 4I1 = 0 .

We then substitute in the initial values and tidy up:

(s+ 6)I1 + (s+ 2)I2 = 40/s , (2.12)

−4I1 + (s+ 2)I2 = 0 . (2.13)

From (2.13)

I2 =4I1s+ 2

. (2.14)

Substituting for I2 in (2.12) and making I1 the subject of the equation,

I1 =40

s(s+ 10)=

4

s− 4

s+ 10,

on using partial fractions. From (2.14)

I2 =16

s(s+ 2)− 16

(s+ 2)(s+ 10)=

8

s− 8

s+ 2− 2

s+ 2+

2

s + 10=

8

s− 10

s+ 2+

2

s+ 10,

30

Page 35: Notes and problem sheets for the course

using partial fractions again.Taking inverse Laplace transforms,

i1(t) = L−1I1 = L−1

4

s

− L−1

4

s+ 10

= 4− 4e−10t ,

and similarly,i2(t) = L−1I2 = 8− 10e−2t + 2e−10t .

2.5 Summary of Laplace transforms

These two chapters have been organised into three separate sets of theory. The firstlooks at finding the Laplace transforms of functions. This can be done by evaluating theimproper integral definition of the Laplace transform,

Lf(t) =

∫ ∞

0

e−stf(t) dt .

This approach is not advocated here as a simpler approach is to use a table of Laplacetransforms together with the first shift theorem and the linear property of the Laplaceoperator.Having mastered Laplace transforms we focused on finding inverse Laplace transforms.This is a more difficult problem as it requires a certain ability to recognise patterns.The different techniques for finding inverse Laplace transforms, such as the use of partialfractions and completing the square, are all about representing the Laplace transform ina way so that it can be matched up with functions in the table of Laplace transforms.The first shift theorem in reverse can also be used to find inverse Laplace transforms.We looked at the application of Laplace transforms to the solution of differential equations.This involves three steps:

Step 1. Apply the Laplace transform to the differential equation.

Step 2. Rearrange the transformed equation to be explicit in the Laplace transform of thesolution.

Step 3. Take the inverse Laplace transform to find the solution of the differential equation.

The Laplace transform method of solution for differential equations has a number ofadvantages over standard methods.

• The incorporation of initial values is simpler.

• The solution technique requires no knowledge of calculus.

• Certain problems involving near instantaneous disturbances to the modelled systemcan be incorporated.

The last point above involves representing instantaneous disturbances using Dirac func-tions and solving the differential equation using the second shift theorem.

Linear systems of differential equations are relatively easy to solve using the Laplacetransform method as you can follow the three-step process given above. The second stepfor systems of differential equations includes the solution of simultaneous equations.

31

Page 36: Notes and problem sheets for the course

2.6 Problems

Problem 2.1. Solve the following initial value problems using Laplace tranforms:

(a)dy

dt+ 3y = e−2t, y(0) = 2 ;

(b)d2y

dt2+ 2

dy

dt+ 5y = 1, y(0) = 0,

dy

dt(0) = 0 ;

(c)d2y

dt2+ 4

dy

dt+ 5y = 3e−2t, y(0) = 4,

dy

dt(0) = −7 ;

(d)d2y

dt2+ 8

dy

dt+ 16y = 16 sin 4t, y(0) = −1

2,

dy

dt(0) = 1 ;

(e)d2y

dt2− 2

dy

dt+ 2y = cos t, y(0) = 1,

dy

dt(0) = 0 .

Problem 2.2. Use the second shift theorem to find the function y(t) with the followingLaplace transforms:

(a)Y (s) =e−3s

s4; (b)Y (s) = e−2s ; (c) Y (s) =

se−s

s2 + 2s+ 5.

Problem 2.3. Solve the initial value problems:

(a)d2y

dt2+ 3

dy

dt+ 2y = δ(t− 4), y(0) =

dy(0)

dt= 0 ;

(b)1

2

d2y

dt2+

dy

dt+ y = 2δ(t− 3), y(0) = 1,

dy(0)

dt= 0 .

Problem 2.4. Application of Kirchhoff’s laws for a two-loop circuit leads to the followingsystem of differential equations for the currents i1 and i2

L1d

dt(i1 + i2) +R1(i1 + i2) +R2i1 + L3

di1dt

= V ,

L2di2dt

+R3i2 − R2i1 − L3di1dt

= 0 ,

i1(0) = 1 , i2(0) = 0 .

Solve the system of equations using Laplace transforms, taking R1 = R2 = R3 = 2,L1 = L2 = L3 = 1 and V = 3.

Problem 2.5. Find the solution x1(t), x2(t) of the system of differential equations:

dx1

dt− x1 − x2 = e−2t;

dx2

dt− 4x1 + 2x2 = −2et;

with x1(0) = 0 and x2(0) = 1.

32

Page 37: Notes and problem sheets for the course

Answers

1.(a) y(t) = e−3t + e−2t,1.(b) y(t) = 1

5

(

1− e−t cos 2t− 12e−t sin 2t

)

,1.(c) y(t) = e−2t(cos t + sin t+ 3),1.(d) y(t) = te−4t − 1

2cos 4t,

1.(e) y(t) = 15cos t− 2

5sin t + 4

5et cos t− 2

5et sin t.

2.

(a) y(t) =

0 t < 3(t−3)3

6t > 3

; (b) y(t) = δ(t− 2) ;

(c) y(t) =

0 t < 1e−(t−1)(cos 2(t− 1)− 1

2sin 2(t− 1)) t > 1

.

3.(a)

y(t) =

0 t < 4e−(t−4) − e−2(t−4) t > 4

;

3.(b)

y(t) =

e−t(cos t+ sin t) t < 3e−t(cos t+ sin t) + 4e−(t−3) sin (t− 3) t > 3

.

4. i1(t) =12(1 + e−2t), i2(t) =

12(1− e−2t).

5. x1(t) =12(−e−3t + et), x2(t) = 2e−3t − e−2t.

33

Page 38: Notes and problem sheets for the course

34

Page 39: Notes and problem sheets for the course

Chapter 3

Geometry

3.1 Introduction

In this and the following chapter we look at vectors and combine them with ideas takenfrom calculus. Our starting point is the concept of a vector and vector operations thatyou are likely to be familiar with already. This area of mathematics forms the basis of allCAD packages and is also useful in simulating the stress fields and fluid motion aroundcomplex shapes. A final area of application of interest to students reading for physics andelectrical engineering is electromagnetism.The vector calculus operators discussed at the end of this part make it possible to statefundamental systems of partial differential equations in a concise way. Physical lawsamenable to such a treatment include the Navier Stokes equations (fluid motion) andMaxwell’s Equations (electro-magnetism).

3.2 Revision of Vector Operations

A vector is a quantity that has two properties, a magnitude (how big it is) and a direction.This is compared to a scalar quantity which just has a magnitude, such as the speed ofa car, or the distance travelled by a car. It is usually denoted in bold, or it may beunderlined or have an arrow on top. The old favourite examples of vector quantities areforces, displacements (where you are in the world), velocities and accelerations.Vectors are incredibly useful things as many problems can be formulated and solved interms of vectors and vector operations, particularly if you are working in three-dimensionalspace (as most of us are). The reason for this is most people have great difficulty picturinga line in 3D space but are entirely comfortable with lines in 2D space. You can draw linesin two dimensions on a piece of paper for a start. The beauty of vectors is that operationsin two-dimensional space extend in a completely natural way to three-dimensional space.Vectors can be represented in a number of ways, such as

r =

123

, (1, 2, 3) or i + 2j + 3k .

The three numbers represent the Cartesian co-ordinates, and i, j and k are unit vectorsin the directions of the x, y and z co-ordinate axis. For the most part we will use the firstbracket, i.e. column, notation for a vector.

35

Page 40: Notes and problem sheets for the course

1 2

3

x

y

z

Figure 3.1: Cartesian co-ordinates of a point vector.

The magnitude of a vector r is denoted by |r| and is given by

|r| =√a2 + b2 + c2

where (a, b, c) are the Cartesian co-ordinates of the vector. So the vector

r =

123

(3.1)

has magnitude |r| =√12 + 22 + 32 =

√14.

It is often convenient to calculate unit vectors. These are vectors with a given directionand magnitude of one. They are often written as

r .

To calculate a unit vector in the direction of a vector r, we divide r by its magnitude:

r = r/|r| .

For example, by construction, the following vector is a unit vector:

r =1√14

123

.

3.2.1 Vector addition

A graphical representation of how vectors are added together is shown in the Fig. 3.2.Working with Cartesian co-ordinates two vectors can be added together by addition ofthe components of the vectors. For example if

r =

11−1

and y =

2−34

then r + y =

11−1

+

2−34

=

1 + 21− 3−1 + 4

=

3−23

.

36

Page 41: Notes and problem sheets for the course

x

y

a + b

a

b

Figure 3.2: Vector addition.

3.2.2 Multiplication by a scalar

Multiplying a vector r by a scalar α gives a vector of magnitude |α||r| with the samedirection as r if α is positive and the opposite direction if α is negative (see Fig. 3.3).Using Cartesian co-ordinates, the components of the vector are muliplied by the scalar,

x

y

32a

a

−12a

−a

Figure 3.3: Multiplication of a vector by a scalar.

e.g., for α = 3 and

r =

2−13

, αr = 3

2−13

=

6−39

.

3.2.3 Scalar product

The extension of scalar multiplication to vectors leads to two types of “vector multiplica-tion”: the scalar product and the vector product.

The scalar product (or dot product) takes two vectors and produces a scalar. Given twovectors, a and b, then the scalar product is written as a · b.

37

Page 42: Notes and problem sheets for the course

Geometrically the scalar product is the magnitude of b multiplied by the projection of aonto b, see Fig. 3.4.

b

a

Projection of a onto b

θ

Figure 3.4: A geometric interpretation of the scalar product of a and b.

The projection of a onto b is |a| cos θ, where θ is the angle between the directions of thetwo vectors. If you do not see this immediately, note that in Fig. 3.4 the projection ofa onto b is the side adjacent to the angle θ, and the magnitude of a is the hypotenuse.Hence

a · b = |a||b| cos θ . (3.2)

If the scalar product is zero then, assuming that neither vector is the zero vector, cos θ = 0which implies that

θ = π/2 = 90.

This is very important as finding vectors that are at right angles often involves findingzero scalar products:Given two non-zero vectors a and b then

a · b = 0 ⇔ a and b are orthogonal. (3.3)

Orthogonal means at right angles. Sometimes such vectors are described as being nor-mal to one another.Another special case for the scalar product is if the scalar product of a vector is takenwith itself:

a · a = |a||a| cos 0 = |a|2 .The square root of the scalar product of a vector with itself gives the vector’s magnitude:

√a · a = |a| .

For scalar products the order of the vectors is immaterial so a · b = b · a.

In Cartesians the scalar product is given by the sum of the pair-wise products of thecoordinates:

a · b = a1b1 + a2b2 + a3b3 , where a =

a1a2a3

and b =

b1b2b3

.

38

Page 43: Notes and problem sheets for the course

Question 3.1. Find the angle between a = (1,−2, 2) and b = (0, 3,−4).

Solution. a · b = |a||b| cos θ, so

cos θ =a · b|a||b|

for θ the angle between a and b.Here |a| =

√1 + 4 + 4 =

√9 = 3, |b| =

√0 + 9 + 16 =

√25 = 5 and a ·b = 1.0+(−2).3+

2.(−4) = −14. Hence

cos θ =−14

15so θ = cos−1(−14/15) = π − cos−1(14/15) .

3.2.4 Vector product

The vector product (or cross product) of vectors a, b is written

a× b .

As the name suggests the vector product produces a vector. Geometrically the vectorproduct is a vector with a magnitude given by the area of a parallelogram and directionperpendicular to the two vectors a and b, see Fig. 3.5. The magnitude of the resulting

a

b

a× b

Figure 3.5: A geometric interpretation of the vector product of a and b.

vector is given by the area of the parallelogram defined by a and b as shown in Fig. 3.5.Two directions are perpendicular to the plane defined by the two vectors a and b, vertically“up” and vertically “down”. In this case the vector is vertically up because of the “right-hand rule”. This says that if your right thumb represents a and right index finger b, thenthe right-hand middle finger (arranged at right angles to thumb and index finger) gives“up”, the direction of a× b (and an “upward” normal vector, n, to the parallelogram).An expression for the vector product is then

a× b = |a||b|n sin θ ,

where n denotes the unit vector in the vertical direction and θ is again the angle betweena and b.

39

Page 44: Notes and problem sheets for the course

If we consider the vector product b×a, it has the same magnitude as a×b but the right-hand rule determines that the direction of the vector exactly opposite (“down” instead of“up”). This implies that the order in the vector product is important:

a× b = −b× a .

Because of the property (3.3),

a · (a× b) = 0 and b · (a× b) = 0 .

This can be a very useful propertyMaking use of Cartesian co-ordinates and the i, j, k notation, the vector product reads

a× b =

i j k

a1 a2 a3b1 b2 b3

, (3.4)

where

a =

a1a2a3

= a1i+ a2j + a3k and b =

b1b2b3

= b1i+ b2j + b3k .

In (3.4) the vector product is given by a 3 × 3 determinant. Recall that this can beevaluated by breaking it down into three 2×2 determinants:

i j k

a1 a2 a3b1 b2 b3

= i

a2 a3b2 b3

− j

a1 a3b1 b3

+ k

a1 a2b1 b2

,

Then each 2×2 determinant can be evaluated from the formula∣

a bc d

= ad− bc , so

a× b = i(a2b3 − a3b2)− j(a1b3 − a3b1) + k(a1b2 − a2b1)

= i(a2b3 − a3b2) + j(a3b1 − a1b3) + k(a1b2 − a2b1) ,

or, using bracket/column notation,

a× b =

a2b3 − a3b2a3b1 − a1b3a1b2 − a2b1

.

You might not find this an easy formula to remember, it is then a better strategy toremember (3.4) and then evaluate the 3×3 determinant each time. Note that determinantswill be looked at again in Section 6.3.

Question 3.2. Calculate the vector product a × b for a = (2, 1, 0) and b = (2, 3, 0).Hence find the angle between a and b.

40

Page 45: Notes and problem sheets for the course

Solution.

a× b =

i j k

2 1 02 3 0

= i

1 03 0

− j

2 02 0

+ k

2 12 3

= i((1)(0)− (0)(3))− j((2)(0)− (0)(2)) + k((2)(3)− (1)(2)) = 4k .

Thus

a× b =

004

.

As a × b = |a||b|n sin θ with n a unit vector and θ the angle between a and b, heren = k = (0, 0, 1) and

sin θ =|a× b||a||b| =

4√4 + 1

√4 + 9

=4√

5√13

=4√65

.

Therefore the angle = θ = sin−1(4/√65) ≈ 0.519 ≈ 29.7.

Exercise 3.1. The angular momentum vector, taken about the origin, H of a particle ofmass m moving with velocity v is given by

H = r × (mv) ,

where r is the displacement of the particle from the origin.If the motion of the particle is described by it having an the angular velocity ω about theorigin, then

v = ω × r .

Using the result for the vector triple product

a× (b× c) = (a · c)b− (a · b)c ,

where a, b and c are vectors, show that if r is perpendicular to ω, then

H = mr2ω ,

where r = |r|.

Finally, recall the scalar triple product: [a, b, c] = [b, c,a] = [c,a, b] = a · (b × c) =(b× c) · a = b · (c× a) = . . . .Using the determinant formula for the vector product, (3.4), it is quite easy to show that

[a, b, c] = a · (b× c) =

a1 a2 a3b1 b2 b3c1 c2 c3

. (3.5)

41

Page 46: Notes and problem sheets for the course

y

z

x

a

b

b− a

Figure 3.6: A line in 3D space passing through the points a and b.

3.3 Lines in Three Dimensions

3.3.1 Parametric equation of a line

Consider two point vectors a and b, see Fig. 3.6.Vector addition gives us b = a+ (b− a).In this case b − a can be thought of as a direction vector The equation of the line,passing through a and in the direction b− a is given, parametrically, by the equation

r = a+ t(b− a) . (3.6)

Here t can be thought of as a free parameter, t = 0 gives the point a, t = 1 gives thepoint b. A value of t between zero and one gives a point between a and b on the line. toutside of the unit interval gives points on the line either side of a and b.A more general representation of the equation of a line using vectors is

r = a+ tm ,

where a is a point on the line and m is a direction vector (a vector parallel to the line).The advantage of this type of representation is it is the same whether the line is in 2D or3D space.

Question 3.3. Suppose a line passes through the point vectors

a =

1−22

and b =

231

.

Derive a parametric equation of the line.

Solution. A parametric form of an equation of a line is r = a+ t(b− a).

42

Page 47: Notes and problem sheets for the course

As

a =

1−22

and b− a =

15−1

,

an equation of the line in this case is

r =

1−22

+ t

15−1

,

or equivalently, r = (1 + t)i + (5t− 2)j + (2− t)k.

3.3.2 Angle between two lines

Given two vectors, a and b say, the angle between them can be calculated using vectoroperations, such as the scalar product (easier than the vector product as we saw above).The angle between two lines is simply the angle between their two direction vectors (seeFig. 3.7), and can therefore be given by use of the direction vectors’ scalar (or vector)product.

x = c + ta

x = d + tb

a

b

θ

c

d

O

Figure 3.7: Angle between two lines.

For example if two lines are given by r = c + ta, r = d + tb, with a = (2, 1, 0) andb = (2, 3, 0), the angle θ between the direction vectors is given by

cos θ =a · b|a||b| =

(2)(2) + 1(3)√5√13

=7√65

.

The angle between the lines is then given by

θ = cos−1(7/√65) ≈ 0.519 ≈ 29.7.

3.4 Equations of a Plane

3.4.1 Non-parametric (Cartesian) equation for a plane

The equation of a plane differs from an equation of a line as we want an equation thatgives the position vector of any point on a flat surface, the plane. Any plane’s orientation

43

Page 48: Notes and problem sheets for the course

x− a

n

O

x

a

Figure 3.8: The important vectors in the definition of a plane.

is specified in terms of a vector normal to the plane, i.e. at right angles to its surface,here denoted by n, see Fig. 3.8.In particular, a plane is defined by a vector normal to the plane, n, and a point vector inthe plane, a (see Fig. 3.8). With reference to the figure, if r is any point on the plane,the vector r−a is a direction vector in the plane, and therefore r−a has an orientationthat is perpendicular to the normal vector, n. If we take a scalar product of r − a andn, then as these two vectors are at normal to each other,

(r − a) · n = |r − a||n| cos π2= 0 so

n · r = n · a . (3.7)

This is the equation of a plane with normal n and having a point vector a lying on it.

One interesting property of the equation of a plane is if the normal vector is a unit vector,i.e. has a magnitude of one, so that the plane can be described by

n · r = d so

with |n| = 1, then the size of right-hand side, |d| in the equation above, is the perpendic-ular distance from the origin to the plane.More generally, the distance h of a point b from a plane n · r = d is given by

h = |d− n · b|/|n| . (3.8)

This can be got by simple trigonometry (see Fig. 3.9). Taking a to be a point on theplane, the plane’s equation is

n · r = n · a = d so

d = n · a .

44

Page 49: Notes and problem sheets for the course

h

O

Cross section through plane

ab

n

θ

b− a

Figure 3.9: The distance h of a point b from a plane.

The perpendicular distance, h, to the plane from b is then the length of the projection ofthe vector from b to a, a − b, onto n: h = ||a − b| cos θ| where θ is the angle betweena− b and n. But remember that n · (a− b) = |a− b||n| cos θ. Hence

h =|n · (a− b)|

|n| =|n · a− n · b|

|n| =|d− n · b|

|n| .

Note that we would generally write the non-parametric equation of a plane, n · r = d,where

n =

n1

n2

n3

and r =

xyz

asn1x+ n2y + n3z = d .

Question 3.4. Suppose we have a plane with orientation defined by the normal vectorn = 3i − j + 2k and a point in the plane a = (1, 1, 3). Represent the non-parametricequation of the plane in vector notation and in Cartesian form, and calculate the perpen-dicular distance of the plane from the origin.

Solution. The general equation for a plane in vector notation reads

n · r = n · a .

The left-hand side in this case is

n · r =

3−12

·

xyz

45

Page 50: Notes and problem sheets for the course

while the right-hand side is

n · a =

3−12

·

113

= 3− 1 + 6 = 8

so the plane is

3−12

· r =

xyz

= 8 .

To convert this to its Cartesian form is straight forward; we simply calculate the scalarproduct on the left-hand side of the equation:

3x− y + 2z = 8 . (3.9)

In getting the distance from the origin, we might alternatively write the plane n · r = das n · r = d, where n is the unit vector in the direction of n: n = n/|n|. An equationof a plane can simply be multiplied throughout by a scalar to get an alternative form.Here we multiply throughout by 1/|n| to get a new right-hand side d = d//|n|. Here|n| =

√9 + 1 + 4 =

√14. Eqn. (3.9) is then replaced by

3√14

x− 1√14

y +2√14

z = 8/1√14 ≈ 2.138 .

Note that this equation has precisely the correct form for reading off the perpendiculardistance to the origin as the left-hand side is the scalar product of the general point, r,with a unit vector normal to the plane.Perpendicular distance to the origin to 4 s.f. is then 2.138.

3.4.2 Parametric representation of a plane

Given two non-parallel direction vectors, b and c, parallel to a plane and a point vectorin the plane, a, the equation of the plane can be derived. A parametric equation of aplane can be derived as a natural extension of the parametric equation of a line,

r = a+ td .

The parametric equation for a plane is given as

r = a + sb+ tc . (3.10)

In the equation of a line the location of a point is given by a numerical value of t once allof the vectors are defined. For the equation of a plane the location of a point in the planeis prescribed using the parameters s and ts. A schematic diagram of a plane defined inthis way is given in Fig. 3.10).Given (3.7) and (3.10) are equivalent representations of a plane, it is instructive to seehow (3.10) can be converted into the general form (3.7).The conversion is relatively straightforward. Both representations require a point in theplane, a. The difference is that (3.7) requires a normal vector, n, perpendicular to the

46

Page 51: Notes and problem sheets for the course

b

c

O

a

Figure 3.10: The definition of a plane by a point vector and two direction vectors.

plane and (3.10) requires two direction vectors, b and c, parallel to the plane but not witheach other.The link between n, and b and c, is the vector product

n = b× c .

This gives a vector that is perpendicular to both b and c, and hence it is perpendicularto the plane, giving the equation of a plane of the form

(b× c) · r = (b× c) · a .

Question 3.5. Suppose that a plane is given by

r =

410

+ s

2−4−3

+ t

−140

.

Convert it into its Cartesian form and hence determine the perpendicular distance be-tween the origin and the plane.

Solution. In the above, the point in the plane and the two direction vectors are givenas

a =

410

, and b =

2−4−3

and c =

−140

,

respectively. Therefore a vector normal to the plane is given by

n = b× c =

i j k

2 −4 −3−1 4 0

= i

−4 −34 0

− j

2 −3−1 0

+ k

2 −4−1 4

= i(0 + 12)− j(0− 3) + k(8− 4) = 12i+ 3j + 4k .

47

Page 52: Notes and problem sheets for the course

Then the equation of a plane in the form given by (3.7) is

n · r = n · a = d with d = n · a =

1234

·

410

= 48 + 3 + 0 = 51 .

The Cartesian form of the plane is therefore

12x+ 3y + 4z = 51 .

To calculate the perpendicular distance h from the plane to the origin we use this equationand the result h = |d|/|n|, (3.8). Here |d| = 51 while |n| =

√144 + 9 + 16 =

√169 = 13.

Thus the perpendicular distance between the plane and the origin is 51/13.

3.4.3 Plane defined by three point vectors

The above analysis requires that the orientation of the plane is given by a vector perpen-dicular to the plane, the normal vector, n. Another possibility is the plane is defined bythree points, say A, B, and C, in the plane, see Fig. 3.11.

BA

C

~OB

b = ~OB − a~OCc = ~OC − a

O

a = ~OA

Figure 3.11: The definition of a plane by three points, A, B, C, lying on it.

To find the equation of a plane through three points A, B, C in the plane, we note thatthe direction vectors

b = ~OB − ~OA and c = ~OC − ~OA (3.11)

are parallel to the plane (see Fig. 3.11). As we have two vectors that are parallel to theplane, if we take their vector product the result is a vector that is perpendicular to thetwo vectors (3.11) and therefore perpendicular to the plane:

n = b× c .

We can now appeal to the original analysis that gave us the result for a plane given apoint in the plane a and a normal vector n.

48

Page 53: Notes and problem sheets for the course

Example 3.1. Suppose we have three point vectors a = (1, 0, 1), b = (−2, 5, 0) andc = (3, 1, 1) lying on a plane.The vectors

b− a =

−250

101

=

−35−1

and c− a =

311

101

=

210

are parallel to the plane.We can calculate their vector product to get a normal to the plane:

n = (b−a)×(c−a) =

−35−1

×

210

=

i j k

−3 5 −12 1 0

= i

5 −11 0

−j

−3 −12 0

+k

−3 52 1

= i(0 + 1)− j(0 + 2) + k(−3− 10) = i− 2j − 13k .

Then the equation of the plane passing through the three point vectors a, b and c is

n · r = (i− 2j − 13k) · (xi+ yj + xk) = n · a = (i− 2j − 13k) · (i+ k) = 1− 13 = −12

since a = i + k lies on the plane. Equivalently, the plane is

x− 2y − 13z = −12 .

3.4.4 Two intersecting planes

Two planes that are not parallel will intersect. The intersection of two planes defines aline, see Fig. 3.12.

Plane P1

Plane P2

Line of intersection, Ln1

mn2

Figure 3.12: Two intersecting planes P1, P2 defining a line L. Normals to the planes aren1 and n2, respectively.

49

Page 54: Notes and problem sheets for the course

To calculate the line of intersection of two planes we can proceed by finding two pointsthat are on the line. This allows us to derive a direction vector for the line and we alreadyhave a point on the line. As we have seen in Subsection 3.3.1, this is enough informationto derive the equation of the line. To appreciate this more fully let us consider an example.

Example 3.2. Consider the two planes 3x + 2y − z = 3 and x − y + z = 1. Let’s findtheir line of intersection.We look for a point on the line with x = 0. Specifying this gives two simultaneousequations for a point that is common to both planes:

2y − z = 3 , −y + z = 1 .

These are solved by y = 4 and z = 5. One point on the line of intersection is thereforer = a = (0, 4, 5).Similarly, trying y = 0, to look for another point on the line of intersection, and thereforecommon to both planes, gives the two simultaneous equations

3x− z = 3 , x+ z = 1 .

These equations have solution, x = 1 and z = 0. Therefore another point on the line ofintersection is r = b = (1, 0, 0).Now we have two points on the line of intersection we can now write down its parametricequation:

r = a+ t(b− a) =

045

+ t

100

045

=

045

+ t

1−4−5

.

In Cartesian form, x = t, y = 4− 4t, z = 5− 5t.

Note that it is possible to calculate a direction vector for the line using the normal vectorsfor the planes. The line of intersection is in both planes so is perpendicular to both planes’normals, say n1 and n2, and therefore a direction vector is given by the vector product

m = n1 × n1 ,

see Fig. 3.12. Using this would mean we would only have to determine one point on theline. However, the calculation of a vector product is more complicated than the solutionof the second set of simultaneous equations in two unknowns to find a second point onthe line.

3.4.5 Parallel planes and the angle between two planes

Whether two planes are parallel or not is determined by their orientations. In terms ofvectors this is given by their normal vectors. Consider two planes defined by

n1 · r = d1 and n2 · r = d2 .

50

Page 55: Notes and problem sheets for the course

These planes are parallel if the two normal vectors, n1 and n2, are parallel. This is trueif one of them is proportional to the other,

n1 = Cn2 ,

where C is some constant.

Example 3.3. Consider the two planes

x+ 2y − z = 3 and 12x+ 24y − 12z = 5 .

These are parallel planes as n1 = (1, 2,−1) and n2 = (12, 24,−12) so that n2 = 12n1.

Two planes that are not parallel will intersect, defining a line as discussed in Subsec-tion 3.4.4. As the condition for two planes to be parallel is dependent on their normalvectors, the angle between two intersecting planes can be calculated from the normalvectors: the angle between the planes is the same as the angle between the normals, seeFig. 3.13.

Plane P1

Plane P2

n1

n2

θθ

Figure 3.13: Two intersecting planes P1, P2, with normals to the planes are n1 and n2,respectively. The angle between the planes (and between the normals) is θ.

The angle between the two planes is given by the scalar product of the two normal vectors.In Fig. 3.13 the angle is denoted by θ. The angle between the planes can then be foundby using (3.2):

n1 · n2 = |n1||n2| cos θ so θ = cos−1

(

n1 · n2

|n1||n2|

)

.

51

Page 56: Notes and problem sheets for the course

Line L

a

b

n

Plane P

θφ

Figure 3.14: The angle φ between a line L and a plane P .

3.4.6 Angle between a line and a plane

The last configuration to consider is the angle between a line and a plane. This can becalculated by considering the normal vector defining the orientation of the plane and thedirection vector of the line (see Fig. 3.14). If we define the plane by n · r = d and theline by r = a+ tb, we can get the angle θ between the plane’s normal vector, n, and theline’s direction vector, b, by using the scalar product:

θ = cos−1

(

n · b|n||b|

)

.

Since the normal vector is perpendicular to the plane, the angle between the plane andthe line, φ, is given by

φ =π

2− θ , alternatively, using degrees, φ = 90 − θ . (3.12)

Question 3.6. A laser located at the point a = (2, 4, 1) is directed at a mirror lyingin the plane given by 2x + 5y + 7z = 11. If the laser intersects the plane at the pointb = (1,−1, 2), what is the angle of incidence of the laser light with the mirror?

Solution. A direction vector for the laser beam is a− b = (1, 5,−1), while a normal tothe mirror is (2, 5, 7).Hence the angle between the normal to the mirror and the laser is given by

cos θ =n · (a− b)

|n||a− b| =2 + 25− 7√

4 + 25 + 49√1 + 25 + 1

=20

(78)(27)=

20

9√26

.

Then θ ≈ 1.120 ≈ 64.16.(Taking a direction vector or normal vector pointing the other way would have givencos θ = −20/(9

√26). We would then want to subtract our value of θ from π (or 180) to

get a value betweeen 0 and π/2 (0 and 90).)The angle between the mirror and the laser is therefore π/2− θ ≈ 0.451 ≈ 25.84.

52

Page 57: Notes and problem sheets for the course

Question 3.7. Where does the line r = (1, 2,−5) + t(2,−3, 1) intersect the plane2x+ 5y − 3z = 6?

Solution. The equation of the line can be represented in Cartesian form as

x = 1 + 2t , y = 2− 3t , z = −5 + t .

A point of intersection must satisfy this set of equations as well as the equation for theplane. Substituting x, y and z into the equation for the plane gives an equation for t:

2(1 + 2t) + 5(2− 3t)− 3(−5 + t) = 6 so

2 + 4t+ 10− 15t+ 15− 3t = 27− 14t = 6 ⇒ 14t = 21 ⇒ t = 3/2 .

We can now calculate the coordinates of the point of intersection:

x = 1 + 2t = 4 , y = 2− 3t = −5

2, z = −5 + t = −7

2.

53

Page 58: Notes and problem sheets for the course

3.5 Problems

Problem 3.1. What is the angle between the vectors (2, 2, 1) and (1,−1, 1)?

Problem 3.2. Evaluate the dot and cross products of the following pairs of vectors.

(a) (1, 2, 3), (4, 5, 6).

(b) (1,−2, 3), (3, 1, 2).

(c) (3, 1, 3), (4, 2, 1).

Problem 3.3. Find the parametric equation of the line passing through each of the pairsof points in the previous question.

Problem 3.4. Verify the identity a × (b × c) = b (a · c) − c (a · b) for the vectorsa = (1, 2, 3), b = (1,−1, 2), and c = (3, 1, 1).

Problem 3.5. If a = (1, 2,−1) and b = (2,−3, 1), find a unit vector perpendicular toboth a and b.

Problem 3.6. Find parametric and non-parametric equations of the planes passingthrough each of the following sets of points.

(a) (1, 2, 3), (4, 5, 6), (0, 0, 0).

(b) (1, 2, 3), (4, 5, 6), (3, 2, 1).

Problem 3.7. Find a non-parametric equation of the plane passing through each of thefollowing points a, with the given normal vectors n.

(a) a = (1, 2, 3), n = (4, 5, 6).

(b) a = (4, 5, 6), n = (3, 2, 1).

Problem 3.8. The vertices of a triangle are given by A = (1, 1,−1), B = (2,−1, 1),C = (−1, 1, 1). Use vector operations to determine the angle between the sides AB andAC.

Problem 3.9. Find the angle between the planes

2x+ y − 2z = 5 ,3x− 6y − 2z = 7 .

Problem 3.10. Find the angle between the plane

2x+ y − 2z = 5 ,

and the linex = 2 + t ,y = 1 + 2t ,z = 5t .

54

Page 59: Notes and problem sheets for the course

Problem 3.11. For each of the two planes, find the shortest distance from the origin:(a) The plane passing through a = (2,−3, 1) and parallel to the vectors d1 = (2, 3, 4) andd2 = (3, 2, 0);(b) The plane passing through a = (0, 3, 6) and parallel to the vectors d1 = (3, 2, 2) andd2 = (−3, 1, 4).

Problem 3.12. A plane is given by x + 2y + z = 6. A second plane passes througha = (3, 2, 1) and is parallel to the first. Find the equation for the second plane and thedistance between the two planes.

Problem 3.13. For the following planes and lines, determine, in each case, whether ornot the line is parallel to the plane. If the plane and line are parallel, find their separation.If they are not, find the angle between the line and the plane, and also determine thepoint at which the line crosses the plane.(a) P : x+ y + z = 2 ; L : r = t(−1, 2, 2).(b) P : x+ 2y − 3z = 0 ; L : r = (1, 1,−1) + t(1, 1, 1).(c) P : −2x+ y + 2z = 1 ; L : r = (1, 1,−2) + t(−1, 6,−4).(d) P : −2x+ y + 2z = 1 ; L : r = (1, 1,−2) + t(2, 2,−1).

Answers

1. 1.377 radians.

2. (a) 32, (−3, 6,−3). (b) 7, (−7, 7, 7). (c) 17, (−5, 9, 2).

3. (a) (1, 2, 3) + t(3, 3, 3). (b) (1,−2, 3) + t(−2,−3, 1). (c) (3, 1, 3) + t(−1,−1, 2).

5. ( 1√59(−i− 3j − 7k).

6. (a) −3x+ 6y − 3z = 0. (b) x− 2y + z = 0.

7. (a) 4x+ 5y + 6z = 32. (b) 3x+ 2y + z = 28.

8. 76 (approx.).

9. 79 (approx.).

10. 21 (approx.).

11. (a) 57/√233. (b) 0.

12. x+ 2y + z = 8;√

2/3.

13. (a) Not parallel; 35.26; (−2/3, 4/3, 4/3). (b) Parallel; 3√

2/7.13. (c) Parallel; 2. (d) Not parallel; 26.39; (−2,−2,−1/2).

55

Page 60: Notes and problem sheets for the course

56

Page 61: Notes and problem sheets for the course

Chapter 4

Vector Differentiation

4.1 Differentiation of Vectors

In many applications vector functions change with time or some other variable, for exam-ple the velocity of a aircraft:

v(t) =

v1(t)v2(t)v3(t)

.

If we wish to calculate the plane’s acceleration then we differentiate each individual com-ponent with respect to time:

a(t) =

a1(t)a2(t)a3(t)

=dv

dt(t) =

dv1/dtdv2/dtdv3/dt

so ai = dvi/dt for i = 1, 2, 3.

Example 4.1. Suppose we have a plane descending from 10,000 m towards an airport.(Planes tend to do this by going in circles as they lose altitude.) If the plane’s location isgiven by the co-ordinates x = 10000 cos(t/100), y = 10000 sin(t/100), z = 10000− 5t, wecan determine its velocity.

The plane’s displacement vector reads

r =

10000 cos(t/100)10000 sin(t/100)

10000− 5t

.

Differentiating each component gives the velocity,

v =dr

dt=

−100 sin(t/100)100 cos(t/100)

−5

.

57

Page 62: Notes and problem sheets for the course

Exercise 4.1. Given the vector function

r =

1 + tt223t3

,

find dr/dt and write it in the form

dr

dt= V (t)T (t) ,

where T (t) is a unit-vector function (the “unit tangent vector”).If r is tought of as position and t as time, so that dr/dt is velocity, V = |dr/dt| is speed;T (t) gives direction of motion.

4.1.1 Differentiation of sums and products of vectors

Suppose that a(t) and b(t) are vector functions, then the following rules of differentiationapply:

d

dt(Ca) = C

da

dtif C is a constant; (4.1)

d

dt(a+ b) =

da

dt+

db

dt; (4.2)

d

dt(a · b) = da

dt· b+ a · db

dt; (4.3)

d

dt(a× b) =

da

dt× b+ a× db

dt. (4.4)

These rules of differentiation are natural extensions of the rules of differentiation forscalar functions. Examples of these rules of differentiation are not be presented as youshould already be sufficiently accomplished at differentiation and the calculation of vectorproducts and scalar products.The same rules hold replacing the ordinary derivative by partial derivatives.

4.1.2 Linear approximation of a curve in three dimensions

Before we consider linear approximations to curves in three-dimensional space, let usremind our selves of linear approximations to 1D functions, and curves in 2D.

Consider the function f(x) = x2.If we consider a truncated Taylor series about the point x0 = 1,

f(x) ≈ f(x0) + (x− x0)f′(x0) , (4.5)

where, here, f(x0) = f(1) = 1, f ′(x0) = 2x0 = 2, so f(x0) + (x− x0)f′(x0) = 1+ 2(x− 1)

andf(x) ≈ f(x0) + (x− x0)f

′(x0) = 2x− 1 .

See Fig. 4.1 to compare the linear approximation with the function x2.

58

Page 63: Notes and problem sheets for the course

x10

y = x2 y = 2x− 1

y

1

Figure 4.1: The tangent line (dashed) giving a linear approximation to the curve y = x2

(solid) around x = 1.

Alternatively, a curve in 2D might be given parametrically as x = x(t), y = y(t). This isthe same as y = f(x) if y(t) = f(x(t)). A tangent to the curve at a point (x0, y0), givenby t = t0 with x0 = x(t0), y0 = y(t0), is then the straight line passing through (x0, y0)

with direction vector

(

dxdt(t0)

dydt(t0)

)

. This can be seen to be the same as the more familiar

y = f(x0) + f ′(x0)(x− x0):

The straight line passing through (x0, y0) with direction vector

(

dxdt(t0)

dydt(t0)

)

is given para-

metrically by(

xy

)

=

(

x0

y0

)

+ s

(

dxdt(t0)

dydt(t0)

)

so that

x = x0 + sdx

dt(t0) , y = y0 + s

dy

dt(t0) .

Eliminating s from these two equations gives

y = y0 +dy/dt(t0)

dx/dt(t0)(x− x0) = f(x0) + f ′(x0)(x− x0) ,

on using y0 = f(x(t0)) = f(x0) and the chain rule:

f ′(x) =dy

dx(x) =

dy/dt

dx/dt.

The same idea can be applied in three dimensions. Consider the vector function x(t) =(x(t), y(t), z(t)). We are interested in a linear approximation centred at the point vectorgiven by t = t0, i.e. on x0 = (x(t0), y(t0), z(t0)).Let R(t) denote the linear approximation, then

R(t) = x(t0) + (t− t0)dx

dt(t0) .

59

Page 64: Notes and problem sheets for the course

Alternatively, the tangent line to the curve x = x(t) at the point x0 is given, on writings = t− t0, by

r = x0 + sdx

dt(t0) .

In two dimensions, since a vector in the tangent direction is (dx/dt, dy/dt), and (dy/dt,−dx/dt)·(dx/dt, dy/dt) = 0, a vector directed perpendicularly to the curve is n = (dy/dt,−dx/dt).Another normal vector is given by n/(dx/dt) = (f ′(x),−1).

Question 4.1. Consider the trajectory of a particle as given by the vector function

x(t) =

2t+ 3t2 + 3tt3 + 2t2

. (4.6)

Calculate a linear approximation to the particle’s trajectory at t = 1.

Solution. When t = 1, x = (5, 4, 3).Differentiating (4.6) with respect to t,

dx

dt(t) =

22t+ 33t2 + 4t

.

Substituting t = 1 into this,dx

dt(1) = (2, 5, 7).

The linear approximation then reads

x(t) =

543

+ (t− 1)

257

=

2t+ 35t− 17t− 4

.

How good an approximation is this? Graphically it is difficult to visualise a curve or itslinear approximation in 3D, although we can get a feel for the accuracy by looking at thedifferent projections onto 2D planes normal to the coordinate axis.Note that we might also write the tangent to the curve at (5, 4, 3) as

x =

543

+ s

257

=

2s+ 55s+ 47s+ 3

.

4.2 Gradient of a Scalar Function

There are many physical and chemical properties that can be represented as a scalarfunction or, as it is sometimes called, a scalar field. For example, the temperature orchemical concentration in a particular application can be represented as a scalar field.It is possible, given a function of more than one independent variable, to define thegradient vector or derivative vector.

60

Page 65: Notes and problem sheets for the course

Given a function of the form f(x, y, z), then we can define its gradient as

gradient of f = grad f = ∇f =

∂f

∂x

∂f

∂y

∂f

∂z

.

Example 4.2. Consider the temperature function T (x, y, z) = x2 + 2y2 + z2. Accordingto Fourier’s law of heat conduction, heat flux (power flow per unit area) is given byq = −k∇T , for k = thermal conductivity. Here the heat flux will be

q = ∇T = k

∂T/∂x∂T/∂y∂T/∂z

=

2kx4ky2kz

.

The gradient will be useful in a following subsection on tangent planes (as might be usedas approximations to surfaces in 3D).The gradient has already appeared, in disguised form, in the lecture course in the previoussemester, F18XC.

4.2.1 Directional derivatives

In the two-dimensional case, the directional derivative of a function f(x, y) in the directionof an angle α, or, equivalently, in the direction of a unit vector a = (cos θ, sin θ), where θgives the angular direction of a vector a as measured anti-clockwise from the x direction,see Fig. 4.2, is

mα = Daf =∂f

∂xcos θ +

∂f

∂ysin θ = a · (∂f/∂x, ∂f/∂y) = a · (∂f/∂x, ∂f/∂y)

|a| ,

where a = a/|a| is the unit vector in the a direction. This then gives the directionalderivative Daf of f in the direction of a general vector a.In three dimensions, the directional derivative of a function f(x, y, z) in the direction ofa vector a = (a1, a2, a3) is likewise given by

Daf = a · (∂f/∂x, ∂f/∂y, ∂f/∂z) = a · (∂f/∂x, ∂f/∂y, ∂f/∂z)|a| .

It follows that, irrespective of the number of dimensions,

Daf =a · ∇f

|a| = a · ∇f .

61

Page 66: Notes and problem sheets for the course

x

a

a

θ

y

O

Figure 4.2: In two dimensions, a vector a, its corresponding unit vector a, and angle ofdirection, θ.

Question 4.2. Consider the function f(x, y, z) = xy + yz + xz. Find the “slope” in thedirection v = (1, 2, 3).

Solution. First of all we need the gradient, ∇f = (∂f/∂x, ∂f/∂y, ∂f/∂z), where∂f

∂x=

∂x(xy+yz+xz) = y+z,

∂f

∂y=

∂y(xy+yz+xz) = x+z,

∂f

∂z=

∂z(xy+yz+xz) = x+y,

so

∇f =

y + zx+ zx+ y

.

The directional derivative is then given by a scalar product:

Dvf =v · ∇f

|v| =(1, 2, 3) · (y + z, x+ z, x+ y)√

1 + 4 + 9

=(y + z) + 2(x+ z) + 3(x+ y)√

14=

1√14

(5x+ 4y + 3z) .

Having defined the directional derivative then it is possible to find the direction withgreatest positive slope. Using the geometric definition of a scalar product,

Dvf =v · ∇f

|v| =|v||∇f | cos θ

|v| = |∇f | cos θ ,

for θ the angle between the direction vector v and the gradient of f .

Therefore the maximum directional derivative occurs when cos θ = 1, that is, for θ = 0(v pointing in the direction of fastest increase of f).

62

Page 67: Notes and problem sheets for the course

The direction with the greatest slope is

v = ∇f

and the directional derivative in this direction is

|∇f | .

Likewise, the direction with the greatest negative slope is

v = −∇f

and the directional derivative in this direction is then

−|∇f | .

Question 4.3. Consider the function given in Question 4.2, f(x, y, z) = xy+ yz+xz. Inwhich direction is f increasing the fastest from the point (1, 3,−1)?

Solution. Recall that the gradient of f is ∇f = (y+ z, x+ z, x+ y). At the point giventhis is

∇f =

204

.

This (or, more simply, (1, 0, 2)) is the direction that the function is increasing the fastest.The magnitude of the vector gives the rate of increase of the function in this direction:|∇f(1, 3,−1)| = |(2, 0, 4)| =

√4 + 16 =

√20 = 2

√5.

Example 4.3. Following the release of a toxic chemical the concentration field is given,at a particular time, by

c = Cex2+y2+z2.

Due to diffusion the rate of change of the toxic chemical at any location is related to thegradient

∇c = C∇ex2+y2+z2 = C

2xex2+y2+z2

2yex2+y2+z2

2zex2+y2+z2

= 2Cex2+y2+z2

xyz

= 2Cex2+y2+z2r .

In particular, at a point (−1, 1, 2) the gradient vector is

∇c = 2Ce6

−112

.

The direction of maximum negative slope (along which the toxic chemical diffuses) is−∇c = 2Ce6(1,−1,−2). An alternative, simpler, vector in the same direction is (1,−1,−2).The slope or size of the gradient in that direction (which gives the speed at which thechemical diffuses) is −|∇c| = −2Ce6|(−1, 1, 2)| = −2

√6 e6C.

63

Page 68: Notes and problem sheets for the course

4.2.2 Equations for a tangent plane and normal line

A surface in three dimensions can be specified by a function as

f(x, y, z) = c ,

where c is some constant. For example the equation

f(x, y, z) = 2x+ 3y + 4z = 1

represents a plane whileg(x, y, z) = x2 + y2 + z2 = 4

represents the surface of a sphere of radius 2 centred on the origin.In this sub-section we will be deriving approximations to surfaces given in this way by atangent plane at a particular point on the surface. This can be thought of as an extensionto linear approximation of a curve by a line. This is a useful thing to do as equations ofplanes can be analysed using the techniques considered in Subsection 4.1.2, whereas it isoften very difficult to deal with an equation for a general surface analytically.Before we consider this problem in detail let us look at a simple surface,

f(x, y, z) = z = 10 .

This is the equation of a plane that is parallel to the x and y axes. If we differentiatethe function with respect to the three independent variables this gives the gradient ∇f =(0, 0, 1).The individual components of the gradient give the derivatives in each of the three co-ordinate directions. So, for example, the function above does not change in the x directionso the x component of the derivative is zero. Another interpretation of the derivativevector is as a direction vector. This interpretation leads to the result that in this case thederivative direction is perpendicular, or normal, to the plane.

Important ResultThis is a specific example of the general result that, given a surface, f(r) = c, thenthe gradient evaluated at a point on the surface r0 = (x0, y0, z0), ∇f(x0, y0, z0), isperpendicular to the surface at r0, see Fig. 4.3.

(It follows from noting that following any curve r(t) = (x(t), y(t), z(t)) on the curve givesdf/dt = dr/dt · ∇f (by the chain rule), while df/dt = dc/dt = 0, so ∇f must be normalto any curves in the surface, hence to all their tangent lines, and hence to the tangentplane.)This is an important result as it makes it possible to calculate planes at a point on asurface.Given a point r0 = (x0, y0, z0) on a surface f(r) = c, then n = ∇f(r0) is perpendicularto the surface at r0.Recall the equation of a plane,

n · r = d ,

where n is a vector normal to the plane. Therefore

∇f(r0) · r = d ,

64

Page 69: Notes and problem sheets for the course

n = ∇f(r0)

Section through tangentplane n · r = n · r0

r0

Section through

surface f(r) = c

Figure 4.3: The tangent plane to a surface f(r) = c at the point r0 = (x0, y0, z0).

is the equation of the tangent plane plane. The constant d can be found by noting thatthe point r0 is in the plane.

Analogously, the parametric equation of a normal line to the surface at r0 is

r = r0 + t∇f(r0) ,

i.e., the gradient at r0 is the direction vector of the normal line passing through r0.Let us see this put into action.

Example 4.4. Consider the surface

f(x, y, z) = x2 + 2y2 + 3z2 = 10

(the surface of an ellipsoid).Suppose that we want to derive an equation of a plane that approximates the surface atthe point (1,

√3, 1).

Applying the gradient,

∇f =

2x4y6z

=

2

4√3

6

at (1,√3, 1).

The equation of the plane is then

2

4√3

6

· r = d

or, equivalently, 2x+ 4√3 y + 6z = d.

To find d we note that r = (1,√3, 1) lies on the plane so

d =

2

4√3

6

·

1√31

= 2 + 12 + 6 = 20 .

65

Page 70: Notes and problem sheets for the course

The equation of the normal plane is therefore

2

4√3

6

· r = 20 .

We could tidy it up a little further as 2 is common to all terms and could be removed.The plane can then be written as x+ 2

√3 y + 3z = 10.

Using the normal vector above, or, more simply, n = (1, 2√3, 3), the equation of the

normal line passing through r0 can be written as

r =

1√31

+ t

1

2√3

3

.

4.3 Introduction to div and curl

This section introduces the vector operators div and curl. Vector calculus is a very usefulfield of mathematics to engineers and scientists. We only give the briefest introduction.

In the previous section we considered the calculus of multi-dimensional scalar functions asthese are useful for characterising scalar fields such as the temperature distribution in athermal system or the concentration distribution following the release of a toxic chemical.

We defined the gradient of a multi-dimensional scalar function f(x, y, z) as a vector func-tion grad f :

grad f = ∇f =

∂f/∂x∂f/∂y∂f/∂z

.

Vector functions as well as arising as gradients of multi-dimensional scalar functions areof interest in their own right to engineers and scientists as they allow us to characterisevector quantities such as forces, velocities and accelerations. A vector function takes theform

f (x, y, z) =

fxfyfz

or

f1f2f3

,

where fx = f1, fy = f2 and fz = f3 represent the components of the vector functionparallel to the x, y and z axes.

When considering derivatives of a vector function there are two possibilities. These arisein the same way that “multiplication” of two vectors can take two forms, the scalar ordot product and the vector or cross product. The divergence operator is related to thescalar product, it is defined now.

66

Page 71: Notes and problem sheets for the course

Definition of the divergence operatorGiven a vector function

f(x, y, z) =

f1f2f3

,

the divergence of f is defined to be

div f = ∇ · f =

∂/∂x∂/∂y∂/∂z

·

f1f2f3

= ∂f1/∂x+ ∂f2/∂y + ∂f3/∂z .

Note that div takes a vector function and produces a scalar one whereas grad takes ascalar function and produces a vector one.

Example 4.5. A compressible fluid with varying density ρ(r, t) flows with velocity v =(v1, v2, v3). To ensure that mass is conserved, the “continuity equation”,

∂ρ

∂t+∇ · (ρv) = 0 ,

has to hold.

Suppose that, at some time, q = ρv = (2x− y2, x2 + 3z, 4y − z2). An evaluation of div q

tells us how fast the density is decreasing.

∇·q =∂q1∂x

+∂q2∂y

+∂q3∂z

=∂

∂x(2x−y2)+

∂y(x2+3z)+

∂z(4y−z2) = 2+0−2z = 2−2z .

Hence ∂ρ/∂t = −divq = 2z − 2.

Question 4.4. Evaluate the divergence of the vector function f = (3x2y, z, x2)

Solution.

∇ · f =

∂/∂x∂/∂y∂/∂z

·

3x2yzx2

=∂

∂x(3x2y) +

∂z

∂y+

∂x2

∂z= 6xy + 0 + 0 = 6xy .

The other derivative operator for vector functions, based on the vector product, is thecurl, defined here:

67

Page 72: Notes and problem sheets for the course

Definition of curlGiven a vector function,

f(x, y, z) =

f1f2f3

,

the curl of f is defined to be

curl f = ∇× f =

∂/∂x∂/∂y∂/∂z

×

f1f2f3

=

i j k

∂/∂x ∂/∂y ∂/∂zf1 f2 f3

.

Example 4.6. Curl can be thought of as giving a measure of how a vector field turns.Suppose that a fluid rotates as a rigid body with angular velocity ω about an axis throughthe origin O. Then the velocity v of the fluid at a point with position vector r = (x, y, z)is given by

v = ω×r =

ω1

ω2

ω3

×

xyz

=

i j k

ω1 ω2 ω3

x y z

= (ω2z−ω3y)i+(ω3x−ω1z)j+(ω1y−ω2x)k .

Then

∇× v =

i j k

∂/∂x ∂/∂y ∂/∂zω2z − ω3y ω3x− ω1z ω1y − ω2x

=

(

∂y(ω1y − ω2x)−

∂z(ω3x− ω1z)

)

i

+

(

∂z(ω2z − ω3y)−

∂x(ω1y − ω2x)

)

j +

(

∂x(ω3y − ω1z)−

∂y(ω2z − ω3y)

)

k

= 2ω1i+ 2ω2j + 2ω3k = 2ω .

The curl of the velocity is twice the angular velocity.

Question 4.5. Find the curl of the vector function

f =

2x− y2

x2 + 3z4y − z2

.

Solution.

curl f = ∇× f =

∂/∂x∂/∂y∂/∂z

×

2x− y2

x2 + 3z4y − z2

=

i j k

∂/∂x ∂/∂y ∂/∂z2x− y2 x2 + 3z 4y − z2

68

Page 73: Notes and problem sheets for the course

= i

∂/∂y ∂/∂zx2 + 3z 4y − z2

− j

∂/∂x ∂/∂z2x− y2 4y − z2

+ k

∂/∂x ∂/∂y2x− y2 x2 + 3z

= i

(

∂y(4y − z2)− ∂

∂z(x2 + 3z)

)

− j

(

∂x(4y − z2)− ∂

∂z(2x− y2)

)

+ k

(

∂x(x2 + 3z)− ∂

∂y(2x− y2)

)

= (4− 3)i− (0 + 0)j + (2x+ 2y)k = i+ 2(x+ y)k .

In some circumstances the div and curl of a physical property can have physical mean-ing, for example in the vector field of the velocity v of an incompressible fluid, massconservation can be expressed as

div v =∂v1∂x

+∂v2∂y

+∂v3∂z

= 0 .

This can be read as the net flow of fluid into a control volume is zero.Similarly a velocity field for a fluid where the curl is zero, curl v = 0, means the fluid hasno rotational motion.

The vector operators div and curl and the scalar operator grad can be combined. Forexample,

div(grad f) = ∇ · (∇f) =

∂/∂x∂/∂y∂/∂z

·

∂f/∂x∂f/∂y∂f/∂z

=∂2f

∂x2+

∂2f

∂y2+

∂2f

∂z2.

This is also written as ∇2f .Provided f(r) has continuous second-order derivatives it is possible to show that

curl grad f = 0 .

Similarly it is possible to show that

div curl f = 0 .

An advantage of working with the vector and scalar operators is that they provide shorthand for systems of partial differential equations. For example, in a solid material themechanism for heat transfer is conduction, this leads to a partial differential equation thatthe temperature field T (x, y, z, t) satisfies. The relevant differential equation without usingvector and scalar operators reads

ρc∂T

∂t=

∂x

(

k∂T

∂x

)

+∂

∂y

(

k∂T

∂y

)

+∂

∂z

(

k∂T

∂z

)

,

where ρ is the density, c is the specific heat and k is the thermal conductivity. Usingvector and scalar operators the differential equation reads

ρc∂T

∂t= div (k grad T ) = ∇ · (k∇T ) .

69

Page 74: Notes and problem sheets for the course

One final example is the system of equations in electromagnetism, Maxwell’s equations.Using vector and scalar operators these are, in a vacuum (without any electric charge orcurrent),

∇ ·H = 0 , ∇ ·E = 0 , ε0E = ∇×H , H = −µ0∇×E .

Here ε0 is the electric permittivity of free space, µ0 is the magnetic permeability of avacuum, E is the electric field and H is the magnetic field.

4.4 Summary of Vector Geometry

This part began with how vector operations, such as the scalar or vector product couldbe used to define useful geometric objects, such as a line in three-dimensional space,

r = a+ tb ,

or give the non-parametric equation of a plane,

n · r = d .

The equation of the plane can take a few different forms depending on what informationis available. For example if you have three points in the plane, a, b, and c, then thenormal vector defining the orientation of the plane must be constructed by deriving twodirection vectors parallel to the plane and using the vector product,

n = (a− b)× (b− c) .

Further relationships between planes and lines, for example the line of intersection betweenplanes or the angle between two intersecting planes, could then be determined withoutthe need to visualise them in three-dimensional space.Once comfortable with the analysis of planes and lines, the calculus of vectors was in-troduced. This made it possible to approximate three-dimensional curves by a linearapproximation and made it possible to construct planes as local approximations to three-dimensional surfaces, i.e. ∇f(r0) · r = d is the tangent (approximating) plane to thesurface f(r) = c at r0 on taking d = ∇f(r0) · r0.We also found that for a scalar function f we could calculate the directional derivative inany direction defined by a vector v:

Dvf =v · ∇f

|v| =v · (∂f/∂x, ∂f/∂y, ∂f/∂z)

|v| .

Moreover, the direction of the maximum slope is v = ∇f .The last part of the block introduced the vector operators div and curl.

70

Page 75: Notes and problem sheets for the course

4.5 Problems

Problem 4.1. If a = 5t2i+ tj − t3k and b = sin(t)i− cos(t)j, find

(a)d

dt(a · b), (b)

d

dt(a× b), (c)

d

dt(a · a).

Problem 4.2. Using the laws given in the lectures, show that

d

dt(a · b× c) = a · b× dc

dt+ a · db

dt× c +

da

dt· b× c.

Problem 4.3. A particle moves along a curve r(t) = (x(t), y(t), z(t)), x = t, y = t2,z = 2t3/3.

(a) Find its velocity (dr/dt) and acceleration (d2r/dt2) at time t = 1.

(b) Find the linear approximation of the particle trajectory, velocity and accelerationat t = 1

Problem 4.4. Calculate the gradient of the following scalar fields.

(a) f(x, y, z) = x2y3z4.

(b) f(x, y, z) = sin x cos(yz).

(c) f(x, y, z) = x2yz + xy2z.

Problem 4.5. Calculate the divergence and curl of the following vector fields.

(a) f(x, y, z) = (x2y2, 2xyz, z2).

(b) f(x, y, z) = (x2y2, y2z2, x2z2).

(c) f(x, y, z) = (sin x, cos y, tan z).

Problem 4.6. Suppose that two vector fields are given by g(r) = r = (x, y, z) andh(r) = ω × r, where ω is a constant vector. Show that:

(a) ∇ · g = 3; ∇× g = (0, 0, 0).

(b) ∇ · h = 0; ∇× h = 2ω.

Problem 4.7. For each of the scalar functions in Problem 4.4, calculate the directionalderivative a.∇f , at the point r = (π, π, 1), a = (1, 2, 2).

Problem 4.8. Find the equations for the normal line and tangent plane for the followingsurfaces, at the points indicated.

(a) xy + yz + zx = 11, at (1, 2, 3).

(b) x2 + 4y2 − z2 = 0, at (3, 2, 5).

(c) x2 + xy + y2 = 3, at (−1,−1, 1).

71

Page 76: Notes and problem sheets for the course

Problem 4.9. Compute the directional derivative at position (2, 1,−1) of the vectorfield φ = x2yz3 in the direction (1, 0, 0). In which direction is the directional derivativeat (2, 1,−1) a maximum?

Problem 4.10. Show that if f (x, y, z) = (yz, xz, xy) then ∇× f = 0, and find a simplescalar field φ(x, y, z) such that that f = gradφ. Can you find another φ(x, y, z) such thatf = gradφ still holds?

Problem 4.11 (Advanced). Show that if the scalar field φ(x, y, z) is a solution ofLaplace’s equation ∇ · (∇φ) = 0, then for gradφ we have that ∇ × gradφ = 0 and∇ · gradφ = 0.

Problem 4.12 (Advanced). Suppose that φ(x, y, z) is a scalar field, and that f (x, y, z)is a vector field. Prove the following:

1. curl(grad (φ)) = 0;

2. curl(curl(f)) = grad (div(f))−∇2f ;

3. ∇× f = i× ∂f

∂x+ j × ∂f

∂y+ k × ∂f

∂z.

Answers

3. (b) (t,−1 + 2t,−4/3 + 2t), (1, 2t,−2 + 4t), (0, 2, 4t).

5. (a) 2xy2+2xz+2z, −2xyi+(2yz−2x2y)k. (b) 2xy2+2yz2+2x2z, −2y2zi−2xz2j−2x2yk. (c) cosx− sin y + sec2 z, 0.

7. 8π4

3(1 + π). (b) 1

3. (c) π2

3(9 + 4π).

8. (a) (1, 2, 3)+u(5, 4, 3), 5x+4y+3z = 22. (b) (3, 2, 5)+u(6, 16,−10), 3x+8y−5z = 0.(c) (−1,−1, 1) + u(−3,−3, 0), x+ y = −2.

10. xyz (+ constant).

72

Page 77: Notes and problem sheets for the course

Chapter 5

Systems of Linear Equations

5.1 Linear Equations and Elementary Row Opera-

tions

Physical and engineering applicationsWhen modelling many physical and engineering problems, we are often left with a systemof algebraic equations for unknown quantities x1, x2, x3, . . . , xn, say. These unknownquantities may represent components of modes of oscillation in structures for example, ormore generally1:

Structures: stresses and moments in complicated structures;

Hydraulic networks: hydraulic head at junctions and the rate of flow (discharge) forconnecting pipes;

Circuits: electrical currents in circuits;

Surveying: error adjustments via least squares method;

Curve fitting: determining the coefficients of the best polynomial approximation;

General networks: abstract network problems – global communication systems;

Finite difference schemes: nodal values in the numerical implementation of a finite-difference scheme for solving differential equation boundary value problems;

Finite element method: elemental values in the numerical implementation of a finiteelement method for solving boundary value problems – useful in arbitrary geomet-rical configurations;

Nonlinear cable analysis: bridges, structures;

Production totals: factories, companies;

1see www.nr.com and www.ulib.org

73

Page 78: Notes and problem sheets for the course

Airline scheduling: flight/ticket availability.

In any of these contexts, the system of algebraic equations that we must solve will inmany cases be linear or at least can be well approximated by a linear system of equations.Linear algebraic equations are characterised by the property that no variable is raised toa power other than one or is multiplied by any other variable. The question is: is there asystematic procedure for solving such systems?

We thus aim to study systems of m linear equations in n unknowns:

a11x1 + a12x2 + · · ·+ a1nxn = b1a21x1 + a22x2 + · · ·+ a2nxn = b2

. . . = . . .

. . . = . . .

. . . = . . .am1x1 + am2x2 + · · ·+ amnxn = bm .

(5.1)

Here x1, x2, . . . , xn are the unknowns and aijs are coefficients and bjs are constants. Givensuch a system we would like to have answers to the following questions:

• Does it have a solution? What conditions are required on the coefficients aij andthe constants bj for the system to have a solution?

• How many solutions?

• How do we find them?

If the constants b1 = b2 = · · · = bm = 0 then the system (5.1) is said to be homogeneous.A homogeneous system always has at least one solution, namely x1 = x2 = · · · = xn = 0;this is the trivial solution.

Question 5.1. Solve the equation

ax = b (5.2)

Solution. There are 3 cases:1. If a 6= 0, then for any b (5.2) has a unique solution

x =b

a.

For example the equation

3x = 12

has unique solution

x =12

3= 4 .

74

Page 79: Notes and problem sheets for the course

2. If a = 0 but b 6= 0, then (5.2) becomes

0× x = b .

Since b is not zero, no value of x will make this statement true, so (5.2) has no solutionsin this case.

3. If both a = 0 and b = 0, then (5.2) becomes

0× x = 0 .

This is true for any x. So (5.2) has infinitely many solutions in this case.

We shall see that the three cases in the above example exactly mirror the general case.

The coefficients aij , i = 1, . . . , m, j = 1, . . . , n present on the left-hand of the system ofequations (5.1) can be arranged into a square table

A =

a11 a12 . . . a1na21 a22 . . . a2n...

......

...am1 am2 . . . amn

(5.3)

called an m×n matrix, more specifically, the coefficient matrix. Here m is the numberof rows in the matrix (the number of equations) and n is the number of columns (thenumber of unknowns). A number positioned in the i-th row and the j-th column is calledthe (ij) matrix entry. For the matrix at hand the i-th row thus corresponds to the i-thequation while the j-th column corresponds to the j-th variable xj .The coefficients bi, i = 1, . . . , m on the right-hand sides of the equations are arranged intoa column

b =

b1b2...bm

.

We put all of the data specifying the system (5.1) into an m × (n + 1) augmentedmatrix by adding to the matrix A one extra column on the right. To emphasise that thecoefficients bi are of a different nature than the coefficients aij we may separate the extracolumn by a vertical bar:

(A|b) =

a11 a12 . . . a1n b1a21 a22 . . . a2n b2...

......

......

am1 am2 . . . amn bm

.

Each row of the augmented matrix represents an equation of system (5.1). To facilitatethe solution of system (5.1), we initially define two matrix row operations:

1. Rj → Rj + kRi means: add k times row i to row j of the matrix;

2. Ri → kRi means: multiply row i by k 6= 0.

75

Page 80: Notes and problem sheets for the course

Question 5.2. Solve the system of linear equations

x+ 2y − 3z = 4 ,

x+ 3y + z = 11 ,

2x+ 5y − 4z = 13 .

Solution. Translated into a matrix formulation, this becomes

(A|b) =

1∗ 2 −3 41 3 1 112 5 −4 13

.

We use the first row to kill the rest of the first column. This corresponds to eliminatingx from all but the first equation. The top left entry of the matrix, which is used to driveall the entries directly below it to zero, is called a pivot and is marked by an asterisk.We apply

R2 → R2 −R1 , R3 → R3 − 2R1 ,

to obtain

1 2 −3 40 1∗ 4 70 1 2 5

.

The process of driving all the entries below a pivot to zero is called a down-sweep. Nextwe use the second enry on the second row as a pivot to kill the elements below it. We dothis by applying R3 → R3 −R2

1 2 −3 40 1 4 70 0 −2 −2

.

We can further simplfy the matrix by multiplying the last row by −1/2:

1 2 −3 40 1 4 70 0 1∗ 1

.

We may now reverse the strategy and use the third row to kill elements in the thirdcolumn. This process is called an up-sweep. After applying

R2 → R2 − 4R3 , R1 → R1 + 3R3,

we obtain

1 2 0 70 1∗ 0 30 0 1 1

.

76

Page 81: Notes and problem sheets for the course

We next use the second row to kill elements in the second column by applying R1 →R1 − 2R2

1 0 0 10 1 0 30 0 1 1

.

The unique solution of the system can now be read off the rightmost column:

x = 1 , y = 3 , z = 1 .

The process that we employed to solve the above problems is called Gaussian elimina-tion. In it one first carries out a sequence of down-sweeps using pivots on the diagonalsuccessively starting with the first row. One next scales the last row and uses it for up-sweeping. Then one scales the second row and uses it for up-sweeping, etc. until oneobtains a unit matrix in the left block of the augmented matrix. The right-most columnof the resulting matrix contains the solution. This algorithm assumes that all pivotsencountered in the course of its execution are non-zero.

Question 5.3. Solve the system of linear equations

x+ y + z = 1

3x+ 4y − z = 2

−2x+ y − z = 8 .

Solution. The augmented matrix for this problem is

1∗ 1 1 13 4 −1 2−2 1 −1 8

.

After down-sweeping using the top left entry as a pivot we obtain

1 1 1 10 1∗ −4 −10 3 1 10

.

down-sweeping using the second row we get

1 1 1 10 1 −4 −10 0 13 13

. (5.4)

After scaling the last row and then up-sweeping, we get

1 1 0 00 1 0 30 0 1 1

.

77

Page 82: Notes and problem sheets for the course

Finally up-sweeping in the second column yields

1 0 0 −30 1 0 30 0 1 1

and the unique solution is x = −3, y = 3, z = 1.

As an alternative to scaling the rows (to make all the pivots equal to one) and up-sweepingfollowing down-sweeping, we can carry out the alternative (but equivalent) process of backsubstitution. Once down-sweeping is complete, the final row (last equation) is used todetermine the last variable. This is then substituted into the final version of the secondlast equation to find the second last variable. Both are put into equation got from thethird last row, giving the third last variable, and so on.

Example 5.1. We can finish off Question 5.3 using back substitution.After down-sweeping is complete, we have the augmented matrix (5.4). The third rowimplies

13z = 13 so z = 1 .

The second row now givesy − 4z = y − 4 = −1 ,

on using z = 1, so y = 3.Then the first row leads to

x+ y + z = x+ 3 + 1 = x+ 4 = 1 ,

on substituting for the values of z and y, so x = −3.

Question 5.4. Solve the system of linear equations

x+ 2y + 3z = 1 ,

4x+ 5y + 6z = 2 ,

7x+ 8y + 9z = 1 .

Solution. The augmented matrix for this problem is

1 2 3 14 5 6 27 8 9 1

.

Down-sweeping brings this matrix to

1 2 3 10 −3 −6 −20 0 0 −2

.

78

Page 83: Notes and problem sheets for the course

From here on we are unable to proceed with up-sweeping because the entry we normallyuse as a pivot is zero. However, we do not have to proceed because the last equation nowreads 0× x+ 0× y + 0× z = −2 which cannot be satisfied for any values of x,y, z. Thesystem therefore has no solutions.

Question 5.5. Solve the system of linear equations

x+ 2y − 3z = 6 ,

2x− y + 4z = 2 ,

4x+ 3y − 2z = 14 .

Solution. The augmented matrix for this system is

1 2 −3 62 −1 4 24 3 −2 14

.

Down-sweeping yields

1 2 −3 60 1∗ −2 20 0 0 0

.

The last row corresponds to the equation

0× x+ 0× y + 0× z = 0

which is true for any values of x, y, z. To simplify the system further we do the up-sweepusing the entry on the second row. We obtain

1 0 1 20 1 −2 20 0 0 0

The first two rows correspond to the equations

x+ z = 2 ,

y − 2z = 2 ,

respectively. While the value of z remains undetermined (arbitrary), given such a value,the corresponding values of x and y are obtained from

x = 2− z , y = 2 + 2z .

The general solution of our system is

(x, y, z) = (2− z, 2 + 2z, z) ,

where z is arbitrary and is called a free variable. There are thus infinitely many solutions.A particular solution is obtained by fixing the value of z. For example z = 3, x = −1,y = 8 is a particular solution.

79

Page 84: Notes and problem sheets for the course

5.2 Gaussian Elimination: General Case

Sometimes pivots do not appear where we naively expect them to be and rows may needto be interchanged. Consider the following problem:

Question 5.6. Solve the system of linear equations represented by the augmented matrix

1∗ 2 3 12 4 5 1−1 1 2 4

.

Solution. After down-sweeping from the first pivot, we obtain

1 2 3 10 0∗ −1 −10 3 5 5

.

We are blocked from using the natural pivot by a zero. However, we can interchange rows2 and 3 and use a new pivot.

1 2 3 10 3∗ 5 50 0 −1 −1

.

Remaining down-sweeps change nothing. After scalings and up-sweeps we obtain

1 0 0 10 1 0 00 0 1 1

and the system has a unique solution (x, y, z) = (−2, 0, 1).

We see that it is convenient to introduce one more row operation: Ri ↔ Rj whichinterchanges the rows i and j.

Question 5.7. Solve the system of linear equations represented by the augmented matrix

1∗ 2 3 12 4 5 1−1 −2 2 4

.

Solution. All that is changed from the previous example is the entry A3,2 but it makesa big difference. After down-sweeping the first column we get

1 2 3 10 0∗ −1 −10 0 5 5

80

Page 85: Notes and problem sheets for the course

and there is nothing further down in the second column. If we can’t move down we moveright:

1 2 3 10 0 −1∗ −10 0 5 5

.

We down-sweep column 3 to obtain

1 2 3 10 0 −1∗ −10 0 0 0

.

Scaling and up-sweeping using the entry A2,3 as a pivot we obtain

1 2 0 −20 0 1 10 0 0 0

.

There are infinitely many solutions. We can express the pivot variables (those multipliedby the units) in terms of the non-pivot ones:

x = −2y − 2 , z = 1 .

The value of y is arbitrary.

A matrix is said to be in echelon form if

1. Any all-zero rows are below all other rows; and

2. The first non-zero entry of any row (called the pivot entry) is strictly further rightthan the first non-zero entry of any row above it

If (A′|b′) is the augmented matrix obtained by using the Gaussian elimination just afterthe last down-sweep, then the matrix A′ is in echelon form. Here is an example of anaugmented matrix after the last down-sweep:

1 2 1 1 4 1 2

0 0 2 −2 6 2 2

0 0 0 0 0 3 60 0 0 0 0 0 0

.

The coefficient part A′ is in echelon form. The pivot entries are put in boxes.

A matrix is said to be in reduced echelon form if all the following are true

1. It is in echelon form.

2. The first non-zero entry of any row is 1. This is called a pivotal 1.

3. All entries above a pivotal 1 are 0.

81

Page 86: Notes and problem sheets for the course

If (A′′|b′′) is the final augmented matrix obtained by Gaussian elimination (as describedabove), then A′′ is in the reduced echelon form. In the above example, the augmentedmatrix, after scalings and up-sweeps, is finally in the form

1 2 0 2 1 0 1

0 0 1 −1 3 0 −1

0 0 0 0 0 1 20 0 0 0 0 0 0

.

It is in reduced echelon form (as its coefficient part). The pivotal 1’s are put into boxes.

Consider now a general system of m equations for n unknowns. The coefficient matrix Ahas dimensions m× n. At the end of Gaussian elimination it has the form

0 . . . 0 1 0 0 0 d10 . . . 0 0 . . . 1 0 0 d20 . . . 0 0 . . . 0 . . . 1 0 d3...

......

......

......

0 . . . 0 0 . . . 0 . . . 0 . . . 1 dl0 . . . 0 0 . . . 0 . . . 0 . . . 0 . . . dl+1...

......

......

......

0 . . . 0 0 . . . 0 . . . 0 . . . 0 . . . dm

.

The first l rows contain pivotal 1’s while the last m− l rows have coefficients zero. Thereare the following possibilities :

1. If at least one of the entries dj with l + 1 ≤ j ≤ m is non-zero, the system has nosolutions.

2. If dj = 0 for all l + 1 ≤ j ≤ m and l < n, the system has infinitely many solutions.The non-pivotal variables can be taken as free (undertermined) variables. All pivotalvariables are expressed via (only) the non-pivotal ones.

3. If dj = 0 for all l + 1 ≤ j ≤ m and l = n the system has a unique solution: xi = di,i = 1, . . . , n.

Question 5.8. Determine how many solutions there is to the system of equations

x+ 2y − z = 0 ,

2x+ 5y + 2z = 0 ,

x+ 4y + 7z = 0 ,

x+ 3y + 3z = 0 .

82

Page 87: Notes and problem sheets for the course

Solution. Down-sweeping, we obtain

1 2 −1 02 5 2 01 4 7 01 3 3 0

1 2 −1 00 1 4 00 2 8 00 1 4 0

1 2 −1 00 1 4 00 0 0 00 0 0 0

.

We see that in the echelon form there are two equations for 3 unknowns (l = 2 < n = 3)and the system has infinitely many solutions.

Question 5.9. Solve the system

x+ 3y − 5z + w = 4 ,

2x+ 5y − 2z + 4w = 6 .

Solution. Down-sweeping, we obtain

(

1 3 −5 1 42 5 −2 4 6

)

→(

1 3 −5 1 40 −1 8 2 −2

)

.

Scaling the second row and up-sweeping, we obtain

(

1 3 −5 1 40 1 −8 −2 2

)

→(

1 0 19 7 −2

0 1 −8 −2 2

)

.

The coefficient matrix is now in reduced echelon form. We have l = 2 < n = 4 and thesystem has infinitely many solutions. The pivotal variables are x and y and the generalsolution is

(x, y, z, w) = (−2 − 19z − 7w, 2 + 8z + 2w, z, w) .

The non-pivotal variables w, z are arbitrary.

The number of non-zero rows in the echelon form of matrix A is called the rank of A,and is denoted by rank(A). (It gives a measure of the “size” of A.)

Question 5.10. Find the rank of

A =

1 1 1 23 4 4 7−2 1 2 −35 3 4 64 5 3 13

.

83

Page 88: Notes and problem sheets for the course

Solution. To find the rank we bring the matrix to echelon form by down-sweeping:

1 1 1 23 4 4 7−2 1 2 −35 3 4 64 5 3 13

1 1 1 20 1 1 10 3 4 10 −2 −1 −40 1 −1 5

1 1 1 20 1 1 10 0 1 −20 0 1 −20 0 −2 4

1 1 1 20 1 1 10 0 1 −20 0 1 −20 0 −2 4

1 1 1 20 1 1 10 0 1 −20 0 0 00 0 0 0

.

The matrix is now in echelon form. There are 3 non-zero rows so rank(A) = 3.

Note: For a system of m equations in n unknowns, so that the coefficient matrix A ism× n and the augmented matrix (A|b) is m× (n+ 1),

• If rank(A) < rank(A|b), there is no solution.

• If rank(A) = rank(A|b) = n, there is a unique solution.

• If rank(A) = rank(A|b) < n, there are infinitely many solutions.

(The rank r of an m× n matrix A is the same as that of its transpose AT , and satisfiesr ≤ the smaller of m and n.)

5.3 Geometric Interpretation

For two unknowns, the system of equations

a11x+ a12y = b1 , (5.5)

represents a line in the plane (assuming that a11 and a12 aren’t both zero). Taking asecond equation,

a21x+ a22y = b2 , (5.6)

gives a second line, and having the two equations holding together, (5.5) and (5.6), leadsto the crossing point of the lines, assuming that the lines are not parallel, i.e. thata11/a12 6= a21/a22, or, equivalently, a11a22 6= a21a12 (see Fig. 5.1). If the lines are parallel,a11a22 = a21a12, e.g. for x+ y = 1, 2x+ 2y = 1, the lines, generally, do not intersect andthen (5.5) and (5.6) have no solution, see Fig. 5.2. If a11/a12 = a21/a22 = b1/b2, the linesare coincident and there are infinitely many solutions (e.g. x+ y = 1 and 2x+ 2y = 2).

In three dimensions,a11x+ a12y + a13z = b1 (5.7)

represents a plane. Combining this with the equation of a second plane,

a21x+ a22y + a23z = b2 (5.8)

84

Page 89: Notes and problem sheets for the course

y

x

a11x + a12y = b1

a21x + a22y = b2

Figure 5.1: Crossing of two non-parallel lines (a11a22 6= a21a12).

gives the planes’ line of intersection (see Subsection 3.4.4). If we solve (5.7) and (5.8), wecan find x and y in terms of the free parameter z, say, and this would then be one formof the equation of the line of intersection.Now adding a third equation, for a third plane,

a31x+ a32y + a33z = b3 , (5.9)

the solution of (5.7), (5.8) and (5.9) (assuming it exists) gives the point where all threeplanes intersect. This is where the line of intersection crosses the third plane.If there is no solution, a plane must be parallel to the line of intersection of the other two.If there are infinitely many solutions, the line of intersection lies on the third plane.

85

Page 90: Notes and problem sheets for the course

y

x

a11x + a12y = b1

a21x + a22y = b2

Figure 5.2: Two parallel lines (a11a22 = a21a12).

5.4 Problems

Problem 5.1. Find how many solutions the following system has:

8x1 + 6x2 = 1 ,20x1 + 15x2 = 0 .

[Use the quantities a11a22 − a12a21 and a22b1 − a12b2 appearing in lectures.]

Problem 5.2. For the system of linear equations

x1 + 2x2 − 3x3 = −1 ,3x1 − x2 + 2x3 = 7 ,5x1 + 3x2 − 4x3 = 2 ,

find the augmented matrix. Simplify it by performing the sequence of row operations

R2 → R2 − 3R1 , R3 → R3 − 5R1 , R3 → R3 −R2 .

How many solutions does this system have?

Problem 5.3. For the system of linear equations

x− z = 2 ,−2x+ y + 4z = −5 ,2x− 3y − 3z = 8 ,

find the augmented matrix. Simplify it by down-sweeping in each column. Find thesolution by back substitution or by up-sweeping.

Problem 5.4. For the system

x+ 2y + z + 3w = 1 ,2x+ 5y + 2z + 5w = 17 ,

−x− 2y − 2w = 4 ,

86

Page 91: Notes and problem sheets for the course

find the augmented matrix. Simplify it by down-sweeping in each column. Find thegeneral solution using back substitution or up-sweeping and taking z to be a free variable.

Problem 5.5. For the system with augmented matrix

1 2 −2 3 22 4 −3 4 55 10 −8 11 12

,

simplify the matrix by down-sweeping in each column. Find the general solution usingback substitution (or up-sweeping).

Problem 5.6. For the electric circuit appearing below, Kirchhoff’s laws give

i2 + i3 = i1 ,10i1 + 5i3 = 95 ,

−5i3 + 10i2 = 35 .

i1 i3

95V35V

i2

10Ω

Find the unknown currents i1, i2 and i3 using Gaussian elimination.

Problem 5.7. Consider the following chemical process:

(x1)CO + (x2)CO2 + (x3)H2 → (x4)CH4 + (x5)H2O . (5.10)

Find the smallest positive integer values of x1, x2, x3, x4, x5 so that (5.10) balances. [Notethat the equations for conservation of C, O and H atoms read, respectively,

x1 + x2 = x4 ,x1 + 2x2 = x5 ,

2x3 = 4x4 + 2x5 .]

Problem 5.8. Two weights of mass m1 = m2 = 3 kg are arranged with light ropes andlight pulleys as shown below.

87

Page 92: Notes and problem sheets for the course

m1

m2x1

x2

Newton’s laws and the equation giving constancy ofrope length give

3a1 + 2T = 3g ,3a2 + T = 3g ,2a1 + a2 = 0 ,

where a1 = x1 and a2 = x2 are the downward accel-erations, T is the tension in the rope linking the firstpulley and the second mass, and g is acceleration dueto gravity. Use Gaussian elimination to find a1, a2and T in terms of g.

Problem 5.9. What condition should be placed on the parameter a so that the system

x+ 2y + 3z = 0 ,4x+ 9y + (a+ 12)z = 2 ,

−2x− 9y + (10− 3a)z = −10 ,

has infinitely many solutions?

Problem 5.10. What condition should be placed on the parameters a and b so that thesystem

x+ 2y = −a ,−3x− 6y = 4a− 2b ,2x+ 7y = 1− 2a ,

has a unique solution?

Problem 5.11. Find the rank of the matrix

B =

1 3 −2 5 41 4 1 3 51 4 2 4 32 7 −3 6 13

.

Would the problem Bx = 0 have non-trivial (meaning non-zero) solutions?For A the matrix given by the first four columns of B and b the 4-vector formed by thelast column of B, does the problem Ay = b, have (a) no solution, (b) a unique solution,or (c) infinitely many solutions.

88

Page 93: Notes and problem sheets for the course

Answers

3. x = 11/5, y = −7/5, z = 1/5.

4. (x, y, z, w) = (−54 + 4z, 20− z, z, 5 − z)

5. (x1, x2, x3, x4) = (4− 2x2 + x4, x2, 2x4 + 1, x4).

6. i1 = 8 A, i2 = 5 A, i3 = 3 A.

7. 1, 1, 7, 2, 3

8. a1 = −g/5, a2 = 2g/5, T = 9g/5.

9. −8.

10. a = 2b.

11. 3, yes, (c).

89

Page 94: Notes and problem sheets for the course

90

Page 95: Notes and problem sheets for the course

Chapter 6

Matrices

6.1 Vectors and Matrices

In this section we explain how to define an action of a matrix on a vector which will allowus to recast the system of linear equations in terms of that action. We will further defineoperations with matrices such as matrix multiplication and the inverse of a matrix.

Recall the following notions:

• R2 denotes the set of all ordered pairs of real numbers

(

xy

)

which are called two-dimensional vectors and can be depicted as

x

y(

xy

)

• R3 denotes the set of all ordered triples of real numbers

xyz

called 3-dimensional vectors and depicted as

91

Page 96: Notes and problem sheets for the course

xyz

x

y

z

• Rn denotes the set of ordered n-tuples

x1

x2...xn

which are called n-dimensional vectors or n-vectors. Rn is called n-dimensionalspace.

The n-vectors have the following properties

1. We can add any two n-vectors by adding their components:

x1

x2...xn

+

y1y2...yn

=

x1 + y1x2 + y2

...xn + yn

.

2. We can multiply any vector by a number λ by multiplying each component:

λ

x1

x2...xn

=

λx1

λx2...

λxn

.

3. There is a special n-vector called the zero vector whose every component is a zero:

0 =

00...0

.

Let A = (Aij) be an m× n matrix and let

x =

x1

x2...xn

92

Page 97: Notes and problem sheets for the course

be an n-vector or a point in Rn. We can define an action of the matrix A on the vector

x to be a vector denoted Ax with components

Ax =

a11x1 + a12x2 + · · ·+ a1nxn

a21x1 + a22x2 + · · ·+ a2nxn

...am1x1 + am2x2 + · · ·+ amnxn

. (6.1)

Example 6.1. Let

A =

1 −3 4 −20 2 5 10 1 −3 0

and let

x =

4−23−1

be a point in R4. Then

TA(x) := Ax =

2410−11

is a point in R3.

Since the action Ax is defined for any vector x ∈ Rn we say that A gives rise to a linear

transformation:

TA : Rn → Rm

by mapping

x 7→ Ax .

We now make two observations

1. For any m× n matrix A we always have

TA(0) = 0

where the 0 on the left-hand side is the zero vector in Rn and the 0 on the right-hand

side is the zero vector in Rm.

2. For some matrices A the linear transformation TA is many-to-one.

93

Page 98: Notes and problem sheets for the course

Example 6.2. For the matrix A as in Example 6.1 and

x1 =

−1271

−17

, x2 =

221−15

,

we have

TA(x1) = TA(x2) =

524

= y

and also many other vectors from R4 are mapped onto y. This happens because TA

“crushes” R4 into R

3.

A system (5.1) of m linear equations for n unknowns in matrix notation can be writtenas

Ax = b . (6.2)

A linear transformation associated with A acts as

TA : Rn → Rm

so that equations (6.2) can be recast as

TA(x) = b

and the problem of solving (6.2) is equivalent to finding all vectors in Rn which TA maps

onto b – a specific vector in Rm.

Suppose now we have an m × n matrix A and an n × k matrix B. The matrix B has nrows and k columns. Each column in matrix B can be considered to be a vector from R

n.Hence we can map each column in B into a column of m elements (a vector in R

m) usingthe rule (6.1). The resulting columns are then arranged into an m × k matrix called aproduct of matrices A and B and written AB. (The order is important!) Thus we havedefined a matrix multiplication, C = AB, so that the (ij) entry in the product matrixis given by the formula

Cij = Ai1B1j + Ai2B2j + · · ·+ AinBnj . (6.3)

Question 6.1. Find the matrix product AB for the matrices

A =

(

1 −1 04 1 1

)

, B =

7 −12 00 1

.

Solution. The result is a 2× 2 matrix

AB =

(

(1× 7− 1× 2 + 0× 0) (1× (−1)− 1× 0 + 0× 1)(4× 7 + 1× 2 + 1× 0) (4× (−1) + 1× 0 + 1× 1)

)

=

(

5 −130 −3

)

.

94

Page 99: Notes and problem sheets for the course

Note that in general not any two matrices can be multiplied. The number of columns inthe first matrix must match the number of rows in the second.

Example 6.3. In the above question one can also define BA:

BA =

7 −12 00 1

(

1 −1 04 1 1

)

=

3 −8 −12 −2 04 1 1

.

6.2 Inverse Matrices

Let A be an n× n matrix. Its inverse, denoted by A−1, is an n× n matrix such that

AA−1 = A−1A = I ,

where I is the n× n identity matrix:

I =

1 0 0 . . . 00 1 0 . . . 00 0 1 . . . 0

. . . . . . . . .. . .

...0 0 0 . . . 1

.

For example one can check that

(

2 15 3

)(

3 −1−5 2

)

=

(

1 00 1

)

=

(

3 −1−5 2

)(

2 15 3

)

and therefore(

2 15 3

)−1

=

(

3 −1−5 2

)

.

(Multiplying a matrix (or vector) by the identity matrix leaves the matrix unchanged –assuming the products are defined: for I the m×m identity matrix, A an l ×m matrixand B an m× n matrix, then AI = A and IB = B.)

Recall that a system of linear equations (5.1) can be written in a matrix form

Ax = b . (6.4)

Suppose further that n = m, then A is an n × n matrix, x is an n × 1 matrix (i.e. ann-vector) and b is an n×1 matrix (another n-vector). If the system has a unique solution,then Gaussian elimination (with up-sweeping and scaling) will bring its augmented matrix(A|b) to the form (A′|b′) = (I|b′) where I is the n × n identity matrix and b′ is the

95

Page 100: Notes and problem sheets for the course

solution x = b′. On the other hand, if we apply the inverse matrix A−1 to both sides ofour equation (6.4),

A−1Ax = A−1b

and thereforeIx = x = A−1b .

This means that b′ = A−1b. Solving the system for different right-hand sides b gives usinformation on the entries of the inverse matrix A−1. Thus if b is a column vector with 1on the i-th row and zeroes everywhere else, b = ei, the i-th elementary column vector(in three dimensions, e1, e2, e3 are the three unit vectors i, j, k), A−1b gives the i-thcolumn of the matrix A−1. Solving the system for all such elementary column vectorswith i = 1, 2, . . . , n gives the entire matrix A−1. We can do it all at once by applyingthe same row operations to a large augmented matrix (A|I) where the second block is ann× n identity matrix (the n elementary column vectors put together).

Question 6.2. Use Gaussian elimination to find the inverse for the matrix

A =

(

2 15 3

)

.

Solution. We start with an augmented matrix

(

2 1 1 05 3 0 1

)

,

which we can treat as a single 2×4 matrix. Down-sweeping in the first column, we obtain

(

2 1 1 00 1/2 −5/2 1

)

.

Multiplying the second row by 2 and up-sweeping the second column, we obtain

(

2 0 6 −20 1 −5 2

)

.

Finally multiplying the first row by 1/2 brings our matrix to the form

(

1 0 3 −10 1 −5 2

)

and we see that when the left block became the identity matrix the right block becamethe inverse matrix to the original coefficient matrix A .

Warning: Not every square matrix has an inverse! However, it can be proved that ifsystem (6.4) has a unique solution then A−1 exists for its matrix of coefficients A.

96

Page 101: Notes and problem sheets for the course

Question 6.3. Find B−1 for

B =

6 11 518 34 1512 25 11

.

Solution. We start with the matrix

(B|I) =

6 11 5 1 0 018 34 15 0 1 013 25 11 0 0 1

and carry out the usual down-sweeping,

6 11 5 1 0 00 1 0 −3 1 00 3 1 −2 0 1

6 11 5 1 0 00 1 0 −3 1 00 0 1 7 −3 1

,

up-sweeping,

6 0 5 34 −11 00 1 0 −3 1 00 0 1 7 −3 1

6 0 0 −1 4 −50 1 0 −3 1 00 0 1 7 −3 1

,

and finally scaling,

1 0 0 −1/6 2/3 −5/60 1 0 −3 1 00 0 1 7 −3 1

.

Hence

B−1 =

−1/6 2/3 −5/6−3 1 07 −3 1

.

6.3 Determinants

A determinant of a 2× 2 matrix A is the number

det(A) := det

(

a bc d

)

=

a bc d

= ad− bc . (6.5)

In Question 6.2, det(A) = 2×3−1×5 = 1. A determinant of a 3×3 matrix is a numberdefined by

det

a b cd e fg h i

=

a b cd e fg h i

= a×det

(

e fh i

)

−b×det

(

d fg i

)

+c×det

(

d eg h

)

,

where the determinants of 2× 2 matrices are computed according to formula (6.5).

97

Page 102: Notes and problem sheets for the course

Example 6.4.

det

1 −3 33 −5 36 −6 4

= 1× det

(

−5 3−6 4

)

− (−3)× det

(

3 36 4

)

+ 3× det

(

3 −56 −6

)

= (−5 × 4− 3× (−6)) + 3(3× 4− 3× 6) + 3(3× (−6)− (−5)× 6)

= −2 + 3× (−6) + 3× 12 = 16 .

In general a determinant of an n× n matrix A = (Aij) can be defined recursively as

det(A) =

n∑

j=1

(−1)j+1A1j × det(A(1,j)) , (6.6)

where A(1,j) is an (n− 1)× (n− 1) matrix obtained from A by removing from A the 1strow and the j-th column.

We will accept without proof the following theorem :

Theorem 6.1. The homogeneous system of n equations for n unknowns: Ax = 0 has anon-trivial solution if and only if det(A) = 0.

Question 6.4. Given a system of linear equations

x+ 2y = 0 ,

−x+ z = 0 ,

2x− 3y = az = 0 ,

find for what values of parameter a it has a non-trivial solution.

Solution. Computing

det

1 2 0−1 0 12 −3 a

= 7− 2a

and setting it to zero, we conclude that the system has a non-trivial solution if and onlyif a = 7/2.

One can also prove that if two matrices A and B can be turned into each other byelementary row operations, their determinants are proportional to each other. Thus ifdet(A) = 0 then det(B) = 0 and vice versa. This implies in particular that:

• if a matrix A has a zero row its determinant vanishes;

• if a matrix A has two rows proportional, its determinant vanishes;

• if a matrix A has rows which are linearly dependent (i.e. one row can be writtenas a sum of others, or a non-trivial sum of rows vanishes), its determinant vanishes.

98

Page 103: Notes and problem sheets for the course

(The same comments apply to columns.)(If the row operations are restricted to adding or subtracting a multiple of one to or fromanother, avoiding swaps and scalings, the value of the determinant is unchanged. Thesame applies to manipulating columns.)

The following theorem relates matrix multiplication and determinants.

Theorem 6.2. For any two n× n matrices A and B, det(AB) = det(A)det(B).

Question 6.5. For the matrices A and B below check that det(AB) = det(BA) =det(A)det(B)

A =

(

1 2−1 4

)

, B =

(

−1 02 5

)

Solution. We have

AB =

(

3 109 20

)

, BA =

(

−1 −2−3 24

)

and the determinants are det(A) = 6, det(B) = −5, det(AB) = det(BA) = −30 so thatindeed det(AB) = det(BA) = det(A)det(B).

Determinants and inverse matricesDeterminants can be used to compute entries of an inverse matrix A−1 directly throughthe entries of the original matrix A.Given an n×nmatrixA, define the (i, j)-thminor, denoted byMij, to be the determinantof the (n− 1)× (n− 1) matrix which results from deleting row i and column j of A.

Example 6.5. For the matrix

A =

1 −2 00 2 3−1 1 1

we find, for instance,

M12 = det

(

0 3−1 1

)

= 3 , M31 = det

(

−2 02 3

)

= −6 .

The entries of the inverse matrix A−1 can becomputed by using the minors using thefollowing formula:

A−1ij =

(−1)i+jMji

det(A). (6.7)

Note that the order of indices for the minor is interchanged compared with the order ofindices in the inverse matrix. In practice it is convenient first to compute the matrix

99

Page 104: Notes and problem sheets for the course

Cij = (−1)i+jMij which is called the cofactor matrix of matrix A, and then take itstranspose, that is, interchange the rows and columns and finally divide the result bydet(A). In general transpose of a matrix A is denoted by AT and means that AT

ij = Aji.For example

1 2 34 5 67 8 9

T

=

1 4 72 5 83 6 9

.

With this notation we haveA−1 = (1/det(A))CT .

Formula (6.7) assumes that det(A) 6= 0, so that we can divide by that quantity. Havingdet(A) 6= 0 is a necessary and sufficient condition for the inverse matrix to A to exist.

Example 6.6. For an arbitrary 2× 2 matrix

A =

(

a bc d

)

,

the above formula gives

A−1 =

(

a bc d

)−1

=1

ad− bc

(

d −b−c a

)

.

(This can be worth remembering!)

Question 6.6. Compute the inverse of matrix given in Example 6.4, using formula (6.7).

Solution. We first find the cofactor matrix

C =

+det

(

−5 3−6 4

)

−det

(

3 36 4

)

+det

(

3 −56 −6

)

−det

(

−3 3−6 4

)

+det

(

1 36 4

)

−det

(

1 −36 −6

)

+det

(

−3 3−5 3

)

−det

(

1 33 3

)

+det

(

1 −33 −5

)

.

We obtain

C =

−2 6 12−6 −14 −126 6 4

.

Taking the transpose of this matrix and dividing it by 16 we obtain

A−1 =1

16

−2 −6 66 −14 612 −12 4

.

100

Page 105: Notes and problem sheets for the course

6.4 Problems

Problem 6.1. For a matrix A and vectors x1 ∈ R3 and x2 ∈ R

5, find vectors y = Ax1 ∈R

5 and z = 2y − 3x2 ∈ R5, with

A =

1 0 −27 1/2 −1

−1/3 0 22 2 20 1 0

, x1 =

6−21

, x2 =

1−10

1/311

.

Problem 6.2. (a) The matrix performing clockwise rotations about the x axis in 3-dimensional space has the form

Rx(θ) =

1 0 00 cos θ sin θ0 − sin θ cos θ

,

where θ is the angle of rotation. Use this matrix to calculate the components of vector

v =

1−2.50.3

after clockwise rotation by π/3 about the x axis.(b) Check, using matrix multiplication, the identity

Rx(π/6)Rx(π/6) = Rx(π/3) .

[Can you guess what Rx(θ1)Rx(θ2) is in general?]

Problem 6.3. Find CD, DC and (CD)2 using matrix multiplication, where

C =

(

3 −1 20 4 5

)

, D =

11 2−1 −30 1

.

Problem 6.4. Use Gaussian elimination to find the inverse of

A =

1 −2 22 −3 61 1 7

.

Problem 6.5. Find B−1 and C−1, by any method, for

B =

(

1 4−1 2

)

and C =

(

0 32

−13

2

)

.

Problem 6.6. Compute the determinants det(D), det(E) of the following matrices:

D =

(

11 −35 2

)

, E =

1 3 02 6 4

−1 0 2

.

101

Page 106: Notes and problem sheets for the course

Problem 6.7. Check, by computing a determinant, that the homogeneous system oflinear equations

x− z = 0 ,

2x+ 7y − 3z = 0 ,

5x+ 14y − 7z = 0 ,

has a non-trivial solution.

Problem 6.8. Find for what values of parameter a the following system of linear equa-tions (for the unknowns x, y) has a non-trivial solution:

ax+ 12y = 0 ,

3x+ ay = 0 .

Problem 6.9. Using the general properties of determinants, compute the determinant

1 77 0 12 0 5 −10 −77 0 13 154 0 0

.

Problem 6.10. Find the cofactor matrix C and hence the inverse A−1 for the matrix

A =

1 3 02 6 4

−1 0 2

using the method of minors. [The determinant is det(A) = −12.]

102

Page 107: Notes and problem sheets for the course

Answers

1.

y =

440010−2

, z =

583019

−37

.

2. (1,−0.99, 2.31)T .

3.

CD =

(

34 11−4 −7

)

, DC =

33 −3 32−3 −11 −170 4 5

, (CD)2 =

(

1112 297−108 5

)

.

4.

A−1 =

27 −16 68 −5 2

−5 3 −1

.

5.

B−1 =

(

1/3 −2/31/6 1/6

)

, C−1 =

(

4 −32/3 0

)

.

6. det(D) = 37, det(E) = −12.

8. a = ±6.

9. −1540.

10. The cofactor matrix is

C =

12 −8 6−6 2 −312 −4 0

, A−1 = − 1

12

12 −6 12−8 2 −46 −3 0

.

103

Page 108: Notes and problem sheets for the course

104

Page 109: Notes and problem sheets for the course

Chapter 7

Eigenvalues and Eigenvectors

7.1 Introduction

In this chapter we study “eigenvalue” problems. These arise in many situations, forexample: calculating the natural frequencies of oscillation of a vibrating system; findingprincipal axes of stress and strain; calculating oscillations of an electrical circuit; imageprocessing; data mining (web search engines); etc.

Differential equations: solving arbitrary order linear differential equations analytically;

Vibration analysis: calculating the natural frequencies of oscillation of a vibrating sys-tem – bridges, cantilevers;

Principal axes of stress and strain: mechanics;

Dynamic stability: linear stability analysis;

Column buckling: lateral deflections – modes of buckling;

Electrical circuit: oscillations, resonance;

Principle component analysis: extracting the salient features of a mass of data;

Markov Chains: transition matrices;

Data mining: web search engines – analysis of fixed point problems;

Image processing: fixed point problems again;

Quantum mechanics: quantised energy levels.

Suppose that A is a square n×n matrix then we can ask if there are any non-zero vectorssuch that A just stretches when it acts on them:

Ax = λx

105

Page 110: Notes and problem sheets for the course

where λ is a number. For λ = 0 the corresponding vectors are said to belong to the nullspace of A. For λ = 1 the corresponding vector is called a fixed point because it does notchange under the action of A.

Example 7.1. Let

A =

1 −3 33 −5 36 −6 4

x =

112

then

Ax =

448

= 4

112

= 4x .

IfAx = λx .

for some vector x then such a number λ is called an eigenvalue of A, and the corre-sponding x is called an eigenvector.

A matrix can have more than one eigenvector and eigenvalue. In the previous examplethe matrix A was shown to have an eigenvalue λ = 4 with eigenvector

x =

112

.

One can check that λ = −2 is also an eigenvalue of A with corresponding eigenvectors

x1 =

110

and x2 =

10

−1

,

that is, Ax1 = −2x1 and Ax2 = −2x2. This example also shows that there can be

more than one eigenvector corresponding to the same eigenvalue. In fact, for the aboveexample, one can check that any linear combination

y = c1x1 + c2x2

where c1, c2 are constants (not both equal to zero), is also an egenvector of A witheigenvalue −2.

The problem of finding the eigenvalues of an n × n matrix A is equivalent to findingfor what values of λ the equation Ax = λx has a non-trivial solution. This system ofequations can be rewritten as

(A− λI)x = 0 ,

where I is the n× n identity matrix. For this homogeneous system to have a non-trivialsolution gives a condition on the values of λ.

106

Page 111: Notes and problem sheets for the course

Question 7.1. Find the eigenvalues of matrix

A =

(

1 21 0

)

.

Solution. Consider the matrix

A− λI =

(

1− λ 21 −λ

)

.

Down-sweeping in the first column we obtain(

1− λ 20 −λ− 2

1−λ

)

.

This matrix has a non-trivial null space if the lower right entry is zero, that is, if

λ2 − λ− 2 = (λ− 2)(λ+ 1) = 0 .

Therefore A has exactly 2 eigenvalues, λ = 2 and λ = −1.

The presence of a variable λ in the matrix made Gaussian elimination messier than usual.(Even worse, our computation has been incomplete as we tacitly assumed that λ− 1 6= 0.This assumption effectively excluded the case λ = 1 from our computations and one needsto check separately that 1 is not an eigenvalue of A.)

A more straightforward way to compute eigenvalues is by using determinants.

By Theorem 6.1, λ is an eigenvalue of matrix A if and only if

det(A− λI) = 0 . (7.1)

The expression χA(λ) := det(A−λI) is a polynomial of degree n called the characteristicpolynomial of A. Equation (7.1) is called the characteristic equation of A. Thus theeigenvalues of A coincide with the roots of its characteristic polynomial.

Question 7.2. Find the eigenvalues of matrix

C =

8 −12 515 −25 1124 −42 19

.

Solution. The characteristic equation reads

0 = χC(λ) = det(C− λI) = det

8− λ −12 515 −25 − λ 1124 −42 19− λ

= (8− λ)[(−25− λ)(19− λ)− (−42)(11)]− (−12)[15(19− λ)− 24× 11]

+5[15× (−42)− 24(−25− λ)] = −λ3 + 2λ2 + λ− 2 .

107

Page 112: Notes and problem sheets for the course

The polynomial factorises to give

(λ− 1)(λ+ 1)(λ− 2) = 0

so that the eigenvalues are

λ1 = 1 , λ2 = −1 , λ3 = 2 .

To find the eigenvalues and the corresponding eigenvectors of an n × n matrix A weproceed as follows.

1. Find the characteristic polynomial χA(λ) = det(A− λI).

2. Find the distinct roots λ1, λ2, . . . , λk of the characteristic equation χA(λ) = 0.These are the eigenvalues of A.

3. For each root λi, i = 1, 2, . . . , k, solve the homogeneous equation (A − λiI)x = 0for

x =

x1

x2...xn

.

The solutions are the corresponding eigenvectors.

Question 7.3. Find the eigenvalues and eigenvectors of

A =

1 0 00 1 10 1 1

.

Solution. (Step 1) The characteristic polynomial is

χA(λ) = det

1− λ 0 00 1− λ 10 1 1− λ

= −λ(λ− 1)(λ− 2) .

(Step 2) The above polynomial has roots

λ1 = 0 , λ2 = 1 , λ3 = 2 .

These are the eigenvalues of A.(Step 3) For λ1 = 0 the homogeneous equation (A− λ1I)x = 0 reads

1 0 00 1 10 1 1

xyz

=

000

.

108

Page 113: Notes and problem sheets for the course

Solving this system gives a corresponding eigenvector (or any multiple thereof)

x1 =

01−1

.

For λ2 = 1 we have to solve the system (A− I)x = 0 which reads

0 0 00 0 10 1 0

xyz

=

000

.

Solving this gives an eigenvector (or any scalar multiple thereof) corresponding to λ2:

x1 =

100

.

For λ3 = 2 we have to solve the system (A− 2I)x = 0 which reads

−1 0 00 −1 10 1 −1

xyz

=

000

.

Solving this gives an eigenvector (or any scalar multiple thereof) corresponding to λ3:

x3 =

011

.

7.2 Algebraic and Geometric Multiplicity of Eigen-

values

Note that in Question 7.3, for example, each eigenvalue is a simple root of the character-istic equation; in other words each eigenvalue only appears “once”. On the other hand,in Example 7.1, the characteristic equation for A is

(4− λ)(2 + λ)2 = 0

so that λ1 = 4 is a single root, and appears once as a solution of the equation, whereasλ2 = −2 is a double root, and appears twice as a solution of the equation. We say thatλ1 = 4 is an eigenvalue of algebraic multiplicity 1 and that λ2 = −2 is an eigenvalueof algebraic multiplicity 2. More generally, if the characteristic polynomial for a matrixA has a factor (λi − λ)j , λi will be an eigenvalue of algebraic multiplicity j.

The number of distinct (independent) eignevectors corresponding to an eigenvalue istermed its geometric multiplicity. The geoemetric multiplicity of an eigenvalue must be

109

Page 114: Notes and problem sheets for the course

at least 1. In Example 7.1 we saw that there were 2 independent eigenvectors correspond-ing to the eigenvalue of algebraic multiplicity 2. In general an eigenvalue’s geoemetricmultiplicity is no greater than its algebraic multiplicity:

1 ≤ geoemetric multiplicity ≤ algebraic multiplicity. (7.2)

Question 7.4. Find the eigenvalues and their algebraic and geoemetric multiplicities for

A =

9 0 00 9 00 0 9

, B =

5 4 −2−2 11 −14 −4 11

, and C =

9 3 6−6 3 0−3 0 15

.

Solution.

The matrix A. The characteristic equation is

det(λI−A) = det

λ− 9 0 00 λ− 9 00 0 λ− 9

= (λ− 9)3 = 0 .

The above polynomial has the triple root

λ = 9

so that A has only one eigenvalue, λ = 9, of algebraic multiplicity three.To now find the eigenvectors, we solve the homogeneous equation (A− λI)x = 0, so

0 0 00 0 00 0 0

xyz

=

000

.

Attempting to solve this system leaves x, y and z undetermined; the general eigenvectoris

xyz

= x

100

+ y

010

+ z

001

.

There are three independent eignevectors :

100

,

010

and

001

,

or, equivalently, the general eigenvector can be written in terms of three arbitrary con-stants: λ = 9 is an eigenvalue of geometric multiplicity three.

110

Page 115: Notes and problem sheets for the course

The matrix B. The characteristic equation is

det(λI−B) = det

λ− 5 −4 22 λ− 11 1−4 4 λ− 11

= (λ− 5)(λ2 − 22λ+ 121) + 16 + 16− 4(λ− 5) + 8(λ− 11) + 8(λ− 11)

= λ3 − 27λ2 + 231λ− 605 + 32 + 12λ+ 20− 176 = λ3 − 27λ2 + 243λ− 729

= λ3 − 3× 9λ2 + 3× 92λ− 93 = (λ− 9)3 = 0 .

Again there is the triple rootλ = 9

so that B also has only one eigenvalue, λ = 9, of algebraic multiplicity three.To now find the eigenvectors, we solve the homogeneous equation (B− λI)x = 0, so

−4 4 −2−2 2 −14 −4 2

xyz

=

000

.

Subtracting twice the second row from the first and adding twice the second row to thethird gives

0 0 0−2 2 −10 0 0

xyz

=

000

.

The second equation then gives −2x+2y−z = 0 so z = 2y−2x with x and y undetermined;the general eigenvector is

xy

2y − 2x

= x

10−2

+ y

012

.

There are two independent eignevectors :

10−2

and

012

,

or, equivalently, the general eigenvector can be written in terms of two arbitrary constants:λ = 9 is an eigenvalue of geometric multiplicity two.

The matrix C. The characteristic equation is

det(λI−C) = det

λ− 9 −3 −66 λ− 3 03 0 λ− 15

= (λ− 9)(λ2 − 18λ+ 45) + 18(λ− 15) + 18(λ− 3) = (λ− 9)(λ2 − 18λ+ 45) + 36(λ− 9)

= (λ− 9)(λ2 − 18λ+ 81) = (λ− 9)3 = 0 .

111

Page 116: Notes and problem sheets for the course

Once again there is the triple rootλ = 9

so that C also has only one eigenvalue, λ = 9, of algebraic multiplicity three.To now find the eigenvectors, we solve the homogeneous equation (C− λI)x = 0, so

0 3 6−6 −6 0−3 0 6

xyz

=

000

.

Dividing the first and third rows by three and the second by minus six recasts the problemas

0 1 21 1 0

−1 0 2

xyz

=

000

,

then adding the third row to the second gives

0 1 20 1 2

−1 0 2

xyz

=

000

,

and subtracting the second row from the first leads to

0 0 00 1 2

−1 0 2

xyz

=

000

.

The second equation then gives y = −2z while the third gives x = 2z; the generaleigenvector is

2z−2zz

= z

2−21

.

There is just one (independent) eignevector :

2−21

,

or, equivalently, the general eigenvector can be written in terms of one arbitrary constant:λ = 9 is an eigenvalue of geometric multiplicity one.

Note from this question that for an eigenvalue λ of an n× n matrix A,

geometric multiplicity = number of independent eigenvectors

= number of parameters in the expression for the general eigenvector

= n− rank of (A− λI) .

From the form of the characteristic equation, it can also be observed, again for an n× nmatrix A, that n equals the sum of the algebraic multiplicities of the eigenvalues of A.

112

Page 117: Notes and problem sheets for the course

7.3 Practical Application: Mass-Spring Systems

Question 7.5. Two identical simple pendula oscillate in the plane as shown in Figure 7.1.Both pendula consist of light rods of length ℓ = 10 and are suspended from the same ceil-ing a distance L = 15 apart, with equal masses m = 1 attached to their ends. The anglesthe pendula make to the downward vertical are θ1 and θ2, and they are coupled throughthe spring shown which has stiffness coefficient k = 1. The spring has unstretched lengthL = 15. Assume that the acceleration due to gravity g = 10. Describe the system’sdynamics by differential equations and find their general solutions.

10

10

m = 1 m = 1

L = 15

θ1θ2

k = 1

Figure 7.1: Simple coupled pendula system.

Solution. Assuming that the oscillations of the spring remain small in amplitude, sothat |θ1| ≪ 1 and |θ2| ≪ 1, by applying Newton’s second law and Hooke’s law one findsthat the coupled pendula system gives rise to the system of differential equations

d2θ

dt2= Aθ, where A =

(

−2 11 −2

)

, (7.3)

and

θ =

(

θ1θ2

)

is the vector of unknown angles for each of the pendula shown in Figure 7.1.

We further look for a solution of the form θ(t) = Reveiωt for a constant vector v.Substituting θ(t) into (7.3) and dividing both sides by eiω(t) we obtain that the system ofdifferential equations (7.3) reduces to solving the eigenvalue problem

(A+ ω2I)v = 0 . (7.4)

We obtain using the characteristic equation method explained in the previous section thatmatrix A has two distinct eigenvalues λ1 = −1 and λ = −3. Since λ = −ω2 we obtain

113

Page 118: Notes and problem sheets for the course

the characteristic frequencies ω1 = 1 and ω2 =√3 (it is usual to take frequencies to be

positive, as was done in F18XC). An eigenvector corresponding to λ1 = −1 is

v1 =

(

11

)

and for λ2 = −3 an eigenvector is

v2 =

(

1−1

)

.

Taking the real combinations of the complex exponents:

cos(ωt) =1

2(eiωt + e−iωt) , sin(ωt) =

1

2i(eiωt − e−iωt) ,

we obtain a general solution in the form

(

θ1(t)θ2(t)

)

=

(

11

)

(C1 cos(t) + C2 sin(t)) +

(

1−1

)

(C3 cos(√3t) + C3 sin(

√3t))

where Ci, i = 1, 2, 3, 4 are arbitrary constants which can be fixed by initial conditions.

7.4 Diagonalisation

An n× n matrix A is said to be similar to an n× n matrix A if

A = X−1AX

for some (non-singular) n× n matrix X. This transformation, which gives A from A, iscalled a similarity transformation.

Diagonalisation transformationIf an n×n matrix A has a set of n linearly independent eigenvectors, x(1), x(2), . . . , x(n),then if we set X = [x(1)|x(2)| . . . |x(n)] (i.e. the matrix whose columns are the eigenvectorsof A), we have

X−1AX = D ,

where D is the n× n diagonal matrix

D =

λ1 0 0 · · · 00 λ2 0 · · · 0...

... · · · · · · ...0 0 · · · 0 λn

,

i.e. the matrix whose diagonal entries are the eigenvalues of the matrix A and whose allother entries are zero. Note that we have

A = XDX−1 .

114

Page 119: Notes and problem sheets for the course

(Also note that if our matrix has some eigenvalue whose algebraic multiplicity is greaterthan its geometric multiplicity, the total number of independent eigenvectors will be lessthan n and A will not be diagonalisable.)

Symmetric MatricesA real square matrix A is said to be symmetric if transposition leaves it unchanged, i.e.AT = A.

Theorem 7.1. If A is a real symmetric n × n matrix, then its eigenvalues, λ1, . . . , λn,are all real.The matrix has corresponding eigenvectors x(1), x(2), . . . , x(n), all linearly independent(even if there aren’t n distinct eigenvalues, so that λi = λj for some i and j).Moreover, any two eigenvectors x(i), x(j) correspondinging to two distinct eigenvaluesλi 6= λj are orthogonal to each other: x(i) · x(j) = 0.In particular, all real symmetric matrices are diagonalisable.

Example 7.2. The matrix

A =

2 2 02 5 00 0 3

is symmetric. The eigenvalues of A are 1, 3 and 6 – all real. The corresponding eigenvec-tors are

x(1) =

−210

, x(2) =

001

, x(3) =

120

.

One can easily check that these vectors are mutually orthogonal. For example,

x(1) · x(2) = x(1)1 x

(2)1 + x

(1)2 x

(2)2 + x

(1)3 x

(2)3 = (−2)× 0 + 1× 0 + 0× 1 = 0 .

Note that as usual the eigenvectors are defined up to rescaling. We can use this freedom topick eigenvectors all to have length one (all to be unit vectors), so they satisfy x(i)·x(i) = 1.To do that we divide each eigenvector by its length

x(i) → 1√x(i) · x(i)

x(i) .

Thus the properly normalised eigenvectors satisfy

x(i) · x(j) =

0 if i 6= j1 if i = j

.

These relations imply that for the matrix X = [x(1)|x(2)| . . . |x(m)] whose columns are theeigenvectors of A, one has

X−1 = XT .

In general matrices for which the inverse coincides with the transposed matrix are calledorthogonal matrices.

115

Page 120: Notes and problem sheets for the course

Question 7.6. Find a matrix X which diagonalises the matrix A from the previous ex-ample via a similarity transformation.

Solution. Normalised eigenvectors with length one are

x(1) =1√5

−210

, x(2) =

001

, x(3) =1√5

120

.

Hence

X =

− 2√5

0 1√5

1√5

0 2√5

0 1 0

.

Now we can check that

X−1 = XT =

− 2√5

1√5

0

0 0 11√5

2√5

0

,

and furthermore

X−1AX =

− 2√5

1√5

0

0 0 11√5

2√5

0

2 2 02 5 00 0 3

− 2√5

0 1√5

1√5

0 2√5

0 1 0

=

1 0 00 3 00 0 6

.

Diagonalisation can be used to obtain large powers of a given matrix. Note that

An = (XDX−1)(XDX−1) . . . (XDX−1) = XDnX−1

and it is straightforward to take the n-th power of a diagonal matrix just by taking then-th power of each diagonal entry.

Question 7.7. Find An for the matrix from the previous example.

Solution. We have

An = XDnX−1 =

− 2√5

0 1√5

1√5

0 2√5

0 1 0

1 0 00 3n 00 0 6n

− 2√5

1√5

0

0 0 11√5

2√5

0

=

15(4 + 6n) 2

5(−1 + 6n) 0

256n 4

56n 0

0 0 3n

.

The need to evaluate matrices to arbitrary powers often arises in connection with differ-ential equations.

116

Page 121: Notes and problem sheets for the course

7.5 Systems of Linear Differential Equations

We have already seen how one (second-order) coupled system could be tackled in Ques-tion 7.5. Other oscillatory problems like this proceed as in the folowing question.

Question 7.8. Find the general solution to

d2x

dt2+Bx = 0 , (7.5)

where x is a two-dimensional vector and B =

(

3 −1−1 3

)

.

Solution. First look for a special solution in complex form, x = veiωt with v a constantvector.Differentiating x twice, we get d2x/dt2 = −ω2veiωt. Then substituting into (7.5) gives

−ω2veiωt +Bveiωt = 0

so Bv = ω2v .

Hence λ = ω2 is an eigenvalue of B with v a corresponding eigenvector.

The characteristic equation here gives

0 = det(λI−B) =

λ− 3 11 λ− 3

= (λ− 3)2− 1 = (λ− 3− 1)(λ− 3+1) = (λ− 4)(λ− 2)

so λ = λ1 = 4 with ω = 2 , or λ = λ2 = 2 with ω =√2 (taking ω positive).

For v1 = (a, b) an eigenvalue corresponding to λ1 = 4,

(B− λ1I)v1 =

((

3 −1−1 3

)

−(

4 00 4

))(

ab

)

=

(

−1 −1−1 −1

)(

ab

)

=

(

−a− b−a− b

)

= 0

so a = −b and an eigenvector is v1 = (1,−1).

For v2 = (a, b) an eigenvalue corresponding to λ2 = 2,

(B− λ2I)v12 =

((

3 −1−1 3

)

−(

2 00 2

))(

ab

)

=

(

1 −1−1 1

)(

ab

)

=

(

a− bb− a

)

= 0

so a = b and an eigenvector is v2 = (1, 1).

These then give special solutions in complex form v1eiω1t =

(

1−1

)

e2it and v2eiω2t =

(

11

)

e√2 it.

To get real solutions, we take real and imaginary parts (remembering that Reeiθ = cos θand Imeiθ = sin θ.) We then have independent solutions

x =

(

x1

x2

)

=

(

1−1

)

cos 2t and

(

1−1

)

sin 2t

117

Page 122: Notes and problem sheets for the course

and also

x =

(

x1

x2

)

=

(

11

)

cos(√2 t) and

(

11

)

sin(√2 t) .

(The first pair of solutions, coming from λ1 = 4, has x1 = x2 – the components movetogether – and such motion is termed in phase. The second pair of solutions, comingfrom λ1 = 2, has x1 = −x2 – the components move opposite to each other – and suchmotion is termed out of phase.)The general solution is then got by combining all four solutions:

x =

(

1−1

)

(a1 cos 2t+ a2 sin 2t) +

(

11

)

(b1 cos(√2 t) + b2 sin(

√2 t)) .

More generally, we can get systems of first-order equations of the form

dx

dt= Ax (7.6)

with x = (x1(t), x2(t), . . . ,xn(t)) and A a constant n × n matrix. (Inhomogeneous ver-sions, with some sort of forcing terms, are also possible but are not considered in thiscourse.)For simplicity we shall only consider case where there are n linearly independent eigen-vectors for the n× n matrix A.

Example 7.3. Let’s first try solving the vector differential equation

dx

dt= Ax

with A as in Question 7.3.

We start by looking for a simple solution of the form x = veλt with v a constant non-zerovector. Differentiating x and substituting into the original equation, we get

λveλt = Aveλt so Av = λv .

Hence λ is an eigenvalue with v a corresponding eigenvector. From Question 7.3, we have:

λ1 = 0 , v1 =

01−1

; λ2 = 1 , v2 =

100

; λ3 = 2 , v3 =

011

.

There are then three independent special solutions:

v1eλ1t =

01−1

; v2eλ2t =

100

et ; v3eλ3t =

011

e2t .

The general solution is given by taking a linear combination:

x = a1v1eλ1t + 2v2e

λ2t + v3eλ3t = a1

01−1

+ a2

100

et + a3

011

e2t .

Alternatively, the individual components are x1 = a2et, x2 = a1+a3e

2t and x3 = a3e2t−a1.

118

Page 123: Notes and problem sheets for the course

Question 7.9. Suppose that x(t) = (x1, x2, x3)T satisfies dx/dt = Ax with

A =

−2 2 −32 1 −6−1 −2 0

.

Find the general solution to the system of ODEs.

Solution. Looking for a special solution of the form x = veλt gives, on substitutingthis into the equation, λv = Av, i.e. λ is an eigenvalue of A and v is an associatedeigenvector.

We can find that the eigenvalues of A are λ1 = 5 and λ2 = −3, and that correspondingeigenvectors are : v1 = (−1,−2, 1) for λ = 5; and v2 = (3, 0, 1)T and v3 = (−2, 1, 0)T forλ = −3.

Independent solutions to the system are then

v1e5t, v2e

−3t and v3e−3t,

so the general solution, in vector form, is

x = α

−1−21

e5t + β

301

e−3t + γ

−210

e−3t,

for arbitrary constants α, β and γ.

Looking at the individual components,

x1 = −αe5t +3βe−3t −2γe−3t,x2 = −2αe5t +γe−3t,x3 = αe5t +βe−3t.

To determine the constants for an initial value problem, a system of linear equations hasto be solved (as in Chap. 5).

Example 7.4. Suppose that at t = 0, x, as in Qu. 7.9, is given by x1 = 3, x2 = −5,x3 = 3. The constants α, β and γ must then satisfy

−α + 3β − 2γ = 3 , −2α + γ = −5 , α + β = 3 .

Solving these by Gaussian elimination gives α = 2, β = 1 and γ = −1. Then

x1 = −2e5t + 3e−3t + 2e−3t, x2 = −4e5t − e−3t, and x3 = 2e5t + e−3t.

119

Page 124: Notes and problem sheets for the course

Systems of linear first-order ordinary differential equations with constant coefficients arenormally equivalent to a single ODE: an n × n system can be usually be written as annth-order ODE, and an nth-order ODE can always be written as an n× n system.

Example 7.5. Let us try to solve

d2y

dt2+ 2

dy

dt− 3y = 0 .

We can first write x1 = y and x2 = dy/dt. Then

dx1

dt= x2 and

dx2

dt=

d2y

dt2= 3y − 2

dy

dt= 3x1 − 2x2 .

In matrix form the system is then

d

dt

(

x1

x2

)

=

(

0 13 −2

)(

x1

x2

)

.

The characteristic equation for the matrix is

0 =

λ −1−3 λ+ 2

= λ(λ+ 2)− 3 = λ2 + 2λ− 3 = (λ+ 3)(λ− 1)

so the eigenvalues are λ1 = −3 and λ2 = 1.An eigenvector corresponding to the first is then given by

(

−3 −1−3 −1

)(

ab

)

=

(

−3a− b−3a− b

)

=

(

00

)

so an eigenvector will be v1 = (1,−3)T.An eigenvector corresponding to the second is given by

(

1 −1−3 3

)(

ab

)

=

(

a− b−3a+ 3b

)

=

(

00

)

so an eigenvector will be v2 = (1, 1)T.The general solution in vector form can be written as

x = α

(

1−3

)

e−3t + β

(

11

)

et

so the general solution for the original problem is

y = x1 = αe−3t + βet.

120

Page 125: Notes and problem sheets for the course

Question 7.10. Use eigenvalues and eigenvectors to solve

d2y

dt2+ 6

dy

dt+ 13y = 0 , y(0) = −1 ,

dy

dt(0) = 11 .

Solution. Write x1 = y and x2 = dy/dt. Then

dx1

dt= x2 and

dx2

dt=

d2y

dt2= −13y − 6

dy

dt= −13x1 − 6x2 .

In matrix form the system is then

d

dt

(

x1

x2

)

=

(

0 1−13 −6

)(

x1

x2

)

.

The characteristic equation for the matrix is

0 =

λ −113 λ+ 6

= λ(λ+ 6) + 13 = λ2 + 6λ+ 13 .

Therefore the eigenvalues are λ = 12(−6±

√36− 52 ) = 1

2(−6±

√16 i) = −3 ± 2i.

The corresponding eigenvectors are given by(

−3± 2i −113 3± 2i

)(

ab

)

=

(

(−3 ± 2i)a− b13a+ (3± 2i)b

)

=

(

00

)

so the eigenvectors can be taken to be (1,−3∓ 2i)T.The general solution in vector form can be written as

x = α

(

1−3− 2i

)

e(−3+2i)t + β

(

1−3 + 2i

)

e(−3−2i)t

or equivalently

x =

(

αe(−3+2i)t + βe(−3−2i)t

(−3− 2i)αe(−3+2i)t + (−3 + 2i)βe(−3−2i)t

)

.

Using e(−3±2i)t = e3t(cos 2t± i sin 2t):

x1 = e−3t(α(cos 2t+ i sin 2t) + β(cos 2t− i sin 2t)= e−3t((α + β) cos 2t+ i(α− β) sin 2t)= e−3t(C1 cos 2t+ C2 sin 2t) ,

on writing C1 = (α + β) and C2 = i(α− β);

x2 = e−3t[(−3 − 2i)α(cos 2t+ i sin 2t) + (−3 + 2i)β(cos 2t− i sin 2t)]= e−3t[α((−3 cos 2t+ 2 sin 2t)− i(3 sin 2t+ 2 cos 2t)) + β((−3 cos 2t+ 2 sin 2t) + i(3 sin 2t+ 2 cos 2t))]= e−3t[(α + β)(2 sin 2t− 3 cos 2t)− i(α− β)(3 sin 2t+ 2 cos 2t)]= e−3t(C1(2 sin 2t− 3 cos 2t)− C2(3 sin 2t+ 2 cos 2t)) .

Now

x = e−3t

(

C1 cos 2t + C2 sin 2tC1(2 sin 2t− 3 cos 2t)− C2(3 sin 2t+ 2 cos 2t)

)

where we also know that t = 0, y = x1 = −1 and dy/dt = x2 = 11 so(

C1

−3C1 + 2C2

)

=

(

−111

)

. Therefore C1 = −1 and C2 = 4. These give

y = x1 = e−3t(4 sin 2t− cos 2t) .

121

Page 126: Notes and problem sheets for the course

7.6 Problems

Problem 7.1. Find the eigenvalues and eigenvectors for the matrices

A =

(

8 3−10 −3

)

, B =

(

3 55 3

)

.

Problem 7.2. Use the results of the previous question to find a general solution to thesystem of equations

dx

dt= 8x+ 3y ,

dy

dt= −10x− 3y .

Problem 7.3. Compute the eigenvalues and eigenvectors of the following 3×3 matrices:

D =

3 5 75 3 −70 0 2

, E =

1 1 01 1 00 0 2

.

Problem 7.4. Find the general solution to the system of differential equations

d2x

dt2= Bx ,

where

x(t) =

(

x1(t)x2(t)

)

and B =

(

−2√2√

2 −3

)

.

Problem 7.5. Consider two equal masses m connected by three springs with stiffnesscoefficients k as indicated in the diagram:

km m

k k

x1 x2

Newton’s equations of motion describing this system are

(m

k

) d2x1

dt2= −2x1 + x2 ,

(m

k

) d2x2

dt2= x1 − 2x2 ,

where x1, x2 are the displacements of the two bodies from their equilibrium positions.Assume that m/k = 1. Rewrite the above equations in matrix form. Find the naturalvibration frequences. Write the general solution to the equations of motion.

122

Page 127: Notes and problem sheets for the course

Problem 7.6. In quantum physics the outcome of a measurement will correspond tothe eigenvalues of an operator. The spins of a particle in the x, y and z directions aredescribed by the three Pauli spin matrices

Sx =1

2

(

0 11 0

)

, Sy =1

2

(

0 i−i 0

)

, Sz =1

2

(

1 00 −1

)

,

where i =√−1 is the imaginary unit. Calculate the values of any measurements of spins

along the x, y and z directions, which are given by the corresponding eigenvalues of Sx,Sy, Sz.

Problem 7.7. Determine the algebraic and geometric multiplicities of the eigenvalues forthe matrix

E =

2 75 00 2 00 0 2

Problem 7.8. For the matrix

B =

(

4 23 −1

)

,

find the diagonalisation transformation.

Problem 7.9. For the matrix

C =

3 1 01 3 00 0 3

,

find the diagonalisation transformation.

Problem 7.10. For the matrix

D =

(

5 11 5

)

,

calculate D54.

Answers

1. For A: λ1 = 2, x1 = α

(

1−2

)

; λ2 = 3, x2 = α

(

−35

)

.

For B: λ1 = 8, x1 = α

(

11

)

; λ2 = −2, x2 = α

(

1−1

)

.

2.(

x(t)y(t)

)

= C1e2t

(

1−2

)

+ C2e3t

(

−35

)

.

123

Page 128: Notes and problem sheets for the course

3. For D: λ1 = −2, x1 = α

1−10

. λ2 = 2, x2 = α

7−74

; λ3 = 8, x3 = α

110

.

For E: λ1 = 0, x1 = α

1−10

; λ2 = 2, x2 = α1

001

+ α2

110

.

4. x(t) =

( √21

)

(C1 cos(t) + C2 sin(t)) +

(

1

−√2

)

(C3 cos(2t) + C4 sin(2t)).

5. The natural frequences are ω1 = 1, ω2 =√3. The general solution is

(A1 cos(t) + A2 sin(t))

(

11

)

+ (A3 cos(√3 t) + A4 sin(

√3 t))

(

1−1

)

.

6. Each of the 3 matrices has eigenvalues 1/2 and −1/2..

7. λ1 = 2 with algebraic multiplicity 3 and geometric multiplicity 2.

8. X−1BX =

(

5 00 −2

)

where X =

(

2 −11 3

)

, X−1 =1

7

(

3 1−1 2

)

.

9.

X−1CX =

3 0 00 4 00 0 2

.

10.

D54 =1

2

(

(654 + 454) (654 − 454)(654 − 454) (654 + 454)

)

.

124

Page 129: Notes and problem sheets for the course

Appendix A

Useful Formulæ for F1.8XD2

Standard Derivatives :

F (x) F ′(x)

xn nxn−1

sin ax a cos ax

cos ax −a sin ax

tan ax a sec2 ax

eax aeax

ln x 1/x

cosh ax a sinh ax

sinh ax a cosh ax

F (ax+ b) aF ′(ax+ b)

u(x)v(x) u′v + uv′

u(x)

v(x)

vu′ − uv′

v2

u(v(x))du

dv

dv

dx

Standard Integrals :

f(x)∫

f(x) dx

xn (n 6= −1) xn+1/(n+ 1)

sin ax −cos ax

a

cos axsin ax

a

tan x − ln cosx

1/(1 + x2) tan−1 x

ln x x ln x− x

eax eax/a

1/x ln x

u(x)

u(x(y))dx

dydy

Integration by Parts :∫ b

a

u(x)dv

dxdx = [u(x)v(x)]ba −

∫ b

a

du

dxv(x) dx

125

Page 130: Notes and problem sheets for the course

Trigonometrical Formulæ :

sin2A+ cos2A = 1 , sec2A = tan2A+ 1 ,

sin(A +B) = sinA cosB + cosA sinB , sin(A−B) = sinA cosB − cosA sinB

cos(A +B) = cosA cosB − sinA sinB , cos(A− B) = cosA cosB + sinA sinB

sin 2A = 2 sinA cosA , cos 2A = 2 cos2A− 1 = 1− 2 sin2A

sinA sinB =1

2(cos(A−B)− cos(A+B))

cosA cosB =1

2(cos(A− B) + cos(A+B))

sinA cosB =1

2(sin(A+B) + sin(A− B))

sinA+ sinB = 2 sin

(

A+B

2

)

cos

(

A− B

2

)

sinA− sinB = 2 sin

(

A− B

2

)

cos

(

A +B

2

)

cosA+ cosB = 2 cos

(

A +B

2

)

cos

(

A−B

2

)

cosA− cosB = −2 sin

(

A+B

2

)

sin

(

A− B

2

)

126

Page 131: Notes and problem sheets for the course

Laplace transforms :

f(t) F (s)

c c/s

t 1/s2

tn n!/sn+1

ekt 1/(s− k)

sin at a/(s2 + a2)

cos at s/(s2 + a2)

t sin at 2as/(s2 + a2)2

t cos at (s2 − a2)/(s2 + a2)2

af(t) + bg(t) aF (s) + bG(s)

f ′(t) sF (s)− f(0)

f ′′(t) s2F (s)− sf(0)− f ′(0)

δ(t− a) e−as

eatf(t) F (s− a)

f(t) =

g(t− a) t > a0 t < a

e−asG(s)

127

Page 132: Notes and problem sheets for the course

128

Page 133: Notes and problem sheets for the course

Appendix B

Partial Fractions

In the same way you can add algebraic fractions together you can also separate them intocombinations of algebraic fractions, such terms are called partial fractions.

Example B.1. Consider7x+ 10

x2 + 3x+ 2.

Suppose we want to convert this into the sum of partial fractions.We first factorise the denominator:

7x+ 10

x2 + 3x+ 2=

7x+ 10

(x+ 2)(x+ 1).

Secondly, we assume a solution with unknown coefficients (say A and B):

7x+ 10

(x+ 2)(x+ 1)=

A

x+ 2+

B

x+ 1.

Next, multiply both sides of the equation by the denominator (x+2)(x+1) and tidy up:

7x+ 10 = A(x+ 1) +B(x+ 2) . (B.1)

Now find A and B.Since (B.1) is true for all values of x it must hold when x is −1 and then −2.Taking x = −1, −7 + 10 = (−1 + 1)A+ (−1 + 2)B = B so B = 3.Taking x = −2, −14 + 10 = (−2 + 1)A+ (−2 + 2)B = −A so A = 4. Hence

7x+ 10

x2 + 3x+ 2=

4

x+ 2+

3

x+ 1.

Where you have an algebraic fraction like

x− 2

(x+ 1)2,

so that the denominator has a repeated root, the above approach does not work.

129

Page 134: Notes and problem sheets for the course

In this case you have to represent the algebraic fraction as the sum of two partial fractionsin the form

x− 2

(x+ 1)2=

A

x+ 1+

B

(x+ 1)2.

Now multiplying both sides by (x+ 1)2 gives

x− 2 = A(x+ 1) +B . (B.2)

You can now equate terms to get two simultaneous equations in A and B to solve:

x : 1 = A ; 1 : −2 = A+B .

Hence A = 1 and then B = −3. (Note that you could instead take x = −1 in (B.2) toget B = −3 immediately.) Then

x− 2

(x+ 1)2=

1

x+ 1− 3

(x+ 1)2.

You can also get algebraic fractions where the denominator includes quadratic terms(ax2 + bx + c) that cannot be factorised into two linear factors (without using complexnumbers) as the roots are complex. Such cases give rise to a partial fractions of the form

Ax+B

ax2 + bx+ c

where A and B are real constants.

Example B.2. We convert the algebraic fraction

7x

(x2 + x+ 1)(x− 2)

into partial fractions.Note that x2 + x + 1 has complex roots so cannot be factorised using real factors. Thepartial fraction representation is given as:

7x

(x2 + x+ 1)(x− 2)=

Ax+B

x2 + x+ 1+

C

x− 2.

Now we have the partial fraction representation of the algebraic fraction we find theunknowns, A, B and C, in the same way as the other examples.Step 1. Recombine the partial fractions over a common denominator:

Ax+B

x2 + x+ 1+

C

x− 2=

(Ax+B)(x− 2) + C(x2 + x+ 1)

(x2 + x+ 1)(x− 2).

Step 2. Multiply out the factors in the numerator:

(Ax+B)(x− 2) + C(x2 + x+ 1)

(x2 + x+ 1)(x− 2)=

Ax2 − 2Ax+Bx− 2B + Cx2 + Cx+ C

(x2 + x+ 1)(x− 2).

130

Page 135: Notes and problem sheets for the course

Step 3. Tidy up:

7x

(x2 + x+ 1)(x− 2)=

(A+ C)x2 + (−2Ax+B + C)x− 2B + C

(x2 + x+ 1)(x− 2).

Step 4. Equate terms:x2 : A+ C = 0 ; (B.3)

x : −2A +B + C = 7 ; (B.4)

1 : −2B + C = 0 . (B.5)

Step 5. Solve system of equations to give A, B and C.We have three equations in three unknowns but the approach is the same as the otherworked examples. From (B.3), C = −A and substituting into the two remaining equationsgives

−3A+B = 7 , (B.6)

A + 2B = 0 . (B.7)

From (B.7), A = −2B and substituting for A in (B.6) gives

−3(−2B) +B = 7B = 7 so B = 1 .

Back substituting, A = −2B = −2 and C = −A = 2.Putting this all together gives the final result:

7x

(x2 + x+ 1)(x− 2)=

1− 2x

x2 + x+ 1+

2

x− 2.

(Again, some work can be saved by seeing what you get by trying x = 2.)

Some general rules for partial fractions are:Given a, b, c, l, m, n, p, q, r and s (i.e. they are numbers) then:

mx+ n

(px+ q)(rx+ s)=

A

px+ q+

B

rx+ s;

mx+ n

(px+ q)2=

A

px+ q+

B

(px+ q)2;

lx2 +mx+ n

(ax2 + bx+ c)(px+ q)=

Ax+B

ax2 + bx+ c+

C

px+ q;

lx2 +mx+ n

(px+ q)2(rx+ s)=

A

px+ q+

B

(px+ q)2+

C

rx+ s.

In all cases, you can multiply through by the denominator on the left-hand side of theequation, tidy up and compare terms in the top line. (Work is often saved by seeing whatx = −q/p (or −s/r) gives.)

131

Page 136: Notes and problem sheets for the course

132

Page 137: Notes and problem sheets for the course

Appendix C

Completing the Square

In any quadratic function you can complete the square. Consider the function

x2 − 3x+ 2 . (C.1)

You can complete the square by recalling that, for any number a,

(x+ a)2 = x2 + 2ax+ a2

so that, subtracting a2 from both sides and writing b = 2a (i.e. a = b/2),

x2 + bx =

(

x+b

2

)2

− b2

4.

Thus, to complete the square in (C.1), where b = −3, we add and subtract 32 = 9/4 toget

x2 − 3x+ 2 =

(

x+3

2

)2

− 9

4+ 2 =

(

x+3

2

)2

− 1

4.

Once you have completed a square you can find the roots of a quadratic equation, althoughin the Laplace transform method that is not the point of the procedure.

133