Sunteți pe pagina 1din 78

Engineering Analysis 2

P.D. Ledger

Civil and Computational Engineering Centre


Swansea University
Singleton Park
Swansea SA2 8PP
Wales. U.K

Script to accompany the lecture Engineering Analysis 2 running in the summer term 2007
Contents

1 Introduction 3

2 Linear Algebra 5
2.1 Simultaneous Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Gauss Elimination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Schematic representation . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.2 Algorithm for m = n . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.3 Linear systems of equations with multiple right hand sides . . . . . . . . 13
2.2.4 The algorithm for m equations and n unknowns . . . . . . . . . . . . . . 13
2.2.5 Rank of a linear system of equations . . . . . . . . . . . . . . . . . . . . 14
2.3 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3.1 Matrix definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3.2 Computations with matrices . . . . . . . . . . . . . . . . . . . . . . . . 17
2.3.3 Matrix notation for linear systems of equations . . . . . . . . . . . . . . 19
2.3.4 Matrix inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.3.5 Rank of a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3.6 Linear independence . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.4 Determinants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.4.1 Definition and properties . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.4.2 Efficient calculation of determinants . . . . . . . . . . . . . . . . . . . . 24
2.4.3 Determinants and linear equation systems . . . . . . . . . . . . . . . . . 24
2.5 Eigenvalue Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.5.1 Eigenvalues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.5.2 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.5.3 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3 Functions of more than one variable 32


3.1 Visualisation of Functions of Two and Three variables . . . . . . . . . . . . . . . 32
3.2 Partial Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2.1 Chain rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2.2 Higher order partial derivatives . . . . . . . . . . . . . . . . . . . . . . . 37
3.2.3 Total differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.3 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3.1 Line integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3.2 Surface integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.3 Volume integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

1
4 Sequences and Series 48
4.1 Sequences and Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.1.1 Graphical representation of sequences . . . . . . . . . . . . . . . . . . . 49
4.2 Finite sequences and series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.2.1 Arithmetical sequences and series . . . . . . . . . . . . . . . . . . . . . 50
4.2.2 Geometric sequences and series . . . . . . . . . . . . . . . . . . . . . . 51
4.2.3 Other finite series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.3 Limit of a sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.1 Convergent sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.2 Proprieties of convergent sequence . . . . . . . . . . . . . . . . . . . . . 54
4.3.3 Divergent sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.3.4 Cauchy’s test for convergence . . . . . . . . . . . . . . . . . . . . . . . 55
4.4 Infinite Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.4.1 Convergence of an infinite series . . . . . . . . . . . . . . . . . . . . . . 55
4.4.2 Tests of convergence of positive series . . . . . . . . . . . . . . . . . . . 56
4.4.3 Absolute convergence of a general series . . . . . . . . . . . . . . . . . 57
4.5 Power Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.5.1 Convergence of power series . . . . . . . . . . . . . . . . . . . . . . . . 58
4.5.2 Binomial Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.5.3 Maclaurin Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.5.4 Taylor series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5 Differential Equations 62
5.1 Classification of differential equations . . . . . . . . . . . . . . . . . . . . . . . 62
5.1.1 Ordinary and partial differential equations . . . . . . . . . . . . . . . . . 62
5.1.2 Independent and dependent variables . . . . . . . . . . . . . . . . . . . 62
5.1.3 Order of a differential equation . . . . . . . . . . . . . . . . . . . . . . . 63
5.1.4 Linear and non–linear equations . . . . . . . . . . . . . . . . . . . . . . 63
5.1.5 Homogeneous and non–homogeneous equations . . . . . . . . . . . . . 64
5.2 First order differential equation . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5.2.1 Implicit and explicit solutions . . . . . . . . . . . . . . . . . . . . . . . 64
5.2.2 General and Particular Solutions . . . . . . . . . . . . . . . . . . . . . . 65
5.2.3 Boundary and initial conditions . . . . . . . . . . . . . . . . . . . . . . 65
5.2.4 Variable Separable Type . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.2.5 Separable after substitution type . . . . . . . . . . . . . . . . . . . . . . 67
5.2.6 Linear Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
5.2.7 More specialised types . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.3 Second Order ODE’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5.3.1 Homogeneous equations . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.3.2 Linear equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.3.3 Linear equations with constant coefficients . . . . . . . . . . . . . . . . 74

2
Chapter 1

Introduction

This script is intended to accompany the lecture course Engineering Analysis 2 which will run
during the summer term 2007 and is common for Aerospace, Civil, Chemical, Electrical and
Mechanical first year undergraduate engineering students. The material contained in the script is
intended to provide the basis of what students should learn during the course, however, there will
also be occasions when additional material (in particular applications of the theory) which will
be discussed during the course and it is the students responsibility to make their own notes where
necessary.
This lecture course, aims to build on the material taught in Engineering Analysis 1 so that
students are provided with further mathematical skills that are required to solve real world en-
gineering problems. Unlike, Engineering Analysis 1, the mathematical concepts that we shall
discuss will be new to nearly all students. However, if you are already familiar with a particular
topic, then please treat it as valuable revision, as you will certainly use it again in your other
engineering courses. If you are having difficulty to understand a particular aspect of the course
please feel free to ask questions.
The course itself will comprise of lecturers and “hands–on MATLAB” classes. In the lecture
classes we will discuss the theory and examples, while in the hands–on classes you get chance to
experiment with a computer based mathematics software called MATLAB. This software is very
useful in solving mathematical problems which would otherwise be difficult, time consuming or
impossible to solve by hand.
As well as the lectures and “hands–on” classes you are expected to conduct your own private
study. You should use the private study for reading the lecture notes and text books, attempting
exercises, completing coursework and preparing for the examination.
The course will be assessed in terms of both continual assessment and an end of semester
examination. The continual assessment will be in the form of exercises which students should
complete (alone) and hand in on a specified date. The weighting is 20% for continual assessment
and 80% for the examination. Exercise sheets will be issued each week and will state if and
when exercises are to be submitted. Late submission will normally be awarded zero marks. Late
submissions due to certified illness will be dealt with according to standard procedures. Further
details about the exercises will follow later.
The university has its own set of calculators which are available for use within examinations.
Only the university owned calculators will be permitted for use within the examination. The
model numbers for the calculators owned by the university can be found on the link
http://www.swan.ac.uk/registry/A-ZGuide/E/Examinations/
There are a range of text books that also discuss the material we shall cover in the course.
The recommended textbooks for the course are

• G. James, Modern Engineering Mathematics, Third Edition, Prentice Hall, ISBN 0-13-

3
018319-9

• A. Croft & R. Davison Mathematics for Engineers: An Interactive Approach, Second Edi-
tion, Prentice Hall, ISBN 0-13-120193-X

Copies of these books have been ordered at the university branch of Waterstones and may also
be found in the university library. If these textbooks are not to your liking or if you are having
difficulty obtaining a copy, then you may also wish to consult any other book with “Engineering
Mathematics” in the title.
MATLAB is installed on the computers in rooms 42, 43, 43a, 942 and 943 of the Talbot
Building, but not those in the LIS. If you wish to use MATLAB on your own machine, a student
version may be purchased from Mathworks
http://www.mathworks.co.uk/academia/student_version/
or from Waterstones. There are many textbooks that have been written about MATLAB some
examples are

• H. Moore, MATLAB for Engineers, Pentice Hall 2007

• A. Biran, M. Breiner, MATLAB 6 for engineers, Prentice Hall 2002

• C. Van–Loan, Introduction to scientific computing : a matrix-vector approach using MAT-


LAB, Prentice Hall 2000

• S.R. Otto and J.P. Denier, An introduction to programming and numerical methods in MAT-
LAB, Springer 2005.

Typing MATLAB as a keyword in voyager will reveal many others. A free book published on-
line written by one of the founders of MATLAB can be found at
http://www.mathworks.com/company/aboutus/founders/clevemoler.html
Lecture notes and exercise sheets will be issued in PDF format over Blackboard. Blackboard is a
piece of software that lets you access learning material related to lectures at Swansea University.
It accessed over the Internet (either on– or off–campus) at the following link
https://blackboard.swan.ac.uk/
instructions on how to log–on can also be found on this site. Once logged on you will be able
to access details relating to the specific courses that you are attending. For this course, the latest
version of the lecture notes and exercise sheets will be available on Blackboard as the course
progresses.
My office is room 150 in the Talbot building. There will be office hours available for this
course, please try to restrict your enquires to the office hours, for times see the announcement on
blackboard.

4
Chapter 2

Linear Algebra

In this chapter we will introduce the concept of Linear Algebra. No doubt you have come across
set of two or three simultaneous equations. We shall extend the idea of simultaneous equations in
to the wider field of linear algebra. In doing so, we shall introduce a new notation for representing
the equations, called matrices and a solution process called Gauss elimination.
When exploring solutions to sets of simultaneous equations, we need to know what solutions
we should expect, a single set of values or no solution, infinitely many solutions and this is where
are discussions begin.

2.1 Simultaneous Equations


Let us start with an example.
Example

x1 + 2x2 = 5
2x1 + 3x2 = 8

Solution
This is an example for linear equation system with two equations and two unknowns. We wish to
find x1 and x2 so that both equations are fulfilled. The values x1 = 1 and x2 = 2, which are found
by substituting one equation in to another, satisfy both equations. They represent the solution of
the linear equation system.

Note that in general a linear equation system may have m equations and n unknowns. Lets
look at some more examples.
Example

x1 + x 2 = 4
2x1 + 2x2 = 5

Here m = 2 and n = 2.
Solution
This is linear equation system has no solution. If one multiplies the first equation by 2 one obtains
2x1 + 2x2 = 8 which disagrees with the second equation.

5
Example

x1 − x 2 + x 3 = 2
2x1 + x2 − x3 = 4

Here m = 2 and n = 3.
Solution
One possible solution is x1 = 2, x2 = 0 and x3 = 0 another is x1 = 2, x2 = 1 and x3 = 1. In
general there are infinitely many solutions, namely x1 = 2, x2 = α and x3 = α where α is any
real number.

Example

x1 + x 2 = 2
x1 − x 2 = 1
x1 = 4

Here m = 3 and n = 2.
Solution
This is linear equation system has no solution. Through addition of the first two equations, one
has 2x1 = 3 which disagrees with the last equation.

The set of all solutions of a linear equation system is called the solution set of the linear
equation system.

2.2 Gauss Elimination


The aim of this section is to describe the development of an efficient strategy for determining
the solution set of a linear equation system. By efficient, we mean that with the fewest possible
calculations. The procedure that we describe is called Gauss elimination. The idea of Gauss elim-
ination is to transform the linear system so that it is easier to solve. Note that the transformation
is performed so that the solution set is not changed during the process.
The following two operations transform a linear equation system in to an equivalent system.

Exchanging equations
x1 + 2x2 = 5 2x1 + 3x2 = 8
is equivalent to
2x1 + 3x2 = 8 x1 + 2x2 = 5
It is clear that both equation systems posses the same solution set.

Addition of factored equation to another equation


x1 + 2x2 = 5 x1 + 2x2 = 5
is equivalent to
2x1 + 3x2 = 8 −x2 = −2
Here, the first equation remains the same. To obtain the revised second equation, we must multi-
plied the first equation by 2 and then subtracted it from the second equation in the original system.

6
The solution set of the left equation system is the same as solution set of the equation system on
the right.
A linear equation with n equations and n unknowns is easier to solve when it is has a trian-
gular form. In this case, one can easily obtain the solution set by back substitution.
Example

3x1 + 2x2 + x3 = 1
x2 − x 3 = 2
2x3 = 4

Here m = n = 3.
Solution
From the third equation we have x3 = 2. Substituting this in to the second equation gives x2 = 4
and finally using both values in the first equation gives x1 = −3.

Lets now attempt to solve a linear equation system using these ideas.
Example

2x2 + 2x3 = 1
2x1 + 4x2 + 5x3 = 9
x1 − x2 + 2x3 = 3

Here m = n = 3.
Solution
First we exchange the first and second equations

2x1 + 4x2 + 5x3 = 9


2x2 + 2x3 = 1
x1 − x2 + 2x3 = 3
1
Next we multiply the first equation by 2
and subtract it from the third equation

2x1 + 4x2 + 5x3 = 9


2x2 + 2x3 = 1
1 3
−3x2 − x3 = −
2 2
3
Finally we multiply the second equation by 2
and add it from the third equation, giving

2x1 + 4x2 + 5x3 = 9


2x2 + 2x3 = 1
5
x3 = 0
2
Then by back substitution we find the solution x1 = 72 , x2 = 12 and x3 = 0. It therefore follows
that this is the only solution to the linear system, i.e. the linear set contains only this solution.

7
What we have just performed is the Gauss elimination algorithm, to explain it in more details
let us consider a system where m = n = 3

a11 x1 + a12 x2 + a13 x3 = b1


a21 x1 + a22 x2 + a23 x3 = b2
a31 x1 + a32 x2 + a13 x3 = b3

here the values aij , i = 1, · · · , 3 and j = 1, · · · , 3 and bi , i = 1, · · · , 3 are known real numbers.
The values aij are the coefficients of the unknown xj in the ith equation of the system. The
number bi is the right hand side of the ith equation.

2.2.1 Schematic representation


To aid the application of the Gauss elimination algorithm, we express the system in the form
x1 x2 x3 1
a11 a12 a13 b1
a21 a22 a23 b2
a31 a32 a33 b3

The coefficients are written in the main part of the schematic, in the header–row stand the
respective unknowns x1 , x2 and x3 . The right–hand side is labelled the 1–column. The schematic
is just another way of writing the linear system. When we wish to perform operations on the
equations, we just perform the analogue on the schematic.

Step 1
Assumption: One of ai1 , i = 1, · · · , 3 is not zero, in other words at least one values in the first
column isn’t zero.

a) If a11 = 0 then swap the first row with a row whose first element isn’t zero. Next we
re-name the coefficients according to the position in which they are now lying in. Continue
to case b).

b) If a11 6= 0 we create a new equivalent scheme in which the coefficients in the second
row are given by their original value minus the value in the first row factored by a 21 /a11 .
Similarly, the values in the third row are given by their original value minus the value in
the first row factored by a31 /a11 .

As a result of this operation the first number in the second and third row, will now be zero. To
highlight the fact that the values in the second and third column have changed we label them
with the superscript (2). We have now eliminated the unknown x 1 from the second and third
equations:

x1 x2 x3 1
a11 a12 a13 b1
(2) (2) (2)
0 a22 a23 b2
(2) (2) (2)
0 a32 a33 b3

8
Step 2
(2)
Assumption:One of ai2 , i = 2, 3 is non zero.
(2)
a) If a22 = 0 we swap rows and then proceed to b).
(2)
b) If a22 6= 0 we create a new equivalent system whose entries in the third row are given by
(2) (2)
their original values minus the values in the second row factored by a 32 /a22 .
We have now eliminated the unknown x2 from the third equation, resulting in a scheme with
triangular form
x1 x2 x3 1
a11 a12 a13 b1
(2) (2) (2)
0 a22 a23 b2
(3) (3)
0 0 a33 b3

Step3
The equivalent system is

a11 x1 + a12 x2 + a13 x3 = b1


(2) (2) (2)
a22 x2 + a23 x3 = b2
(3) (3)
a33 x3 = b3

The solution set can be found by back substitution.

2.2.2 Algorithm for m = n


What we have just performed can be expressed in terms of an algorithm. In the algorithm we use
the construction For j = 1, · · · , n which means that all the lines which follow this statement are
evaluated with j = 1 until the statement End is reached. At this point the lines are then executed
again, in turn, but this time with j = 2 until End is reached. The process is repeated until j = n.
This enables us to write the Gauss elimination algorithm in a concise way and will turn out to be
useful for The algorithm for the case where we have n equations and n unknowns is as follows:
Perform the elimination process:
For j = 1, · · · , n − 1:
(j)
Determine the row index p ∈ j, · · · , n for which apj 6= 0

