mathematics 1em/1es/1fm/1fs notes, weeks 18-23macpd/1e/notes2.pdf · 12 matrices mathematics...

34
12 MATRICES Mathematics 1EM/1ES/1FM/1FS Notes, weeks 18-23 Carl Dettmann, version May 2, 2012 12 Matrices 12.1 Basic concepts See: A.J. Sadler, D.W.S. Thorning, Understanding Pure Mathematics, pp. 159ff In mathematics, a matrix (plural: matrices ) is a rectangular table of numbers. For example, the data of the table Sold tickets Mon Wed Fri Sat Sun Adults 4 34 56 112 101 Children 60 78 24 100 123 Free tickets 0 0 0 10 12 can also be summarised by the following matrix: A = 4 34 56 112 101 60 78 24 100 123 0 0 0 10 12 This matrix has three rows and five columns and is therefore said to be a 3 × 5 matrix, or a matrix of order 3 × 5. Depending on how we interpret the elements of a matrix, it might be useful to be able to add, subtract or multiply matrices etc. Multiplication of a matrix by a scalar s: s a 11 ... a 1n . . . . . . . . . a m1 ... a mn = sa 11 ... sa 1n . . . . . . . . . sa m1 ... sa mn Addition and subtraction of two matrices: One matrix can be added to (subtracted from) another one only if they have the same number of rows and columns. a 11 ... a 1n . . . . . . . . . a m1 ... a mn ± b 11 ... b 1n . . . . . . . . . b m1 ... b mn = a 11 ± b 11 ... a 1n ± b 1n . . . . . . . . . a m1 ± b m1 ... a mn ± b mn Addition of matrices is commutative A + B = B + A, associative A +(B + C)=(A + B)+ C, and has distributive laws with multiplication by a scalar c(A + B)= cA + cB,(c + d)A = cA + dA. Multiplication of two matrices: Matrices can only be multiplied if the number of columns in the first matrix equals the number of rows in the second matrix. Matrix multiplication is not commutative (i.e. AB 6= BA), except in special cases. It is however associative: (AB)C = A(BC ) and satisfies expected properties in conjunction with addition, and with multiplication by a scalar: A(B + C)= AB + AC,(A + B)C = AC + BC , c(AB)=(cA)B = A(cB). a 11 a 12 ... a 1n a 21 a 22 ... a 2n . . . . . . . . . . . . a m1 a m2 ... a mn b 11 b 12 ... b 1r b 21 b 22 ... b 2r . . . . . . . . . . . . b n1 b n2 ... b nr = a 11 b 11 + ... + a 1n b n1 ... a 11 b 1r + ... + a 1n b nr a 21 b 11 + ... + a 2n b n1 ... a 21 b 1r + ... + a 2n b nr . . . . . . . . . a m1 b 11 + ... + a mn b n1 ... a m1 b 1r + ... + a mn b nr The transpose of a matrix A is written A T and is found by interchanging the rows and columns. Page 1. University of Bristol 2012. This material is copyright of the University unless explicitly stated otherwise. It is provided exclusively for educational purposes at the University and is to be downloaded or copied for your private study only.

Upload: lythuy

Post on 24-Jul-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

12 MATRICES

Mathematics 1EM/1ES/1FM/1FS Notes, weeks 18-23Carl Dettmann, version May 2, 2012

12 Matrices

12.1 Basic concepts

See: A.J. Sadler, D.W.S. Thorning, Understanding Pure Mathematics, pp. 159ff

In mathematics, a matrix (plural: matrices) is a rectangular table of numbers. For example, the data ofthe table

Sold tickets Mon Wed Fri Sat SunAdults 4 34 56 112 101

Children 60 78 24 100 123Free tickets 0 0 0 10 12

can also be summarised by the following matrix:

A =

4 34 56 112 10160 78 24 100 1230 0 0 10 12

This matrix has three rows and five columns and is therefore said to be a 3 × 5 matrix, or a matrix of order3× 5. Depending on how we interpret the elements of a matrix, it might be useful to be able to add, subtractor multiply matrices etc. Multiplication of a matrix by a scalar s:

s

a11 . . . a1n...

. . ....

am1 ... amn

=

sa11 . . . sa1n...

. . ....

sam1 ... samn

Addition and subtraction of two matrices:One matrix can be added to (subtracted from) another one only if they have the same number of rows andcolumns. a11 . . . a1n

.... . .

...am1 ... amn

± b11 . . . b1n

.... . .

...bm1 ... bmn

=

a11 ± b11 . . . a1n ± b1n...

. . ....

am1 ± bm1 ... amn ± bmn

Addition of matrices is commutative A + B = B + A, associative A + (B + C) = (A + B) + C, and hasdistributive laws with multiplication by a scalar c(A+B) = cA+ cB, (c+ d)A = cA+ dA.

Multiplication of two matrices:Matrices can only be multiplied if the number of columns in the first matrix equals the number of rows inthe second matrix. Matrix multiplication is not commutative (i.e. AB 6= BA), except in special cases. It ishowever associative: (AB)C = A(BC) and satisfies expected properties in conjunction with addition, and withmultiplication by a scalar: A(B + C) = AB +AC, (A+B)C = AC +BC, c(AB) = (cA)B = A(cB).

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

. . ....

...am1 am2 ... amn

b11 b12 . . . b1rb21 b22 . . . b2r...

. . ....

...bn1 bn2 ... bnr

=

a11b11 + ...+ a1nbn1 . . . a11b1r + ...+ a1nbnra21b11 + ...+ a2nbn1 . . . a21b1r + ...+ a2nbnr

.... . .

...am1b11 + ...+ amnbn1 . . . am1b1r + ...+ amnbnr

The transpose of a matrix A is written AT and is found by interchanging the rows and columns.

Page 1. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.1 Basic concepts 12 MATRICES

Examples:

Let A =

(−1 −3

1 1

), B =

(6 32 1

), C =

1 32 0−3 2

.

1. A+B =

(−1 −3

1 1

)+

(6 32 1

)=

(5 03 2

)

2. 2B −A = 2

(6 32 1

)−(−1 −3

1 1

)=

=

(12 64 2

)−(−1 −3

1 1

)=

(13 93 1

)

3. AB =

(−1 −3

1 1

)(6 32 1

)=

(−12 −6

8 4

)

4. BA =

(6 32 1

)(−1 −3

1 1

)=

(−3 −15−1 −5

)As AB 6= BA, we see that matrix multiplication is indeed not necessarily commutative.

5. CT =

(1 2 −33 0 2

)The determinant of a 2× 2 matrix is obtained as follows:

If A =

(a bc d

), then

det A = ad− bc.

Other ways in order to notate the determinant are:

|A| or

∣∣∣∣ a bc d

∣∣∣∣Geometrically the absolute value of the determinant of a 2 × 2 matrix A, |det A|, gives us the area of the

parallelogram based on the vectors v1 =

(ac

)and v2 =

(bd

).

The determinant of a 3× 3 matrix can be obtained as follows:∣∣∣∣∣∣a1 a2 a3b1 b2 b3c1 c2 c3

∣∣∣∣∣∣ = a1(b2c3 − b3c2)− a2(b1c3 − b3x1) + a3(b1c2 − b2c1)

Geometrically the absolute value of the determinant of a 3×3 matrix is the volume of the parallelepiped based

on the vectors v1 =

a1a2a3

, v2 =

b1b2b3

and v3 =

c1c2c3

.

The 3× 3 determinant also gives a compact method of defining the cross product:

