Documente Academic
Documente Profesional
Documente Cultură
P.D. Ledger
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
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
• 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.
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.
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.
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
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
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.
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
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 = β
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
.
Else
(j)
If possible determine a row index p ∈ {i, · · · , m} for which apj 6= 0 otherwise set j = j+1
and goto *.
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
End
Compute the solution set by back substitution
• 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.
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
• 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.
m x j’th column =
n m
B AB
A
j’th column
j of matrix B to obtain the element (AB)ij of matrix AB. Explicitly this given as
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
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
• 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
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 is invertible
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
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 = 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
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.
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 · · ·
· · · · · · · ·
• The determinate of a triangular matrix is equal to the product of the diagonal terms.
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
24
Furthermore the following statements are equivalent:
• det A 6= 0
• 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.
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.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
√
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
• 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
√
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
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
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
−λ
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
31
Chapter 3
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.
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.
• 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)
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
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
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
∂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
35
Example
Determine ∂f /∂x, ∂f /∂y and ∂f /∂z when
Solution
We obtain that
∂f
= yz 2 + 3y
∂x
∂f
= xz 2 + 3x
∂y
∂f
= 2xyz − 1
∂x
36
Example
Find ∂T /∂r and ∂T /∂θ when
T (x, y) = x2 + 2xy + y 3 x2
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)
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
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
Next, we multiply the first term by ∆x/∆x = 1 and the second term by ∆y/∆y = 1
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
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.
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
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
41
Example
Evaluate Z
(zdx + x2 dy − 2ydz)
C
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 DE y = −1 and ds = dx
• Along EA x = 1 and ds = dy
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
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
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ι
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)
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
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
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
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.
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
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
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
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.
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.
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.
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
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)
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
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
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
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.
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.
S = 1 − 2 + 4 − 8 + 16 − 32 + · · ·
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.
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
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.
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.
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
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.
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.
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)
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.
(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.
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
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.
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
.
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.
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.
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
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)
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
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
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
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
70
y Y
y=k
X
x=l x
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
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
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
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
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).
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
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)
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.
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
75
• Suppose that f (x) = Aekx where A and k are given constants.
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
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
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
2b2 − 2(b0 + b1 x + b2 x2 ) = x2 + 2
• Suppose that f (x) = A sin kx + B cos kx where A, B and k are given constants.
77