If p 6= j exchange rows and renumber coefficients according to their new locations.

For k = j + 1, · · · , n :
(j) (j)
Compute lkj = akj /ajj
For p = j, · · · , n:
(j+1) (j) (j)
Set akp = akp − lkj ajp
End
(j+1) (j) (j)
Set bk = bk − lkj bj

End

9
End
Determine the solution by back substitution.
Set xn = bn /ann
For j = n − 1, · · · , n

Set v = bj

For k = j + 1, · · · , n

Calculate v = v − ajk xk

End

Set xj = v/ajj

End

Example

x1 + 2x2 + 3x3 + x4 = 5
2x1 + x2 + x3 + x4 = 3
x1 + 2x2 + x3 = 4
x2 + x3 + 2x4 = 0

Solution
First we write the equation in schematic representation
x1 x2 x3 x4 1
1 2 3 1 5
2 1 1 1 3
1 2 1 0 4
0 1 1 2 0
We now proceed with the Gauss elimination algorithm:
x1 x2 x3 x4 1 x1 x2 x3 x4 1 x1 x2 x3 x4 1
1 2 3 1 5 1 2 3 1 5 1 2 3 1 5
0 -3 -5 -1 -7 0 -3 -5 -1 -7 0 -3 -5 -1 -7
0 0 -2 -1 -1 0 0 -2 -1 -1 0 0 -2 -1 -1
0 1 1 2 0 0 0 − 23 53 − 73 0 0 0 36 − 36
We then determine the solution through back substitution giving x 4 = −1, x3 = 1, x2 = 1 and
x1 = 1

What happens when we apply the Gauss elimination algorithm to a system that has no solu-
tion? Lets consider the following example

10
Example

x1 + x 2 = 4
2x1 + 2x2 = 5

Solution
First we write the equation in schematic representation
x1 x2 1
1 1 4
2 2 5
Then we proceed with the Gauss elimination algorithm, giving
x1 x2 1
1 1 4
0 0 -3
Clearly 0x1 + 0x2 6= −3 so the linear system has no solution.

Let us now look at an example in which the right hand side vector contains a unknown pa-
rameter.

11
Example

2x1 − x2 + 3x3 − x4 + x5 = −2
2x1 − x2 + 3x3 − x5 = −3
−4x1 + 2x2 − 4x3 + 5x4 − 5x5 = 3
−2x3 + 2x4 − 7x5 = −5 + s
−2x1 + x2 − x3 + 4x5 = 5

Solution
First we write the equation in schematic representation
x1 x2 x3 x4 x5 1
2 −1 3 −1 1 -2
2 -1 3 0 -1 -3
-4 2 -4 5 -5 3
0 0 -2 2 -7 -5+s
-2 1 -1 0 4 5
then we proceed with the Gauss elimination algorithm:
x1 x2 x3 x4 x5 1 x1 x2 x3 x4 x5 1
2 −1 3 −1 1 -2 2 −1 3 −1 1 -2
0 0 0 1 -2 -1 0 0 2 3 -3 -1
0 0 2 3 -3 -1 0 0 0 1 -2 -1
0 0 -2 2 -7 -5+s 0 0 -2 2 -7 -5+s
0 0 2 -1 5 3 0 0 2 -1 5 3
x1 x2 x3 x4 x5 1 x1 x2 x3 x4 x5 1
2 −1 3 −1 1 -2 2 −1 3 −1 1 -2
0 0 2 3 -3 -1 0 0 2 3 -3 -1
0 0 0 1 -2 -1 0 0 0 1 -2 -1
0 0 0 5 -10 -6+s 0 0 0 0 0 -1+s
0 0 0 -4 8 4 0 0 0 0 0 0
We have the following consequences. For s 6= 1 we have no solution to the linear system. For
s = 1, through back substitution we find

x4 = −1 + 2x5
1 3
x3 = (−1 + 3x5 − 3x4 ) = 1 − x5
2 2
1 11 1
x1 = (−2 − x5 + x4 − 3x3 + x2 ) = −3 + x5 + x2
2 4 2
The solution set consists of two free parameters x5 and x2 , this means that for s = 1 we have
infinitely many solutions to the linear system, giving
11 1
x1 = = −3 + β + α
4 2
x2 = α
3
x3 = 1 − β
2
x4 = −1 + 2β
x5 = β

where α and β are any real numbers.


12
2.2.3 Linear systems of equations with multiple right hand sides
To illustrate how the Gauss elimination method may be used with problems with multiple right
hand side vectors, consider the following example
Example

2x2 + 2x3 = b1
2x1 + 4x2 + 5x3 = b2
x1 − x2 + 2x3 = b3

For
b1 = 1 b1 = 2 b1 = 5
a) b2 = 9 b) b2 = 13 c) b2 = −4
b3 = 3 b3 = 1 b3 = 2
Solution
x1 x2 x3 1 a 1 b 1 c x1 x2 x3 1a 1b 1c
0 2 2 1 2 5 1 -1 2 3 1 2
2 4 5 9 13 -4 2 4 5 9 13 -4
1 -1 2 3 1 2 0 2 2 1 2 5
x1 x2 x3 1 a 1 b 1 c x1 x2 x3 1a 1b 1c
1 -1 2 3 1 2 1 -1 2 3 1 2
0 6 1 3 11 -8 0 6 1 3 11 -8
0 2 2 1 2 5 0 0 53 0 − 53 233
7 1
By backsubstition we obtain the solutions a) x1 = 2
, x2 = 2 , x3 = 0, b) x1 = 5, x2 = 2, x3 = −1
and c) x1 = − 279
30
, x2 = − 63
30
, x3 = 23
5
.

2.2.4 The algorithm for m equations and n unknowns


In the general case the algorithm is as follows
Set i = 1, j = 1
* If i > m or j > n then

Goto back substitution stage

Else
(j)
If possible determine a row index p ∈ {i, · · · , m} for which apj 6= 0 otherwise set j = j+1
and goto *.

If p 6= i, exchange rows p and i and renumber them accordingly

For k = i + 1, · · · , m :
(j) (j)
Compute lki = akj /aij
For p = j, · · · , n:
(j+1) (j) (j)
Set akp = akp − lki aip

13
End
(j+1) (j) (j)
Set bk = bk − lki bi

End

Set i = i + 1 and j = j + 1 , goto *.

End
Compute the solution set by back substitution

2.2.5 Rank of a linear system of equations


The rank of a linear equation system is defined as the number, r, of non–zero rows after perform-
ing the Gauss elimination algorithm. Using the rank, one can immediately describe the solution
set of the linear system of equations: A linear equation system has at least one solution if

• r = m, or

• r < m and ci = 0, i = r + 1, · · · , m where c is the right hand side vector after Gauss
elimination.
Example

x1 − x 2 + x 3 = 2
2x1 + x2 − x3 = 4

Solution
First we write the equation in schematic representation
x1 x2 x3 1
1 −1 1 2
2 1 -1 4
Then we proceed with the Gauss elimination algorithm, giving
x1 x2 x3 1
1 −1 1 2
0 3 -3 0
The rank of this system is therefore r = 2 and we have at least one solution, explicitly

x2 = x 3
x1 = 2 + x 2 − x 3 = 2

which means that x3 is a free parameter. Thus we have infinitely many solutions, x1 = 2,
x2 = x3 = α where α is any real number.

14
Example

x1 + x 2 = 2
x1 − x 2 = 1
x1 = 4

Solution
First we write the equation in schematic representation
x1 x2 1
1 1 2
1 -1 1
1 0 4
Then we proceed with the Gauss elimination algorithm, giving
x1 x2 1 x1 x2 1
1 1 2 1 1 2
0 -2 -1 0 -2 -1
5
0 -1 2 0 0 2
The rank of this system is r = 2 < m = 3 and c3 6= 0 so that the system has no solution.

2.3 Matrices
In the last section we introduced the Gauss elimination method for solving linear equations. To
simplify the way we write large systems of equations a new notation is introduced called matrix
notation. Matrices can be used not only in connection with linear systems of equations, but also
in mappings and in the solution of systems of differential equations.

2.3.1 Matrix definitions


A m × n matrix is a schematic of mn numbers ordered in to m rows and n columns. The mn
numbers are called elements of the m × n matrix.
In these lecture notes we shall use capital letters to represent matrices. The element of a
matrix A which lies on the ith row and jth column is denoted by a ij or (A)ij . We write a matrix
as follows
 
a11 a12 · · · a1n
 a21 a22 · · · a2n 
A =  ..
 
.. 
 . . 
am1 am2 · · · amn
For example  
2 3 1
A=
5 1 2
is a 2 × 3 matrix. In the first row is the second element (A)12 = a12 = 3.
A n × n matrix has an equal number of rows and columns and is called a square matrix.
The two matrices A and B are said to be equal when they have the same number of rows and
columns and when the respective elements of the two matrices are the same

Aij = Bij for all i, j

15
For example the following two matrices are equal
   
5 1 10/2 1
=
2 4 3 − 1 22
Below we introduce some common matrices which are used in engineering:
• A m × n matrix is called the null matrix (or zero matrix) if every element of the matrix is
zero. For example, the matrix  
0 0 0
0 0 0
is 2 × 3 null matrix.
• A square matrix U is called a upper triangular matrix if (U )ij = 0 for i > j. For example
 
1 3 1
U = 0 2 4 
0 0 3

• A square matrix L is called a lower triangular matrix if (L)ij = 0 for i < j. For example
 
2 0 0 0
 3 4 0 0 
L=  1 2 2 0 

1 0 0 3

• A n×n matrix is called a diagonal matrix if (D)ij = 0 for i 6= j. The elements (D)ii = dii
are called the diagonal elements. For a diagonal matrix with given diagonal elements,
d11 , d22 , · · · , dnn we write D = diag(d11 , d22 , · · · , dnn ). For example
 
5 0 0
 0 2 0  = diag(5, 2, 3)
0 0 3

• The n × n matrix In = diag(1, 1, · · · , 1) is called the identity matrix. For example


 
1 0 0
I3 =  0 1 0 
0 0 1

• A further class of matrices are the 1-column or n × 1 matrices. The n × 1 matrix are
commonly known as column vectors. We write column vectors using lower case letters.
The elements of column vectors are called components. Components are only identified
with a single index. For example, the 4 × 1 matrix
 
2
 −4 
b=  7 

0
 
b1
 b2 
is a column vector. We also have that b =   b3  with b1 = 2, b2 = −4, b3 = 7 and

b4
b4 = 0.

16
2.3.2 Computations with matrices
Addition
Consider two m × n matrices A and B. To add the matrices A and B together, we add the
respective elements of A and B together. Written more precisely: the m × n matrix A + B with
(A)ij + (B)ij is called the sum of matrices A and B
Example
   
3 1 0 1 2 0
A= B=
2 −2 1 0 1 1
Find A + B.
Solution
     
3 1 0 1 2 0 4 3 0
A+B = + =
2 −2 1 0 1 1 2 −1 2

Multiplication by a scaler
If a m × n matrix is multiplied by scaler number α, this means that every element of the matrix is
multiplied by α. The matrix αA with (αA)ij = α(A)ij is called the α multiple of the matrix A.

Multiplication of two matrices

Pn A be an m × n matrix and B a n × p matrix. The m × p matrix AB, with (AB) ij =


Let
k=1 (A)ik (B)kj is called the matrix product of matrices A and B.
Note that the matrix product AB can only be computed when the number of columns of matrix
A is exactly the same as the number of rows of matrix B. An illustration of matrix multiplication
is shown in Figure 2.1. In this figure, we observe how row i of matrix A is multiplied by column
n p
p
i’th row (AB)ij i’th row

m x j’th column =
n m
B AB
A

j’th column

Figure 2.1: Illustration of matrix multiplication

j of matrix B to obtain the element (AB)ij of matrix AB. Explicitly this given as

(AB)ij = ai1 b1j + ai2 b2j + · · · + ain bnj

17
Example
 
  1 1 0 0
3 1 0
A= is a 2 × 3 matrix and B =  1 2 2 1  is a 3 × 4 matrix
2 −2 1
2 −1 −1 2
Find AB.
Solution
 
4 5 2 1
AB = . The two elements in the first column were computed as follows
2 −3 −5 0

(AB)11 = a11 b11 + a12 b21 + a13 b31 = 3 · 1 + 1 · 1 + 0 · 2 = 4


(AB)21 = a21 b11 + a22 b21 + a23 b31 = 2 · 1 + (−2) · 1 + 1 · 2 = 2

Rules
When computing with matrices, the following rules should be obeyed:
• For m × n matrices A and B, the commutative law of addition holds
A+B =B+A

• For m × n matrices A, B and C the associative law of addition holds


(A + B) + C = A + (B + C)

• For every m × n matrix A, n × p matrix B and p × q matrix C, the associative law of


multiplication holds
(AB)C = A(BC)
• For m × n matrices A and B and n × p matrices C and D, the distributive law of multipli-
cation holds
(A + B)C = AC + BC
A(C + D) = AC + AD

• Note, however that the commutative law of multiplication does NOT hold for matrices.
That is to say that in general for two matrices A and B
AB 6= BA

Example
   
2 6 1 4
A= B=
1 3 5 2
Find AB and BA
Solution
   
32 20 6 18
AB = 6= BA = (2.1)
16 10 12 36

• For every m × n matrix A, it holds that Im A = AIn = A. Thus giving the name for the
identity matrix Im and In .

18
Transpose
Let A be a m × n matrix. Then the n × m matrix AT with (AT )ij = (A)ji is called the transpose
of A. A matrix is called symmetric if AT = A holds.
Example
Determine the transpose of the following matrices
 
  2 3 −5
1 2 3 4
A= B =  3 −1 2 
5 6 7 8
−5 2 7

Solution
 
1 5  
2 3 −5
2 6 
AT =  B T =  3 −1

 3
=6 A is NOT symmetric 2  = B is symmetric
7 
−5 2 7
4 8
The matrix transpose obeys the following rules

• For general m × n matrices A and B, (A + B)T = AT + B T holds

• For every m × n matrix A and every n × p matrix B, (AB)T = B T AT holds.

2.3.3 Matrix notation for linear systems of equations


We are now in a position to write the linear equation system

a11 x1 + a12 x2 + · · · + a1n xn = b1


.. .. (2.2)
. .
am1 x1 + am2 x2 + · · · + amn xn = bm

in a much shorter way. To enable us to do this, we define the matrix


 
a11 · · · a1n
A =  ... .. 

. 
am1 · · · amn

and the column vectors    


x1 b1
x =  ...  b =  ...  (2.3)
   
xn bm
The matrix A is called the coefficient matrix and b is called the right hand side of the linear
equation system. The equation system( 2.2) is equivalent to the matrix equation

Ax = b (2.4)

To solve this linear system of equations we use the Gauss elimination method discussed ear-
lier.

19
2.3.4 Matrix inverse
The matrix inverse only makes sense for square matrices. It is defined as follows: The n × n
matrix X is called the inverse of matrix A if AX = In . If the matrix A has an inverse, the matrix
A is called invertible or regular, if the matrix has no inverse it is called singular. For a regular
n × n matrix A, we denote its inverse by A−1 .
Let A and B be invertible n × n matrices, then

• A−1 A = In

• A−1 is invertible and (A−1 )−1 = A

• AB is invertible and (AB)−1 = B −1 A−1

• AT is invertible and (AT )−1 = (A−1 )T

The following statements are equivalent:

• A is invertible

• The linear equation system Ax = b is solvable for every b

• The linear equation system Ax = 0 has only the trivial solution x = 0

