chapter 4: linear equations - school of mathematics and...

42
Chapter 4: Linear Equations Daniel Chan UNSW Semester 1 2018 Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 1 / 42

Upload: phungtuong

Post on 07-Mar-2018

218 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Chapter 4: Linear Equations

Daniel Chan

UNSW

Semester 1 2018

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 1 / 42

Page 2: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

An Ancient Chinese Problem

The following maths problem was taken from the Chinese maths text “NineChapters on the Mathematical Arts” ca. 200CE

ProblemOne pint of good wine costs 50 gold pieces, one pint of bad only 10. If two pintsare bought for 30 gold pieces, how much of each wine is bought?

The Chinese knew this is a simple algebra problem. If x , y are the amount (inpints) of good and bad wine bought then

x + y = 2 (1)

50x + 10y = 30 (2)

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 2 / 42

Page 3: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Kindergarten solution

We review the solution, as we wish to generalise this later.

Key Eliminate variables. This can be done in lots of ways but the method we’llgeneralise is

Subtract 50 × eqn (1) from eqn (2) to get

−40y = −70 =⇒ y =7

4.

Now obtain x by using this and eqn (1) (or (2))

x = 2− y =1

4.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 3 / 42

Page 4: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Linear equations

A linear equation in n unknowns x1, . . . , xn is an equation of the form

a1x1 + a2x2 + · · ·+ anxn = b

where a1, . . . , an, b are given real numbers.

E.g. The name linear comes from

We are interested in solving several of these simultaneously as in the ancientChineses problem. A system of m linear equations in n variables is

a11x1 + a12x2 + · · · + a1nxn = b1

a21x1 + a22x2 + · · · + a2nxn = b2

......

......

am1x1 + am2x2 + · · · + amnxn = bm

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 4 / 42

Page 5: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Point normal form for lines in R2

Just as there are point normal forms for planes in R3, there are point normalforms for lines in R2 (can you see the general pattern??)

Let L ⊂ R2 be the line in R2 passing through the point a with normal vector

n =

(n1

n2

).

L is the set of points x satisying the point normal form

n · (x− a) = 0 ⇐⇒ n1x1 + n2x2 = n · x = n · a.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 5 / 42

Page 6: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Intersecting 2 lines in R2

Consider solving a system of 2 eqns in 2 unknowns x , y :

a11x + a12y = b1 (3)

a21x + a22y = b2 (4)

Plotting solutions in the xy -plane allows us to understand the nature of solutionsbetter. Assume both eqns are non-zero (otherwise ??) so eqns (3), (4) define linesL1, L2 and L1 ∩ L2 represents the simultaneous soln.On geometric grounds, we see there are ?? possibilities

Let’s verify this algebraically!

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 6 / 42

Page 7: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

2 linear equations in 2 unknowns: algebraic version

L1 = L2 iff eqn (3) and (4) are scalar multiples of each other. Simultaneoussoln same as the soln to one of them.

L1 ‖ L2 but not equal. this means that the normals are parallel so(a11a12

)= r

(a21a22

), for some r ∈ R. Then (3)− r × (4) gives

0 = b1 − rb2 6= 0 WHY?

so there are no solns.(a11a12

),

(a21a22

)are not parallel. Our procedure gives a unique soln. This is

easy to see from any e.g. such as in the ancient Chinese problem.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 7 / 42

Page 8: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Intersecting 3 planes in R3

Here are some possibilities for intersecting 3 planes P1,P2,P3 ⊂ R3.

The planes intersect in a point.

There is no intersection as the three are parallel and distinct.

P1,P2 intersect in a line which is parallel to P3. There’s no intersection.

P1 = P2 intersect P3 in a line so the three intersect in a line.

etc

There are heaps more cases, which makes it hard to analyse. We need makesystematic, our method of solving simultaneous solns and understanding the set ofsolns.

This procedure, described in the “Nine Chapters” and re-discovered by Gauss iscalled Gausssian elimination.