Page 2. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.1 Basic concepts 12 MATRICES

∣∣∣∣∣∣i j kb1 b2 b3c1 c2 c3

∣∣∣∣∣∣ = (b2c3 − b3c2)i− (b1c3 − b3c1)j + (b1c2 − b2c1)k = v2 × v3

Determinants also have the following properties:

|AB| = |A||B|

|AT | = |A|

so the determinant is like the “magnitude” of a matrix.An n× n matrix I of the form

1 0 0 . . . 00 1 0 . . . 00 0 1 . . . 0...

......

. . ....

0 0 0 ... 1

is called identity matrix (unit matrix). It is like the number one, satisfying AI = IA = A for any n×nmatrix A.

The inverse of a matrix A is written A−1 and is such that

AA−1 = A−1A = I

For a 2× 2 matrix the inverse matrix can be determined very easily:

If A =

(a bc d

)then

A−1 =1

ad− bc

(d −b−c a

)i.e. to determine the inverse of a matrix A, interchange the elements of the leading diagonal of A, change thesigns of the elements of the other diagonal and divide by the determinant of the matrix.

NB: If the determinant of a matrix is zero, the inverse cannot be determined because 10 is meaningless. Any

n× n matrix with determinant zero is called a singular matrix as it has no inverse.Examples:

1. Evaluate.∣∣∣∣ 5 10 1

∣∣∣∣ = 5 · 1− 1 · 0 = 5− 0 = 5

Thus the area A of the parallelogram based on the vectors

(50

)and

(11

)is: A = 5 square units.

Page 3. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.2 Solving systems of linear equations using matrices 12 MATRICES

2. Evaluate.∣∣∣∣∣∣3 1 −22 1 10 1 −2

∣∣∣∣∣∣ = 3 · 1 · (−2) + 1 · 1 · 0 + (−2) · 2 · 1−

− (−2) · 1 · 0− 1 · 2 · (−2)− 3 · 1 · 1 =

= −6 + 0 + (−4)− 0− (−4)− 3 = −9

Thus the volume V of the parallelepiped based on the vectors

320

,

111

and

−21−2

would be:

V = 9 cubic units.

3. Let A =

(−1 3

2 4

)(a) Calculate A−1.

A−1 =1

(−1) · 4− 3 · 2

(4 −3−2 −1

)= − 1

10

(4 −3−2 −1

)=

(− 4

10310

210

110

)(b) Show that AA−1 = I and A−1A = I.

AA−1 =

(−1 3

2 4

)(− 4

10310

210

110

)=

(410 + 6

10 − 310 + 3

10− 8

10 + 810

610 + 4

10

)=

(1 00 1

)= I

A−1A =

(− 4

10310

210

110

)(−1 3

2 4

)=

(410 + 6

10 − 1210 + 12

10− 2

10 + 210

610 + 4

10

)=

(1 00 1

)= I

12.2 Solving systems of linear equations using matrices

A system of linear equations is a set of equations with n equations and n unknowns (x1, x2, . . . , xn), and is ofthe following form:

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

...an1x1 + an2x2 + ...+ annxn = bn

In matrix form the system of equations above can be written as:a11 a12 . . . a1na21 a22 . . . a2n...

. . ....

...an1 an2 ... ann

x1x2

...xn

=

b1b2

...bn

Let A =

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

. . ....

...an1 an2 ... ann

, x =

x1x2

...xn

and b =

b1b2

...bn

.

Then a simpler way to rewrite the system of linear equations is:

Ax = b

Page 4. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.2 Solving systems of linear equations using matrices 12 MATRICES

Hence, whenever we can evaluate A−1, we can use this inverse matrix in order to solve these simultaneouslinear equations, because:

Ax = b

A−1Ax = A−1b

Ix = A−1b

x = A−1b

Examples:

1. Solve the following simultaneous equations by matrix methods.(Compare with the first exercise in chapter 7.2)

I: 2x+ y = 7

II: 3x− 2y = 7

First we must express the equations in matrix form:(2 13 −2

)(xy

)=

(77

)

Then we premultiply both sides by the inverse of

(2 13 −2

):

1

2 · (−2)− 1 · 3

(−2 −1−3 2

)(2 13 −2

)(xy

)=

1

2 · (−2)− 1 · 3

(−2 −1−3 2

)(77

)(

1 00 1

)(xy

)= −1

7

(−21−7

)(xy

)=

(31

)Thus x = 3 and y = 1.

2. Solve the equations

I: 2x− y + z = 5

II: x− 3y + 2z = 2

III: 2x+ y + 4z = −3

One way of solving this system of linear equations is to eliminate the x’s in two equations and then usethese two equations to eliminate y:

I: 2x− y + z = 5

II*=I-2II: 5y − 3z = 1

III*=I-III: −2y − 3z = 8

I: 2x− y + z = 5

II*: 5y − 3z = 1

III**=2II*+5III*: −21z = 42

Row III** gives: z = −2.Using this value in row II* gives: 5y − 3 · (−2) = 1, i.e., y = −1.Finally, using these values in row I gives: 2x− (−1) + (−2) = 5, i.e., x = 3.

Page 5. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.2 Solving systems of linear equations using matrices 12 MATRICES

The same ideas are used when we solve this exercise in matrix form.

We express the equations in matrix form: 2 −1 11 −3 22 1 4

xyz

=

52−3

We solve this matrix equation by reducing the 3× 3 matrix to a triangular matrix. 2 −1 1

0 5 −30 −2 −3

xyz

=

518

2 −1 1

0 5 −30 0 −21

xyz

=

51

42

Row 3: −21z = 42, i.e. z = −2Row 2: 5y − 3 · (−2) = 1, i.e. y = −1.Row 1: 2x− (−1) + (−2) = 5, i.e. x = 3.

The geometrical interpretation of the solution x = 3, y = −1 and z = −2 is that the three planesdefined by the three equations have a common point, (3,−1,−2). In this course, we will only considersystems of equations that have a unique solution.

If you are interested in special cases, consult: A.J. Sadler, D.W.S. Thorning, Understanding Pure Math-ematics, pp. 442ff

The operations, called elementary row operations that we can do are just those that we could do withequations:

1. Exchange two rows.

2. Multiply all elements of a row by a non-zero number.

3. Add two rows.

In these calculations, we distinguish between matrices that have zeros below the diagonal, upper triangularmatrices and those with zeros both above and below the diagonal, diagonal matrices. To solve the linearequations, we reduced the matrix to upper triangular form, then did back substitution. We could also reducethe matrix completely to diagonal form, then divide by the relevant entries to get the complete solution.

Each of the above elementary row operations is equivalent to multiplying on the left by an elementary matrix,for example the matrices (

0 11 0

),

(3 00 1

),

(1 01 1

)applied to a 2× 2 matrix (a) interchange the rows, (b) multiply the first row by 3, and (c) add the first row tothe second row, respectively.

Just as in the case of 2 × 2 matrices (see p. 5), one could also solve the previous system of equations bydetermining the inverse of the corresponding matrix. There are many ways to evaluate the inverse A−1 of a3×3 matrix A. The easiest one is probably to row reduce the matrix to diagonal form, then divide each row bythe amount required to leave the unit matrix, to the matrix (A|I) until we obtain a matrix of the form (I|B).Each row operation is equivalent to multiplying on the left by an elementary matrix, so the combination of therow operations that converted A to I, must correspond to A−1 and also convert I to A−1. Thus the matrix B

Page 6. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.2 Solving systems of linear equations using matrices 12 MATRICES