The matrix inverse is very rarely computed as it is an expensive computation. In theory, one
could compute the solution to a n × n linear equation system Ax = b using the matrix inverse,
since A−1 Ax = A−1 b and A−1 A = In so that A−1 Ax = In x = x = A−1 b. However, this is not
recommended and Gauss elimination should be used.
To compute the matrix inverse for a regular n × n matrix A we proceed as follows: We denote
the matrix inverse by X and note that
  
AX = a(1) · · · a(n) x(1) · · · x(n) = In = b(1) · · · b(n)

where a(1) , · · · , a(n) are column vectors which make up the columns of matrix A and x (1) , · · · , x(n)
are column vectors which make up the inverse of A. To determine x (1) , · · · , x(n) , we can solve
linear systems Ax(1) = b(1) , · · · , Ax(n) = b(n) for x(1) , · · · , x(n) where b(1) , · · · , b(n) are columns
of the identity matrix In . Then, the inverse of A is given by the matrix whose columns are
x(1) , · · · , x(n) .

20
Example
Determine the inverse of the following matrix
 
0 3 −2
A =  4 −2 1 
2 −1 1

Solution
We follow a similar procedure to that undertaken when solving linear equations with multiple
right hand sides.
x1 x2 x3 1 1 1 2 1 3 x1 x2 x3 11 12 13
0 3 -2 1 0 0 2 -1 1 0 0 1
4 -2 1 0 1 0 4 -2 1 0 1 0
2 -1 1 0 0 1 0 3 -2 1 0 0
x1 x2 x3 1 1 1 2 1 3 x1 x2 x3 11 12 13
2 -1 1 0 0 1 2 -1 1 0 0 1
0 0 -1 0 1 -2 0 3 -2 1 0 0
0 3 -2 1 0 0 0 0 -1 0 1 -2
 1   1   1

6 6 6
, x(2) =  − 2  and x(3) =  , thus the matrix inverse
1 4
The solutions are x(1) =  3 3 3
0 −1 2
1 1 1
 
6 6 6
1
is given by A −1
= 3
− 32 43 . We can check this as follows
0 −1 2
 1 1 1
   
6 6 6
0 3 −2 1 0 0
A−1 A =  31 − 23 43   4 −2 1 = 0 1 0 
0 −1 2 2 −1 1 0 0 1

2.3.5 Rank of a matrix


The rank of a matrix A is the same as the rank of the linear equation system Ax = 0. It is denoted
by rank A. To determine the rank of a matrix we undertake the Gauss elimination strategy for the
linear equation system Ax = 0.

2.3.6 Linear independence


Let us consider a sequence of n column vectors a(1) , a(2) , · · · , a(n) each of length m. We can
construct a m × n matrix whose columns are these vectors

A = a(1) a(2) · · · a(n)

We say that the vectors a(1) , a(2) , · · · , a(n) are linearly independent if the linear system Ax = 0
has only the trivial solution x = 0. If the linear system Ax = 0 has a non trivial solution x 6= 0
we say that the vectors are linearly dependent.
Linear independence means that each of the vectors a(1) , a(2) , · · · , a(n) cannot be written as
a linear combination of the other vectors. Linearly dependent on the other hand means that the
vectors a(1) , a(2) , · · · , a(n) can be written as a linear combination of each other.

21
In practise, we perform Gauss elimination on the matrix A to decide whether the vectors are
linearly independent or not. In particular for a m × n matrix we have

• If r = n the vectors are linearly independent.

• If r < n the vectors are linearly dependent.

• If r = m the vectors are called generating.

• If r = n = m the vectors are generating and linearly independent and form a basis.

Example
Determine whether the following vectors are linearly dependent or not
   
1 0
 1  and  0 
1 0

Solution
We form the matrix whose columns are the two vectors
 
1 0
A= 1 0 
1 0

Next, we perform Gauss elimination on the system Ax = 0


x1 x2 1 1 x1 x2 1 1
1 0 0 1 0 0
1 0 0 0 0 0
1 0 0 0 0 0
We observe that r = 1, m = 3 and n = 2. This means that r < n so that the system is linearly
dependent and not generating.

2.4 Determinants
The determinate of a square matrix is an important aspect of linear algebra. It enables one to
characterise whether a matrix is regular or singular. With help of determinants one can discuss
linear equation systems. There also lies a connection between determinants and volumes. Further
topics of linear algebra such as eigenvalues and eigenvectors require the use of determinants.

2.4.1 Definition and properties


A determinate is a number which can be computed from each square matrix A. The number is
written as det A or |A|. Below, we illustrate some simple examples

a11 a12
a21 a22 = a11 a22 − a12 a21 (2.5)


a11 a12 a13
a22 a23 a21 a23 a21 a22
a21 a22 a23 = a11
a32 a33 − a12 a31 a33 + a13 a31 a32 (2.6)


a31 a32 a33

22
To determine the explicit value for the case given in equation (2.6) we use the result from equa-
tion (2.5).
The definition of a determinate is a follows
• For a 1 × 1 matrix A = (a)
det A = |A| = a
• Set  
a11 a12 · · · a1n
 a21 a22 · · · a2n 
A=
 
.. .. 
 . . 
an1 an2 · · · ann
to be a n × n matrix with n ≥ 2. For i = 1, 2, · · · , n set A1i to be the (n − 1) × (n − 1) matrix
that one obtains when the first row and the ith column has been deleted. Then the number
det A = |A| = a11 det A11 − a12 det A12 + a13 det A13 − · · · + (−1)n+1 a1n det A1n (2.7)
is called the determinate of A.
Example
Determine the determinants of the following matrices
 
  1 0 1 0
  1 2 1
3 2  0 4 1 2 
A= B= 2 3 2  C= 
1 2  2 0 2 1 
4 1 2
1 0 2 2
Solution

3 2
det A = = 3·2−2·1= 4
1 2

1 2 1 3 2 2 2 2 3
= 1 − 2 + 1
det B = 2 3 2 1 2 4 2 4 1
4 1 2 = 1 · 4 − 2 · (−4) + 1 · (−10) = 2


1 0 1 0
4 1 2

2 1 2

2 4 2

2 4 1


2 4 1 2
det C = = 1 0 2 1 − 0 2 2 1 + 1 2 0 1 − 0 2 0 2
2 0 2 1
0 2 2 1 2 2 1 0 2 1 0 2


1 0 2 2  
2 1 0 1 0 2
= 1 4
−1 0 2 +2 0 2 +

 2 2 
0 1 2 1 2 0
+1 2 − 4
1 2 +2 2 0

0 2
= 1[4 · 2 − 1 · 0 + 2 · 0] + 1[2 · 0 − 4 · 3 + 2 · 0]
= −4
Some important proprieties of determinants are listed below
• If two row of a square matrix are interchanged, the determinate changes sign

· · · · · · · ·

a j bj cj · · · a i bi ci · · ·

· · · · = − · · · ·

a i bi ci · · · a j bj cj · · ·

· · · · · · · ·

23
• If a one row is multiplied by a constant factor and added to another row, the determinate
remains unaltered


· · · ·
· · · ·
ai + αaj bi + αbj ci + αcj · · · ai bi ci · · ·


· · · · = · · · ·

aj bj cj · · · aj bj cj · · ·
· · · · · · · ·

• If a row of a matrix is multiplied by a factor α, the determinate also becomes multiplied by


that factor.
· · · · · · · ·

αai αbi αci · · · = α ai bi ci · · ·

· · · · · · · ·

• The determinate of a triangular matrix is equal to the product of the diagonal terms.

• For every n × n matrix A, it holds that det A = det AT

• If the n × n matrix A is invertible then det A 6= 0 and det A−1 = det1 A

2.4.2 Efficient calculation of determinants


We have seen that the multiples of other rows of a matrix can be added to other rows without
altering the determinate of a matrix. Also, we noted that when the matrix is in triangular form,
the determinate is just simply the product of the diagonal terms. This means that we can use
Gauss elimination to achieve efficient calculation of the determinate. After performing Gauss
elimination, the determinate is just simply the product of the diagonal entries. Note that if rows
are exchanged during Gauss elimination, the determinate changes sign.
Example
Determine the determinant of the following matrix using Gauss elimination
 
0 3 −2
A =  4 −2 1  (2.8)
2 −1 1
Solution


0 3 −2 2 −1 1

det A = 4 −2
1 = −
4 −2 1

2 −1 1 0 3 −2

2 −1 1 2 −1 1

= − 0
0 −1 = 0 3 −2
0 3 −2 0 0 −1

The determinate is then the product of the diagonal terms det A = 2 · 3 · (−1) = −6

2.4.3 Determinants and linear equation systems


The first thing to note is that when A is a n × n matrix, then performing the Gauss elimination
procedure leads one to the conclusion that det A 6= 0 exactly when a matrix has full rank (r = n).

24
Furthermore the following statements are equivalent:

• The matrix A is invertible

• det A 6= 0

• After performing Gauss elimination r = n

• The linear equation system is solvable for every b.

• The solution of the linear equation system Ax = b is unique.

• The linear equation system Ax = 0 has only the trivial solution x = 0.

If we set A to be a n × n matrix, then the following holds

• The homogeneous linear equation system Ax = 0 has only the trivial solution when
det A 6= 0.

• The linear equation system Ax = b is solvable for any right hand sides when det A 6= 0.

• The solution of the linear equation system Ax = b is unique when det A 6= 0.

Now if we consider the solution set of a linear equation system with n equations and n un-
knowns we have the following

• If det A 6= 0 the homogeneous linear equation system Ax = 0 has only the trivial solution.

• If det A = 0 the homogeneous linear equation system Ax = 0 has infinitely many solutions.

• If det A 6= 0 the linear equation system Ax = b has for a general right hand side vector
exactly one solution.

• If det A = 0 the linear equation system Ax = b has no solution or infinitely many solutions,
depending on the right hand side vector.

2.5 Eigenvalue Problems


The eigenvalue problem is one of the most important exercises in linear algebra. In what follows
we shall describe how eigenvalues and eigenvectors may be computed by hand for small matrices.

2.5.1 Eigenvalues
Let us consider a n × n matrix A. We now ask the question, does a a (column) vector exist that
allows us to write the matrix vector product Ax in a particularly simple way? In other words, is
there a vector such that we can write Ax as a number multiplied by x?
Eigenvalues and eigenvectors are defined as follows

• The number λ is called an eigenvalue of matrix A, if there exists a vector x such that
Ax = λx holds.

• If λ is an eigenvalue of the matrix A, then the vector x, for which Ax = λx holds, is called
the eigenvector of matrix A corresponding to eigenvalue λ.

25
For the moment, we just want to characterise the eigenvalue of matrix A. As we described
above, the value λ is an eigenvalue of A when there is a vector x 6= 0 such that Ax − λx = 0
holds. The equation can also be written as Ax − λIn x = 0 or (A − λIn )x = 0. The number λ is
therefore the eigenvalue of the matrix A when the homogeneous equation system (A−λI n )x = 0
has a non–trivial solution. It follows from the previous section, that this is exactly the case when
det (A − λIn ) = 0.
Example
Determine the eigenvalues of the following matrix
 
−2 1 0
A =  1 −2 1 
0 1 −2
Solution
 
−2 − λ 1 0
A − λIn =  1 −2 − λ 1 
0 1 −2 − λ
Next, we compute the determinate of this matrix

det (A − λI) = (−2 − λ) (−2 − λ)2 − 1 − 1 [(−2 − λ) − 0]


 

= (−2 − λ) (−2 − λ)2 − 2 = −(2 + λ)(λ2 + 4λ + 2)


 


The cubic equation
√ det (A − λI) = 0 has the following roots, λ 1 = −2, λ 2 = −2 + 2 and
λ3 = −2 − 2 which are also in turn the eigenvalues of matrix A.
In general for a n × n matrix A we observe that det (A − λIn ) is a polynomial of nth degree in
λ. We call the polynomial det (A − λIn ) the characteristic polynomial of matrix A and denote
it by PA (λ). If the polynomial PA (λ) has a root λ∗ which is repeated k times, we call k the
algebraic multiplicity of eigenvalue λ∗ .
We have the following properties

• Every n × n matrix has at least one eigenvalue.

• Every n × n matrix has at most n eigenvalues.

• The algebraic multiplicity of every eigenvalue is greater or equal to 1 and less than or equal
to n.

• Every n × n matrix has exactly n eigenvalues when the algebraic multiplicity of each
eigenvalue is taken in to account.

• For every real matrix the coefficients of the characteristic polynomial are real. In this case,
the eigenvalues are either real or appear in complex conjugate pairs.

• The following holds for the characteristic polynomial PA (λ) = cn λn + cn−1 λn−1 + · · · +
c1 λ + c 0

cn = (−1)n
cn−1 = (−1)n−1 (a11 + a22 + · · · + ann )
c0 = det A

26
Example
Determine the eigenvalues of the following matrix
 
2 1 1
A= 1 2 1 
1 1 2
Solution
This time we use Gauss elimination to compute det (A − λIn )

2−λ 1 1 1 1 2−λ

det (A − λIn ) = 1 2−λ 1 = −
1 2−λ 1

1 1 2−λ 2−λ 1 1

1 1 2 − λ 1 1 2−λ

= − 0 1−λ −1 + λ = − 0 1−λ −1 + λ

0 −1 + λ 1 − (2 − λ)2 0 0 −4 + 5λ − λ2
= (1 − λ)(4 − 5λ + λ2 )

Therefore we have PA (λ) = −(λ − 1)(4 − 5λ + λ2 ) = −(λ − 1)2 (λ − 4). Therefore there are
two eigenvalues 1 and 4.
The eigenvalue λ = 1 has algebraic multiplicity 2.
The eigenvalue λ = 4 has algebraic multiplicity 1.

2.5.2 Eigenvectors
Let us set A to be an n × n matrix and λ to be an eigenvalue of this matrix. We have seen, that
when the determinate of the matrix (A − λIn ) is equal to zero, there exists an eigenvector x 6= 0
to matrix A corresponding to the eigenvalue λ, if

(A − λIn )x = 0 (2.9)

The set of eigenvectors corresponding to eigenvalue λ is equal to set the set of non–trivial so-
lutions to the equation system (2.9). We call this set of nontrivial solutions the eigenspace of
A corresponding to eigenvalue λ and is given the symbol Eλ . The dimension of Eλ is called
the geometric multiplicity of the eigenvalue λ. The geometric multiplicity is always greater or
equal to 1.
The span is the set of all linear combinations of a set of vectors which make up the eigenspace.

27
Example
Given the following matrix
 
−2 1 0
A =  1 −2 1 
0 1 −2

√ we have already found that its eigenvalues are λ1 = −2, λ2 = −2 +
For which 2 and λ3 =
−2 − 2, now compute the corresponding eigenspaces
Solution
Eigenspace for λ = −2. The coefficient matrix of the linear equation (2.9) is
 
0 1 0
A + 2I3 =  1 0 1 
0 1 0

With Gauss elimination we can find the eigenspace E−2


x1 x2 x3 1 x1 x2 x3 1 x1 x2 x3 1
0 1 0 0 1 0 1 0 1 0 1 0
1 0 1 0 0 1 0 0 0 1 0 0
0 1 0 0 0 1 0 0 0 0 0 0
The solution set is {x3 = α, x2 = 0, x1 = −α|α ∈ R} or
     
 −1   −1 
E−2 = α  0  | α ∈ R = span  0 
1 1
   


Eigenspace to λ = −2 + 2. Proceeding with Gauss elimination we have
x x2 x3 1 x1 x x3 1 x1 x x3 1
√1 √2 √2
− 2 √1 0 0 √1 − 2 1 0 1 − 2 √1 0
1 − 2 √1 0 − 2 1 √0 0 0 −1 √2 0
0 1 − 2 0 0 1 − 2 0 0 1 − 2 0
x1 x x3 1
√2
1 − 2 √1 0
0 −1 2 0
0 0 0 0