Aside Gauss developed it to solve a system of 6 linear eqns in 6 unknowns andhence compute the orbit of the dwarf planet Ceres. Look up Stigler’s law onWikipedia.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 8 / 42

Page 9: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Augemented matrix form

We first abbreviate our system of m linear equations in n variables:a11x1 + a12x2 + · · · + a1nxn = b1

a21x1 + a22x2 + · · · + a2nxn = b2

......

......

am1x1 + am2x2 + · · · + amnxn = bm

to augmented matrix form:a11 a12 · · · a1n b1

a21 a22 · · · a2n b2

......

. . ....

...am1 am2 · · · amn bm

.

Here the notation omits the unknowns x1, . . . , xn which must be understood fromthe context (or irrelevant).

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 9 / 42

Page 10: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Example: augemented matrix form

E.g. Write the augmented matrix form for the system{6x1 − 2x2 + 5x3 = 73x1 + x2 + 2x3 = 0

Solution.

E.g Write the system of equations with augmented matrix form(2 1 1 −33 5 0 7

).

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 10 / 42

Page 11: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Matrices

A matrix is just a rectangular array of numbers, like(1 2 30 7 5

).

We would say that this is a 2× 3 matrix as it has 2 rows and 3 columns.

An m × 1 matrix just looks like a vector b =

b1

b2

. . .bm

∈ Rm

The augmented matrix consists of the coefficient matrix (on the left of the line)

augmented by the right-hand-side vector. We can write

(2 1 1 −33 5 0 7

)as

(A|b) where A =

(2 1 13 5 0

)and b =

(−37

).

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 11 / 42

Page 12: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Simultaneous equations as a single vector equation

Any system of (not necessarily linear) simultaneous eqns can be written as a singlevector eqn.The above eqn (A|b) can be re-written as(

−37

)=

(2x1 + x2 + x33x1 + 5x2

)= x1

(23

)+ x2

(15

)+ x3

(10

)or perhaps as

x1a1 + x2a2 + x3a3 = b.

where a1, a2, a3 are the columns of A.

That is, solving this system is equivalent to asking:

How can we write b as a linear combination of the vectors a1, a2 and a3?

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 12 / 42

Page 13: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Examples: different forms for linear equations

Q The following vector equation is equivalent to which system of linear equationsand which augmented matrix?

x1

123

+ x2

456

=

789

Q Write a vector equation equivalent to the following augmented matrix.(1 0 −22 e2 π

)

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 13 / 42

Page 14: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Equivalent systems of linear equations

We say a system of linear eqns is consistent if it has at least one solution andinconsistent otherwise.

E.g. x + y = 2, 2x + 2y = 5 is

Definition

Two systems of linear equations (A|b), (A′|b′) are said to be equivalent if theyhave exactly the same set of solutions.

The following define equivalent systems of linear equations

x + y = 2 x + y = 2 (5)

2x + 3y = 5 3x + 4y = 7 (6)

Why? Note that the 2nd system is gotten from the 1st by adding eqn (5)LHS toeqn (6)LHS. Similarly, the 1st systemThe systems are equivalent because

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 14 / 42

Page 15: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Elementary row operations

To solve (A|b), we pass to an equivalent system of eqns where one of the eqns hasonly 1 unknown. We can solve this and then by induction on the number ofvariables, should be done.

Q How do you pass to an equivalent system of linear equations?Any of the following procedures will yield an equivalent system:

Elementary row operations

Swap the order in which you write the equations!

Multiply any equation by a nonzero constant. (Why non-zero?)

Add a multiple of one equation to another equation. For example, you canreplace

equation (5)with

equation (5) + 7× equation (6).

These are called the elementary row operations.

This is all easier to do if we use the augmented matrix form! We just replace theword eqn above with row of the augmented matrix.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 15 / 42

Page 16: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Notation for EROs

We record the elementary row operation on an arrow between the old system andthe new. In each case below, the system on the right is equivalent to the left. 0 2 3 5

−1 3 1 62 4 7 8

R2 ↔ R1−−−−−−−−−−→

−1 3 1 60 2 3 52 4 7 8

.

1 2 3 5−1 −4 1 6

2 10 7 8

R2 = R2 + R1−−−−−−−−−−−→

1 2 3 50 −2 4 112 10 7 8

1 2 3 4 8

0 0 3 6 90 0 0 4 8

R2 = 13R2−−−−−−−−−−−→

R3 = 14R3

1 2 3 4 80 0 1 2 30 0 0 1 2

.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 16 / 42

Page 17: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Row echelon form: motivation

We wish to apply a series of EROs until we arrive at a system of linear eqns wecan solve!

Q Which systems are these?

A Ones like the bottom right one on the previous slide. Remember, thataugmented matrix is just saying

x1 + 2x2 + 3x3 + 4x4 = 8x3 + 2x4 = 3

x4 = 2

Starting from the bottom, you can first solve x4, and then moving up solve x3 andthen (see later) x2, x1.

Such a system is said to be in row-echelon form. Solving it by starting from thebottom eqn and progressively moving up is called back substitution.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 17 / 42

Page 18: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Row echelon form

In any matrix

1 a leading row is one which is not all zeros,

2 the leading entry in a leading row is the first (i.e. leftmost) non-zero entry,

3 a leading column is a column which contains the leading entry for some row.

Row echelon formA matrix is said to be in row-echelon form if

1 all leading rows are above all non-leading rows (so any all-zero rows are atthe bottom of the matrix), and

2 in every leading row, the leading entry is further to the right than the leadingentry in any row higher up in the matrix.

If you remove the zeros, row echelon form gives an upside-down staircase shape.

A matrix is in reduced row echelon form if it 1) is in row echelon form, 2) allleading entries are 1 and, 3) all entries above leading entries are 0.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 18 / 42