obtained by this process is the inverse of A, i.e. A−1 = B.

Examples:

1. Find the inverse A−1 of the matrix A =

1 −1 2−1 0 3

2 3 4

.

This is then (A|I): 1 −1 2 1 0 0−1 0 3 0 1 0

2 3 4 0 0 1

Step 1 is to apply the elimination method such that we get 0 in the first column in rows 2 and 3:

� We leave the first row like it is.

� We get the new second row by adding the first row to the second row.

� We get the new third row by adding −2 times the first row to the third row.

1 −1 2 1 0 00 −1 5 1 1 00 5 0 −2 0 1

Step 2 is to apply the elimination method such that we get 0 in the second column in rows 1 and 3:

� We leave the second row like it is.

� We get the new first row by subtracting the second row from the first row.

� We get the new third row by adding 5 times the second row to the third row.

1 0 −3 0 −1 00 −1 5 1 1 00 0 25 3 5 1

Step 3 is to apply the elimination method such that we get 0 in the third column in rows 1 and 2:

� We leave the third row like it is.

� We get the new first row by adding 3 times the third row to 25 times the first row.

� We get the new second row by subtracting the third row from 5 times the second row.

25 0 0 9 −10 30 −5 0 2 0 −10 0 25 3 5 1

Step 4 is to divide the rows by numbers such that we get 1s in the main diagonal. As always, the maindiagonal starts in the left upper corner of the matrix, and in this case it ends with the entry in the thirdrow and third column.

1 0 0 925 − 2

5325

0 1 0 − 25 0 1

5

0 0 1 325

15

125

Page 7. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.2 Solving systems of linear equations using matrices 12 MATRICES

Thus:

A−1 =

925 − 2

5325

− 25 0 1

5

325

15

125

2. Find the inverse A−1 of the matrix A =

−1 2 12 −4 13 −2 −2

.

This is (A|I): −1 2 1 1 0 02 −4 1 0 1 03 −2 −2 0 0 1

Step 1 is to apply the elimination method such that we get 0 in the first column in rows 2 and 3:

� We leave the first row like it is.

� We get the new second row by adding 2 times the first row to the second row.

� We get the new third row by adding 3 times the first row to the third row.

−1 2 1 1 0 00 0 3 2 1 00 4 1 3 0 1

Before we can do step 2, we have to solve the problem that we have 0 in the second column in row 2. Itis allowed to exchange rows (but not columns!), so we exchange rows 2 and 3. −1 2 1 1 0 0

0 4 1 3 0 10 0 3 2 1 0

Step 2 is to apply the elimination method such that we get 0 in the second column in rows 1 and 3:

� We leave the second row like it is.

� We get the new first row by adding the second row to −2 times the first row.

� Here we can leave the third row like it is, as we already have 0 in the second column in row 3.

2 0 −1 1 0 10 4 1 3 0 10 0 3 2 1 0

Step 3 is to apply the elimination method such that we get 0 in the third column in rows 1 and 2:

� We leave the third row like it is.

� We get the new first row by adding the third row to 3 times the first row.

� We get the new second row by adding the third row to −3 times the second row.

6 0 0 5 1 30 −12 0 −7 1 −30 0 3 2 1 0

Page 8. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.3 Transformations in the plane 12 MATRICES

Step 4 is to divide the rows by numbers such that we get 1s in the main diagonal.1 0 0 5

616

12

0 1 0 712 − 1

1214

0 0 1 23

13 0

Thus:

A−1 =

56

16

12

712 − 1

1214

23

13 0

To summarise: We can use row reduction of (A|I) to compute the inverse of a matrix A. In order to solve

systems of equations Ax = b, we can either

1. Row reduce (A|b) to upper triangular form, write the result as equations, and back-substitute.

2. Row reduce (A|b) completely, turning A into I and b into the solution.

3. Find A−1 by the formula (2× 2) or by row reduction (3× 3), then the solution is x = A−1b.

The first method is probably fastest. However the others are useful if we need to solve the same set of equationswith different b, or we need to find A−1 anyway.

12.3 Transformations in the plane

See also: A.J. Sadler, D.W.S. Thorning, Understanding Pure Mathematics,pp. 163ff

Matrices cannot only be used in order to solve systems of linear equations, they can also be used to per-form transformations.

A transformation of a plane takes any point A in the plane and maps it onto one and only one image A′,

also lying in the plane. We say that the point A(x, y) with position vector

(xy

)has an image A′(x′, y′) with

position vector

(x′

y′

)under the transformation.

The basic transformations in the plane are: enlargement (dilatation), reflection, rotation, shear and translation.

In this course, we will only study linear transformations, i.e. transformations that can be expressed by apair of equations of the form

I: x′ = ax+ by

II: y′ = cx+ dy

or, writing this in matrix form (x′

y′

)=

(a bc d

)(xy

).

Thus, every linear transformation of the plane has an associated 2× 2 matrix.

Under a translation by the vector

(rs

), the transformation equations are

I: x′ = x+ r

II: y′ = y + s

Page 9. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.3 Transformations in the plane 12 MATRICES

Thus a translation is not a linear transformation.

Here are two basic facts about linear transformations and their matrices:

� The associated 2× 2 matrix can be determined by examining the images of

(10

)and

(01

).

If

(10

)→(ac

)and

(01

)→(

bd

), then the transformation matrix is

(a bc d

).

� Under any linear transformation, the origin (0, 0) maps onto itself.

Examples:

1. Find the matrices corresponding to each of the following linear transformations and consider the effectof each transformation on the triangle ABC, with A(1, 1), B(3, 1) and C(1, 2):

(a) a rotation of 90◦ anticlockwise about the origin

(b) a reflection in the x-axis

(c) a reflection in the line y = x

(d) an enlargement by the scale factor 3 and with the centre at (0, 0)

(e) a stretch (×2) parallel to the y-axis, x-axis fixed

(f) a shear with x-axis fixed and (0, 1)→ (1, 1)

(a)

Under this transformation

(10

)→(

01

)and

(01

)→(−1

0

).

Thus the required matrix is

(0 −11 0

).

We get the coordinates of the position vectors of the points A′, B′ and C ′ by evaluating the followingmultiplications:

−−→OA′ =

(0 −11 0

)(11

)=

(−1

1

)�

−−→OB′ =

(0 −11 0

)(31

)=

(−1

3

)�

−−→OC ′ =

(0 −11 0

)(12

)=

(−2

1

)(b)

Under this transformation

(10

)→(

10

)and

(01

)→(

0−1

).

Thus the required matrix is

(1 00 −1

).

We get the coordinates of the position vectors of the points A′, B′ and C ′ by evaluating the followingmultiplications:

Page 10. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.3 Transformations in the plane 12 MATRICES

−−→OA′ =

(1 00 −1

)(11

)=

(1−1

)�

−−→OB′ =

(1 00 −1

)(31

)=

(3−1

)�

−−→OC ′ =

(1 00 −1

)(12

)=

(1−2

)

(c)

Under this transformation

(10

)→(

01

)and

(01

)→(

10

).

Thus the required matrix is

(0 11 0

).

We get the coordinates of the position vectors of the points A′, B′ and C ′ by evaluating the followingmultiplications:

−−→OA′ =

(0 11 0

)(11

)=

(11

)�

−−→OB′ =

(0 11 0

)(31

)=

(13

)�

−−→OC ′ =

(0 11 0

)(12

)=

(21

)(d)

Under this transformation

(10

)→(

30

)and