The solution has the form x3 = α, x2 = 2α, x1 = α, α ∈ R. Thus
     
 √ 1   √ 1 
E−2+√2 = α  2  | α ∈ R = span  2 
1 1
   


Eigenspace to λ = −2 − 2. In a similar fashion to the above, we get
     
 √ 1   √ 1 
E−2−√2 = α  − 2  | α ∈ R = span  − 2 
1 1
   

28
Example
Given the following matrix
 
2 1 1
A= 1 2 1 
1 1 2
For which we have already found that its eigenvalues are λ1 = λ2 = 1, and λ3 = 4, now compute
the corresponding eigenspaces
Solution
Eigenspace for λ = 1. With help of Gauss elimination we have
x1 x2 x3 1 x1 x2 x3 1
1 1 1 0 1 1 1 0
1 1 1 0 0 0 0 0
1 1 1 0 0 0 0 0
The solution set is {x3 = α, x2 = β, x1 = −α − β|α, β ∈ R}, thus
        
 −α − β   −1 −1 
E1 =  β  |α, β ∈ R = α  0  +β  1 |α, β ∈ R

α 1 0
   
   
 −1 −1 
= span  0  ,  1 
1 0
 

This solution set has two free parameters. The dimension of E1 is therefore 2, we say that the
geometric multiplicity of eigenvalue λ = 1 is 2.
Eigenspace for λ = 4. With help of Gauss elimination we have
x1 x2 x3 1 x1 x2 x3 1 x1 x2 x3 1
-2 1 1 0 1 −2 1 0 1 −2 1 0
1 −2 1 0 0 −3 3 0 0 −3 3 0
1 1 −2 0 0 3 −3 0 0 0 0 0
The solution has the form x3 = α, x2 = α, x1 = α, α ∈ R
     
 1   1 
E4 = α 1 |α ∈ R = span  1 
  (2.10)
1 1
   

The geometric multiplicity of λ = 4 is 1.

2.5.3 Application
We now consider the application of eigenvalues to the vibration of a simple 2 degree of freedom
system. Consider a system in which two particles are joined by 3 springs shown in Figure 2.2.
The equations of motion for particles 1 and 2 are
m1 ü1 = −k1 u1 + k2 (u2 − u1 )
m2 ü2 = −k3 u2 − k2 (u2 − u1 )
which we can rearrange as
m1 ü1 + (k1 + k2 )u1 − k2 u2 = 0
m2 ü2 − k2 u1 + (k2 + k3 )u2 = 0

29
u u
1 2

 m
        m      

 k 
 

















 k 





























 k









 


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

1 2
1 3


 
 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  



  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 


 
 
 
 


 
 
 
  
 
  
 
  
 
  
 
  
 
  
 
  
 
 


                

Figure 2.2: Free vibration of a simple 2 degree of freedom system

or in matrix notation as
   
m1 0 k1 + k 2 −k2
M ü + Ku = 0 M= K=
0 m2 −k2 k2 + k 3
For simplicity we assume that m1 = m2 = m and k1 = k2 = k3 = k. We also assume that
u1 = x1 sin(ωt + ψ) and u2 = x2 sin(ωt + ψ) so that
Kx = ω 2 M x
which are already looks similar to the eigenvalue problem we investigated previously. In fact this
type of eigenvalue problem is called a generalised eigenvalue problem. By multiplying both
sides of the equation by M −1 we get
Ax = λx
where A = M −1 K and λ = ω 2 . We solve this in the same way as before, by finding λ such that
det (A − λI2 ) = 0
 1   2k k
2k
− λ − mk
 
−1 m
0 2k −k m
−m
m

A=M K= = , det (A−λI 2 ) =
0 m1 −k 2k −m k 2k
m
−k
m
2k
m
−λ

By evaluating the determinate we have


k2 kλ
det (A − λI2 ) = 3 2
−4 + λ2 = 0
m m
k k
The roots of this quadratic equation in λ are λ = ω 2 = 3 m and λ = ω 2 = m , which are also the
eigenvalues of matrix A. The eigenspaces which represent the different modes of the system are
as follows
Eigenspace for λ = 3km
x1 x2 1 x1 x2 1
k k k k
−m −m 0 −m −m 0
k k
−m −m 0 0 0 0
Thus the solution is of the form x2 = α, x1 = −α, α ∈ R so that
     
1 1
E 3k = α |α ∈ R = span
m −1 −1
k
Eigenspace for λ = m
x1 x2 1 x1 x2 1
k k k
m
−m 0 m
− mk 0
k k
−m m
0 0 0 0

30
Thus the solution is of the form x2 = α, x1 = α, α ∈ R so that
     
1 1
Ek = α |α ∈ R = span
m 1 1

The final solution to the problem is given by superposition of the different modes
  2
u1 X
= Cj u(j)
u2
j=1

where u(j) = x(j) sin(ωj t + ψj ) and Cj is a constant and x(j) is the jth eigenvector. Thus we have
    r !   r !
u1 1 k 1 3k
= C1 sin t + ψ1 + C2 sin t + ψ2
u2 1 m −1 m

where C1 , C2 , ψ1 and ψ2 are found from initial conditions.

31
Chapter 3

Functions of more than one variable

Last semester we looked at differentiation and integration for functions of a single variable. We
saw how we could differentiate and integrate a variety of functions and looked at their importance
in engineering. However, many of the functions that we come across in engineering depend on
more than one variable, for example the area of a rectangular plate of width x and breadth y is
given by
A = xy (3.1)
The variables x and y are clearly independent of each other, so we say that the dependent variable
A is a function of the two independent variables x and y. This is expressed by writing A = f (x, y)
or A(x, y). Let us now consider the volume of a plate given by

V = xyz (3.2)

where the thickness of the plate is z. In this case V is the dependent variable and x , y and z are
independent variables. We write V = f (x, y, z) or V (x, y, z).
In general if we have a variable t which is a function of n independent variables x 1 , x2 , x3 , · · · , xn
we can express this as
t = f (x1 , x2 , x3 , · · · , xn ) (3.3)
As for functions of one variable f (x) which we discussed last semester, the function of n variables
has an associated domain in n–dimensional space, a range and a rule that assigns each n–tuple
of real numbers (x1 , x2 , x3 , · · · , xn ) in the n–dimensional domain with a real number z in the
range.
We do not wish to pursue deeper in to these issues as our interest here lies with the differenti-
ation and integration of functions of more than one variable. We begin this chapter with looking
at how we visualise functions of more than one variable, then we move on to the topic of partial
differentiation. We finish the chapter by considering integrals of surfaces and volumes.

3.1 Visualisation of Functions of Two and Three variables


For purposes of illustration we restrict ourselves to functions of two or three independent vari-
ables. Let us consider the function
z = f (x, y) (3.4)
which is a function of two independent variables x and y. We have two ways of visualising
such a function: The first way uses level curves which curves in the x, y domain on which the
function f (x, y) has a constant value. Level curves follow the same ideas as contours which are
used to show elevation on a ordnance survey map. The second alternative is to plot the points

32
corresponding to (x, y, z) with z = f (x, y) in a rectangular coordinate system with axis x, y, z.
By doing this we end up with function being represented as a surface.
Example
We wish to visualise the function
z = x2 + y 2
Solution
By using MATLAB, we can make level surface plots and surface plots of this functions. Illustra-
tions of both are shown below
2 2
x +y

10

80
8

6
60
4

2 40

0
20
−2

−4 0
5
−6 6
4
0 2
−8 0
−2
−5 −4
−10 −6
−10 −8 −6 −4 −2 0 2 4 6 8 10 y x

Note that for functions of three independent variables, eg w = f (x, y, z) we cannot plot
surfaces like we did for functions of two variables. We can, however, plot level surfaces. Level
surfaces are like level curves, they represent a surface on which w is constant.

3.2 Partial Differentiation


We recall from last semester that the derivative of a function f (x) of one variable measures the
slope of the tangent to the graph of the function. If we now consider a function z = f (x, y)
of two variables, slope no longer makes sense because z = f (x, y) defines a surfaces in three
dimension. Consider the following two cases:

• Lets start with the simplest surface z = 0 ie, a surface which is flat in both the x and y
directions, as shown in Figure 3.1 (a). If we move along a line for which y is fixed and x
is increasing, the slope of this line will be 0. Similarly if we move along a line for which x
is fixed and y is increasing this line will also have zero slope.

• Next we consider the surface z = x + 2y, as shown in Figure 3.1 (b). For this example,
the slope is equal to 1 if we move along a line of fixed y and increasing x. If, however,
we move along a line for which x is fixed and y is increasing then we find that the slope is
equal to 2.

It turns out that for a general surface the slope will be different depending on which direction
we move in. To measure this a new kind of derivative is introduced called the partial derivative.
Formally the partial derivative of f (x, y) with respect to x is defined as

f (x + ∆x, y) − f (x, y)
lim (3.5)
∆x→0 ∆x

33
0 x+2 y

1 20

0.5 10

0 0

−0.5 −10

−1 −20
5 5
5 5
0 0
0 0
−5 −5 −5 −5
y x y x

(a) (b)

Figure 3.1: Visualisation surfaces for z = 0 and z = x + 2y

This means that we differentiate f (x, y) with respect to x while keeping y constant (fixed). The
partial derivative of f (x, y) with respect to x is the same as measuring the slope in the x direction.
We denote this partial derivative by
∂f
or ∂f /∂x
∂x
Note the use of ‘curly dee’s’ to distinguish between partial differentiation and normal differ-
entiation. In writing care must be taken to distinguish between
df ∆f ∂f
, and (3.6)
dx ∆x ∂x
In a similar way to the partial derivative of f (x, y) with respect to x, we define the partial
derivative of f (x, y) with respect to y as

∂f f (x, y + ∆y) − f (x, y)


= lim (3.7)
∂y ∆x→0 ∆y

which we determine by differentiating f (x, y) with respect to y by keeping x constant. This


partial derivative is the same as measuring the slope in the y direction.
If we know both ∂f ∂x
and ∂f
∂y
we can work out slope of the surface for any direction. If we
consider a direction at an angle α to the x axis the slope is given by
∂f ∂f
cos α + sin α (3.8)
∂x ∂y
we call this the directional derivative.

34
Example
Given the function f (x, y) = x2 y 3 + 3y + x, determine its partial derivative with respect to x and
y. Hence determine its directional derivative for a direction at angle α to the x axis.
Solution
To find the partial derivative of f (x, y) with respect to x, we differentiate f (x, y) and keep y
constant. Thus
∂f
= 2xy 3 + 1
∂x
Similarly, we obtain the partial derivative of f (x, y) with respect to y, by differentiating f (x, y)
while keeping x constant
∂f
= 3x2 y 2 + 3
∂y
We obtain the directional derivative by applying formula (3.8), giving

(2xy 3 + 1) cos α + (3x2 y 2 + 3) sin α

Here are some more examples


Example
Determine ∂f /∂x and ∂f /∂y when f (x, y) is

a) x2 y 2 + 3xy − x + 2 b) sin(x2 − 3y)

Solution
a) For f (x, y) = x2 y 2 + 3xy − x + 2 we have

∂f ∂f
= 2xy 2 + 3y − 1 = 2x2 y + 3x
∂x ∂y

b) For f (x, y) = sin(x2 − 3y) we have

∂f ∂ ∂f
= cos(x2 − 3y) (x2 − 3y) = 2x cos(x2 − 3y) = −3 cos(x2 − 3y)
∂x ∂x ∂y

In the examples we have considered so far we have used partial differentiation in the context
of function of two variables. However, the concept may be extended to functions of as many
variables as we please. For a function f (x1 , x2 , · · · xn ) of n variables, the partial derivative with
respect to xi is given by

∂f f (x1 , x2 , · · · , xi + ∆xi , xi+1 , · · · , xn ) − f (x1 , x2 , · · · , xn )


= lim
∂xi ∆xi →0 ∆xi
in practise we obtain this by differentiating the function with respect to x i while keeping all other
n − 1 variables constant.

35
Example
Determine ∂f /∂x, ∂f /∂y and ∂f /∂z when

f (x, y, z) = xyz 2 + 3xy − z

Solution
We obtain that
∂f
= yz 2 + 3y
∂x
∂f
= xz 2 + 3x
∂y
∂f
= 2xyz − 1
∂x

3.2.1 Chain rule


We already came across the chain rule when we performing standard differentiation for functions
of a single variable. We now wish to extend these ideas to functions of more than one variable.
Lets consider the case where z = f (x, y) and x and y are themselves functions of two indepen-
dent variables s and t. This means that we can also write z as a function of s and t, say F (s, t).
If we want to differentiate z with respect to s or t we have
∂z ∂z ∂x ∂z ∂y ∂z ∂z ∂x ∂z ∂y
= + = + (3.9)
∂s ∂x ∂s ∂y ∂s ∂t ∂x ∂t ∂y ∂t
We can write this in matrix notation as follows
∂y ∂z
 ∂z   ∂x  
∂s = ∂s ∂s ∂x (3.10)
∂z ∂x ∂y ∂z
∂t ∂t ∂t ∂y

This result is called the chain rule.

36
Example
Find ∂T /∂r and ∂T /∂θ when

T (x, y) = x2 + 2xy + y 3 x2

and x = r cos θ and y = r sin θ


Solution
By the chain rule
∂T ∂T ∂x ∂T ∂y
= +
∂r ∂x ∂r ∂y ∂r
In this example
∂T ∂T
= 2x + 2y + 2xy 3 = 2x + 3x2 y 2
∂x ∂y
and
∂x ∂y
= cos θ = sin θ
∂r ∂r
so that
∂T
= (2x + 2y + 2xy 3 ) cos θ + (2x + 3x2 y 2 ) sin θ
∂r
= (2r cos θ + 2r sin θ + 2r 4 cos θ sin3 θ) cos θ + (2r cos θ + 3r 4 cos2 θ sin2 θ) sin θ

Similarly
∂T
= −(2x + 2y + 2xy 3 )r sin θ + (2x + 3x2 y 2 )r cos θ
∂θ
= −(2r cos θ + 2r sin θ + 2r 4 cos θ sin3 θ)r sin θ + (2r cos θ + 3r 4 cos2 θ sin2 θ)r cos θ

Example
Find dR/ds when
R(s) = cosh(x2 + 3y)
and x = s2 + 3s and y = sin s
Solution
For this example, x and y are functions of s only so
dR ∂R dx ∂R dy
= +
ds ∂x ds ∂y ds
which gives
dR
= 2x(2s + 3) sinh(x2 + 3y) + 3 cos s sinh(x2 + 3y)
ds
= 2(s2 + 3s)(2s + 3) sinh((s2 + 3s)2 + 3 sin s) + 3 cos s sinh((s2 + 3s)2 + 3 sin s)
= 2(2s3 + 9s2 + 9s) sinh((s2 + 3s)2 + 3 sin s) + 3 cos s sinh((s2 + 3s)2 + 3 sin s)

3.2.2 Higher order partial derivatives


So far we have considered functions like f (x, y) and found its partial derivatives ∂f∂x
and ∂f
∂y
. If
the partial derivatives are also functions of x and y, they can also be differentiated with respect

37
to x an y. We define higher order partial derivatives as follows

∂2f
 
∂ ∂f
=
∂x2 ∂x ∂x
∂2f
 
∂ ∂f
=
∂y 2 ∂y ∂y
∂2f
 
∂ ∂f
=
∂x∂y ∂x ∂y
∂2f
 