Page 19: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Examples: leading columns, row echelon form

E.g. Check the following is in row echelon form and solve(1 2 30 2 4

)

E.g. 1 2 3 −10 0 2 π0 0 e 0

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 19 / 42

Page 20: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Back-substitution

We can solve systems of linear eqns if they are in row echelon form as in thefollowing e.g. 1 2 3 4 8

0 0 1 2 30 0 0 1 2

(R1)(R2)(R3)

From (R3), x4 = 2. Back substituting this into (R2) you get x3 = .

The convention is that you set the variable for any non-leading column to be anarbitrary parameter.

So, let x2 = λ. Then

x1 = 8− 2λ− 3× (−1)− 4× 2 = 3− 2λ.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 20 / 42

Page 21: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Vector form of the solution

It is instructive to write the soln in vector formx1x2x3x4

=

3− 2λλ−12

=

This shows the solution set is a line in R4 in the direction

Upshot This argument shows that you will have as many parameters λ1, . . . , λj asyou have non-leading columns. Geometrically, the solution set is j-dimensional.We usually expect you to write your answer in vector form as above.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 21 / 42

Page 22: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Gaussian elimination: easy example

There are many sequences of EROs you can apply to obtain row echelon form(and hence solve systems of linear equations). One algorithm is easily seen in thefollowing example. It corresponds to eliminating variables systematically.First use Rj = Rj + αjR1, to get zeros in the first column of every row (except row1!): 1 2 3 5

−1 −4 1 62 10 7 8

R2 = R2+?−−−−−−−−−−−−−→

1 2 3 50 −2 4 11

Now rows 1 and 2 are looking fine. Essentially we eliminated x1 from eqns in R2,R3. Next use ERO Rj = Rj + βjR2 to get zeros in the 2nd column of every row(except rows 1 and 2):

R3 = R3−?−−−−−−−−−−−−−→

1 2 3 50 −2 4 110 0

If the matrix were bigger, you would just keep going zeroing one column in turn,until the matrix is in row-echelon form.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 22 / 42