(01

)→(

03

).

Thus the required matrix is

(3 00 3

).

Page 11. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.3 Transformations in the plane 12 MATRICES

We get the coordinates of the position vectors of the points A′, B′ and C ′ by evaluating the followingmultiplications:

−−→OA′ =

(3 00 3

)(11

)=

(33

)�

−−→OB′ =

(3 00 3

)(31

)=

(93

)�

−−→OC ′ =

(3 00 3

)(12

)=

(36

)(e)

Under this transformation

(10

)→(

10

)and

(01

)→(

02

).

Thus the required matrix is

(1 00 2

).

We get the coordinates of the position vectors of the points A′, B′ and C ′ by evaluating the followingmultiplications:

−−→OA′ =

(1 00 2

)(11

)=

(12

)�

−−→OB′ =

(1 00 2

)(31

)=

(32

)�

−−→OC ′ =

(1 00 2

)(12

)=

(14

)(f)

Under this transformation

(10

)→(

10

)and

(01

)→(

11

).

Thus the required matrix is

(1 10 1

).

We get the coordinates of the position vectors of the points A′, B′ and C ′ by evaluating the followingmultiplications:

−−→OA′ =

(1 10 1

)(11

)=

(21

)�

−−→OB′ =

(1 10 1

)(31

)=

(41

)

Page 12. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.3 Transformations in the plane 12 MATRICES

−−→OC ′ =

(1 10 1

)(12

)=

(32

)

2. A linear transformation T has matrix

(2 −11 1

). Find (a) the image of the point (2, 3) under T , (b)

the coordinates of the point having an image of (7, 2) under T .

If (x′, y′) is the image of (x, y) then (x′

y′

)=

(2 −11 1

)(xy

)(a) In this case (x, y) = (2, 3).

Hence: (x′

y′

)=

(2 −11 1

)(23

)(x′

y′

)=

(15

)Thus (1, 5) is the image of the point (2, 3) under T .

(b) In this case (x′, y′) = (7, 2).Hence: (

72

)=

(2 −11 1

)(xy

)Premultiplying both sides of this equation by the inverse of

(2 −11 1

):

1

3

(1 1−1 2

)(72

)=

(1 00 1

)(xy

)1

3

(9−3

)=

(xy

)Hence, x = 3 and y = −1.Thus (3,−1) is the point having an image of (7, 2) under T .

Page 13. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.3 Transformations in the plane 12 MATRICES

3. Find the 2× 2 matrix that will transform the point (1, 2) to (3, 3) and the point (−1, 1) to (−3, 3).

Let the matrix be

(a bc d

).

Then (a bc d

)(12

)=

(33

)and

(a bc d

)(−1

1

)=

(−3

3

)We can rewrite this into the following four equations:

*I: a+ 2b = 3

**II: c+ 2d = 3

III: −a+ b = −3

IV: −c+ d = 3

I+III: 3b = 0

b = 0

*I: a+ 2 · 0 = 3

a = 3

II+IV: 3d = 6

d = 2

**II: c+ 2 · 2 = 3

c = −1

Thus the required matrix is:

(3 0−1 2

)The following facts regarding transformation matrices should also be noted:

Let T be the matrix that corresponds to a certain linear transformation, let S′ be the image of a shape Sunder this transformation, and let AS and AS′ be the areas of the shapes S and S′ respectively. Then

Page 14. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.4 Linear transformations in 3-D space 12 MATRICES

� the inverse matrix T−1 maps S′ back onto S.

� det T gives the scale factor for any change of the area AS under the transformation, i.e.

AS′ = |det T | ·AS

If det T = 0, i.e. if T is a singular matrix, then T maps all points in the plane onto a line.

� If the matrix P transforms (x, y) to (x′, y′) and the matrix Q transforms (x′, y′) to (x′′, y′′), then thematrix given by the product QP will transform (x, y) directly to (x′′, y′′).

Exercise: Prove that the transformation matrix

(1 22 4

)maps all points of the x-y plane onto a straight line

and find the equation of that line.

We evaluate the determinant of the transformation matrix:∣∣∣∣ 1 22 4

∣∣∣∣ = 4− 4 = 0

Thus, all points in the plane will be mapped onto a line. We consider:(x′

y′

)=

(1 22 4

)(xy

)=

(x+ 2y

2x+ 4y

)=

(x+ 2y

2(x+ 2y)

)Hence, all image points lie on the line y = 2x.

12.4 Linear transformations in 3-D space

See also: A.J. Sadler, D.W.S. Thorning, Understanding Pure Mathematics,pp. 433ff

In the previous chapter we saw that a linear transformation in 2-dimensional space has an associated 2 × 2matrix. Similarly any linear transformation in 3-dimensional space has an associated 3×3 matrix. If under this

transformation the points with position vectors

100

,

010

and

001

are transformed to the points with

Page 15. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.4 Linear transformations in 3-D space 12 MATRICES

position vectors

abc

,

def

and

ghi

respectively, then the associated 3× 3 matrix is

a d gb e hc f i

.

As in 2-D space, the origin (0, 0, 0) is mapped onto itself by a linear transformation in 3-D space: a d gb e hc f i

000

=

000

Examples: Find the 3× 3 matrix representing the following linear transformations in 3-D space:

1. reflection in the x-y plane (i.e. the plane z = 0),

2. 90◦ rotation about the x-axis such that the positive y-axis maps onto the positive z-axis,

3. reflection in the y + x = 0 plane,

4. stretch parallel to the x-axis, scale factor 2, with y-z plane fixed,

5. orthogonal projection onto the x-z plane.

1.

Under this transformation

100

→ 1

00

,

010

→ 0

10

and

001

→ 0

0−1

.

Thus the required matrix is

1 0 00 1 00 0 −1

.

2.

Under this transformation

100

→ 1

00

,

010

→ 0

01

and

001

→ 0−1

0

.

Thus the required matrix is

1 0 00 0 −10 1 0

.

Page 16. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.4 Linear transformations in 3-D space 12 MATRICES

3. Under this transformation

100

→ 0−1

0

,

010

→ −1

00

and

001

→ 0

01

.

Thus the required matrix is

0 −1 0−1 0 0

0 0 1

.

4. Under this transformation

100

→ 2

00

,

010

→ 0

10

and

001

→ 0

01

.

Thus the required matrix is

2 0 00 1 00 0 1

.

5. This projection maps any point A(a, b, c) onto the point A′(a, 0, c).

Thus

100

→ 1

00

,

010

→ 0

00

and

001

→ 0

01

and the required matrix is

1 0 00 0 00 0 1

.

The following facts regarding 3 × 3 transformation matrices should be noted (compare with the properties of2× 2 transformation matrices, p. 152):

Let T be the matrix that corresponds to a certain linear transformation, let S′ be the image of a solid Sunder this transformation, and let VS and VS′ be the volumes of the solids S and S′ respectively. Then

� the inverse matrix T−1 maps S′ back onto S.

� det T gives the scale factor for any change of the volume VS under the transformation, i.e.

VS′ = |det T | · VS

If det T = 0, i.e. if T is a singular matrix, then T maps all points in 3-D space either onto a line or ontoa plane (as in example 5 above).

� If the matrix P transforms (x, y, z) to (x′, y′, z′) and the matrix Q transforms (x′, y′, z′) to (x′′, y′′, z′′),then the matrix given by the product QP will transform (x, y, z) directly to (x′′, y′′, z′′).

Examples:

1. Show that the matrix M =

