MAM2084 Notes v1.1
MAM2084 Notes v1.1
MAM2084F/S
T H O M A S VA N H E E R D E N
Contents
1 Fundamentals 5
Vectors & Vector Spaces 5
Linear Combinations 8
Systems of Linear Equations 9
Subspaces 14
Gauss Reduction 16
Generating Sets 19
Linear Independence 22
Basis & Dimension 25
2 Determinants 29
Calculating Determinants 30
Calculating Determinants by Gauss Reduction 32
Adjoints and Cramer’s Rule 37
An Important and Useful Fact About Determinants 38
3 Differential Equations 41
Separable Differential Equations 41
Exact Differential Equations 43
Linear Differential Equations 45
Linear Independence and the Wronskian 49
Linear, Homogeneous Differential Equations with Constant Coefficients 52
Variation of Parameters 55
4 university of cape town
4 Diagonalisation 59
A First Example 59
Eigenvalues and Eigenvectors 60
More Facts about Eigenvalues and Eigenvectors 64
Diagonalisation 67
Inner Products, Norms and Orthogonality 70
Orthogonal Diagonalisation 76
Quadratic Forms 79
Rotation and Reflection in R2 and R3 84
5 Laplace Transforms 87
The Basics 87
Some Useful Facts 90
The Inverse Transform 92
Solving Differential Equations 94
Convolution 96
Step Functions 98
1
Fundamentals
The first of these fundamental ideas are vectors and vector spaces.
What is a vector? You may already have some idea from your previ-
ous courses.
These definitions are not wrong, but they are very narrow. We are
going to introduce a much broader, more general definition which
encompasses the answers above, and includes other useful objects.
Definition. We call the set V = {u, v, w, . . .} a vector space and its This definition is not rigorous – if
elements vectors if you are interested you can find the
formal definition of a vector space on
Wikipedia.
6 university of cape town
R3 = {( x1 , x2 , x3 )| xi ∈ R}
u1 v1 u1 + v1
Let u = u2 and v = v2 . Then u + v = u2 + v2 .
u3 v3 u3 + v3
1 5 6
Let u = 6 and v = 0 . Then u + v = 6 .
−3 2 −1
1 3
Let u = 6 and α = 3. Then αu = 18 .
−3 −9
We can show that Rn is a vector space similarly.
At this point you might start thinking that all sets are closed under
any operation. After all, it seems so obvious for vector addition and
scalar multiplication. This is not true. The dot product u · v combines
two vectors but gives a scalar as a result. R3 is not closed under the
dot product.
Example. RR
The second set we look at is the set of all functions R → R, i.e.
all functions that take any real number as an input, and give a real
number as an output.
RR = { f : R → R }
At this point you might start thinking that all vector spaces are
infinitely big. After all, if we take any element of the vector space u
then all the multiples αu should also be in the vector space since the
space is closed under scalar multiplication. This does not necessarily
mean the space is infinite, as we see in the final example below.
Example. F32 (Binary codes of length 3)
F2 is the set {0, 1} and F32 is just three copies of this set:
F32 = {( a, b, c)| a, b, c ∈ F2 } .
This is a finite set – it has only eight elements. Three are listed
below:
Let u = (1, 1, 1)
v = (1, 1, 0)
w = (0, 0, 1)
This example might seem a little contrived and useless for any-
thing other than scaring engineers who refuse to eat their vegeta-
bles. It’s not. The theory of codes is incredibly important in modern
telecommunications. Unfortunately there isn’t enough time to cover
this in any depth, but if you are interested in reading up by your-
self you could start by looking at the Wikipedia page for Hamming
codes.
Linear Combinations
! !
1 −2
Example. Give all possible linear combinations of the vectors , ∈ R2
0 1
mam2084f/s 9
After some thought, and perhaps consulting Figure 1.2, we might (x,y)
realise that any vector in R2 can be written as a linear combination
of these two vectors, i.e. S = R2 . We will revisit this idea later in the
course.
Example. Give all possible linear combinations of the vectors
f ( x ) = 2x2 , g( x ) = π, h( x ) = −3x ∈ RR .
Solution. The set of all possible linear combinations is Figure 1.2: Two noncollinear vectors
generate a plane.
S = {α f ( x ) + βg( x ) + γh( x ); α, β, γ ∈ R} .
Again, after some thought we may realise that this can be simplified.
The resulting set S is the set of all polynomials of degree two or less,
i.e. n o
S = ax2 + bx + c; a, b, c ∈ R .
Example. Give all possible linear combinations of the vectors (1, 1, 0), (0, 1, 0) ∈ F32 .
Solution. The set of all possible linear combinations is
S = {( a, b, 0); a, b ∈ F2 } .
Ax = b.
The i-th entry of the vectors x and b are xi and bi respectively, and
the entry in the i-th row and j-th column of A is the coefficient aij .
Definition. If a system of linear equations doesn’t have a solution
we call it inconsistent. If it has at least one solution we call it consis-
tent.
Fact 1.1. The result of the matrix multiplication Ax is a linear combination
of the columns of A, i.e.
a11 a12 a1n
a21 a22 a2n
Ax = x +
.. 1 .. 2
x + . . . + .. xn .
(1.1)
. . .
am1 am2 amn
2. T (αu) = αT (u)
for any vectors u and v in V and any scalar α associated with V.
Fact 1.3. Every linear transformation from Rn to Rm can be represented by
an m × n matrix, and every m × n matrix corresponds to a linear transfor-
mation between Rn and Rm .
! !
1 1
Example. A linear transformation T sends to and it
0 1
! !
−2 0
sends the vector to . Find its matrix representation.
1 −2
mam2084f/s 11
We have used the linearity of T to move from the first line to the
second. The information given completely describes a linear trans-
formation, so let’s find it. Let A be the matrix that represents this
transformation. Remember that the matrix multiplication Ax is just a
linear combination of the columns of A.
! ! ! ! !
1 a11 a12 1 1 a12
A = 1× +0× = ⇒A=
0 a21 a22 1 1 a22
and
! ! ! ! !
−2 1 a12 0 1 2
A = −2 × +1× = ⇒A=
1 1 a22 −2 1 0
Homogeneous Systems
Fact 1.5. If x and y are two solutions to a homogeneous system, then every
linear combination of x and y is a solution to that homogeneous system.
12 university of cape town
Inhomogeneous Systems
Definition. We call a system of linear equations inhomogeneous if it Figure 1.3: Null Space of a Projection
Matrix
has the form Ax = b and b 6= 0. Every inhomogeneous system has an
associated homogeneous system Ax = 0.
Fact 1.7. If x is a solution to an inhomogeneous system and z is a solution
to the associated homogeneous system, i.e. z ∈ NS( A), then x + z is a
solution to the inhomogeneous system.
Explanation. We have x and z that satisfy Ax = b and Az = 0.
Consider how x + z is transformed by the matrix A:
A(x + z) = Ax + Az
= b+0
=b
mam2084f/s 13
Fact 1.8. If x and y are two solutions to the inhomogeneous system then
x − y satisfies the associated homogeneous system, i.e. x − y ∈ NS( A).
Explanation. We have x and y that satisfy Ax = b and Ay = b.
Consider their difference, x − y:
A(x − y) = Ax − Ay
= b−b
=0
so A(x − y) = 0 as claimed.
Together these two facts imply that if we have a solution x to an
inhomogeneous system of linear equations we can generate another
solution by adding a solution to the associated homogeneous equa-
tion, and further, every other solution to the inhomogeneous system
can be generated in this way.
1. no solutions,
Subspaces
We use the same vector addition and scalar multiplication for S that
we do for V.
Example. Consider the following subsets of R2 and decide whether
or not they are subspaces.
( ! )
x
1. S = ; x 2 + y2 ≤ 1
y
( ! )
x
2. S = ; x ≥ 0, y ≥ 0
y
( ! )
x
3. S = ; y = 3x
y
Solution.
!
3
2. No. The set is not closed under scalar multiplication, e.g.
7
! !
3 −3
is in S but −1 = is not.
7 −7
Fact 1.11. Any vector space V has at least two subspaces, {0} and V
itself.
(a) R2 ,
(b) straight lines through the origin,
(c) the origin, i.e. {0}.
(a) R3 ,
(b) planes through the origin,
(c) straight lines through the origin,
16 university of cape town
Gauss Reduction
2. Move the leftmost, nonzero entry in the matrix to the top row
by interchanging rows if necessary. Scale the top row so that the
leftmost nonzero entry is 1. This entry is our first pivot element.
3. Make all the entries underneath the pivot equal to zero by sub-
tracting a suitable multiple of the pivot row from each row be-
neath it.
(0 0 . . . 0 | α ).
5. The leftmost, nonzero entry in the bottom row becomes our first
pivot element.
6. Make all the entries above the pivot equual to zero by subtracting
a suitable multiple of the pivot row from each row above it.
We subtract row 1 from row 2, and three copies of row 1 from row
3 to make all the entries in the first column under the pivot zero.
We indicate these changes to the matrix with following notation:
R2 → R2 − R1, R3 → R3 − 3R1.
1 4 1 2 1 4
0 −1 0 −1 0 −3 .
0 −6 0 −2 2 −10
Multiply the second row by negative one so that the first non-zero
entry in the row is one: R2 → − R2
1 4 1 2 1 4
0 1 0 1 0 3 .
0 −6 0 −2 2 −10
Add six copies of row two to row three to make the entry under
the pivot zero. We can also think of this as subtracting negative six
copies. In either case we denote it with: R3 → R3 + 6R2
1 4 1 2 1 4
0 1 0 1 0 3 .
0 0 0 4 2 8
Scale the third row so that the first non-zero entry is equal to one:
R3 → 41 R3
1 4 1 2 1 4
0 1 0 1 0 3 .
0 0 0 1 12 2
We work from right to left making entries above the pivot zero. We
subtract two copies of row three from row one and row three from
row two: R1 → R1 − 2R3, R2 → R2 − R3
1 4 1 0 0 0
0 1 0 0 − 12 1 .
1
0 0 0 1 2 2
−4 −1 −2
x = 0 +α 1 + β 0 .
0 0 1
We can do the same for the remaining two rows. After scaling the
final vector by a factor of two to remove the fractions we arrive at
the final answer
−4 −1 −4
1 0 1
x = 0 +α 1 + β 0 .
2 0 −1
0 0 2
Generating Sets
hSi
Let S ⊆ V and T ⊆ V. (S and T are subsets of V).
Definition. We denoted by hSi a new set that is formed by taking all
possible linear combinations of vectors in S. If hSi = T then we say
1
that T is generated by S, or that S is a generating set for T. 2
( !)
1
Example. If S = what is hSi?
2
Solution. Since S is a singleton set, i.e. it has only one element, all
the possible linear combinations of vectors in S will be just the scalar
multiples of that vector,
( ! )
1 Figure 1.4: The set generated by a single
hSi = α ;α ∈ R . vector in R2 is a straight line.
2
20 university of cape town
( ! !)
1 3
Example. If S = , what is hSi?
2 6
Solution. The set of all possible linear combinations is
( ! ! )
1 3
hSi = α +β ; α, β ∈ R .
2 6
( ! !)
1 1
Example. If S = , what is hSi?
2 0
Solution. The set of all possible linear combinations is
( ! ! )
1 1
hSi = α +β ; α, β ∈ R .
2 0
h S i = R2 ;
u = β 1 x1 + β 2 x2 + . . . + β n xn
v = γ1 y1 + γ2 y2 + . . . + γm ym
for some y j in S.
The addition of u and v is
u + v = β 1 x1 + β 2 x2 + . . . + β n xn + γ1 y1 + γ2 y2 + . . . + γm ym
mam2084f/s 21
n o
hSi = αx2 + βx + γ; α, β, γ ∈ R = T.
Linear Independence
α1 v1 + α2 v2 + . . . + αn vn = 0 (1.2)
is α1 = α2 = . . . = αn = 0.
Note that any set of vectors will have this trivial solution to (1.2).
We call the set linearly independent if it is the only solution. Con-
versely, some sets are linearly dependent.
Definition. We say that a set of vectors S = {v1 , v2 , v3 . . . vn } is
linearly dependent if (1.2) has at least one solution where one of the
coefficients αi 6= 0.
1
0 5
Example. Is S = 0 , 2 , 4 linearly dependent or
0
0 0
independent?
Solution. The set is linearly dependent since
1 0 5
5 0 + 2 2 − 4 = 0.
0 0 0
α1 v1 = 0.
After some Gauss reduction (do it) we see that this is equivalent to
1 4 2 0
0 −7 −1 0 .
0 0 −6 0
Fact 1.17. Consider a set S of two or more vectors. Then the following two
statements are equivalent:
1. S is linearly dependent.
Explanation. There are two steps to showing that Fact 1.17 is true.
First we must show linear dependence implies that one vector is a
linear combination of the others, then we must do the converse.
Assume that S is linearly dependent, i.e. there is an αk 6= 0 so that
α1 v1 + α2 v2 + . . . + αk vk + . . . αn vn = 0.
Now we can divide by −αk since this is non-zero and we see that
α1 α2 α α αn
− v1 − v2 − . . . − k−1 vk−1 − k+1 vk+1 − . . . − vn = vk .
αk αk αk αk αk
We have shown that vk is a linear combination of the other vectors.
Now assume that one vector in S can be expressed as a linear
combination of the others, i.e.
Rearrange:
αx2 + βx + γ = 0
and this must be true for any value of x. In particular it must be true
when x = 1, when x = 0 and when x = −1:
α+β+γ = 0
γ=0
α−β+γ = 0
dependent or independent?
Solution. We can exploit the linear independence of x2 , x and 1 that
we have just shown to solve this problem. We start with
α( x2 + x − 1) + β(2x2 + 3x + 1) + γ( x2 − 4) = 0.
Since the different powers of x are linearly independent this can only
sum to zero if the coefficients of each power are individually equal
to zero. This gives three equations and three unknowns which we
represent with an augmented matrix: Make sure you understand how we
produced this matrix.
mam2084f/s 25
1 2 1 0
1 3 0 0 .
−1 1 −4 0
2. h Bi = V.
( ! !)
1 0
Example. Show that , is a basis for R2 .
0 1
We need to show that this set is linearly independent and gener-
ates all of R2 . Consider
! ! !
1 0 0
α +β = .
0 1 0
x
tor in R2 , i.e. v = . We need to find two constants α and β so
y
that ! ! !
1 0 x
α +β = .
0 1 y
1
0 0
Example. The standard or canonical basis for R3 is 0 , 1 , 0
0
0 1
or {e1 , e2 , e3 }. Write down the standard basis for R4 .
1 0 0 0
0 1 0 0
Solution. The canonical basis for R4 is {e1 , e2 , e3 , e4 } = , , , .
0 0 1 0
0 0 0 1
Note that the notation e1 is slightly ambiguous. This is the canon-
ical basis vector where the first entry is 1 and the remaining entries
are 0, but without context we don’t know how many other entries
there are. We have used it to denote a 2-, 3- and 4-dimensional vector
above. This ambiguity is only removed by reading through the sur-
rounding text and understanding which vector space we are working
in.
( ! !)
1 3
Example. Show that , is also a basis for R2 .
2 5
x
arbitrary vector . Then we want to find α and β so that
y
! ! !
1 3 x
α +β = .
2 5 y
No matter what the components of the vectors vi are, upon Gauss re-
ducing this matrix we will find at most two pivots which means that
one of α, β or γ is free and there are an infinite number of solutions.
S is linearly dependent and fails to be a basis.
Fact 1.18. For any vector space V, all its bases have the same number of
elements.
Definition. The dimension of a vector space is the number of ele-
ments in any of its bases. This all gets significantly more com-
plicated for infinite dimensional vector
Example. Let P2 [ x ] be the vector space of all polynomials in x of spaces. We do not discuss them in
degree two or less. What is the dimension of P2 [ x ]? detail in this course.
B0 = {b1 , b2 , b3 , . . . , bn }
B̃1 = {t1 , b1 , b2 , . . . , bn } .
This set is a basis for V since it is linearly independent and still spans
V. Why? Think.
Now add t2 to form the set B̃2 , then drop one of the elements
in the set, bq , to create a new basis B2 . We repeat this procedure
until we have added all the elements in T to our new basis. Note
that we will never be forced to pull out one of the elements that we
previously added. Why? Think!
Since we can add all elements of T without running out of original
elements of B to remove it must be the case that j ≤ n.
2
Determinants
This definition is difficult to work with, and it’s not at all clear
how the determinant of a particular matrix should be calculated.
We’re going to adopt a more pragmatic approach in the following
section; we jump right in to computing determinants. All you need
to know is that the slightly odd-looking computations have a sound
theoretical justification and agree with the definition above. We will
show that this is true a little later in the course.
30 university of cape town
Calculating Determinants
a b
det( A) = = ad − bc.
c d
− +
!
1 2
Example. What is det ?
3 4
Solution. 1 × 4 − 2 × 3 = −2.
Determinants of larger matrices 3 × 3, 4 × 4, n × n are calculated
recursively using the determinants of smaller matrices using the
Laplace or cofactor expansion. We work through a 3 × 3 example first
and then discuss the general case.
1 0 2
Example. Calculate the determinant of A = 1 −1 1 .
2 1 2
Solution. The first step in calculating this determinant is to select a
row or column of the matrix along which we will expand. The calcu-
lation is simplified if any of the entries in the chosen row or column
are 0, so we will expand along the first row. (We could also expand
along the second column to take advantage of the zero entry).
1 0 2
1 −1 1
2 1 2
For each entry in the chosen row or column we calculate the de-
terminant of a smaller 2 × 2 matrix formed by omitting the row and
column corresponding to that entry.
mam2084f/s 31
1 0 2 1 0 2 1 0 2
1 −1 1 1 −1 1 1 −1 1
2 1 2 2 1 2 2 1 2
−1 1 1 1 1 −1
det( A) = +1 −0 +2
1 2 2 2 2 1
= 1(−1 × 2 − 1 × 1) − 0(1 × 2 − 1 × 2) + 2(1 × 1 − (−1) × 2)
=3
Make sure that you get the same answer if you calculate the deter-
minant by expanding along the second column.
Definition. Given a n × n matrix A, the minor Mij corresponding
to the entry aij is the determinant of the (n − 1) × (n − 1) matrix
formed by omitting the i-th row and j-th column of A. The cofactor
Cij corresponding to aij is (−1)i+ j Mij .
The determinant of A can be calculated by using the Laplace or
cofactor expansion along any row or column, i.e. for a fixed i
n n
det( A) = ∑ aij (−1)i+ j Mij = ∑ aij Cij
j =1 j =1 I realise these two formula look compli-
or for a fixed j cated. Make sure you understand how
they relate to the examples above and
n n below.
det( A) = ∑ aij (−1)i+ j Mij = ∑ aij Cij .
i =1 i =1
1 2 −1
Example. Let A = 3 1 1 . Calculate | A|.
−1 3 2
There are no zero entries in this matrix so expanding along one
row or column will be as much work as any other row or column. We
will expand along the second row.
| A| = ∑ a2j (−1)2+ j M2j
j
2 −1 1 −1 1 2
= 3 × (−1) × +1×1× + 1 × (−1) ×
−1 −1
3 2 2 3
= −21 + 1 − 5
= −25
32 university of cape town
You should check that you get the same answer if you expand along
another row or column.
2 2 6 3
1 0 2 −1
Example. Let B = . Calculate | B|.
3 0 1 1
−1 0 3 2
Calculating the determinant of an arbitrary 4 × 4 matrix using
this method is tedious. Fortunately there is only one non-zero entry
in the second column of B, so expanding along this column greatly
reduces the amount of work.
We might also notice that the minor associated with the only non-
zero entry in the second column is just the matrix A from the previ-
ous example. Together these two imply that | B| = 50. Make sure you
can fill in the details yourself.
a11 0 0 ··· 0
0 a22 0 ··· 0
0 0 a33 ··· 0
.. .. .. .. ..
.
. . . .
0 0 0 ··· ann
Diagonal matrix
a11 a12 a13 ··· a1n
0 a22 a23 ··· a2n
0 0 a33 ··· a3n
.. .. .. .. ..
.
. . . .
0 0 0 ··· ann
Upper triangular matrix
2 1 3 6
=9 = −9
3 6 5 7
These observations hold for all square matrices, and we show why
below.
Fact 2.3. If the square matrix B is obtained from A by scaling one row of A
by the constant k then
det( B) = k det( A).
Explanation. Assume that it was the p-th row of the matrix A that
was scaled by k to produce B. We will calculate det( A) and det( B) by
34 university of cape town
det( A) = ∑ a pj (−1) p+ j M pj
j
Fact 2.5. If two rows of a square matrix are identical then the determinant
of that matrix is zero.
Explanation. This is a corollary of the previous fact. Let A be a
matrix with two identical rows and B be the matrix produced by
swapping those identical rows. Then
det( B) = − det( A)
det( B) = det( A)
since the two matrices are identical. This implies that det( A) = − det( A)
which is only possible if the determinant is zero.
Fact 2.6. If one row of a square matrix is a scalar multiple of another row
then the determinant of that matrix is zero.
Explanation. Do it yourself – it uses the same idea as the previous
problem but there is one additional step with Fact 2.3.
Fact 2.7. If A, B and C are square matrices, identical except for their p-th
row where
c pj = a pj + b pj
then
det(C ) = det( A) + det( B).
mam2084f/s 35
1 2 3
= 2 0 2 −1
Zero the entries under the pivot.
0 0 4
= 16
1 −1 −2 −3
−5 1 2 4
Example. Show that = −200.
1 −1 6 1
1 −2 3 4
Do this yourselves. You can either expand directly, or you can do
some Gauss reduction first.
I strongly suggest that if you have any doubts about how useful
Gauss reduction is for these types of problem you try to expand it
directly.
If you do choose to do it by Gauss reducing, you don’t need to
reduce it all the way to row echelon form (although you can). Even a
single step will make it much easier to evaluate the determinant.
Definition. The transpose of a matrix A (written A T ) is created by
interchanging rows and columns.
36 university of cape town
1 2 3 1 4 7
Example. If A = 4 5 6 then A T = 2 5 8 .
7 8 9 3 6 9
For 3 × 3 matrices expanding along the first row of a matrix and the
first column of its transpose produce the same answer. We use the
result for 2 × 2 matrices to rearrange the intermediate calculation.
a b c
e f d f d e
d e f = a −b +c
h i g i g h
g h i
e h d g d g
= a −b +c
f i f i e h
a d g
= b e h
c f i
Similarly the 4 × 4 case can be proven using the result for the 3 × 3
case, then the 5 × 5, 6 × 6 and so on.
Fact 2.10. Since det( A) = det( A T ) all the previous facts about rows are
also true for columns.
Every element aij in A has a cofactor cij = (−1)i+ j Mij , from which we
can define a new matrix of cofactors
c11 c12 c13 ··· c1n
c21 c22 c23 ··· c2n
c31 c32 c33 ··· c3n
C= .
.. .. .. .. ..
.
. . . .
cn1 cn2 cn3 ··· cnn
= det( A)
Similarly the i-th diagonal entry is ∑ j aij (−1)i+ j Mij = det( A).
Off-diagonal entries: Consider the entry in the first row and second
column of the product,
Unlike the diagonal entries, this expression does not look immedi-
38 university of cape town
= ∑ a1j c2j
j
The following theorem ties together all of the work that we have
done in this section.
mam2084f/s 39
1. det( A) 6= 0.
4.b The same is true for the rows of A. (Since the transpose doesn’t change
the value of the determinant).
1
The inverse of A is adj( A).
det( A)
2 ⇒ 3: Assume that A−1 exists.
Ax = 0
−1
A Ax = A−1 0
Ix = 0
x=0
dy
= f ( x ) g(y)
dx
dy
= f ( x ) g(y)
dx
1 dy
= f (x)
g(y) dx
1 dy
Z Z
dx = f ( x ) dx
g(y) dx
1
Z Z
dy = f ( x ) dx
g(y)
dy √
=x y
dx
1 dy
√ =x Only possible to divide through if
y dx y 6= 0.
1 dy
Z Z
√ dx = xdx
y dx
√ 1
2 y = x2 + C
2
√ 1 2
Since y(0) = 0 we see that the constant C = 0. Thus 2 y = 2x
x4
which can be rearranged to find that y = 16 . Note that this is not the
only solution! The trivial solution y = 0 which we excluded earlier
also solves the DE. This non-uniqueness of solutions is typical of
non-linear DEs.
Example. Find a family of curves so that each member of the family
is orthogonal to each member of the family of hyperbolas x2 − y2 =
C.
dy dy
Solution. If x2 − y2 = C then 2x − 2y dx = 0 which means dx = yx .
We recall from school that the product of the slopes of two orthognal
lines is negative one, so the derivative of the new family of curves is
mam2084f/s 43
dy
dx = − yx .
dy y
=−
dx x
1 dy 1
=−
y dx x
1 1
Z Z
dy =− dx
y x
ln |y| = − ln | x | + C
eln |y| = Ae− ln | x| Since eC = A with A > 0.
A
y= Relaxing the condition to A 6= 0 when
|x| we change |y| to y.
∂f
= 2xy − 1
∂x
∂f
= x2 + 3y2
∂y
dy
M ( x, y) + N ( x, y) =0
dx
an exact differential equation if
∂M ∂N
= .
∂y ∂x
To solve an exact DE we look for an underlying potential function How do we know F exists? Read your
F ( x, y) where MAM2083 notes.
∂F ∂F
= M and = N.
∂x ∂y
44 university of cape town
dy
Example. Solve 3x ( xy − 2) + ( x3 + 2y) dx = 0.
Solution. First we check whether or not this is an exact DE. Since
M( x, y) = 3x ( xy − 2) and N ( x, y) = x3 + 2y we have My = 3x2 = Nx
and so it is exact.
Next we look for a function F ( x, y) so that Fx = M. Do this by
integrating M with respect to x.
Z
F ( x, y) = M( x, y) ∂x
Z
= 3x2 y − 6x ∂x
= x 3 y + y2 + h ( x )
f ( x, y) = x3 y −3x2 + g(y)
f ( x, y) = x3 y + h ( x ) + y2
dy
y + (t + ey ) =0
dt
which is exact and can be solved in the same manner as the previous
problems (details are left to the reader).
All separable equations are also exact since
dy
= f ( x ) g(y)
dx
1 dy
⇒ − f (x) + =0
g(y) dx
dn y dn −1 y dy
a n ( x ) n + a n −1 ( x ) n −1 + . . . + a 1 ( x ) + a0 ( x ) y = f ( x )
| dx dx {z dx }
T (y)
Both of these are easy to show using the linearity of the derivative.
dn dn −1 d
T (αy1 ) = an ( x ) n
( αy 1 ) + a n −1 ( x ) n − 1
(αy1 ) + . . . + a1 ( x ) (αy1 ) + a0 ( x )αy
dx dx dx
dn dn −1 d
= αan ( x ) n (y1 ) + αan−1 ( x ) n−1 (y1 ) + . . . + αa1 ( x ) (y1 ) + αa0 ( x )y
dx dx dx !
dn dn −1 d
= α an ( x ) n
( y 1 ) + a n −1 ( x ) n − 1
( y1 ) + . . . + a1 ( x ) ( y1 ) + a0 ( x ) y
dx dx dx
= αT (y1 )
=0
(This result is analogous to the ones we showed earlier for systems of linear
equations).
Explanation. Consider a linear non-homogeneous differential equa-
tion T (y) = f ( x ) with two solutions y1 and y2 . The difference be-
mam2084f/s 47
T ( y1 − y2 ) = T ( y1 ) − T ( y2 )
= 0.
T ( y1 + y0 ) = T ( y1 ) + T ( y0 )
= f ( x ).
y g = y p + y0 .
y = e x + A cos( x ) + B sin( x ).
dy
a1 ( x ) + a0 ( x ) y = f ( x )
dx
can be rewritten as
dy
+ P ( x ) y = Q ( x ).
dx
This can be solved by multiplying through by an appropriate inte-
grating factor. For these problems the appropriate integrating factor
is Rx
e P(s)ds .
P(s)ds dy
Rx Rx Rx
P(s)ds P(s)ds
e + P( x )e y = Q( x )e
| dx {z }
product rule
48 university of cape town
where we should notice that the terms on the left hand side of the
equation can be rewritten as a single derivative
d h R x P(s)ds i Rx
e y = Q( x )e P(s)ds .
dx
The solution y can be easily determined by integrating both sides
with respect to x and rearranging.
Example. Solve y0 − 4x y = x5 e x subject to y(1) = 0.
Solution. First calculate the integrating factor:
Z x
4
− ds = −4 ln | x |
s
1
= ln
x4
Rx
ln 1
− 4s ds
⇒e =e x4
1
= 4
x
Now multiply by the integrating factor and solve.
1 0 4
y − 5y = xe x
x4 x
d hyi
= xe x
dx x4
y
Z
= xe x dx Integrate by parts.
x4
y
= xe x − e x + C
x4
⇒ y = |x5 e x {z
− x4 e}x + |{z}
Cx4
yp y0
We can see that the solution y can be split into two pieces: the so-
lution to the association homogeneous equation and a particular
solution. Finally we use the specified condition y(1) = 0 to determine
the value of the constant of integration. In this case C = 0.
Example. A tank with a capacity of 500 litres holds 300 litres of pure
water. Brine with a concentration of 0.05 kg of salt per litre flows in
at a rate of 3 litres per minute. The mixture is thoroughly stirred and
drains at the same rate.
Draw up a differential equation that describes the rate of change
of salt in the tank. Use this differential equation to find an expression
for S(t), the total amount of salt in the tank at time t.
Solution. Since we started with pure water the initial condition is
S(0) = 0. The rate of change of salt in the tank can be written as
dS
= Salt In − Salt Out.
dt
mam2084f/s 49
The rate of salt coming in and out can be calculated by taking the
product of the flow rate with the concentration. Note that all the
terms will have units of kilograms per minute.
dS S(t)
= (3l/min)(0.05kg/l ) − (3l/min) .
dt 300l
After some simplification and rearrangement of terms we recover the
following linear first-order differential equation,
dS 1
+ S(t) = 0.15.
dt 100
The integrating factor associated with this differential equation is
t
e 100 . Multiply through by the integrating factor, recognise the left
hand side as the result of applying the product rule, and integrate.
d h t 15 t
Z i Z
e 100 S(t) dt = 15 e 100 dt. S(t)
dt 100
After integration we can rearrange to find an expression for S(t),
t
S(t) = 15 + Ce− 100 . The initial condition can now be used to de- 15kg
α( x2 + x ) + β(4x ) + γ(2) = 0.
dent on [0, 2π ]?
Solution. Recall that cos(2x ) = cos2 ( x ) − sin2 ( x ). Substitution in
equation 3.1 gives
(α + γ) cos2 ( x ) + ( β − γ) sin2 ( x ) = 0.
α1 f 1 ( x ) + α2 f 2 ( x ) = 0
⇒ α1 f 10 ( x ) + α2 f 20 ( x ) = 0 By taking the derivative on both sides.
or more compactly as
Mα = 0.
If the matrix M is invertible then α = 0, i.e. the only solution to 3.1 is
α1 = α2 = 0 so the set is linearly independent. Consequently, if we
can find some value x0 ∈ I so that the determinant of M is non-zero
at x0 then F is linearly independent.
Definition. The Wronskian of a set F = { f 1 ( x ), f 2 ( x ), . . . , f n ( x )}, de-
noted W ( x ), may be defined on an interval I where all the functions
mam2084f/s 51
αx2 + βx | x | = 0.
y = α1 y1 + α2 y2 + . . . + α n y n .
xy00 − ( x2 + 1)y0 = 0
52 university of cape town
and so this is a solution. Next we check that these are two indepen-
dent solutions.
1 e x2 /2 2
W (x) = = xe x /2 .
0 xe x2 /2
There are many values of x that make the Wronskian non-zero, e.g.
W (1) 6= 0, so this is an independent set. The general solution can be
written as
2
y = α + βe x /2 .
dn y dn −1 y dy
an ( x ) n
+ a n −1 ( x ) n −1 + . . . + a 1 ( x ) + a0 ( x )y = 0.
dx dx dx
If the functions ak ( x ) are constants then we say this is a differential
equation with constant coefficients. These types of differential equa-
tions can be easily solved and the solutions all involve exponentials.
Definition. Every linear, constant coefficient differential equation
has an associated auxiliary polynomial. There are two ways to calculate
this polynomial.
1. Substitute y = eλx into the equation.
Example. Let y00 − 3y0 + 2y = 0. Then substitution gives λ2 eλx − 3λeλx + 2eλx = 0
and after dividing through by the exponential we recover λ2 − 3λ + 2 = 0.
The auxiliary polynomial p(λ) = λ2 − 3λ + 2.
y1 = e βx
y2 = xe βx
..
.
yk = x k−1 e βx
y = α1 e βx + α2 xe βx + . . . + αk x k−1 e βx .
= ( D − β)n y∗
= 0.
54 university of cape town
over the reals (but has a complex conjugate pair of roots β ± iω) , 2k inde-
pendent solutions
y1 = e βx cos(ωx ) y2 = e βx sin(ωx )
y3 = xe βx cos(ωx ) y4 = xe βx sin(ωx )
.. ..
. .
y2k−1 = x k−1 e βx cos(ωx ) y2k = x k−1 e βx sin(ωx )
Explanation. The explanation for why the repeated roots lead to ad-
ditional powers of x in the solution is the same as the previous fact’s.
It might be useful to review why the k = 1 case gives trigonometric
functions in our answer.
We start with the differential equation ( D − β)2 y + ω 2 y = 0. All
these constants are real and the function y is real-valued. If we as-
sume that y = eλx we find an auxiliary polynomial p(λ) = (λ − β)2 + ω 2
which is irreducible over the reals.
To solve this problem we factorise over the complex numbers. We
are allowed to introduce complex numbers for intermediate steps
of our calculation as long as we make sure that in the final solution
all the imaginary parts have disappeared and we have a real-valued
function y. The complex conjugate pair of roots are λ = β ± iω. We
write down our general solution
y = α1 e βx+iωx + α2 e βx−iωx .
y = α1 e βx cos(ωx ) + α2 e βx sin(ωx ).
mam2084f/s 55
d5 y
Example. Solve + 32y = 0.
dx5
Solution. The associated polynomial is λ5 + 32 = 0. If we let
cos(π/5) = C and sin(π/5) = S then the roots are λ1 = −2, Make sure you know how to find these!
λ2,3 = 2C ± i2S and λ4,5 = −2(C2 − S2 ) ± i2SC and the solution is
2 − S2 ) x 2 − S2 ) x
y = α1 e−2x + α2 e2Cx cos(2Sx ) + α3 e2Cx sin(2Sx ) + α4 e−2(C cos(2SCx ) + α5 e−2(C sin(2SCx ).
Variation of Parameters
d2 y dy
a2 ( x ) + a1 ( x ) + a0 ( x ) y = f ( x ).
dx2 dx
From the theory we have developed earlier we know that the general
solution to this equation can be written as
y = y p + αy1 + βy2 .
56 university of cape town
a2 (v10 y10 + v1 y100 + v20 y20 + v2 y200 ) + a1 (v1 y10 + v2 y20 ) + a0 (v1 y1 + v2 y2 ) = f .
Two sets of terms are zero since y1 and y2 are solutions to the homo-
geneous differential equation, so this simplifies to
f
v10 y1 + v20 y20 = . (3.3)
a2
mam2084f/s 57
y = v1 y1 + v2 y2 + αy1 + βy2 .
y (0) = 1 ⇒ α + β = 1
1
y 0 (0) = 0 ⇒ α − β = −
2
1
solving these gives α = 4 and β = 34 .
Example. Solve the differential equation ( D2 + 1)y = tan( x ).
Solution. The associated homogeneous equation has two indepen-
dent solutions y1 = cos( x ) and y2 = sin( x ). We must therefore solve
the equation
! ! !
cos( x ) sin( x ) v10 0
= .
− sin( x ) cos( x ) v20 tan( x )
which gives v10 = − sin( x ) tan( x ) and v20 = cos( x ) tan( x ) = sin( x ). In-
tegration of v20 is easy and we recover one of the functions v2 = − cos( x ).
Integrating v10 is a little harder:
Z
v1 = − sin( x ) tan( x ) dx
− sin2 ( x )
Z
= dx
cos( x )
cos2 ( x ) − 1
Z
= dx
cos( x )
Z
= cos( x ) − sec( x ) dx
Vector spaces have more than one basis, and some of these bases
are more useful than others for thinking about particular problems.
For example, consider the standard first-year physics/statics problem
of a box resting on an inclined plane. Although we are used to de-
scribing R2 with the canonical basis {(1, 0) T , (0, 1) T } the first step we
might take in analysing the box on the plane is to describe the forces
acting on the box in terms of a new basis whose elements are a unit
vector parallel to the plane and perpendicular to it. It is this idea –
choosing an appropriate basis to describe a problem in a simple way
– that motivates this section on diagonalisation.
A First Example
x0 = Ax (4.1)
! !
x1 2 −1
where the vector x = and the matrix A = . Let
x2 5 −4
!
1 1
x = Py where P = . If we substitute into the equation 4.1 Why? Where did this matrix P come
1 5 from?
it becomes
Py0 = APy.
y0 = P−1 APy.
!
1 0
The product P−1 AP is a diagonal matrix D = . This is It’s really diagonal? Yes – check it
0 −3 yourself. Why is it diagonal?
equivalent to the system of differential equations
(
y10 = 1y1 + 0y2
y20 = 0y1 − 3y2
Av = λv.
Av = λv
Av − λIv = 0
( A − λI )v = 0
det( A − λI ) = 0 Since we want to find a non-zero
solution.
The characteristic polynomial is p(λ) = det( A − λI ) and the charac-
teristic equation is p(λ) = 0.
mam2084f/s 61
!
1 2
Example. Find the eigenvalues of A = .
2 1
Solution. The characteristic equation is
1−λ 2
=0
1−λ
2
(1 − λ )2 − 4 = 0
λ2 − 2λ − 3 = 0
(λ − 3)(λ + 1) = 0.
The eigenvalues of A are λ1 = −1 and λ2 = 3.
The eigenvectors can be calculated by solving the equation ( A − λI )v = 0
for each different eigenvalue.
Example. Now find the eigenvectors of A.
Solution. The first eigenvalue we found is λ1 = −1. Substitution
into the equation gives us
!
1 − (−1) 2
v = 0.
2 1 − (−1)
We write this as an augmented matrix and Gauss reduce:
! !
2 2 0 1 1 0
∼
2 2 0 0 0 0
!
1
the solutions are v = α where α ∈ R, α 6= 0.
−1
The second eigenvalue is λ2 = 3. Substitution gives us the aug-
mented matrix (and its Gauss reduced form)
! !
−2 2 0 1 −1 0
∼
2 −2 0 0 0 0
!
1
which has solutions v = α where α ∈ R, α 6= 0.
1
Note that for both eigenvalues when we substitute in and Gauss
reduce one of the rows of the augmented matrix is reduced to a row
of zeros. This will always happen – if it does not you have made a
mistake, either in the Gauss reduction or in your calculation of the
eigenvalues.
In this example the eigenvalues were distinct. It is possible that
a matrix may have repeated eigenvalues, as we see in the following
example.
1 0 0
Example. Find the eigenvalues and eigenvectors of B = 1 3 2 .
1 2 3
62 university of cape town
Eλ = {v ∈ Rn ; Av = λv}
A(u + v) = Au + Av
= λu + λv
= λ (u + v)
A(αu) = αAu
= αλu
= λ(αu)
Geometric Interpretation
A 2 × 2 matrix is a linear transformation of the plane, e.g. a projec- x
tion, reflection, rotation and so on.
For certain linear transformations – ones that can be represented
by a symmetric matrix (i.e. a matrix equal to its own transpose) –
there is an easy geometric interpretation of the matrix’s eigenvalues
and eigenvectors. The image of a unit circle under this transforma-
tion is an ellipse whose axes are aligned with the eigenvectors, and
whose lengths are given by the absolute value of the eigenvalues. Figure 4.1: The
imageof a unit circle
1 2
under A = is an ellipse.
2 1
64 university of cape town
since vectors normal to the plane through the origin are squashed flat
onto the origin and
−3 −2
E1 = β 0 + γ 1 ; β, γ ∈ R
1 0
Solution. The shape of this matrix lends itself to a very simple cal-
culation. We simply expand along the first column to evaluate the
determinant:
5−λ 6 7
8−λ 9
0 8−λ 9 = (5 − λ ) = (5 − λ)(8 − λ)(10 − λ).
0 10 − λ
0 0 10 − λ
Fact 4.2. If A is
1. upper triangular,
2. lower triangular, or
3. a diagonal matrix.
{v1 , v2 , . . . , vk }
is linearly independent.
Explanation. Consider the case k = 2, i.e. we have only two eigen-
vectors v1 and v2 belonging to the distinct eigenvalues λ1 and λ2 . We
are interested in solutions to the equation
A(αv1 + βv2 ) = A0
αλ1 v1 + βλ2 v2 = 0
and
αλ1 v1 + βλ2 v2 + γλ3 v3 = 0.
After manipulation we have
α̃v1 + β̃v2 = 0.
Note that α̃ = 0 ⇒ α = 0.
For k = 4 we can reduce it to the k = 3 case and so on.
Fact 4.5. If an n × n matrix has n distinct eigenvalues then there is a basis
for Rn consisting of eigenvectors of A.
Explanation. This is a corollorary of the previous fact. Note that if
the eigenvalues are not distinct we may still be able to find a basis of
eigenvectors but it is not guaranteed.
mam2084f/s 67
Diagonalisation
Fact 4.6. For any square matrix A, any matrix P (whose columns are
eigenvectors of A) and associated D (a diagonal matrix with corresponding
eigenvalues as entries) satisfy
AP = PD. (4.2)
P−1 AP = D.
The k-th column of the product AP on the left hand side of equation
4.2 is simply Avk . The k-th column of the product PD on the right
is λk vk . If A is diagonalisable the eigenvectors v1 , v2 , . . . vn can be If you can’t see this immediately start
chosen to form a linearly independent set – this makes P invertible calculating the products and you
should notice it.
(Fact 2.16).
Given a matrix A, the process of finding an appropriate matrix P
so that P−1 AP = D is called diagonalising A.
!
1 2
Example. Let A = . Find, if possible, a diagonal matrix
−1 4
D and another matrix P so that D = P−1 AP. If not possible, explain
why.
Solution. We start by calculating the eigenvalues. We need to solve
1−λ 2
=0
−1 4−λ
(1 − λ)(4 − λ) + 2 = 0
λ2 − 5λ + 6 = 0
(λ − 3)(λ − 2) = 0
68 university of cape town
and
! ! !
1−3 2 0 1 −1 0 1
∼ ⇒v=β , β 6= 0.
−1 4 − 3 0 0 0 0 1
Then we have
! !
2 0 2 1
D= and P = .
0 3 1 1
For the sake of completeness we will check that P−1 AP really does
give D.
! ! !
1 −1 1 2 2 1
P−1 AP =
−1 2 −1 4 1 1
! !
1 −1 4 3
=
−1 2 2 3
!
2 0
= .
0 3
!
3 4
Example. Let B = . Find, if possible, a diagonal matrix
−1 7
D and another matrix P so that D = P−1 BP. If not possible, explain
why.
Solution. Again, start by calculating eigenvalues.
3−λ 4
=0
−1 7−λ
(3 − λ)(7 − λ) + 4 = 0
λ2 − 10λ + 25 = 0
(λ − 5)2 = 0.
then P−1 AP = D. The order of the entries in D is important. It must Check this yourselves by doing the
correspond to the order of the columns of P. multiplication. It’s worth working
through this tedious calculation at least
Example. Solve the system of differential equations once for the 3 × 3 case to appreciate
what a great result this is.
dx1 = x1 + 2x2 + 2t
dt .
dx2 = − x1 + 4x2 + t
dt
Solution. We start by rewriting the system in a more useful form:
! !
dx 1 2 2t
= x+ .
dt −1 4 t
| {z }
A
70 university of cape town
Now let x = Py. Then 1 2
Where P = , a matrix of
1 1
eigenvectors of A.
!
d 2t
( Py) = APy +
dt t
!
−1 dy 2t
P P = P−1 APy + P−1
dt t
!
dy 0
= Dy + .
dt t
u · v = u1 v1 + u2 v2 + . . . + u n v n
= uT v.
u · v = 0 ⇐⇒ u ⊥ v.
hu, vi = u1 v1 + u2 v2 + . . . + un vn
= uT v.
ha, bi = i (2 − 3i ) + 0 + (1 − i )(7 + 2i )
= 2i + 3 + 7 + 2 − 7i − 2i
= 12 − 3i
hb, ai = (2 + 3i )(−i ) + 0 + (7 − 2i )(1 + i )
= −2i + 3 + 7 + 2 − 2i + 7i
= 12 + 3i
1. hx, yi = hy, xi
Explanation. The first three are tutorial problems. For the last prop-
erty note that
h Ax, yi = ( Ax)T y = xT A T y
72 university of cape town
and
hx, A T yi = xT A T y = xT A T y.
Explanation.
p √
1. k0k = h0, 0i = 0 + 0 + . . . + 0 = 0.
For any non-zero z ∈ C zz = <(z)2 + =(z)2 > 0. If x 6= 0 it has
at least one non-zero component, and hence at least one term in
the sum hx, xi is strictly positive and the rest are non-negative. The
square root of a positive number is again positive.
2.
q
kαxk = hαx, αxi
p
= αx1 αx1 + αx2 αx2 + . . . + αxn αxn
p
= | α | x1 x1 + x2 x2 + . . . + x n x n
= | α | kxk
hx, yi = −1 + 0 + 1 = 0.
It’s equally easy to see that the vectors do not have a norm of 1, e.g.
√ √
kxk = 1 + 1 = 2.
Fact 4.9. Every set of mutually orthogonal vectors is also linearly indepen-
dent.
74 university of cape town
Not all linearly independent sets are mutually orthogonal (but they can
be made orthogonal using the Gram-Schmidt procedure).
Explanation. The explanation of the first part is a tutorial problem.
The second part, the Gram-Schmidt procedure, will be discussed a
little later on. We will need it to solve some problems and it’s best
explained through demonstration.
Definition. An invertible real-valued matrix Q is called orthogonal if
Q−1 = Q T . An invertible complex-valued matrix is called unitary if
Q −1 = Q T .
Example. Consider the rotation matrix
!
cos θ − sin θ
R= .
sin θ cos θ
The diagonal elements aiT ai = 1, i.e. the vectors all have a norm of
one. The off-diagonal elements aiT a j = 0 which means that every pair
of vectors is orthogonal. The set is thus orthonormal.
Orthogonal matrices have a number of important properties.
mam2084f/s 75
3. all the eigenvalues λi of Q lie on the unit circle in the complex plane, i.e.
|λi | = 1.
Explanation.
1.
and
h Qx, Qyi = Qx · Qy = |x||y| cos φ
3. Let λ be an eigenvalue of Q.
Orthogonal Diagonalisation
D = Q−1 AQ = Q T AQ.
Q T AQ = D
⇒ A = QDQ T
Then A T = ( QDQ T ) T
AT = (QT )T D T QT
A T = QDQ T
AT = A
1. it is orthogonally diagonalisable,
Explanation.
Ax = λx
x Ax = xT λx
T
xT Ax = λ kxk2
Second:
Ax = λx
Ax = λx
Ax = λx A is real-valued.
T T
x Ax = x λx
xT Ax = λ kxk2
mam2084f/s 77
xT Ax − xT Ax = (λ − λ) kxk2 .
λhx, yi = hλx, yi
= h Ax, yi
T
= hx, A yi
= hx, Ayi
= hx, µyi
= µhx, yi
and
1
E11 = γ 1 ; γ 6= 0 .
1
v2 = vku + v⊥u .
|{z}
u2
hv2 , u1 i
The projection of v2 onto u1 is vku = u . In this case You should convince yourself that this
hu1 , u1 i 1 is true in R2 and R3 by using the dot
product and doing some trigonometry.
hv2 , u1 i
vku = u
hu1 , u1 i 1
−1
1
= 1
2
0
u2 = v⊥u
= v2 − v k u
−1 −1
1
= 0 − 1
2
1 0
−1
1
= −1
2
2
so the matrix
− √1 − √1 √1
2 6 3
√1 − √1 √1
Q=
2 6 3
0 √2 √1
6 3
and
8 0 0
D= 0 8 0
0 0 11
and
D = Q−1 AQ.
mam2084f/s 79
1. Let u1 = v1 .
2. Create uk for 2 ≤ k ≤ n by
hvk , u j i
(a) calculating the projections u for 1 ≤ j < k.
hu j , u j i j
(b) subtracting these projections from vk , i.e.
h v k , u1 i hv , u2 i hvk , uk −1 i
uk = vk − u1 − k u2 − . . . − u .
hu1 , u1 i hu2 , u2 i huk −1 , uk −1 i k −1
Quadratic Forms
Parabola: c(y − y0 ) = ( x − x0 )2 or c( x − x0 ) = (y − y0 )2
( x − x0 )2 ( y − y0 )2
Hyperbola: − = ±1
lx2 ly2
ly
( x − x0 )2 ( y − y0 )2
Ellipse: + =1
lx2 ly2 ( x0 , y0 ) lx
1. all of the standard forms for these conic sections can be expressed
as a general quadratic form,
2. but some general quadratic forms are not standard forms of conic
lx
sections. Specifically, if b 6= 0, the term 2bxy does not appear when
( x0 , y0 )
any of the standard forms are expanded.
in the form
! ! !
a b x x
( x y) + (d e) = −f.
b c y y
Some comments:
1. If you aren’t sure that the quadratic form can be rewritten in this
way multiply out xT Ax and confirm that you recover the original
expression.
Having rewritten the quadratic form in this way we will now orthog-
onally diagonalise A. First we must find its eigenvalues.
8−λ −4
=0
−4 2−λ
(8 − λ)(2 − λ) − 16 = 0
λ(λ − 10) = 0.
X
We have recovered a standard conic form in the variables X and
Y. It’s a parabola, and we plot it alongside. What remains is to trans-
form back to the original variables x and y. To do this recall that the
original and new variables are related through x = QX. In terms
Figure 4.7: Our parabola plotted against
of the variables X and Y the X axis points in the direction (1 0) T . the XY-axes.
The corresponding direction in terms of x and y can be recovered by
calculating
x = QX
!
1
x=Q
0
√1
!
x= 5 .
√2
5
Similarly we can see that the Y axis points (in terms of x and y) in the
direction
−2
!
√
5 .
√1
5
If we plot our quadratic form we recover the following.
Y
−2
!
√ √1
!
5 5
√1 √2
5 5
and
6 0 0
D= 0 −3 0
0 0 −3
then Q−1 AQ = D. Let X = ( X Y Z ) T and make the substitution
x = QX in the equation that describes the sufrace. After some simpli-
fication we recover
Y2 ( Z − 1)2
X2 − − = 0.
2 2
This is the standard form of a cone, parallel to the X axis. In terms of
our original variables x, y, and z, it is a cone oriented along Q(1 0 0) T =
(2 − 2 1) T .
84 university of cape town
and the same linear transformation can be represented with respect to this
second basis by a matrix B where
B = Q−1 AQ = Q T AQ
or equivalently
A = QBQ−1 = QBQ T . A
R3 R3
Usual
Explanation. Consider figure 4.9 which shows the action of A, B, Basis
Q and Q−1 . Since matrix multiplication is simply the composition of Q −1 Q
New
functions its obvious that A = QBQ−1 .
Basis
Let’s use this to solve the problem above.
R3 R3
Example. Find a matrix A that represents reflection in the plane B
x + y + z = 0.
Figure 4.9: The transformation rep-
Solution. We are going to introduce a new basis for R3 . This basis, resented by A is the same as QBQ−1 .
{û1 , û2 , û3 }, will have two vectors û1 and û2 which lie in this plane
and û3 perpendicular to the plane. If we think in terms of a new
XYZ-axes the plane above will lie in the XY-plane and its normal
will run parallel to the Z-axis.
mam2084f/s 85
It’s easiest to start with û3 which describes the Z-axis. This should
be normal to the plane, so we take
1
u3 = 1
1
and scale by its norm to recover
√1
3
√1
û3 =
3
.
√1
3
Next we find two vectors that lie inside the plane, and that are
orthogonal to each other. Finding two vectors in the plane is easy, we
take
1 1
v1 = −1 and v2 = 0 .
0 −1
Next we apply the Gram-Schmidt procedure and recover
√1
1
√
2 1 6
û1 = − √1 and û2 = √ .
2 6
2
0 −√
6
We form a matrix Q whose columns are the vectors ûi . The matrix
B which represents this linear transformation, i.e. this reflection, with
respect to the new XYZ-axes is very simple:
1 0 0
B = 0 1 0 .
0 0 −1
Fact 4.15. If Q is orthogonal and A and B are two square matrices so that
A = QBQ T
then
1. the eigenvalues of A and B are the same (and so are the determinants and
trace),
2. Solve
Direct solution too hard.
Differential Algebraic
Solution 3. Inverse Laplace Transform L−1 {·} Solution
Figure 5.1: Using the Laplace transform
to solve a differential equation.
Before we can implement this approach we are going to have to
review some of the basic properties of the Laplace transform and the
inverse Laplace transform.
The Basics
1
L {1} = ; s > 0.
s
n!
L {tn } = .
s n +1
To actually prove this is true for all
This transform, along with a number of others, is included on the values of n we could use mathematical
induction.
summary sheet at the back of these notes and will be provided in
the exam. You do still need to be able to calculate the transform of a
function using the definition though.
Example. Find the Laplace transform of f (t) = e at .
Solution. Apply the definition as we have done for the previous two
examples.
mam2084f/s 89
Z ∞
L e at = e−st e at dt
0
Z k
= lim e(a−s)t dt
k→∞ 0
k
1 ( a−s)t
= lim e
k→∞ a−s 0
1
= ; s>a
s−a
Z
I= e−st sin( at) dt
1 s
Z
= − cos( at)e−st − e−st cos( at) dt
a a
1 s −st s2
Z
= − cos( at)e−st − e sin ( at ) − e−st sin( at) dt
a a2 a2 | {z }
I
s2
1 s
1+ 2 I=− cos( at) + 2 sin( at) e−st
a a a
− ( a cos( at) + s sin( at)) e−st
I= .
s2 + a2
2. L {α f (t)} = αL { f (t)}
1 1
we expect L 1e at =
Example. Since L {1} = which we
s s−a
have shown above.
Explanation. Use the definition.
Z ∞
L f (t)e at = e−st f (t)e at dt
0
Z ∞
= e−(s− a)t f (t) dt Let s̃ = s − a.
0
Z ∞
= e−s̃t f (t) dt
0
= F (s̃)
= F (s − a)
Fact 5.3. The Laplace transforms of the derivatives of f (t) are
L f 0 (t) = sL { f (t)} − f (0)
..
.
n o
L f (n) (t) = sn L { f (t)} − sn−1 f (0) − sn−2 f 0 (0) − . . . − f (n−1) (0)
mam2084f/s 91
L f 00 (t) = L g0 (t)
= s L f 0 ( t ) − f 0 (0)
= s2 L { f (t)} − 1
n o
L f 00 (t) = L −2a sin( at) − a2 t cos( at)
Second approach is to use the ex-
pression for f 00 (t) and linearity of the
= −2aL {sin( at)} − a2 L {t cos( at)} transform.
−2a2
= − a2 L { f (t)}
s2 + a2
These two expressions must be equal.
−2a2
s2 L { f (t)} − 1 = − a2 L { f (t)} Now rearrange.
s2 + a2
−2a2
(s2 + a2 )L { f (t)} = 1 + 2
s + a2
s − a2
2
L { f (t)} = 2
( s + a2 )2
2as
Similarly L {t sin( at)} = .
( s2 + a2 )2
92 university of cape town
Fact 5.4. If f 1 (t) and f 2 (t) are both continuous on [0, ∞) then L { f 1 (t)} = L { f 2 (t)}
only if f 1 (t) = f 2 (t).
This result is difficult to prove but it does allow us to define an
inverse Laplace transform.
Definition. The inverse laplace transform of a function F (s) is defined
by:
1
Example. Calculate L −1 .
s2 − 1
Solution. We check the table of known transformations but this
time there is nothing immediately useful so we do a partial fraction
mam2084f/s 93
expansion.
1 1
=
s2 −1 (s − 1)(s + 1)
1 α β
= +
s2 − 1 s−1 s+1
1 = α ( s + 1) + β ( s − 1)
1 1
⇒α= and β = −
2 2
1 1 1 1 1
So 2 = −
s −1 2s−1 2s+1
These two fractions do appear in the table.
1 1 1 1 1
L −1 2 = L −1 −
s −1 2s−1 2s+1
1 −1 1 1 1
= L − L −1
2 s−1 2 s+1
1 t 1 −t
= e − e
2 2
= sinh(t)
1
Example. Calculate L −1 .
s2 + 64
8 1 1
Solution. The table shows L {sin(8t)} = so L−1 = sin(8t).
s + 82
2 2
s + 64 8
3s + 5
Example. Calculate L −1 .
s2 + 7
n √ o s
Solution. From the table we see that L cos( 7t) = 2 and
√ s + 7
n √ o 7
L sin( 7t) = 2 . Then
s +7
( √ )
3s + 5 s 5 7
L −1 2 = L −1 3 2 +√ 2
s +7 s +7 7 s + 7
( √ )
−1 s 5 −1 7
= 3L 2
+√ L 2
s +7 7 s +7
√ 5 √
= 3 cos( 7t) + √ sin( 7t).
7
3
Example. Calculate L−1 .
s2 + 4s + 5
Solution. We complete the square in the denominator:
Since s2 + 4s + 5 = (s + 2)2 + 1
3 1
L −1 2 = 3 L −1
s + 4s + 5 ( s + 2)2 + 1
= 3e−2t sin(t) From the transform of sin(t) and Fact
5.2.
94 university of cape town
a2
Example. Calculate L−1 .
s ( s + a2 )
2
a2 α βs + γ
= + 2
s ( s2 + a2 ) s s + a2
a2 = α(s2 + a2 ) + ( βs + γ)s
a2 = (α + β)s2 + γs + α2
⇒ α = 1, β = −1 and γ = 0
Then
a2
−1 −1 1 s
L =L − 2
s ( s2 + a2 ) s s + a2
= 1 − cos( at)
We will see later in the course that we can solve this problem without
doing a partial fraction decomposition. We could instead use the
convolution theorem.
dy
Example. Solve − y = 4 subject to y(0) = 6.
dx
Solution. The solution is split into three steps as outlined in figure
5.1. First we transform this differential equation into an algebraic
equation.
dy
−y = 4
dx
dy
L − y = L {4}
dx
dy
L − L { y } = L {4}
dx
4
sL {y} − 6 − L {y} =
s
Next we solve this algebraic equation.
4
sL {y} − 6 − L {y} =
s
4
(s − 1)L {y} = + 6
s
4 6
L {y} = +
s ( s − 1) s − 1
−4 10
L {y} = +
s s−1
mam2084f/s 95
−4 10
L {y} = +
s s−1
−4
10
L−1 {L {y}} = L−1 +
s s−1
−4
10
y = L −1 + L −1
s s−1
y = −4 + 10et
10et − −4 + 10et = 4
2
(s2 L {y} − 2s − 6) − 6(sL {y} − 2) + 9L {y} =
( s − 3)3
2
L {y} (s2 − 6s + 9) = 2s + 6 − 12 +
( s − 3)3
2
L { y } ( s − 3)2 = 2( s − 3) +
( s − 3)3
2 2
L {y} = +
s − 3 ( s − 3)5
2 2
L−1 {L {y}} = L −1 +
s − 3 ( s − 3)5
1 2 4!
y = 2 L −1 + L −1
s−3 4! ( s − 3)5
1
y = 2e3t + t4 e3t
12
transforms.
s
s2 L {y} − 1 + 16L {y} = 2
s + 42
s
(s2 + 16)L {y} = 1 + 2
s + 16
1 s
L {y} = 2 + 2
s + 16 (s + 16)2
1 1
y = sin(4t) + t sin(4t)
4 8
This differential equation models the behaviour of an undamped,
driven simple harmonic oscillator. In this case the driving force,
cos(4t), is matched to the resonant frequency of the system which is
why the solution “blows up”. As t → ∞, |y| → ∞.
The differential equations we have solved so far all have initial
conditions specified at t = 0. If the conditions on y are imposed at
some other time we must make the following adjustment.
Example. Solve y0 − y = 0 at y(1) = 4.
Solution. This is a very simple differential equation, but the condi-
tion on y is at 1 rather than 0 so it’s not immediately obvious how
we would apply Fact 5.3 to calculate the transform of y0 . In cases
like this we introduce a new condition y(0) = α. (And y0 (0) = β,
y00 (0) = γ and so on as necessary).
L y0 − y = 0
L y0 − L {y} = 0
sL {y} − α − L {y} = 0
α
L {y} =
s−1
y = αet
Convolution
Fact 5.6. The Convolution Theorem. Consider two functions f (t) and
g(t) with Laplace transforms F (s) and G (s). Then
equivalently
a2
a 1
L −1 = L −1 a 2 ×
s ( s2 + a2 ) s + a2 s
a −1 1
= a L −1 2 ∗ L
s + a2 s
= a sin( at) ∗ 1
Z t
=a sin( aw)1 dw
0
= 1 − cos at
1
Example. Calculate L −1 without doing a partial
(s − 1)(s2 + 1)
fraction expansion.
Solution. We will use the convolution theorem instead.
1 1 1
L −1 = L −1 ×
(s − 1)(s2 + 1) s − 1 s2 + 1
= et ∗ sin(t) By application of the convolution theo-
rem and the table of known transforms.
indefinite integral.
Z
I= ew sin(t − w) dw
Z
= ew sin(t − w) + ew cos(t − w) dw Integrate by parts.
Z
= ew sin(t − w) + ew cos(t − w) − ew sin(t − w) dw Parts, again.
| {z }
I
w
2I = e (sin(t − w) + cos(t − w))
1 t 1 1
⇒ et ∗ sin(t) = [ I ]0t = e − sin(t) − cos(t)
2 2 2
Fact 5.7. The convolution of f with g is the same as the convolution of g
with f , i.e.
( f ∗ g)(t) = ( g ∗ f )(t).
Step Functions
H (t) or Θ(t).
The unit step function is useful in engineering contexts because it
allows us to “turn on” (and “turn off”) other functions which may
represent current that starts flowing through a circuit, or a catalyst
added to a reaction vessel, or a load transferred onto a structure, or Figure 5.2: The unit step function.
any other situation where there is an abrupt change.
Example. Plot f (t) = u(t) sin(t)
Solution. When t < 0 the unit step function is “off” so the function
mam2084f/s 99
f (t) is zero. When t ≥ 0 it is “on” and the function f (t) is just sin(t).
0 t<0
f (t) = 1
sin(t) t≥0
The unit step function u(t) “turns on” at zero. If we want to “turn
on” at a different point we can use a shifted unit step function u(t −
u(t) sin(t)
a) −1
0 t < a
u(t − a) = .
1 t ≥ a Figure 5.3: “Turning on” the sine
function.
By combining two shifted unit step functions we can “turn on” and
then “turn off” at a later point.
Example. Plot f (t) = u(t + 1) − u(t − 2).
Solution. This function is zero when t is less than −1, one from −1
to 2, and then zero again after that.
This example is slightly unphysical. We normally restrict ourselves −1 2
u(t − 1) sin(t − 1)
−1
Fact 5.8. Let F (s) be the Laplace transform of f (t). For a > 0
Equivalently,
L−1 e−as F (s) = u(t − a) f (t − a).
100 university of cape town
1. u(t − 5)
3. u(t − 2)t2
Solution. The first two are fairly straightforward. The third requires
some manipulation.
e−s
Example. Find the inverse Laplace transform L−1 2
.
s +9
1 1
Solution. We know that 2
L −1
= sin(3t). All that remains
s +9 3
is to correct for the exponential using Fact 5.8.
−1 −s 1 1
L e 2
= u(t − 1) sin (3(t − 1))
s +9 3
mam2084f/s 101
x 0 + 4y = 6 x (0) = 0
0
y + 4y − x = 0 y (0) = 0
6
sX − 0 + 4Y = (5.1)
s
sY − 0 + 4Y − X = 0 (5.2)
6
s(s + 4)Y + 4Y =
s
6
Y=
s ( s + 2)2
a b c
= + +
s s + 2 ( s + 2)2
some algebra happens
3 3
2 2 3
= + +
s s+2 ( s + 2)2
( ) ( )
3 3
−1 2 −1 2 −1 3
y(t) = L +L +L
s s+2 ( s + 2)2
3 3 −2t
= − e − 3te−2t
2 2
We can find x (t) in two different ways. Either find X and transform
back, or substitute y(t) into the original differential equation.