Page 23: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Pivots

The above algorithm is fine until you meet a matrix like 0 2 3 52 −2 4 11 3 2 6

or

0 0 3 50 0 4 10 1 2 6

Here you need to swap the first row with the second or third.In general

Pivot elements1 Go to the 1st (from left) nonzero column called the pivot column.

2 Go down that column to the 1st nonzero entry called the pivot element.

3 Swap that row, called the pivot row with the first (unless of course it is thefirst).

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 23 / 42

Page 24: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Gaussian elimination: complete algorithm

Algorithm

To solve (A|b):

1 Select the pivot element.

2 Swap the pivot row to the top if necessary.

3 Reduce to zero all the entries below the pivot element using EROs.

4 Repeat steps 1, 2 and 3 on the submatrix of rows and columns to the rightand below the pivot element...recursively until you run out of pivot elements!

5 When you arrive at row-echelon form, use back-substitution to solve.

Example. Solve1 −1 1 −1 −2−1 1 −1 1 2

1 0 2 1 13 −1 5 1 0

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 24 / 42

Page 25: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Application: geometry

Q Do the lines

x =

123

+ λ

−11−1

, λ ∈ R x =

0−11

+ µ

2−12

, µ ∈ R

intersect?

You can turn this into a vector equation in λ and µ:123

+ λ

−11−1

=

0−11

+ µ

2−12

λ

−11−1

+ µ

−21−2

=

−1−3−2

.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 25 / 42

Page 26: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Application cont’d

As we saw before, this corresponds to a system of linear eqns which, in augmentedmatrix form is −1 −2 −1

1 1 −3−1 −2 −2

R2 = R2 + R1−−−−−−−−−−−−−−→R3 = R3 − R1

−1 −2 −10 −1 −40 0 −1

For this, and many other problems, what you want to know is

‘Does a solution exist?’, not ‘What is the solution?’

You can read this straight off the row-echelon form!

The system is inconsistent because the bottom row gives the inconsistent eqn

0λ+ 0µ = −1.

No intersection so the lines are skew.

Remark: An inconsistent eqn corresponds to a row in the augmented matrix ofthe form

(0 0 . . . 0|b) where b 6= 0.

For (U|y) in row echelon form, this occurs precisely when y is a leading column asabove.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 26 / 42

Page 27: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Nature of solutions and row echelon form

Back-substitution readily gives

Theorem

Suppose that the system (A|b) has equivalent row-echelon form (U|y).

The system has no solution iff y is a leading column iff it has an inconsistentrow.

If y is not a leading column then1 The system has a unique solution if U has no non-leading columns, and2 The system has infinitely many solutions if U has non-leading columns. There

is one arbitrary parameter for each nonleading column.

E.g. Describe geometrically, the solution sets to −1 3 1 60 2 3 50 0 7 8

and

−1 3 1 60 2 3 50 0 0 0

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 27 / 42

Page 28: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Underdetermined equations

Question. Can the system 1 −1 1 −1 −22 −2 −1 3 7−2 −3 3 8 5

have a unique solution?

Solution. In general, if you have more variables than equations you cannot have aunique soln. Indeed, in the row-echelon form (U|y),

no. leading columns = no. leading rows < no. columns in U

so there must be a non-leading column in U.

If y is leading then

If y is non-leading then

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 28 / 42

Page 29: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Describing spans in cartesian form

Q Which

b1

b2

b3

∈ R3 are in the span of

123

,

1−1−2

and

334

?

A As a vector eqn, this is asking whether there exist λ1, λ2, λ3 such that

λ1

123

+

In augmented matrix form this is 1 1 3 b1

2 −1 3 b2

3 −2 4 b3

−−−−−→ 1 1 3 b1

0 −3 −3 b2 − 2b1

0 0 0 b3 + b13 −

5b23

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 29 / 42

Page 30: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Describing Span cont’d

We need to know whether this system has a solution.The right-hand side vector here is a leading column — unless