∂ ∂f
=
∂y∂x ∂y ∂x
∂f ∂f ∂2f ∂2f
If ,
∂x ∂y
, ∂x∂y
and ∂y∂x
exist and are continuous, then it follows that

∂2f ∂2f
= (3.11)
∂x∂y ∂y∂x
Note, however, that if the conditions are not fulfilled these so called mixed partial deriva-
tives are not equal.
Example
For the function
f (x, y) = sin x cos y + x3 ey (3.12)
find all the second order partial derivatives
Example
First we find the first order partial derivatives
∂f ∂f
= cos x cos y + 3x2 ey = − sin x sin y + x3 ey
∂x ∂y
Then by differentiating these expressions again we can find the second order derivatives

∂2f
= − sin x cos y + 6xey
∂x2
∂2f
= − sin x cos y + x3 ey
∂y 2
∂2f
= − cos x sin y + 3x2 ey
∂x∂y
∂2f
= − cos x sin y + 3x2 ey
∂y∂x
∂2f ∂2f
In this case, we have that ∂x∂y
= ∂y∂x

3.2.3 Total differentiation


Let us consider the function z = f (x, y) which is a function of two variables x and y. Now let
∆x represent a small change in x, ∆y a small change in y and ∆z a small change in z.
It follows that
∆z = f (x + ∆x, y + ∆y) − f (x, y)

38
we can rewrite this as the sum of two terms, the first of which shows the change in z due to a
change in x and the second which shows the change in z due to a change in y

∆z = [f (x + ∆x, y + ∆y) − f (x, y + ∆y)] + [f (x, y + ∆y) − f (x, y)]

Next, we multiply the first term by ∆x/∆x = 1 and the second term by ∆y/∆y = 1

[f (x + ∆x, y + ∆y) − f (x, y + ∆y)] [f (x, y + ∆y) − f (x, y)]


∆z = ∆x + ∆y
∆x ∆y
By letting ∆x, ∆y and ∆z tend to zero we get
∂f ∂f
dz = dx + dy (3.13)
∂x ∂y

In this expression dx, dy and dz are called differentials. If z = f (x) so that it is a function of
one variable, the formula takes the form
df
dz = dx (3.14)
dx
If w = f (x, y, z) is a function of three variables we have

∂f ∂f ∂f
dw = dx + dy + dz (3.15)
∂x ∂y ∂z

We can use the idea of differentials to calculate errors. If z = f (x, y) and ∆x and ∆y are
errors in x and y, then the error in z is approximately given by
∂f ∂f
∆z ≈ ∆x + ∆y (3.16)
∂x ∂y

Example p
We want to estimate (3.01)2 + (3.97)2
Solution p √
Let z = pf (x, y) = x2 + y 2 . If we set x = 3 and y = 4 we can easily compute z = 32 + 42 =
5. Now (3.01)2 + (3.97)2 is z when x is increased by ∆x = 0.01 and when y is decreased by
0.03, ie ∆y = −0.03
∂f ∂f
∆z ≈ ∆x + ∆y
∂x ∂y
1 1
= 2x(x2 + y 2 )−1/2 ∆x + 2y(x2 + y 2 )−1/2 ∆y
2 2
x y
= p ∆x + p ∆y
x2 + y 2 x2 + y 2
 
3 4
= × 0.01 + × (−0.03) = −0.018
5 5
p
So (3.01)2 + (3.97)2 ≈ 5 + ∆z = 5 − 0.018 ≈ 4.98

39
Example
The height of a cylinder is under measured by 3% and the raduis is over measured by 2% we wish
to estimate the percentage error in the volume.
Solution
The volume of a cylinder is given by V = πr 2 h so
∂V ∂V
= 2πrh = πr 2
∂r ∂h
So that the error in the volume may be written as
∂V ∂V
∆V ≈ ∆r + ∆h
∂r ∂h
= 2πrh∆r + πr 2 ∆h

As we are interested in the percentage error, we divide this equation by V

2πrh πr 2
∆V ≈ ∆r + ∆h
πr 2 h πr 2 h
2∆r ∆h
= +
r h
∆r 2 ∆h 3 ∆V 1
From the question we know that r
= 100
and h
= − 100 giving V
= 100
. This means that the
volume is overestimated by 1%.

3.3 Integration
As well as being able to differentiate multivariate functions we also need to be able to integrate
them. In engineering, three types of integrals commonly occur: line integrals, surface integrals
and volume integrals. In this section we shall look at how these may be performed.

3.3.1 Line integrals


Let us consider the integral
Z b
f (x, y)dx where y = g(x) (3.17)
a

we can perform the integration in the usual way, once we have substituted y for g(x)
Z b
f (x, g(x))dx (3.18)
a

Clearly the value of the integral depends on the function y = f (x). We can interpret it as
Rb
evaluating a f (x, y)dx along the curve y = g(x), as shown in Figure 3.2. The result of this
integral is no longer the area under the curve and to distinguish it from our earlier integrals we
call it a line integral.
This isn’t the only type of line integral, other examples are
Z Z Z Z
f (x, y)dx f (x, y)ds f (x, y)dt [f1 (x, y)dx + f2 (x, y)dy]
C C C C

40
y

A
B
C

a b x

Figure 3.2: Illustration of a line integral

Note that in the above the symbol C, this means that the integral is evaluated along the curve or
path C. The path is not restricted to two dimensions and may be in as many dimensions as we
please. It is generally preferred to use C instead of the usual limits a and b when talking about
line integrals, as the limits of integration are usually clear from how C is defined.
ExampleR
Evaluate C xydx from (1, 0) to (0, 1) along the curve C that is the portion of x2 + y 2 = 1 in the
first quadrant.

(0,1)
C

(1,0) x

Solution √
On this curve y = 1 − x2 so that
0
0 √

12 1
Z Z
2 2 3/2
xydx = x 1 − x dx = − (1 − x ) =−
C 1 23 1 3

Example
Evaluate the integral Z
I= [(x2 + 2y)dx + (x + y 2 )dy]
C

from (0, 1) to (2, 3) along the curve C defined by y = x + 1


Solution
Since y = x + 1 then dy = dx and
Z 2
I = [(x2 + 2(x + 1)) + (x + (x + 1)2 )]dx
0
Z 2  2
2 2 3 5 2 64
= (2x + 5x + 3)dx = x + x + 3x =
0 3 2 0 3

41
Example
Evaluate Z
(zdx + x2 dy − 2ydz)
C

along the curve C which is specified parametrically as x = t, y = t2 and z = t3 from (0, 0, 0) to


(1, 1, 1).
Solution
On the curve C, dx = dt, dy = 2tdt and dz = 3t2 dt. Also at the point (0, 0, 0) t = 0 and at the
point (1, 1, 1) t = 1 so that
Z Z 1
2
(zdx + x dy − 2ydz) = (t3 dt + 2t3 dt − 6t4 dt)
C 0
Z 1
= (3t3 − 6t4 )dt
0
 1
3 4 6 5 9
= t − t =−
4 5 0 20
R
As we mentioned earlier, some line integrals may be given in the form C f (x, y)ds where s
indicates the arc Rlength along the curve defined by y = g(x). One of the simplest examples of
such integrals is C ds which is equal to the length of the curve C. To evaluate this kind integrals
we note that ds is given by
q
dy 2

• ds = 1 + dx dx in Cartesian form
q  2
dx 2
• ds = dt
+ dydt
dt in parametric form
q
dr 2

• ds = r 2 + dθ dθ in polar form

Furthermore, if a line integral is such that the integration


H is performed around a closed (sim-
ple)curve, then we denote this type of integral by C ds with the convention that the integral is
evaluated by travelling around C in an anticlockwise direction.

42
Example
Evaluate the integral
ds
I
p
C x2 + y 2
where C is the unit square with vertices (1, 1), (−1, 1), (−1, −1), (1, −1).

y
(−1,1) (1,1)
B A

x
D E
(1,−1)
(−1,−1)

Solution
We can break the integral into four parts
I Z B Z D Z E Z A
= + + +
C A B D E

• Along AB y = 1 and ds = −dx

• Along BD x = −1 and ds = −dy

• Along DE y = −1 and ds = dx

• Along EA x = 1 and ds = dy

Thus the integral becomes


Z −1 Z −1 Z 1 Z 1
ds −dx −dy dx dy
I
p = √ + p + √ + p
C x2 + y 2 1 1 + x2 1 1 + y2 −1 1 + x2 −1 1 + y2
Z 1
dt
= 4 √ = 4[sinh−1 t]1−1 = 8 sinh−1 1
1 + t 2
−1

3.3.2 Surface integrals


We recall the definition of an integral of a function f (x) from Engineering Analysis 1,
Z b n
X
f (x)dx = lim f (x̄i ∆xi
a n→∞ i=1
∆xi → 0

where a = x0 < x1 < · · · < xn = b, ∆xi = xi − xi−1 and xi−1 ≤ x̄i ≤ xi . We remember that
this integrals is equal to the area under the curve f (x) between x = a and x = b, as shown in
Figure 3.3.
We now wish to extend this to integrals of functions of more than one variable. Next we
consider z = f (x, y) and a region R of the xy plane, as illustrated in Figure 3.4. We define the

43
f(x)

f(x*r )

0 x0 x1 xr−1 x*r xr xn x
a b

Figure 3.3: Integral of a function of a single variable

integral of f (x, y) over R by


Z Z n
X
f (x, y)dA = lim f (x̄i , ȳi )∆Ai (3.19)
R n→∞ i=1
∆Ai → 0

where ∆Ai is an elemental area of R and (x̄i , ȳi ) is a point in ∆Ai . As we have already seen
f (x, y) represents a surface and so f (x̄i , ȳi )∆Ai = z̄i ∆Ai is the volume between the z = 0 and
z = z̄i whose base cross section is ∆Ai . The integral is the limit of the sum of all such volumes
and so it is the volume under the surface of z = f (x, y) above R.
z

            

              
              
x 

  

∆ Ai

Figure 3.4: Integral of a function of two variables

If we introduce a series of lines which are parallel to the x and y axis, as shown on Figure 3.5,
we can write ∆Ai = ∆xi ∆yi , giving
Z Z Z Z n
X
f (x, y)dA = f (x, y)dxdy = lim f (x̄i , ȳi )∆xi ∆yi (3.20)
R R n→∞
i=1
RR
Note that we can evaluate integrals of the type R
f (x, y)dxdy as repeated single integrals in x
and y andR Rconsequently they are usually called double integrals. For the particular case of the
integral R
dA we note that this equal to the area of region R.

44
y

∆ yι

x
∆ xι

Figure 3.5: Lines introduced for double integrals

There are two alternatives to evaluating double integrals. If data is given such that y = g(x),
ie y is some function of x then we work out the integral by first performing the integration with
respect to y and then with respect to x, ie
Z Z Z "Z b x=g2 (x)
#
f (x, y)dA = f (x, y)dy dx
R a y=g1 (x)

Alternatively if we have that x is expressed as some function of y, eg x = h(y), then we first


perform the integration with respect to x and then integrate with respect to y
Z Z Z "Z d x=h2 (y)
#
f (x, y)dA = f (x, y)dx dy (3.21)
R c x=h1 (y)

In the particular case where the region R is a rectangle, then the limits of the integration are
constant and so it does not matter whether integrate x or y first.
Z Z Z dZ b Z bZ d
f (x, y)dA = f (x, y)dxdy = f (x, y)dydx
R c a a c

45
Example
Evaluate the integral Z 1 Z 3
(x2 + y 2 )dxdy
0 1
Solution
If we integrate with respect to x first, then we obtain
1 3 x=3 1 
1 3
Z Z Z
2 2 2
(x + y )dxdy = x +y x dy
0 1 0 3 x=1
Z 1   1
26 2 26 2 3 28
= + 2y dy = y+ y =
0 3 3 3 0 3

Alternatively with respect to y first


1 3 y=1 3 
1 3
Z Z Z
2 2 2
(x + y )dxdy = x y+ y dx
0 1 1 3 y=0
Z 3 
2 1 28
= x + dx =
1 3 3

ExampleR R
Evaluate R
(x2 + y 2 )dA over a triangle with vertices (0, 0), (2, 0) and (1, 1).
Solution

y y y

1 1 1
y=x y=2−x


 



 



  
 

 
1 2 x 1 2 x 1 2 x

First, integrating with respect to x first gives


Z Z Z 1 Z x=2−y
2 2
(x + y )dA = (x2 + y 2 )dxdy
R 0 x=y
1  x=2−y 1  
1 3 8 8 3 4
Z Z
= x + y 2x dy = 2
− 4y + 4y − y dy =
0 3 x=y 0 3 3 3

Next integrating with respect to y first


Z Z Z 1 Z y=x Z 2 Z y=2−x
2 2 2 2
(x + y )dA = (x + y )dydx + (x2 + y 2 )dydx
R 0 y=0 1 y=0

Here the integrals are


Z 1 Z y=x  y=x Z 1 1
1 3 4 3 1
Z
2 2 2
(x + y )dydx = x y+ y dx = x dx =
0 y=0 0 3 y=0 0 3 3
Z 2 Z y=2−x Z 2 y=2−x Z 2 
2 2 2 1 3 8 2 4 3
(x + y )dydx = x y+ y dx = − 4x + 4x − x dx = 1
1 y=0 1 3 y=0 1 3 3
1
(x2 + y 2 )dA = 1 + = 34 .
RR
So R 3

46
3.3.3 Volume integrals
Volume integrals are evaluated by carrying out three successive integrals. Volume integrals are
of the form Z Z Z
dV (3.22)
V
and are called triple integrals. They are evaluated in the same way as double integrals, we
start by evaluating the inner integral and work outwards. The main difficulty is associated with
determining the correct limits for the integration. To aid, this one may make a sketch of the region
to be integrated. Also useful to note that if integrals are evaluated in the order x, y, z then the
limits on the y integral may depend on z but not on x.
Example
A cube 0 ≤ x, y, z ≤ 1 has a variable density given by ρ = 1 + x + y + z, what is the total mass
of the cube
Solution
The total mass is given by
Z Z Z
M = ρdV
V
Z 1Z 1Z 1 Z 1Z 1 1
x2
= (1 + x + y + z)dxdydz = x+ + xy + xz dydz
0 0 0 0 0 2 0
Z 1Z 1  Z 1 2
1
3 3y y
= + y + z dydz = + + yz dz
0 0 2 0 2 2 0
Z 1 2 1
 
z 5
= (2 + z)dz = 2z + =
0 2 0 2

47
Chapter 4

Sequences and Series

This chapter investigates sequences and series and there importance in engineering. Sequences
are important and arise if a continuous function is measured or sampled at periodic intervals.
They also arise when attempts are made to find approximate solutions of equations that model
physical phenomena. Closely related to sequences are series. They are important as certain
mathematical problems can expressed as series. Two well known series that we shall consider
are the Taylor and Maclaurin series.

4.1 Sequences and Series


A sequence is a set of numbers which are written down in a specific order. Examples of se-
quences are 2, 4, 6, 8 and −7, −9, −11, −13. We call each number a term of the sequence. The
continuation dots · · · are sometimes used to illustrate that the sequence continues.
Often sequences arise from the evaluation of a function, for example if we consider the set
of whole number {0, 1, 2, 3, · · · }, the set of values {f (0), f (1), f (2), f (3), · · · } which arise from
evaluating the function on the set of whole numbers is also called a sequence. In this case, we give
the identify terms in the sequence as follows f0 = f (0), f1 = f (1) and so on. Thus the first term
in the sequence is f0 , the second term in the sequence is f1 . If the sequence has a given number
of terms such as {f0 , f1 , · · · , fn } we call it a finite sequence. Sequences like {f0 , f1 , · · · , f∞ }
which extend to infinity are called infinite sequences.
If the next term in a sequence can be generated from some combination of previously com-
puted terms, the formula which gives the next term is called a recurrence relation.

48
Example
One way to compute square roots is Newton formula. This states
√ that if x is an approximation
to the square root of a, then a/x is also an approximation to a. A better approximation
√ can be
obtained by taking an average of the two values. Thus if x0 is an approximation to a then
 
1 a
x1 = x0 +
2 x0

similarly  
1 a
x2 = x1 +
2 x1
is a better approximation than x0 . In general xn+1 given by
 
1 a
xn+1 = xn +
2 xn

√ better approximation than xn , this is an example of recurrence relation. If we wish to compute


is
2 then starting with x0 = 1 gives the sequence
3 17 577
x0 = 1 x1 = = 1.5 x2 = = 1.416666(6dp) x3 = = 1.414216(6dp)
2 12 408

A series is obtained when terms of a sequence are added. For example, if a sequence contains
2, 4, 6, 8, 10, then by adding the terms we obtain the series

2 + 4 + 6 + 8 + 10

We can use sigma notation to write a series more concisely. For example, if a sequence contains
the integers 0, 1, 2, · · · , n a series is given by
n
X
Sn = 0 + 1 + 2 + · · · + n = k
k=0

Example
Use summation notation to write the series consisting of a) the first six odd numbers and b) the
first seven even numbers.
Solution
a) A series which sums the first six odd numbers is given by
6
X
(2k − 1) = 1 + 3 + 5 + 7 + 9 + 11
k=1