−1 1 32 −2 −6−4 4 12

maps all points in 3-D space onto a line and find the

cartesian equations of this line.

Page 17. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.4 Linear transformations in 3-D space 12 MATRICES

det M = (−1) · (−2) · 12 + 1 · (−6) · (−4) + 3 · 2 · 4− 3 · (−2) · (−4)− 1 · 2 · 12− (−1) · (−6) · 4 =

= 24 + 24 + 24− 24− 24− 24 = 0

Thus M maps all points in 3-D space either onto a line or onto a plane.

In order to find out whether the image of the transformation is a line or a plane, we consider: x′

y′

z′

=

−1 1 32 −2 −6−4 4 12

xyz

=

−x+ y + 3z2x− 2y − 6z−4x+ 4y + 12z

We see that: x′ = − 1

2y′ and x′ = 1

4z′

Thus this transformation maps all points onto the line with cartesian equations

x = −1

2y =

1

4z

Another way to solve this exercise can be found in: A.J. Sadler, D.W.S. Thorning, Understanding PureMathematics, p. 434

2. Show that the matrix M =

3 −2 0−1 3 7

2 −1 1

maps all points in 3-D space onto a plane and find the

cartesian equation of this plane.

det M = 3 · 3 · 1 + (−2) · 7 · 2 + 0 · (−1) · (−1)− 0 · 3 · 2− (−2) · (−1) · 1− 3 · 7 · (−1) =

= 9 + (−28) + 0− 0− 2− (−21) = 0

Thus M maps all points in 3-D space either onto a line or onto a plane.

In order to find out whether the image of the transformation is a line or a plane, we consider again: x′

y′

z′

=

3 −2 0−1 3 7

2 −1 1

xyz

=

3x− 2y−x+ 3y + 7z

2x− y + z

As the formulas for x′, y′ and z′ are not multiples of each other, we know that M maps all points in 3-Dspace onto a plane.In order to find the equation of this plane we need the coordinates of the images of three points that donot all lie on the same straight line.Just by looking at the matrix, we know already that under this transformation the points A(1, 0, 0),B(0, 1, 0) and C(0, 0, 1) are mapped onto A′(3,−1, 2), B′(−2, 3,−1) and C ′(0, 7, 1). So, we have to findthe plane which is determined by A′, B′ and C ′. However, to make the calculation easier, it is betterto replace one of these images by the image of the origin O which is always O′(0, 0, 0) under a lineartransformation. So, let’s replace C ′ by O′. We have:

−−→O′A′ =

3−1

2

and−−−→O′B′ =

−23−1

Thus the parametric vector equation of the required plane is:

r =

000

+ λ

3−1

2

+ µ

−23−1

Page 18. ©University of Bristol 2012. This material is copyright of the University unless

explicitly stated otherwise. It is provided exclusively for educational purposes at theUniversity and is to be downloaded or copied for your private study only.

12.5 Eigenvectors and eigenvalues 12 MATRICES

**I: x = 3λ− 2µ

II: y = −λ+ 3µ

*III: z = 2λ− µ

II+3III: y + 3z = 5λ

λ =1

5y +

3

5z

*III: µ =2

5y +

6

5z − z

µ =2

5y +

1

5z

**I: x =3

5y +

9

5z − 4

5y − 2

5z

x = −1

5y +

7

5z

Thus 5x+ y − 7z = 0 is the cartesian equation of the required plane.

Another way to solve this exercise can be found in: A.J. Sadler, D.W.S. Thorning, UnderstandingPure Mathematics, p. 434

12.5 Eigenvectors and eigenvalues

In this section, we are interested in straight lines passing through the origin that are mapped onto themselves.

In 2-D space, a straight line through the origin can be described by the following parametric vector equa-tion:

L :

(xy

)=

(00

)+ s

(v1v2

)And similar in 3-D space:

L :

xyz

=

000

+ s

v1v2v3

Hence, in general a straight line through the origin can be described by:

L : r = sv

Let A be the matrix of any linear transformation. How can we find a straight line L passing through the originthat is mapped onto itself under this linear transformation? In other words: How can we find the correspondingvector v of any such line?

Let P be a point on such a special straight line L where P is distinct from the origin: then the positionvector p of any such point P can be expressed as

p = s1v

where s1 is a constant number. Since P is lying on L, its image P ′ must lie on L as well. Therefore, it mustbe possible to find another constant number s2 such that the position vector p’ of P ′ can be expressed as:

p’ = s2v

Page 19. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

12.5 Eigenvectors and eigenvalues 12 MATRICES

Thus we get:

Ap = p’

A (s1v) = s2v

s1Av = s2v

Av =s2s1

v

Let λ = s2s1

, then:

Av = λv

Av− λv = 0

(A− λI)v = 0

Our goal is thus to find those vectors v which satisfy this last equation.If the inverse of the matrix (A−λI) existed, then the (only) solution of the equation would be the zero vector,but then both v and p would have to be 0 and L could not be a straight line.That’s why we will only get a proper solution if (A− λI) is not invertible, i.e., if

det(A− λI) = 0

The values for λ that solve this equation are called eigenvalues and the corresponding vectors v which thencan be evaluated and which determine the straight lines through the origin that are mapped onto themselvesare called eigenvectors.Exercise:

Find the equations of any lines passing through the origin that are mapped onto themselves by the trans-

formation defined by the matrix

(4 13 2

).

As a first step, we have to find the eigenvalues of this matrix:∣∣∣∣ 4− λ 13 2− λ

∣∣∣∣ = 0

(4− λ)(2− λ)− 1 · 3 = 0

8− 6λ+ λ2 − 3 = 0

λ2 − 6λ+ 5 = 0

λ =6±√

36− 20

2λ = 5 or λ = 1

Thus the eigenvalues are λ = 5 and λ = 1.

Now, we want to find the vectors v =

(v1v2

)that solve for either eigenvalue the following equation:

(4− λ 1

3 2− λ

)(v1v2

)= 0

For λ = 5 we get: (4− 5 1

3 2− 5

)(v1v2

)= 0(

−1 13 −3

)(v1v2

)= 0

Page 20. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

13 FUNCTIONS OF TWO VARIABLES

I: −v1 + v2 = 0

II: 3v1 − 3v2 = 0

As one equation is a multiple of the other one, it is not possible to find a unique solution for v1 and v2. All

vectors v =

(v1v2

)with v1 = v2 are eigenvectors for this transformation and can be used in order to describe

the first straight line L1 that passes through the origin and is mapped onto itself.

If we choose v =

(11

), we can e.g. write L1 as:

L1 : r = s

(11

)For λ = 1 we get: (

4− 1 13 2− 1

)(v1v2

)= 0(

3 13 1

)(v1v2

)= 0

I: 3v1 + v2 = 0

II: 3v1 + v2 = 0

As again one equation is a multiple of the other one, it is not possible to find a unique solution for v1 and v2.

All vectors v =

(v1v2

)with v2 = −3v1 are also eigenvectors for this transformation and can be used in order

to describe the second straight line L2 that passes through the origin and is mapped onto itself.

If we choose v =

(1−3

), we can thus write L2 as:

L2 : r = t

(1−3

)Examples like this one can be solved in a similar way in 3-D space, but we won’t cover that in this lecture.

13 Functions of two variables

13.1 Surfaces and contour lines

So far we have dealt with functions of a single variable. But, in the real world, physical quantities often dependon two or more variables. In this section, we discuss functions of two variables.