b3 +b1

3− 5b2

3= 0. (∗)b1

b2

b3

is a linear combination of the three vectors precisely when (∗) holds.

The span of the 3 vectors is the plane in b1b2b3-space defined by the cartesianeqn (∗).

Can you see what is happening geometrically?

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 30 / 42

Page 31: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Solving simultaneous equations: functional viewpoint

We often solve eqns like sin x = 12 or more generally f (x) = c for some

f : R −→ R and constant c ∈ R. Solving simultaneous eqns can be put in thisframework if we allow vector-valued functions f : Rn −→ Rm.

Consider a1, . . . , an ∈ R and the function l : Rn −→ R defined by

l(x) = a1x1 + . . .+ anxn.

This is a scalar valued linear function (with vector inputs). l(x) = b is a linear eqn.Given a vector x ∈ Rn and an m × n-matrix

A =

a11 . . . a1n...

...am1 . . . amn

we define Ax =

a11x1 + . . .+ a1nxn...

am1x1 + . . .+ amnxn

.

l : Rn −→ Rm : x 7→ Ax i.e. defined by l(x) = Ax is an example of a vector-valuedlinear function.The system of linear eqns corresponding to (A|b) is equivalent to the vectorequation Ax = b. We call Ax the matrix-vector product of A and x.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 31 / 42

Page 32: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Matrix-vector product: examples

Q Calculate 1 31 24 0

( 2−1

).

Q Let A =(1 00 −1

). Describe the function f : R2 −→ R2 : x 7→ Ax as a mapping

from the plane to itself. Hence solve f (x) = x. We’ll see much more of this nextsemester.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 32 / 42

Page 33: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Distributive law for matrix-vector product

Part of the reason we use the product notation/terminology is the

Distributive Law

Suppose that x, y ∈ Rn and A is an m × n-matrix. Then

A(x + y) = Ax + Ay.

Why? For ease of notation, suppose n = 2 so x =

(x1x2

), y =

(y1y2

).

A(x + y) = A

(x1 + y1x2 + y2

)=

a11(x1 + y1) + a12(x2 + y2)...

am1(x1 + y1) + am2(x2 + y2)

=

a11x1 + a12x2...

am1x1 + am2x2

+

a11y1 + a12y2...

am1y1 + am2y2

= Ax + Ay

Ex Prove that if λ ∈ R, A(λx) = λ(Ax).

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 33 / 42

Page 34: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Linearity

Next semester, we will study the concept of linearity in great generality. For now,we say a function T : Rn −→ Rm is linear if for all x, y ∈ Rn, λ ∈ R we have

T (x + y) = T (x) + T (y), T (λx) = λT (x).

Last slide =⇒ the function T : Rn −→ Rm : x 7→ Ax is linear. Next semester,we’ll see all linear maps Rn −→ Rm have this form.

E.g. T

(xy

)= x2 + y

Warning Our defn conflicts with the one in calculus! f (x) = ax + b is linear iff

Sometimes, we call such functions affine linear.Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 34 / 42

Page 35: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Homogeneous equations: abstract view

Let T : Rn −→ Rm be a linear function and b ∈ Rm. We consider the linearequation Tx = b and solve for x.We say Tx = b is homogeneous if b = 0, and is inhomogeneous otherwise.

Proposition

Suppose x1, . . . , xr are solutions to the homogeneous eqn Tx = 0.

1 x = 0 is a homogeneous soln, (existence).

2 x1 + x2, λx1 are homog solns for any λ ∈ R.

3 Any linear combination λ1x1 + . . .+ λrxr is a homog soln.

Proof. For (1) just calculate.2) =⇒ 3) by induction.For 2) just calculate:

T (x1 + x2) = Tx1 + Tx2 = 0 + 0 = 0.

Similarly, T (λx1) =Terminology We express (2) by saying that the set of homogeneous solns isclosed under addition and scalar multiplication. We express (3) by saying homogsolns are closed under linear combinations.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 35 / 42