b) A series which sums the first seven even numbers is given by


7
X
2k = 2 + 4 + 6 + 8 + 10 + 12 + 14
k=1

4.1.1 Graphical representation of sequences


Sometimes it helpful to display a sequence graphically. We can do this by plotting each term in
the sequence on a standard x, y graph. For example, terms in a particular sequence are defined

49
by xn = 1 + (−1)n /n, starting with n = 1 and considering terms up to n = 10 gives to 2dp
0, 1.50, 0.67, 1.25, 0.80, 1.17, 0.86, 1.12, 0.89, 1.10
By plotting each term of the sequence as a graph, where the term’s index is used as the x coor-
dinate and the term’s value is used as the y coordinate, gives the plot shown in Figure 4.1. From

1.5

1
xn

0.5

0
1 2 3 4 5 6 7 8 9 10
x

Figure 4.1: Graph of the sequence xn = 1 + (−1)n /n

this figure, we can observe that values of the sequence oscillate around 1 and become closer to 1
as n increases. Thus plotting a sequence can often give us valuable insights in to its behaviour.

4.2 Finite sequences and series


We now wish to look at finite sequences and series in more detail.

4.2.1 Arithmetical sequences and series


An arithmetical sequence is a sequence in which the difference between successive terms is a
constant number. Examples of arithmetical sequences are {0, 3, 6, 9, 12, 15} and {1, 0, −1, −2, −3}.
Traditionally arithmetical series were called arithmetical progressions, however the former
name is now preferred. We can write arithmetical sequences as {a + kd} n−1 k=0 where a is the
first term, d is the difference between the terms and n is the number of terms in the sequence. So,
for the first example a = 0, d = 3 and n = 6, for the second example a = 1, d = −1 and n = 5.
The sum of terms in an arithmetical sequence is an arithmetical series. In general this can
be written as
n−1
X
Sn = a + (a + d) + (a + 2d) + · · · + [a + (n − 1)d] = (a + kd) (4.1)
k=0

We can obtain an expression for the sum of n terms in the series. If we expand the summation
and then write it in reverse order we have
Sn = a + (a + d) + (a + 2d) + · + [a + (n − 1)d]
Sn = [a + (n − 1)d] + [a + (n − 2)d] + [a + (n − 3)d] + · · · a
Now if we add these expressions we obtain
2Sn = [2a + (n − 1)d] + [2a + (n − 1)d] + [2a + (n − 1)d] + · · · [2a + (n − 1)d]

50
Thus giving
1
Sn = n[2a + (n − 1)d] (4.2)
2
as the sum of n terms of an arithmetical series.
Example
How many terms of the arithmetical sequence 2, 4, 6, 8, · · · will give rise to 420?
Solution
For this example, a = 2, d = 2, Sn = 420, we need to find n
1
Sn = 420 = n[4 + 2(n − 1)] = 2n + n(n − 1)
2
Thus p
2 −1 ±
1 − 4(−420)
n + n − 420 = 0 n=
2
Hence n = 20 or n = −22, since n must be a positive number, n = 20
Example
A building company offers to place a foundation pile at a cost of 100 pounds for the first metre,
110 pounds for the second metre and increasing at a cost of 10 pounds per metre thereafter. It is
decided to set piles at 5 metres.

a) What is the the total cost of the piling?

b) What is the cost of piling the last metre?

Solution
a) The cost is the sum of the arithmetic series where a = 100, b = 10 and n = 40
5
Sn = [2(100) + (5 − 1)10] = 600 pounds
2
b) The cost of piling the last metre is given by the fifth term in the sequence. This 100 + (5 −
1)10 = 140 pounds.

4.2.2 Geometric sequences and series


A geometric sequence is one in which the ratio of successive terms is a constant number. Ex-
amples of geometric sequences are {3, 6, 12, 24, 48} and {−1, − 12 , − 41 , − 16
1 1
, − 32 }. A geometric
k n−1
sequence always takes the form {ar }k=0 where a is the first term in the sequence, r is the ratio
between the terms and n is the number of terms in the sequence. Thus in the first example a = 3,
r = 2 and n = 5, for the second example a = −1, r = 21 and n = 5. Geometric sequences are
sometimes still called geometric progressions. The sum of a geometric sequence is a geometric
series. The general geometric series has the form
n−1
X
Sn = a + ar + ar 2 + ar 3 + · · · + ar n−1 = ar k (4.3)
k=0

To obtain the sum Sn , we first multiply the equation by r


rSn = ar + ar 2 + ar 3 + ar 4 + · · · + ar n
then if we subtract this from Sn we obtain
(1 − r)Sn = a − ar n

51
so that
n−1
X 1 − rn
Sn = ar k = a (4.4)
k=0
1−r

Example
An insurance company garantees that, for a fixed annual premium payable at the beginning of
each year, for a period of 25 years, the return will be equal to the premium paid together with 3%
compound interest. For an annual premuim of 250 pounds what is the guaranteed sum at the end
of 25 years?
Solution
The first year premium earns interest for 25 years and so grantees 250(1 + 0.03) 25
The second year premium earns interest for 24 years and so grantees 250(1 + 0.03) 24
..
.
The final year premium earns interest for 1 year and so grantees 250(1 + 0.03)
The total sum is therefore

250[(1.03) + (1.03)2 + · · · + (1.03)25 ]

the term inside the square brackets is a geometric sequence. Taking a = 1.03, r = 1.03 and
n = 25 gives the total cost as

(1 − 1.0325 )
 
250 1.03 = 9388 pounds
(1 − 1.03)

4.2.3 Other finite series


Sometimes engineers are required to use finite series other than arithmetical and geometrical
sequences. We investigate a method that can be generalised to finding the sums of different finite
series and apply it to the case of finding the sum of squares.
We wish to find the summation of squares
n
X
Sn = 1 2 + 2 2 + 3 2 + · · · + n 2 = k2
k=1

To do this we use the identity (k + 1)3 − k 3 = 3k 2 + 3k + 1. This means we can write


n
X n
X
3 3
[(k + 1) − k ] = (3k 2 + 3k + 1)
k=1 k=1

In this expression, we can expand the left hand side to find that
23 − 13 + 33 − 23 + 43 − 33 + · · · + (n + 1)3 − n3 = (n + 1)3 − 1
and the right hand side is equal to
n
X n
X n
X
2
3 k +3 k+ 1
k=1 k=1 k=1
Pn 1
Pn
We already know that k=1 k= 2
n(n + 1) and k=1 1 = n so this means that
n
3
X 3n
(n + 1) − 1 = 3 k2 + (n + 1) + n
k=1
2

52
an

a+ε

a−ε

N n

Figure 4.2: Convergence of a sequence

which finally gives


n
X 1
Sn = k 2 = n(n + 1)(2n + 1) (4.5)
k=1
6

4.3 Limit of a sequence


4.3.1 Convergent sequences
We previously saw how we could use Newton’s formula to gain an ever improving approximation
√ square root of a value. Starting with 1 we obtained the following improving approximations
to the
to 2
x0 = 1
x1 = 1.50
x2 = 1.42
if the process is continued we would obtain
x22 = 1.41
x23 = 1.41
indeed for n ≥ 22 we have xn = 1.41 to 2dp. We observe that the difference between x22 and
x23 is indistinguishable when the numbers are expressed to two decimal places, in other words
the difference is less than the rounding error. When this happens, we say that the sequence tends
to a limit or has a limiting value or converges or that it is convergent.
Given a general sequence {ak }∞ k=0 we say it has the limiting value a as n becomes large, if
given a small positive number , an differs from a by less than  for all sufficiently large n, ie

an → a as n → ∞ if, given any  > 0, there is a number N such that |a − a n | <  for all
n>N

We remark that → stands for ’tend to the value’ or ’converges to the limit’. An alternative
notation would be to write
lim an = a (4.6)
n→∞
We illustrate this process graphically in Figure 4.2.
Note that the limit of a sequence need not actually be an element of the sequence. For example
−1 ∞
{n }n=1 has the limit of 0, but 0 is not an element of the sequence.

53
4.3.2 Proprieties of convergent sequence
It turns out that a convergent sequence satisfies a number of properties which are given below

• Every convergent sequence is bounded; that is, if {an }∞


n=0 is convergent then there is a
positive number M such that |an | < M for all n.

• If {an } has limit a and {bn } has limit b then

– {an + bn } has limit a + b


– {an − bn } has limit a − b
– {an bn } has limit ab
– {an /bn } has limit a/b for bn 6= 0 and b 6= 0.

Example
Find the limits of the sequence {xn }∞
n=0 when xn is given by

n 2n2 + 3n + 1
a) xn = b) xn =
n+1 5n2 + 6n + 2
Solution
a) xn = n/(n + 1) leads to the sequence {0, 21 , 34 , 45 , · · · }. Already from these values it seams that
xn → 1 as n → ∞. We can prove this by rewriting xn as
1
xn = 1 −
n+1
As n increases 1/(n + 1) becomes smaller and smaller, thus we have
n
lim =1
n→∞ n + 1

2
b) Now considering xn = 2n +3n+1
5n2 +6n+2
it is easiest to divide the numerator and denominator by the
highest power of n, giving
2 + n3 + n12
xn =
5 + n6 + n22
3 1 6 2
We have that limn→∞ 2 + n
+ n2
= 2 and limn→∞ 5 + n
+ n2
= 5. Hence we have that

2n2 + 3n + 1 2
lim =
n→∞ 5n2 + 6n + 2 5

4.3.3 Divergent sequences


To illustrate the fact that not all sequences converge we consider the following geometric se-
quence
an = r n r constant (4.7)
For this sequence we have 
0 (−1 < r < 1)
lim an =
n→∞ 1 (r = 1)

54
if r > 1 the sequence increases without bound as n → ∞ and we say that it diverges. If r = −1
the sequence has takes the values of alternating ±1, and has no limiting value. If r < −1 the
sequence is unbounded and the terms alternate in sign.

4.3.4 Cauchy’s test for convergence


The following test for convergence is used in a computational context. If we do not know the limit
a to which a sequence {an } converges we cannot measure |a − an |. However, in a computational
context where we often use a recurrence relationship to compute the sequence {a n }, we say that
is has converged when all subsequent terms yield the same level of approximation required. We
say that a sequence of finite terms is convergent if for any n and m > N

|an − am | <  (4.8)

where  is specified. This means that a sequence terns to a limit if all the terms of the sequence
for n > N are restricted to an interval that can be made arbitrarily small by making N arbitrarily
large. This is called Cauchys test for convergence.

4.4 Infinite Series


We must exercise care when dealing with infinite series as mistakes can be made if they are not
dealt with correctly. If we consider the series

S = 1 − 2 + 4 − 8 + 16 − 32 + · · ·

then by multiplying it by 2 we obtain

2S = 2 − 4 + 8 − 16 + 32 − 64 + · · ·

if we add these equations we might come to the conclusion that 3S = 1 or S = 13 , however this
result is clearly incorrect. To avoid making such mistakes we have introduce methods for dealing
with infinite series correctly.

4.4.1 Convergence of an infinite series


We have already seen that series and sequences are closely related. When the sum S n of a series
of n terms tends to a limit as n → ∞ we say it is convergent. Provided that we can express S n
is a simple form it is usually easy to say whether or not the series converges. When considering
infinite series, the sequence of partial terms is taken to the limit.

55
Example
We wish to examine the following series for convergence

a) 1 + 3 + 5 + 7 + 9 + · · ·
b) 12 + 22 + 32 + 42 +
1 1 1 1
c) 1 + + + + +···
2 4 8 16
1 1 1 1
d) + + + +···
1×2 2×3 3×4 4×5
a) The first case is an arithmetic sequence which we can write as
n−1
X
Sn = (2k + 1) = 1 + 3 + 5 + · · · + (2n − 1) = n2
k=0

we can see that Sn → ∞ as n → ∞ and the series does not converge to a limits. It is an example
of a divergent series.
b) The second case can be written as
1
Sn = 12 + 22 + 32 + · · · + · · · n2 = n(n + 1)(2n + 1)
6
This is another example where Sn → ∞ as n → ∞, ie the series is divergent.
c) For the third example
1 1 1
Sn = 1 + + + · · · + n−1
2 4 2
we have a geometric sequence, the sum can be written as

1 − 21n
 
1
Sn = =2 1− n
1 − 12 2

we have that as n → ∞, Sn → 2, hence the sum converges to 2.


d) In the final example we have
n n n
1 1 1 1 1 X 1 X1 X 1
Sn = + + + +···+ = = −
2 6 12 20 n(n + 1) k=1 k(k + 1) k=1 k k=1 k + 1

Expanding we have
1 1 1 1 1 1 1 1
Sn = 1 − + − + − +···+ − =1−
2 2 3 3 4 n n+1 n+1
thus as n → ∞, Sn → 1, hence the sum converges to 1.

4.4.2 Tests of convergence of positive series


Unfortunately the sum of a series can’t always be expressed in a closed form expression. For
such cases we use a series of tests to examine the convergence of a series.

56
Comparison Test
Given a sequence ∞
P
k=0 ck which consists
P∞ of positive terms (ck ≥ 0 for all k) which is convergent,
P∞
P∞ k=0 uk of positive terms such that uk ≤ ck then
then if we have a different series, P∞ k=0 uk is
convergent also. Note that if k=0 ck diverges and uk ≥ ck ≥ 0 for all k then k=0 uk also
diverges.

D’Alembert’s ratio test


Given a series of positive terms ∞ un+1
P
k=0 uk and that limn→∞ un = ` exists. Then D’Alembert’s
ratio test says that this series is convergent if ` < 1 and divergent if ` > 1. For ` = 1 it is not
possible to use D’Alembert test to determine whether the series converges or not.
Example
Determine whether the following sequences are convergent
∞ ∞
X 2k X 2k
a) b)
k=0
k! k=0
(k + 1)2

Solution
a) Using D’Alembert’s ratio test we write un = 2n /n! giving

un+1 2k+1 n! 2
= k =
un 2 (n + 1)! n+1

which tends to zero as n → ∞. Thus the series is convergent.


b) Again using D’Alembert’s ratio test we have
 n+1
2 (n + 1)2
  
4 2
lim = lim 2 − + =2
n→∞ 2n (n + 2)2 n→∞ n + 2 (n + 2)2

which follows by using partial fractions, hence the series diverges.

Necessary condition for convergence