A function f of two variables is a rule that assigns to each ordered pair (x, y) of real numbers in a set Da unique real number z, written as z = f(x, y). The set D is the domain of f and the set of all elements f(x, y)is called the range of f . The variables x and y are independent variables and z is the dependent variable.Like before, it is possible to visualise the behaviour of a function by considering its graph. We know that thegraph of a function f of one variable is a curve C with equation y = f(x). The graph of a function f of twovariables is a surface S with equation z = f(x, y).

As it is often not easy to draw 3D-graphs by hand, we will always use Maple in this course in order tovisualise the behaviour of a function of two variables.

Examples:

Page 21. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

13.1 Surfaces and contour lines 13 FUNCTIONS OF TWO VARIABLES

1. Plot the graph of the function f(x, y) = 6− 3x− 2y.

Maple: plot3d(6− 3x− 2y,x = −5..5,y = −5..5,axes=boxed);

The function in this example is a special case of a function

f(x, y) = ax+ by + c

which is called a linear function. The graph of such a function has the equation z = ax + by + c, orax+ by − z + c = 0, so it is a plane.

2. Plot the graph of the function g(x, y) =√

9− x2 − y2.

Maple: plot3d(sqrt(9− x2 − y2),x = −3..3,y = −3..3,axes=normal,grid=[100,100]);

3. Plot the graph of the function h(x, y) = 4x2 + y2.

Maple: plot3d(4x2 + y2,x = −3..3,y = −3..3,axes=normal);

Once Maple has created a surface image, it is possible to explore various options for axes, shading, contoursand so on by clicking on the right mouse-button. By holding down a left click on the image it is possible torotate it in any direction.

Page 22. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

13.1 Surfaces and contour lines 13 FUNCTIONS OF TWO VARIABLES

Another method for visualising functions, borrowed from mapmakers, is a contour map on which points ofconstant elevation are joined to form contour curves, also called contour lines or level curves.

The level curves of a function f of two variables are the curves with equations f(x, y) = c, where c is aconstant (in the range of f).

One common example of level curves occurs in topographic maps of mountainous regions. The level curves arecurves of constant elevation above sea level. If you walk along one of these contour lines you neither ascendnor descend.

Examples:

1. Sketch the level curves of the function z = f(x, y) = 6− 3x− 2y for the values c = −6, 0, 6, 12.The level curves are

6− 3x− 2y = c or y = −3

2x− 1

2(c− 6)

This is a family of straight lines with slope − 32 . The four particular level curves with c = −6, 0, 6, 12 are:

y = −3

2x+ 6

y = −3

2x+ 3

y = −3

2x

y = −3

2x− 3

Page 23. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

13.2 Partial derivatives 13 FUNCTIONS OF TWO VARIABLES

The level curves are equally spaced parallel lines because the graph of f is, as we have seen before, aplane.

2. Given the function z = g(x, y) =√

9− x2 − y2, plot and label the contour lines where g(x, y) takes thevalues c1 = 0, c2 = 1, c3 = 2 and c4 = 3.

In general for any constant c, the level curves are√9− x2 − y2 = c or x2 + y2 = 9− c2

This is a family of concentric circles with center (0, 0) and radius√

9− c2.The four particular contour lines where c1 = 0, c2 = 1, c3 = 2 and c4 = 3 are:

x2 + y2 = 9

x2 + y2 = 8

x2 + y2 = 5

x2 + y2 = 0

13.2 Partial derivatives

13.2.1 First partial derivatives

Let f(x, y) be a function of two variables. Now keep y constant, and consider the limit:

limh→0

f(x+ h, y)− f(x, y)

h

If this limit exists, its value is the derivative of f with respect to x at (x, y); it’s called the(first) partial derivative of f with respect to x.

Page 24. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

13.2 Partial derivatives 13 FUNCTIONS OF TWO VARIABLES

If z = f(x, y), we can use either of these notations for the partial derivative with respect to x:

fx(x, y), fx,∂f

∂x,∂

∂xf(x, y) or

∂z

∂x

Similarly, we can keep x constant and consider:

limh→0

f(x, y + h)− f(x, y)

h

If this limit exists, it’s called the (first) partial derivative of f with respect to y Similar notations, like thoseabove, can be used.

Rule for finding partial derivatives of z = f(x, y):

� To find fx, regard y as a constant and differentiate f(x, y) with respect to x.

� To find fy, regard x as a constant and differentiate f(x, y) with respect to y.

Examples:

1. Find the partial derivatives ∂z∂x and ∂z

∂y for

(a) z = 3x− 2y4

∂z

∂x= 3

∂z

∂y= −8y3

(b) z = 5x ln y + cosx

∂z

∂x= 5 ln y − sinx

∂z

∂y= 5x · 1

y=

5x

y

2. If f(x, y) = x3 + x2y3 − 2y2, find fx(2, 1) and fy(2, 1).

At first, we have to evaluate fx(x, y) and fy(x, y):

fx(x, y) = 3x2 + 2xy3

fy(x, y) = 3x2y2 − 4y

Now, we can evaluate both partial derivatives at the point (2, 1):

fx(2, 1) = 3 · 22 + 2 · 2 · 13 = 16

fy(2, 1) = 3 · 22 · 12 − 4 · 1 = 8

Geometric interpretation:

Suppose the graph of z = f(x, y) is the surface shown below. Consider the partial derivative of f withrespect to x at a point (x0, y0).Holding the y-value constant and varying x, we trace out a curve that is the intersection of the surface withthe vertical plane y = y0.The partial derivative fx(x0, y0) measures the change in z per unit increase in x along this curve. That is,fx(x0, y0) is just the slope of the curve at (x0, y0). The geometrical interpretation of fy(x0, y0) is analogous.

Similarly, contour plots can also be related to partial derivatives. For example, a vertical contour at a pointmeans that the function has zero y derivative at that point. If the contours correspond to evenly spaced valuesof the function (eg equally spaced c), then closely spaced contours in a region are associated with large valuesof one or both of the partial derivatives, or in the case of a topographic map, that the terrain is very steep.

Page 25. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

13.3 Maxima and minima 13 FUNCTIONS OF TWO VARIABLES

13.2.2 Second partial derivatives

If f is function of two variables, then its partial derivatives fx and fy are also functions of two variables, so we canconsider their partial derivatives (fx)x, (fx)y, (fy)x, and (fy)y, which are called the second partial derivatives of f .

If z = f(x, y), we use the following notations:

(fx)x = fxx =∂

∂x

(∂f

∂x

)=∂2f

∂x2=∂2z

∂x2

(fx)y = fxy =∂

∂y

(∂f

∂x

)=

∂2f

∂y∂x=

∂2z

∂y∂x

(fy)x = fyx =∂

∂x

(∂f

∂y

)=

∂2f

∂x∂y=

∂2z

∂x∂y

(fy)y = fyy =∂

∂y

(∂f

∂y

)=∂2f

∂y2=∂2z

∂y2

Exercise: Find the second partial derivatives of

f(x, y) = x3 + x2y3 − 2y2.

From before we already know that:

fx(x, y) = 3x2 + 2xy3 and fy(x, y) = 3x2y2 − 4y

Therefore:

fxx =∂

∂x(3x2 + 2xy3) = 6x+ 2y3 fxy =

∂y(3x2 + 2xy3) = 6xy2

fyx =∂

∂x(3x2y2 − 4y) = 6xy2 fyy =

∂y(3x2y2 − 4y) = 6x2y − 4