Page 36: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Inhomogeneous equations: abstract view

The solutions to an inhomogeneous linear eqn Tx = b are related to the solns ofthe corresponding homogeneous eqn Tx = 0, as long as solns exist!

Proposition

Let x = xp be a soln to Tx = b.

1 Then x = xp + xh is also a solution for any homog soln xh to Tx = 0.

2 Every soln to Tx = b has this form.

Remark The importance of the proposition is that if you know a particularinhomogeneous soln, and the general homogeneous soln, then you know thegeneral inhomogeneous soln too.

Proof. 1)

2) Let x0 be a soln to Tx = b. Let xh = x0 − xp so x0 = xp + xh. It suffices toshow xh is a homog soln:

Corollary If x = 0 is the unique homogeneous soln, then an inhomogeneous solnis unique (assuming it exists).

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 36 / 42

Page 37: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Relating the abstract view with result from Gaussianelimination

E.g. Consider the linear eqn Ax = b corresponding to the reduced row echelonaugmented matrix 1 2 0 4 8

0 0 1 2 30 0 0 0 0

.

Assigning parameters x2 = λ, x4 = µ, back-substution gives the general soln as

x = =

8030

+ λ

−2100

+ µ

−40−21

.

Setting λ = µ = 0 gives the particular soln

8030

and the propn last slide =⇒

the general homog soln is the span of

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 37 / 42

Page 38: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Application: differential equations

Question

Are there any polynomials p(x) = a0 + a1x + . . . anxn which satisfy the differentialeqn

p′′(x) + 3xp′(x)− p(x) = x + 2?

A The two sides can only be equal if all the coefficients match. Now

xp′(x) = a1x + 2a2x2 + 3a3x3 + · · ·+ nanxn

p′′(x) = 2a2 + 6a3x + 12a4x2 + . . . n(n − 1)anxn−2.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 38 / 42

Page 39: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Application cont’d

Coeff of 1: 2a2 + 3× 0− a0 = 2

Coeff of x : 6a3 + 3a1 − a1 = 1

...

Coeff of xn: 0 + 3nan − an = 0.

In augmented matrix form, for the variables a0, . . . , an:−1 0 2 0 . . . 0 2

0 2 0 6 0 1...

......

0 3n − 1 0

which clearly has a unique solution as all columns except the last are leading.

Remark Note that uniqueness of the soln is independent of the entries in the lastcolumn, which matches up with our result relating homogeneous andinhomogeneous solns.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 39 / 42

Page 40: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Application: Geometry

Q Is the line with parametric equation x =

−911

+ λ

−111

parallel to the

plane through the points with coords (0, 0, 0), (1, 0, 1), (2,−1, 2)?

A The question is equivalent to asking if

−111

lies in the span of

101

,

2−12

i.e. can we solve

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 40 / 42

Page 41: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Modern economic problem

The Republic produces 3 types of X-wing fighters: 1) 1 person, 2) 2 person and 3)4 person. Production involves 3 plants operated by Gungans, Ewoks andWookiees, which deal with a) weapons manufacture, b) engine manufacture andc) assembly respectively. The time (in hours) required to produce each type offighter is given below

1 person 2 person 4 personGungans 1 2 3

Ewoks 2 3 4Wookiees 2 4 8

The Gungans will only work 20 hours a week, the Ewoks 33 and the Wookiees 44.If the production plants are to operate at full capacity, how many of each type offighter will be produced?

A Let x1, x2, x3 be the number of 1 person, 2 person and 4 person fightersproduced a week.

We have one equation for each plant.

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 41 / 42

Page 42: Chapter 4: Linear Equations - School of Mathematics and ...web.maths.unsw.edu.au/~danielch/fyalg15a/Chapter4hand.pdf · Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2017

Economic problem cont’d

Daniel Chan (UNSW) Chapter 4: Linear Equations Semester 1 2018 42 / 42