This states that for convergence of any series we need that the terms of the series mustPtend to
zero as n → ∞. One way to test for divergence is that if un → u 6= 0 as n → ∞ then ∞ k=0 uk
is divergent.
Care is required, since although un → 0 as n → ∞ is required for convergence it does not
guarantee convergence!

4.4.3 Absolute convergence of a general series


We have just spoken about a number of tests can be applied when our series has positive terms.
In general a series S given by

X
S= uk
k=0

may have both positive and negative terms. Now, if we consider the series

X
T = |uk |
k=0

57
and it turns out that T is convergent, then we say that S is absolutely convergent.
We can test for absolute convergence by extending our earlier convergence tests for positive
series. For example, extending the D’Alembert test we have

X
un+1
if limn→∞ un < 1 then uk is absolutely convergent
k=0

X
un+1
if limn→∞ un > 1 then uk is divergent
k=0

un+1
if limn→∞ un = 1 then no conclusion can be made
P P
The product of two absolutely convergent series A = an and B = bn is also an absolutely
convergent series.
There are convergent sequences that are not absolutely convergent series, the most common
series of this type are alternating series, where un changes in sign. For example if
|un | < |un−1 | for all n and un → 0 as n → ∞
then the series is convergent even if the series is not absolutely convergent.

4.5 Power Series


A power series is a series of the type
a 0 + a 1 x + a 2 x2 + a 3 x3 + · · · + a n xn + · · ·
where a0 , a1 , a2 , · · · are independent of x

4.5.1 Convergence of power series


Power series often converge for certain value for x,and diverge for others. We can use D’Alembert’s
ratio test to investigate the convergence of power series
an+1 xn+1

lim <1
n→∞ a n xn
Thus the sequences converges if

an+1 an
|x| lim <1 or |x| < lim
n→∞ an n→∞ an+1

Another way to interpret this is if we denote r = lim n∞ |an /an+1 | then we see that the series is
absolutely convergent for −r < x < r and divergent outside these limits, ie x > r and x < −r.
The convergence behaviour at x = ±r has to be determined by other means. We call r the radius
of convergence.

4.5.2 Binomial Series


The first power series that we wish to explore in more detail is the binomial series. If n > 0 is
some positive integer then we can write expansions of (1 + x)n as
n(n − 1) 2 n(n − 1)(n − 2) 3
(1 + x)n = 1 + nx + x + x + · · · + xn
2! 3!

58
this says that we can expand (1 − x)n into n terms. We call this the Binomial theorem or
Binomial Series. When n is no longer a positive integer, but is some real number, we get a
alternative form of the Binomial form which consists of an infinite series
n(n − 1) 2 n(n − 1)(n − 2) 3
(1 + x)n = 1 + nx + x + x +··· only for − 1 < x < 1
2! 3!
Note that when n is any real number the series is infinite and only valid for −1 < x < 1.
Example
Obtain the form of the expansion of 1/(` − x)2 by writing down the first four terms. Write down
the condition required for convergence of the series.
Solution
First we write
1 1 1  x −2
= 2 = 1 −
(` − x)2 `2 1 − x` `2 `

2
Now we can use the Binomial theorem to expand 1 − x`
 x −2  x  (−2)(−3)  x 2 (−2)((−3)(−4)  x 3
1− = 1 + (−2) − + − + − +···
` ` 2! ` 3! `
2x 3x2 4x3
= 1+ + 2 + 3 +···
` ` `
Thus
1  x −2 1 2x 3x2 4x3
1 − = + + 4 + 5 +···
`2 ` `2 `3 ` `
Therefore an = n/`n+1 , so
n`n+2

an n` `
|x| < lim = lim = lim = lim ` − = |`|
n→∞ an+1 n→∞ (n + 1)`n+1 n→∞ (n + 1) n→∞ (n + 1)

Hence |x| < |`| for convergence.

4.5.3 Maclaurin Series


The next series that we wish to consider is the Maclaurin series. This takes the form
x2 00 x3
f (x) = f (0) + xf 0 (0) + f (0) + f 000 (0) + · · · (4.9)
2! 3!
which is an infinite series, although good approximations can often be obtained by using just a
few terms.
Example
Write down the first four terms of the Maclaurin series for f (x) = ex
Solution
Using equation (4.9) we have

x2 0 x3 0
ex = e0 + xe0 + e + e +···
2! 3!
2 3
x x
= 1+x+ + +···
2! 3!

59
We can apply the Maclaurin series to obtain a range series for common functions. Some
examples are given below

x x2 x3 xn
e = 1+x+ + +···+ +···
2! 3! n!
x2 x3 xn
e−x = 1−x+ − + · · · + (−1)n + · · ·
2! 3! n!
x2 x3 x4 xn+1
ln(1 + x) = x− + − + · · · + (−1)n +···
2 3 4 n+1
x2 x4 x6 x2n
cosh x = 1+ + + +···+ +···
2! 4! 6! (2n)!
x3 x5 x7 x2n+1
sinh x = x+ + + +···+ +···
3! 5! 7! (2n + 1)!
x2 x4 x6 x2n
cos x = 1− + − + · · · + (−1)n +···
2! 4! 6! (2n)!
x3 x5 x7 x2n+1
sin x = x− + − + · · · + (−1)n +···
3! 5! 7! (2n + 1)!

which are valid for all x. Note that for cos x and sin x, the expansion are only valid when x is
measured in radians.

Small angle approximation


An important consequence of these series expansions is the small angle approximation of the cos
and sin functions. If x is small, and measured in radians, then we can approximate cos x and
sin x by
x2
cos x ≈ 1 − sin x ≈ x (4.10)
2
we call this the small angle approximation. These approximations make sense since if x is
sufficiently small higher order powers of x such as x3 , x4 , ... quickly become very small

4.5.4 Taylor series


The Taylor series is very similar to the Maclaurin series. Instead of expanding f (x) about the
origin, we now expand it about some point x = a, giving the Taylor series

(x − a)2 00 (x − a)3 000


f (x) = f (a) + (x − a)f 0 (a) + f (a) + f (a) + · · · (4.11)
2! 3!
Note that if we substitute a = 0 into this equation we get the Maclaurin series. The series is
clearly an infinite series. Taylor series are commonly written also in the following form

(x − a)2 00 (x − a)3 000 (x − a)n (n)


f (x) = f (a) + (x − a)f 0 (a) + f (a) + f (a) + · · · + f (a) + Rn (x)
2! 3! n!
(4.12)
where Rn is called the remainder and is defined as follows

(x − a)n+1 n+1
Rn = f (ξ) a<ξ<x (4.13)
(n + 1)!

60
which says that all the remaining terms in the infinite series can summed to form the remainder.
The remainder consists of working out the n + 1th derivative of f (x) at some unknown point
lying between a and x.
Taylor series is often used in the derivation of approximate numerical methods, we consider
a simple application in the following example.
Example
Consider two points x = a and x = a + h. Use Taylor series to find a simple way to approximate
the derivative to the function f (x) at the point x = a.
Solution
The simplest approximation to the derivative will just involve the x coordinates and evaluation of
the function. If we write a Taylor series expansion for the point x = a + h we obtain

h2 00 h3
f (a + h) = f (a) + hf 0 (a) + f (a) + +···
2! 3!
We can rewrite this as
f (a + h) = f (a) + hf 0 (a) + O(h2 ) (4.14)
where the O(h2 ) stands for the fact that additional terms involve terms like h2 and higher powers
of h. Now if h is sufficiently small we can ignore these higher order terms and write

f (a + h) − f (a)
f 0 (a) ≈
h
which gives us an approximation to the derivative at x = a.

Taylor series for functions of more than one variable


We note that Taylor can also be extended to functions of more than one variable. For example,
Taylor series for functions of two variables is given by

 
1 ∂ ∂
g(x, y) = g(a, b) + (x − a) + (y − b) g(a, b) +
1! ∂x ∂y
2
∂2 2
 
1 2 ∂ 2 ∂
+ (x − a) + (x − a)(y − b) + (y − b) g(a, b) + · ·(4.15)
·
2! ∂x2 ∂x∂y ∂y 2

which is often used in deriving approximate numerical methods for problems involving functions
of two variables.

61
Chapter 5

Differential Equations

In this chapter we shall discuss differential equations. A differential equation is an equation


which involves derivatives, an equation which contains integrals is an integral equation and
an equation containing both derivatives and integrals is an integro–differential equation. Our
interest lies here with trying to find the solution to certain classifications of differential equations.
Indeed, as we will see shortly, we already have the tools at our disposal to solve certain
differential equations. Lets begin by talking about some of the classifications of differential
equations.

5.1 Classification of differential equations


It turns out that there are many different methods to solve differential equations. So that we know
what method we should apply to solve a particular differential equation it is useful to classify the
different types of differential equation.

5.1.1 Ordinary and partial differential equations


Differential equations may either involve normal or partial derivatives. Differential equations
which only involve normal derivatives are called ordinary differential equations and are some-
times abbreviated as ODE’s, differential equations which involve partial derivatives are called
partial differential equations or PDE’s for short. Thus
∂f ∂f
+ = 2x2 + 4y
∂x ∂y
is an example of a partial differential equation where as
d2 f df
2
− 4x = cos 2x
dx dx
is an example of an ordinary differential equation.
Here we restrict consideration to ordinary differential equations. Partial differential equations
will be dealt with in later courses.

5.1.2 Independent and dependent variables


The variables to which differentiation occurs are called the independent variables while those
which are being differentiated are called the dependent variables. These names reflect that a dif-
ferential equation expresses the way in which the dependent variable (or variables) depend on the

62
independent variable (or variables). Ordinary differential equations have only a single indepen-
dent variable where as partial differential equations have two or dependent variables. A single
ordinary differential equation usually consists of one dependent variable and one independent
variable.
In the ordinary differential equation

d2 f df
+ 2x = sin 2x
dx2 dx
the independent variable is x and the dependent variable is f . The two ordinary differential
equations
dx dy
+ 2 − 2x + 3y = cosh t
dt dt
dx dy
2 + 3 + 5x + 2y = sinh t
dt dt
are coupled and the independent variable is t and the dependent variables are x and y.

5.1.3 Order of a differential equation


To further classify a differential equation we often talk about its order. The order of a differential
equation is the degree of the highest derivative in the differential equation. Thus

d2 f df
2
+ 2x = sin 2x
dx dx
is a second order differential equation. The coupled differential equations
dx dy
+ 2 − 2x + 3y = cosh t
dt dt
dx dy
2 + 3 + 5x + 2y = sinh t
dt dt
are both first order. Also the differential equation
 2
dx dx
+4 =0
dy dy
 2
dx
is first order despite the term dy
.

5.1.4 Linear and non–linear equations


Linear differential equations are those in which the dependent variable (or variables) and their
derivatives do not occur as products, raised to powers or in non–linear functions. Nonlinear
equations are those which are not linear.
The coupled equations
dx dy
+ 2 − 2x + 3y = cosh t
dt dt
dx dy
2 + 3 + 5x + 2y = sinh t
dt dt

63
are examples of linear differential equations. Whereas
 2
dx dx
+4 = 0
dy dy
d2 x dx
2
+x = 4 sin t
dt dt
dx
4 + sin x = 0
dt
are all non–linear differential equations.

5.1.5 Homogeneous and non–homogeneous equations


Note that in all the examples we have presented so far all the terms involving the dependent
variable appear on the left hand side of the equation and all those involving the independent
variable appear on the right. When linear equations are arranged in this way and the right hand
side is zero we call it a homogeneous differential equation. And when the right hand side of
a linear equation is not zero we call it a non–homogeneous differential equation. Thus the
equations
dx
+ 4x = 0
dt
dx
4 + x sin t = 0
dt
are homogeneous differential equations. The equations
d2 x dx
2
+t = 4 sin t
dt dt
d2 f df
2
− 4x = cos 2x
dx dx
are non–homogeneous differential equations.

5.2 First order differential equation


5.2.1 Implicit and explicit solutions
We consider first order ODE’s that can be put in the form
dy
= f (x, y) (5.1)
dx
here f is any function of x and y. We say that y = Φ(x) is an explicit solution to ( 5.1) on the
interval I if y = Φ(x) satisfies (5.1) for all x ∈ I. The interval is defined as

I = (a, b) = {x : x ∈ R, a < x < b} (5.2)

This implies that


dy
= Φ0 (x) = f (x, Φ(x)) for all x ∈ I (5.3)
dx
We say that the equation
G(x, y) = 0

64
is an implicit solution to (5.1), ie if when you differentiate G implicitly with respect to x you get
(5.1).
In what follows we shall only be interested in obtaining implicit solutions to ODE’s.
Example
Show that x + y + exy = 0 is an implicit solution to the differential equation
dy
(1 + xexy ) + 1 + yexy = 0
dx
Solution
Differentiating x + y + exy = 0 with respect to x gives
d
(x + y + exy ) = 0 (5.4)
dx  
dy xy dy
1+ +e y+x = 0
dx dx
dy
(1 + xexy ) + 1 + yexy = 0 (5.5)
dx
and so x + y + exy = 0 is an implicit solution to the differential equation.

5.2.2 General and Particular Solutions


Some differential equations have infinitely many solutions. For example, as we will see shortly
dy
the differential equations dx = y has infinitely many solutions of y = Aex where A is any real
constant. We say that this is the general solution of the differential solution. The general
solution of a first order differential equation has one arbitrary constant. A solution to an ODE
that has no arbitrary constants is called a particular solution. The particular solution is generally
given by numerical values to the constants in the general solution.

5.2.3 Boundary and initial conditions


To obtain the particular solution to a first order differential equation (ie to ensure that it has just
one solution), we have to specify a boundary condition. The boundary conditions specify a
value of the dependent variable at a particular value of the independent variable. In the special
case where all boundary conditions are given at the same value of the independent variable the
boundary conditions are called initial conditions.
A differential equation together with its boundary conditions is called a boundary value
problem. A differential equation together with its initial conditions is called a initial value
problem.
Example
dy
The differential equation dx = y has the general solution y = Aex . Work out the particular
solution for the case when y(0) = 1.
Solution
By substituting y(0) = Ae0 = 1 we find that A = 1 and thus have the solution y = ex

5.2.4 Variable Separable Type


ODE’s of the form
dy
= g(y)h(x) (5.6)
dx

65
are called variable separable type differential equations. This means that f (x, y) can be written
as f (x, y) = g(y)h(x), ie a function of y times a function of x. Note that not every function can
be written in this way (eg f (x, y) = 1 + xy).
To solve variable separable type differential equations, assuming that g(y) 6= 0 we write
dy
= h(x)dx
g(y)
so that the terms on the right hand side of the equation are involving y and those on the left just
involve x. Next we integrate to get the general solution.
dy
Z Z
= h(x)dx + A
g(y)

Example
dy
Determine the general solution to the differential equation dx =y
Solution
We first assume y 6= 0 and write dy
y
= dx and integrating we get

dy
Z Z
= dx
y
ln |y| = x + B
|y| = ex+B = Cex

where C is a positive constant. Now |y| could mean either y or −y so that

y = ±Cex
y = Aex

where A is a nonzero constant. But, y = 0 is also a solution and so y = De x with D any real
constant.
Example
dy y−1
Determine the general solution to the differential equation dx = x+3 . Find the particular solution
for which y(0) = −1
Solution
dy dx
We first assume y − 1 6= 0 and write y−1 = x+3 integrating gives

dy dx
Z Z
=
y−1 x+3
ln |y − 1| = ln |x + 3| + A
|y − 1| = eln |x+3|+A = eA |x + 3|
|y − 1| = B|x + 3| (5.7)

where B is a positive constant. We remember that |X| = |Y | implies that X = Y or X = −Y


so that the general solution is