Notice that fxy = fyx. This is not just a coincidence. It turns out that the mixed partial derivatives fxy andfyx are equal for most functions that one meets in practice. We won’t discuss that in detail in this lecture.

13.3 Maxima and minima

We have already studied how it is possible to determine maximum and minimum points of functions of a singlevariable. We will see in this chapter that it works in a similar way for functions with two variables.

A point (a, b) is called a critical point (or stationary point) of f if fx(a, b) = 0 and fy(a, b) = 0, or if oneof these partial derivatives does not exist. At a critical point, a function can have a local maximum or a localminimum or neither.

Page 26. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

13.3 Maxima and minima 13 FUNCTIONS OF TWO VARIABLES

By checking the second partial derivatives, it is (most of the time) possible to decide whether a critical pointis a local maximum or local minimum or neither.

Second Derivatives Test:Suppose the second partial derivatives of f are continuous at (a, b), and suppose that fx(a, b) = 0 andfy(a, b) = 0.Let

D = D(a, b) = fxx(a, b)fyy(a, b)− [fxy(a, b)]2

1. If D > 0 and fxx(a, b) > 0, then f attains a local minimum at (a, b).

2. If D > 0 and fxx(a, b) < 0, then f attains a local maximum at (a, b).

3. If D < 0, then f has a saddle point at (a, b).

4. If D = 0, then no conclusion can be drawn (any of these behaviours is possible).

To remember the formula for D it’s helpful to write it as a determinant:

D =

∣∣∣∣ fxx fxyfyx fyy

∣∣∣∣ = fxxfyy − (fxy)2

Exercise: Find at which points the function f(x, y) = x4 +y4−4xy+1 has local maximum and local minimumvalues, and which points are saddle points.

We first locate the critical points:

fx = 4x3 − 4y fy = 4y3 − 4x

Setting these partial derivatives equal to 0, we obtain the equations

I: x3 − y = 0

II: y3 − x = 0

To solve these equations we substitute y = x3 from the first equation into the second one. This gives:

0 = x9 − x = x(x8 − 1) = x(x4 − 1)(x4 + 1) = x(x2 − 1)(x2 + 1)(x4 + 1)

So there are three real roots: x = 0, 1,−1By substituting these values into the first equation we get the corresponding y-values. Thus the three criticalpoints are (0, 0), (1, 1), and (−1,−1).

Next we calculate the second partial derivatives and D(x, y):

fxx = 12x2 fxy = −4 fyy = 12y2

D(x, y) = fxxfyy − (fxy)2 = 144x2y2 − 16

Since D(0, 0) = −16 < 0, according to the Second Derivatives Test, the origin is a saddle point.

Since D(1, 1) = 128 > 0 and fxx(1, 1) = 12 > 0, there is a local minimum at (1, 1), which is f(1, 1) = −1.

Similarly, we have D(−1,−1) = 128 > 0 and fxx(−1,−1) = 12 > 0, so there is also a local minimum at(−1,−1), which is also f(−1,−1) = −1.

In order to visualise these results, we can plot the function using Maple:

Page 27. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

14 DIFFERENTIAL EQUATIONS

14 Differential equations

See also: A.J. Sadler, D.W.S. Thorning, Understanding Pure Mathematics,pp. 509ff

When we solve an algebraic (eg linear or quadratic) equation involving a variable x, a solution is a realor complex number. If we substitute a solution for x, the equation is satisfied. Some equations have no solu-tions, some have one and some have more. For example, the solutions of x2 = 4 are 2 and −2. Substitutingeither of these solutions gives the equation 4 = 4.

A differential equation is an equation involving a function y = f(x) that contains derivatives. A solution ofa differential equation is a function that when substituted, leads to an equation satisfied for all x. For example,y′ = 2y/x is a differential equation. If we substitute y = x2 we get 2x = 2x, which is an equation valid forall x. So this is a solution of the differential equation. y = 3x2 gives the equation 6x = 6x, so this is anothersolution. We can see that y = cx2 for any constant c is a solution; in fact it turns out that these are the onlysolutions of this equation.

The order of a differential equation is the order of the highest derivative that appears in the equation.

Examples:

�1xy′ = ln x

sin y is a first order differential equation.

� (y′′)4 + 11y′ + 12y = x3 + 5x− 7 is a second order differential equation.

Of course we could use variables other than x and y to write down differential equations. Often we wantto describe how quantities change with time, so we would use t in place of x.

14.1 First order differential equations

Without realising it, we have already studied how to solve first order differential equations of the form

y′ = f(x).

Solving for y is easy. We just need to integrate both sides:

y =

∫f(x)dx

This gives the family of solutions, also called general solution, y = F (x) + c for the differential equation, wherec is an arbitrary constant of integration.

Page 28. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

14.1 First order differential equations 14 DIFFERENTIAL EQUATIONS

If an initial condition is given along with the differential equation, that is, a constraint of the form y = y0 whenx = x0, then this information can be used to determine the particular value of c. In this way, one particularsolution can be selected from the family of solutions – the one that satisfies both the differential equation andthe initial condition.

Examples:

1. Find the general solution of the differential equation y′ = 2x− 3.

y =

∫(2x− 3)dx = 2 · x

2

2− 3x+ c = x2 − 3x+ c

If we were to draw the graphs of y = x2 − 3x + c for various values of c, we would obtain a family ofcurves, each of which has the property that y′ = 2x− 3.

2. Solve the differential equation y′ + 4 = 3x2 given that when x = 1, y = 2.

First, we find the general solution:

y′ + 4 = 3x2

y′ = 3x2 − 4

y =

∫(3x2 − 4)dx

y = 3 · x3

3− 4x+ c

y = x3 − 4x+ c

But when x = 1, y = 2, thus:

2 = 13 − 4 · 1 + c

c = 5

Hence y = x3 − 4x+ 5 is the required solution.

In this course we will only study one other type of first order differential equation, equations that can beexpressed in the form

y′ =f(x)

g(y).

Differential equations of this type can be solved by separating the variables.

In this case it is helpful to use the notation dydx for y′. So we can rewrite the equation above as:

dy

dx=f(x)

g(y)

Page 29. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

14.1 First order differential equations 14 DIFFERENTIAL EQUATIONS

Now we can ‘put the x’s with the dx and the y’s with the dy’ and integrate both sides:∫g(y)dy =

∫f(x)dx

Note that dydx is merely a useful notation that helps us to remember how differential equations of the type from

above can be solved – it is NOT an actual fraction.Examples:

1. Solve the equation dydx = x(x−2)

ey .

We separate the variables and integrate both sides:∫eydy =

∫(x(x− 2))dx∫

eydy =

∫(x2 − 2x)dx

ey =x3

3− 2 · x

2

2+ c

ey =1

3x3 − x2 + c

(Why do we know that∫eydy = ey? Because we already know that if f(y) = ey then f ′(y) = ey.)

As a last step we solve for y:

y = ln(1

3x3 − x2 + c)

2. Solve the differential equation y′ = 2sin y .

dy

dx=

2

sin y∫sin y dy =

∫2 dx

− cos y = 2x+ c

cos y = −2x− cy = cos−1(−2x− c)

Note: As c is an arbitrary constant which can take either positive or negative values, we lose no generalityby writing this solution as

y = cos−1(c− 2x)

3. Solve the equation y′ = y2 subject to y(0) = 1.

Again, we can rearrange the equation to separable form:

dy

dx= y2∫

y−2dy =

∫1dx

−y−1 = x+ c

y =−1

x+ c

Page 30. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

14.1 First order differential equations 14 DIFFERENTIAL EQUATIONS

Now, use the initial condition to find the constant c:

1 =−1

0 + c

c = −1

y =−1

x− 1=

1

1− xHaving studied these two types of differential equations, we are now able to solve real-world questions like

in the following exercise.

Exercise: An animal has mass 30 grams at birth. It reaches maturity in 3 months. The rate of growthm′(t) is given by 120(t− 3)2, where m grams is the mass of the animal t months after birth.

� Find the mass of the animal when fully grown.

� How long does it take for the animal to reach a mass of 790 grams?

At first we find a formula for the mass m(t) of the animal after t months.

m′(t) = 120(t− 3)2

m′(t) = 120(t2 − 6t+ 9)

m′(t) = 120t2 − 720t+ 1080

m(t) =

∫(120t2 − 720t+ 1080)dt

m(t) = 120 · t3

3− 720 · t

2

2+ 1080t+ c

This leads us to the general solution

m(t) = 40t3 − 360t2 + 1080t+ c.

However, only one equation from this family of solutions is right for this problem. It is given that, when t = 0(at birth), m = 30. So c must satisfy the equation

30 = 40 · 03 − 360 · 02 + 1080 · 0 + c,

giving c = 30.

The mass of the animal after t months is therefore

m(t) = 40t3 − 360t2 + 1080t+ 30

The mass when fully grown is found by putting t = 3 in this formula, giving

m(3) = 40 · 33 − 360 · 32 + 1080 · 3 + 30 = 1110.

So the mass of the animal at maturity is 1110 grams.

In order to find how long it takes for the animal to reach a mass of 790 grams, we have to solve the fol-lowing equation:

40t3 − 360t2 + 1080t+ 30 = 790

40t3 − 360t2 + 1080t− 760 = 0

t3 − 9t2 + 27t− 19 = 0

(t− 1)(t2 − 8t+ 19) = 0

We get only one real solution, t = 1. Hence, after 1 month the animal reaches a mass of 790 grams.

Page 31. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

14.2 Second order differential equations 14 DIFFERENTIAL EQUATIONS

14.2 Second order differential equations

In this course, we will consider two standard forms of second order differential equations.

Differential equations of the formy′′ = f(x)

can be solved by integrating with respect to x, twice. The first integration gives y′ and the second integrationgives y.

Exercise: Solve the differential equation d2ydx2 = 6x− 2, given that when x = 1, dy

dx = 2 and y = 3.

dy

dx=

∫(6x− 2)dx

dy

dx= 6 · x

2

2− 2x+ c1

dy

dx= 3x2 − 2x+ c1

We know that, when x = 1, dydx = 2, thus c1 must satisfy the equation

2 = 3 · 12 − 2 · 1 + c1

giving c1 = 1.

Thus:dy

dx= 3x2 − 2x+ 1

Integrating again gives

y = 3 · x3

3− 2 · x

2

2+ x+ c2 = x3 − x2 + x+ c2

But when x = 1, y = 3, thus c2 must satisfy the equation

3 = 13 − 12 + 1 + c2

giving c2 = 2.

Thus the required solution is y = x3 − x2 + x+ 2.

The second type of second order differential equations we discuss in this course is of the form

ay′′ + by′ + cy = f(x)

If the right-hand side of this equation is equal to zero, that is, if the equation is of the form

ay′′ + by′ + cy = 0

then it’s said to be homogeneous.The general solution of such a homogeneous differential equation can be determined by taking the followingsteps:

By substituting y = epx, y′ = pepx and y′′ = p2epx into the differential equation, we get

ap2epx + bpepx + cepx = 0

which leads us to the following quadratic equation:

ap2 + bp+ c = 0

Page 32. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

14.2 Second order differential equations 14 DIFFERENTIAL EQUATIONS

� If this quadratic equation has real distinct roots p1 and p2, the general solution is

y = Aep1x +Bep2x.

� If this quadratic equation has a repeated root p, the general solution is

y = (A+Bx)epx

� If the roots are not real, i.e., if the roots are complex conjugates p1 = α+ βi and p2 = α− βi, then thegeneral solution is

y = eαx(A cosβx+B sinβx)

For f(x) 6= 0, we first obtain the general solution of the differential equation with f(x) = 0. This is called thecomplementary function, and then we add a particular solution, i.e.

general solution = complementary function + particular solution.

Examples of particular solutions are:

� f(x) = 2x+ 3: Choose Cx+D.

� f(x) = x2: Choose Cx2 + Dx + E since the derivatives in the equation will lead to the lower degreeterms.

� f(x) = e2x: Choose Ce2x.

� f(x) = sin 3x: Choose C sin 3x+D cos 3x again due to derivatives in the equation.

� f(x) = ep1x ie something from the complementary function: The same function won’t work; it turns outwe can multiply by x: Choose (Cx+D)ep1x.

In each case, subsitute into the original equation and determine the unknown constants C, D etc.Finally, if there are initial conditions, use them to find the constants A and B in the general solution (not

the complementary function).Examples:

1. Find the general solution to the differential equation y′′ − 4y′ + 3y = 0.

By substituting y = epx, y′ = pepx and y′′ = p2epx into the differential equation, we get

p2epx − 4pepx + 3epx = 0

which leads us to the following quadratic equation:

p2 − 4p+ 3 = 0

p =4±√

16− 12

2

p =4± 2

2p1 = 3 and p2 = 1

As this quadratic equation has real distinct roots, the general solution to the differential equation is

y = Ae3x +Bex.

Page 33. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.

14.2 Second order differential equations 14 DIFFERENTIAL EQUATIONS

2. Find the general solution to the differential equation

4d2y

dx2+ 4

dy

dx+ y = 3x+ 4.

and the solution satisfying y = 2 and dydx = 4 at x = 0.

To find the complementary function we solve 4y′′ + 4y′ + y = 0.Substituting y = epx, y′ = pepx and y′′ = p2epx into the differential equation will lead us to the followingquadratic equation:

4p2 + 4p+ 1 = 0

p =−4±

√16− 16

8

i.e. p = −1

2is a repeated root.

Thus the complementary function is y = (A+Bx)e−12x.

To find a particular solution we try a solution of the form of the R.H.S. of the differential equation,i.e. y = Cx+D. The corresponding derivatives are: y′ = C and y′′ = 0.

(Note: If the R.H.S. is a quadratic polynomial, we have to tryy = Cx2 +Dx+ E, and so on.)

Substitution in the differential equation gives:

4 · 0 + 4 · C + (Cx+D) = 3x+ 4

Cx+ (4C +D) = 3x+ 4

Now we can find C and D by comparing the coefficients of the L.H.S and of the R.H.S.:

I: C = 3

II: 4C +D = 4

4 · 3 +D = 4

D = −8

Thus a particular solution is y = 3x− 8 and the general solution to the differential equation is:

y = (A+Bx)e−12x + 3x− 8

Finally, we can also find a solution satisfying the initial conditions. Differentiating the general solutiongives

dy

dx= Be−

12x − 1

2(Ax+B)e−

12x + 3

Substituting x = 0 and y = 2 gives A = 10. Then substituting x = 0 and dydx = 4 gives B −A/2 + 3 = 4,

so B − 5 + 3 = 4 hence B = 6. So the final solution is

y = (10 + 6x)e−12x + 3x− 8

Page 34. ©University of Bristol 2012. This material is copyright of the University unlessexplicitly stated otherwise. It is provided exclusively for educational purposes at the

University and is to be downloaded or copied for your private study only.