y − 1 = ±B(x + 3)
y − 1 = C(x + 3)

where C is nonzero constant. The particular solution for y(0) = −1 gives C = − 23 and y − 1 =
− 32 (x + 3)

66
5.2.5 Separable after substitution type
Some first order differential equations are not directly separable but become separable after mak-
ing a simple substitution. Any first order differential equation that can be put in the form
dy y
=k
dx x
where k(·) is a function of a single variable is differential equation of this type.
Then if we put v = xy where v is a function of x we obtain an ODE that is satisfied by v and
x and can be solved for v and hence for y. To see this, if we set y = vx then
dy dv
=v+x
dx dx
by the product rule and thus we can write
dy y dv
=k = k(v) = v + x
dx x dx
so that we have
dv k(v) − v
=
dx x
which is of the separable type with general solution
dv dx
Z Z
= +A
k(v) − v x

After integrating we replace v by y/x.

67
Example
Find the general solution to the first order ODE
dy
3xy 2 = x3 + y 3
dx
Solution
dy x3 +y 3
We observe that dx
= 3xy 2
is not of the separable type. If we divide the top and bottom by x3
we get
dy 1 + (y/x)3 1 + t3
= = k(y/x) wherek(t) =
dx 3(y/x)2 3t2
This is the separable after substitution type so we let v = y/x or y = vx. Thus

dy dv 1 + v3
=v+x =
dx dx 3v 2
dv 1 + v3 1 − 2v 3
x = − v =
dx 3v 2 3v 2
dv 1 1−2v 3 1−2v 3
and we have separable differential equation dx
= x 3v 2
and if we that assume 3v 2
6= 0 we get

3v 2 dx
Z Z
dv =
1 − 2v 3 x
1
− ln |1 − 2v 3 | = ln |x| + A
2 p
−A = ln(|x| |1 − 2v 3 |)
p
e−A = B = |x| |1 − 2v 3 |

where B is any real non–zero constant, inserting v = y/x and squaring gives

|x3 − 2y 3 |
x2 3
= B2 |x3 − 2y 3 | = B 2 |x|
|x |

Thus we have
(x3 − 2y 3 ) = ±B 2 x (x3 − 2y 3 ) = Cx
where C is any non zero constant. If we substitute C = 0 we get
1  y 3
x3 − 2y 3 = 0 x3 = 2y 3 = = v3
2 x
dv
thus v 3 = 1/2. In turns out that this is indeed a solution to the differential equation dx
and is
3
exactly the solution for which 1−2v
3v 2
= 0. Thus the general solution is

(x3 − 2y 3 ) = Cx

with C any real number.

5.2.6 Linear Type


Most general first order linear type ODE’s are of the form
dy
R(x) + S(x)y = T (x)
dx

68
where R(x), S(x) and T (x) are given functions of x. Note that if T (x) = 0 then the ODE is of
the separable type already discussed. For cases when T (x) 6= 0 then we put the equation into
standard form by dividing by R(x) to get

dy
+ N (x)y = M (x)
dx
where N (x) = S(x)/R(x) and M (x) = T (x)/R(x). R
To solve this type of ODE we multiply the equation by e N (x)dx . This is called the integrating
factor of the ODE and gives

N (x)dx dy
R R R
N (x)dx N (x)dx
e + yN (x)e = M (x)e
dx
Now
d  R N (x)dx  R dy d  R N (x)dx 
e y = e N (x)dx +y e
dx dx dx
R dy R
= e N (x)dx + yN (x)e N (x)dx
dx
So that we have the ODE
d  R N (x)dx  R
e y = M (x)e N (x)dx
dx
When we integrate this equation we get
R
Z  R 
N (x)dx
e y= M (x)e N (x)dx dx + A

Hence the general solution to the equation is


R
Z  R   R
− N (x)dx N (x)dx
y=e M (x)e dx + Ae− N (x)dx

69
Example
Find the general solution to the ODE

dy x4
x −y = √ with x > 0
dx 1 + x3
and find the particular solution that satisfies y(2) = 6.
Solution
We first write the equation in standard form

dy 1 x3
− y=√
dx x 1 + x3
In this case N (x) = −1/x and the integrating factor is
R 1 −1 ln 1 1 1
e− x
dx
= e− ln |x| = eln |x| =e |x| = =
|x| x

since x > 0. If we multiply the differential equation by the integrating factor we get

1 dy 1 x2
− 2y = √
x dx x 1 + x3
x2
 
d 1
y = √
dx x 1 + x3
If we integrate both sides we get

1 x2
Z
y = √ dx + A
x 1 + x3
1 2√
y = 1 + x3 + A
x 3
2 √
y = x 1 + x3 + Ax
3
where A is any real constant. The particular solution for which y(2) = 6 gives
2 √
6= · 2 · 9 + 2A hence A = 1
3
Thus
2√
 
y=x 1 + x3 + 1
3

5.2.7 More specialised types


Type A
We can solve ODE’s of the type
dy
= g(ax + by)
dx

70
y Y

y=k
X

x=l x

Figure 5.1: Change of axis to (X, Y )

where a and b are known constants and g is a known function. By using the substitutionz =
ax + by we have that
dz dy
=a+b (5.8)
dx dx
So that we can write
 
dy 1 dz dz
= − a = g(z) and = a + bg(z)
dx b dx dx

This equation is now of a separable type in z and x and has solution


dz
Z Z
= dx + A
a + bg(z)

Type B
An ODE of the type
dy ax + by + e
=
dx cx + f y + g
is not separable but we can make a simple substitution to make it the same as in type A or
separable after a substitution so that we can solve it. Let us suppose that

ax + by + e = 0
cx + f y + g = 0

represent two lines. If these two lines are parallel then cx + f y = λ(ax + by) for some constant
λ. If λ exists then we can write
dy ax + by + e t+e
= = h(ax + by) where h(t) =
dx λ(ax + by) + g λt + g

and thus we have an equation which is of type A.


If the two lines are not parallel, they intersect say at the point (`, k). We change the coordinate
axis from (x, y) to (X, Y ) as shown in Figure 5.1, so the position of the new origin in the old
coordinate system is (`, k). Thus

X =x−` Y =y−k

71
The equation of the 2 straight lines in the (X, Y ) coordinate system are

aX + bY = 0
cX + f Y = 0

and therefore the ODE can be re–written as


dY aX + bY
=
dX cX + f Y

which is of the separable type after substitution and can be solved by putting v = Y /X

Type C
The final first order type that we wish to explore are ODE’s of the form
dy
+ P (x)y = Q(x)y n
dx
when n 6= 0. The is also known as Bernoulli’s equation. We note that when n = 0 then this
is a first order linear equation and when n = 1 then the equation is a first order linear separable
equation.
To solve this type of equation we assume that y 6= 0 and divide both sides by y n to get
dy
y −n + P (x)y 1−n = Q(x)
dx
dz dy
If we set z = y 1−n then dx
= (1 − n)y −n dx . Thus the differential equation becomes

1 dz
+ P (x)z = Q(x)
1 − n dx
which is a first order linear ODE in Z and x. If we express it in standard form we have
dz
+ (1 − n)P (x)z = (1 − n)Q(x)
dx
R
(1−n)P (x)dx
and it has integrating factor e . Thus we can solve for z and substitute back to get y.

72
Example
Find the general solution to the ODE
dy 5
− 5y = − xy 3
dx 2
Solution
We recognise it as an example of the Bernoulli equation. Assuming that y 6= 0 and dividing by
y 3 we get
dy 5
y −3 − 5y −2 = − x
dx 2
dz dy
If we let z = y −2 then dx
= −2y −3 dx then the ODE becomes

1 dz 5
− − 5z = − x
2 dx 2
which when expressed in standard form is
dz
+ 10z = 5x
dx
R
10dx
The integrating factor is e = e10x . Multiplying by the integrating factor gives
dz
e10x + 10ze10x = 5xe10x
dx
d 10x 
e z = 5xe10x
dx  10x Z 10x 
xe e
Z
10x 10x
e z = 5 xe dx = 5 − dx
10 10
 10x
e10x

xe
= 5 − +A
10 100

where A is an arbitrary constant of integration. We have that


x 1 1 x 1
z= − + Ae−10x 2
= − + Ae−10x
2 20 y 2 20
Earlier we made the assumption that y 6= 0 however, y = 0 also satisfies the ODE so it is also a
solution.

5.3 Second Order ODE’s


For simplicity we shall only consider second order linear ODE’s. These are equations of the form

d2 y dy
2
+ P (x) + Q(x)y = f (x) (5.9)
dx dx
here P (x), Q(x) and f (x) are all given continuous functions.

73
5.3.1 Homogeneous equations
For the special case where f (x) = 0 in (5.9) then

d2 y dy
2
+ P (x) + Q(x)y = 0 (5.10)
dx dx
and this is called a second order homogeneous differential equation. The general solution to
equations of this form is
y(x) = A1 y1 (x) + A2 y2 (x) (5.11)
where A1 and A2 are arbitrary constants and y1 (x) and y2 (x) are any linearly independent so-
lutions to (5.10). We first came across linear independence when talking about vectors, when
applied to scalers this means that y1 (x) is not a multiple of y2 (x).

5.3.2 Linear equations


We can use the general solution to (5.10) to get the general solution to (5.9). All we need to find
is a particular solution y = p(x) to (5.9) then the general solution to (5.9) is given by

y(x) = A1 y1 (x) + A2 y2 (x) + p(x) (5.12)

in other words the general solution to a second order ODE is the general solution to (5.10) plus a
particular solution to (5.9).
We can check this as follows, if y = A1 y1 + A2 y2 + p then

y 0 = A1 y10 + A2 y20 + p0 y 00 = A1 y100 + A2 y200 + p00

We note that y100 + P (x)y10 + Q(x)y10 = 0, y200 + P (x)y20 + Q(x)y20 = 0, Q(x)y = (A1 y1 + A2 y2 +
p)Q(x) and P (x)y 0 = (A1 y10 + A2 y20 + p0 )P (x). Thus we have

y 00 + P (x)y 0 + Q(x)y = [A1 y100 + A2 y200 + p00 ] + P (x)[A1 y10 + A2 y20 + p0 ] + Q(x)[A1 y1 + A2 y2 + p]
= p00 + P (x)p0 + Q(x)p = f (x)

Hence the general solution to (5.9) is

y(x) = general solution of the homogeneous equation + any particular solution to (5.9)

We call the general solution to the homogeneous equation the complementary function and the
particular solution the particular integral.

5.3.3 Linear equations with constant coefficients


We restrict consideration to equations of the type

d2 y dy
2
+ a1 + a0 y = f (x) (5.13)
dx dx
where a1 and a0 are constants and f (x) is continuous. To obtain the solution we need to find the
complementary function and the particular solution.

74
To find the complementary function
This is the solution to the differential equation
d2 y dy
2
+ a1 + a0 y = 0 (5.14)
dx dx
to find the solution to this equation, we first write down the polynomial equation
m2 + a 1 m + a 0 m = 0 (5.15)
this is an equation in m and is called the auxiliary equation. We find the roots of this equation
m = m1 , m2 say. The general solution to (5.14) then are
• If the roots m1 and m2 are real and m1 is different from m2 then the the complementary
function is of the form
y = A 1 e m1 x + A 2 e m2 x
where A1 , A2 are arbitrary constants
• If the roots are equal m1 = m2 then the complementary function is given by
y = (A1 + A2 x)em1 x
where A1 , A2 are arbitrary constants
• If the roots are complex then m1 and m2 are complex conjugates say p ± jq then the
complementary function is
y = epx (A1 cos qx + A2 sin qx)
where A1 , A2 are arbitrary constants
Example
Find the general solution to the ODE

d2 x dx
2
+2 + 10x = 0
dt dt
Solution
We first write down the auxiliary equation

m2 + 2m + 10 = 0

which has roots √


−2 ± 4 − 40
m= = −1 ± j3
2
Thus the general solution is x = e−t (A1 cos 3t + A2 sin 3t) and A1 , A2 are real constants.

To find the particular integral


To find a solution to the equation
d2 y dy
2
+ a1 + a0 y = f (x) (5.16)
dx dx
we use the trial method. In this method we make a guess depending on the form of f (x) and the
complementary function. Then we substitute our guess into the ODE.

75
• Suppose that f (x) = Aekx where A and k are given constants.

– If k is not a root of the auxiliary equation, try y(x) = aekx


– If k is a simple root of the auxiliary equation, try y(x) = axekx
– If k is a double root of the auxiliary equation, try y(x) = ax2 ekx

Example
Find the general solution to
d2 y dy
− = 5ex
dx dx
Solution
To find the complementary function, we first find the roots of the auxiliary equation m 2 − m =
m(m − 1) = 0. Hence the roots are m = 0 and m = 1. Thus the complementary function is

ycf = A1 e0x + A2 e1x = A1 + A2 ex

where A1 and A2 are arbitrary constants. Since m = 1 is a simple root of the auxiliary equation
we try y = axex . Thus
y 0 = aex (1 + x) y 00 = aex (2 + x)
and so y is a solution provided that

aex (2 + x) − aex (1 + x) = 5ex


aex = 5ex
a = 5
2 dy
Thus y = 5xex is a solution to ddxy − dx = 5ex and hence the particular integral is ypi = 5xex .
The general solution is
y = ycf + ypi = A1 + A2 ex + 5xex

• Suppose that f (x) = p0 + p1 x + · · · + pk xk where p0 , p1 , · · · , pk are given constants

– If 0 is not a root of the auxiliary equation try y(x) = b0 + b1 x + · · · + bk xk


– If 0 is a simple root of the auxiliary equation try y(x) = x(b0 + b1 x + · · · + bk xk )
– If 0 is a double root of the auxiliary equation try y(x) = x2 (b0 + b1 x + · · · + bk xk )
d2 y dy
In all cases substitute y(x) into dx
+ a1 dx + a0 y = f (x) and determine the constants
b0 , b1 , · · · , b k .

76
Example
Find the general solution to
d2 y
− 2y = x2 + 2 (5.17)
dx
Solution √
For the complementary function the auxiliary equation is m2 − 2 = 0 and has roots m = ± 2.
Thus the complementary function is
√ √
2x
ycf = A1 e + A 2 e− 2x

For the particular integral we try y = b0 + b1 x + b2 x2 where b0 , b1 , b2 are constants to be found.


Differentiating we have
y 0 = b1 + 2b2 x y 00 = 2b2
and substituting this into the differential equation gives

2b2 − 2(b0 + b1 x + b2 x2 ) = x2 + 2

Equating coefficients of x2 gives −2b2 = 1 so that b2 = −1/2. Equating coefficients of x gives


−2b1 = 0 and it follows that b1 = 0. Finally equating coefficients of x0 gives 2b2 − 2b0 = 2
which gives b0 = −3/2. Thus the particular integral is
3 1
ypi = − − x2 (5.18)
2 2
and the general solution is
√ √ 3 1 2
2x
y = ycf + ypi = A1 e + A 2 e− 2x
− − x
2 2

• Suppose that f (x) = A sin kx + B cos kx where A, B and k are given constants.

– If sin kx is not a term in the complementary function, try y = a cos kx + b sin kx


– If sin kx is a term in the complementary function try y = x(a cos kx + b sin kx)
d2 y dy
In all cases y(x) into dx
+ a1 dx + a0 y = f (x) and determine the constants a, b.
2
• Suppose that f (x) = f1 (x) + f2 (x) where y1 is a solution of ddxy + a1 dx
dy
+ a0 y = f1 (x) and
2
d y dy
y2 is a solution of dx + a1 dx + a0 y = f2 (x). Then y(x) = y1 (x) + y2 (x) is a solution of
d2 y dy
dx
+ a1 dx + a0 y = f (x).

77

S-ar putea să vă placă și