Systems of Linear Equations in Two Variables (4.1) : Opening Example
Systems of Linear Equations in Two Variables (4.1) : Opening Example
Systems of Linear Equations in Two Variables (4.1) : Opening Example
Opening example
1
Solve by graphing
z One method to find the solution of a system of linear equations is to
graph each equation on a coordinate plane and to determine the
point of intersection (if it exists). The drawback of this method is that
it is not very accurate in most cases, but does give a general
location of the point of intersection. Lets take a look at an example:
Solve by graphing
z 3x + 5y = -9
z x+ 4y = -10
z Intercept method:
z If x = 0, y= -9/5
z If y = 0 , x = - 3
z Plot points and draw line
(2,-3)
z Second line:
z (0, -5/2) , ( -10,0)
z From the graph we see that the point of intersection is (2,-3).
z Check: 3(2)+5(-3)= -9 and 2+4(-3)= -10 both check.
Another example:
2
Method of Substitution
z Although the method of graphing is intuitive, it is not very accurate in
most cases. There is another method that is 100% accurate- it is
called the method of substitution. This method is an algebraic one.
This method works well when the coefficients of x or y are either 1 or
-1. For example, let’s solve the previous system
z 2x + 3 = y
z X + 2y = -4
using the method of substitution. This steps for this method are as follows:
1) Solve one of the equations for either x or y.
2) Substitute that result into the other equation to obtain an
equation in a single variable ( either x or y).
3) Solve the equation for that variable.
4. Substitute this value into any convenient equation to
obtain the value of the remaining variable.
Method of substitution
Another example:
z Solve the system z Solution:
using substitution:
3x − 2 y = 7
z 3x-2y=-7
y = 2x − 3
z y = 2x -3
3x − 2(2 x − 3) = 7
3x − 4 x + 6 = 7
−x = 1
x = −1
y = 2 ( −1) − 3 → y = −5
3
Terminology:
z 1. A consistent linear system is one that has one or more
solutions.
{ A) If a consistent system has exactly one solution then it is
said to be independent. An independent system will occur
when two lines have different slopes.
{ B) if a consistent system has more than one solution, then it
is said to be dependent. A dependent system will occur when
two lines have the same slope and the same y intercept. In
other words, the two equations are identical. The graphs of
the lines will coincide with one another and there will be an
infinite number of points of intersection.
z 2. An inconsistent linear system is one that has no
solutions. This will occur when two lines have the same
slope but different y intercepts. In this case, the lines will
be parallel and will never intersect.
An example:
Elimination by Addition
z The method of substitution is not preferable if none of
the coefficients of x and y are 1 or -1. For example,
substitution is not the preferred method for the system
below: 2x – 7y=3
{ -5x + 3y = 7
{A better method is elimination by addition: First of all,
we need to know what operations can be used to
produce equivalent systems. They are as follows:
{1) Two equations can be interchanged.
{2. An equation is multiplied by a non-zero constant.
{3. An equation is multiplied by a non-zero constant
and then added to another equation.
4
Elimination by Addition
2x-7y=3 ⎫
z For our system, we will seek to z S:
⎬→
eliminate the x variable. The -5x+3y=7 ⎭
coefficients of the x variables are 2
5(2 x − 7 y ) = 5(3) ⎫
⎬→
and -5. The least common multiple of
2 and 5 is 10. Our goal is to obtain 2( −5 x + 3 y ) = 2(7) ⎭
coefficients of x that are additive
inverses of each other. 10 x − 35 y = 15 ⎫
z We can accomplish this by multiplying ⎬→
the first equation by 5
−10 x + 6 y = 14 ⎭
Multiply second equation by 2.
2 0 x − 29 y = 29 →
z xNext, we can add the two equations to y = −1
eliminate the x-variable.
z –Solve for y
2 x − 7(−1) = 3 →
z Substitute y value into original 2x + 7 = 3 →
7equation and solve for x 2 x = −4
z yWrite solution as an ordered pair
x = −2
= (−2, −1)
3
Applications
z A man walks at a rate of 3 miles per hour and jogs at a
rate of 5 miles per hour. He walks and jogs a total
distance of 3.5 miles in 0.9 hours. How long does the
man jog?
z Solution: Let x represent the amount of time spent walking and y
represent the amount of time spent jogging. Since the total time
spent walking and jogging is 0.9 hours, we have the equation
z x +y = 0.9 . We are given the total distance traveled as 3.5 miles.
Since Distance = Rate x time, we have [distance walking] +
[distance jogging] = [total distance] . Distance walking = 3x and
distance jogging = 5y. Then [distance walking] plus [distance
jogging] 3x+5y= 3.5.
5
Application continued
z We can solve the system using z Solution:
substitution. x + y = 0.9
z 1. Solve the first equation for y
y = 0.9 − x
z 2. Substitute this expression
3x + 5 y = 3.5
into the second equation.
z 3. Solve 2nd equation for x 3x + 5(0.9 − x) = 3.5
z 4. Use this x value to find the y 3x + 4.5 − 5 x = 3.5
value −2 x = −1
z 5. Answer the question. x = 0.5
z 6. Time spent jogging is 0.4 0.5 + y = 0.9
hours.
y = 0.4
6
4.2 Systems of Linear equations
and Augmented Matrices
Matrices
z A matrix is a rectangular
array of numbers written
within brackets. Here is an ⎛ a11 a12 a13 ⎞
example of a matrix which ⎜ ⎟
has three rows and three
⎜ a21 a22 a23 ⎟
columns: The subscripts
⎜a a33 ⎟⎠
give the “address” of each
entry of the matrix. For ⎝ 31 a32
example the entry a 23
z Is found in the second row
and third column
1
Generalization
z Solve z
⎡: 1 3 5 ⎤
⎢ ⎥
z x +3y=5 ⎣2 −1 3⎦
z 2x – y=3 − 2 R1 + R 2 →
z 1. Augmented system
⎡1 3 5 ⎤
z 2. Eliminate 2 in 2nd row by row ⎢ ⎥
operation ⎣0 −7 −7 ⎦
z 3. Divide row two by -7 to R2 / − 7 → R2 →
obtain a coefficient of 1.
z 4. Eliminate the 3 in first row, ⎡1 3 5⎤
second position. ⎢ ⎥
⎣0 1 1⎦
z 5. Read solution from matrix
− 3 R 2 + R1 → R1 →
⎡1 0 2 ⎤
⎢ ⎥ → x = 2, y = 1; ( 2,1)
⎣0 1 1 ⎦
2
Solving a system using augmented
matrix methods
z X+2y=4
x + 2 y = 4
z X+(1/2)y=4 1
1. Eliminate fraction in second x + y = 4 → 2x + y = 8
equation. 2
Write system as augmented ⎡1 2 4⎤
⎥ →
2.
⎢
matrix. ⎣2 1 8⎦
3. Multiply row 1 by -2 and add to ⎡1 2 4⎤
row 2 ⎢ ⎥ →
4. Divide row 2 by -3 ⎣0 −3 0⎦
5. Multiply row 2 by -2 and add to ⎡1 2 4⎤
row 1. ⎢ ⎥ →
⎣0 1 0⎦
6. Read solution : x = 4, y = 0
(4,0) ⎡1 0 4⎤
⎥ →
7.
⎢
⎣0 1 0⎦
z 10x -2y=6
z -5x+y= -3
⎡10 −2 6 ⎤
⎢ ⎥
z 1. Represent as augmented
matrix. ⎣ −5 1 −3⎦
z 2. Divide row 1 by 2
⎡ 5 −1 3 ⎤
z 3. Add row 1 to row 2 and
⎢ ⎥
⎣ −5 1 −3⎦
replace row 2 by sum
z 4. Since 0 = 0 is always true,
we have a dependent system.
The two equations are identical ⎡5 −1 3 ⎤
and there are an infinite number ⎢ ⎥
of solutions. ⎣0 0 0 ⎦
Another example
z Solve 5 x − 2 y = −7 5 x − 2 y = −7 ⎫
5 ⎬→
y = x +1 −5 x + 2 y = 2 ⎭
2
⎡ 5 −2 −7 ⎤
z Rewrite second equation :
⎢ ⎥→
2 y = 5x + 2 → ⎣ −5 2 2 ⎦
−5 x + 2 y = 2 ⎡ 5 −2 − 7 ⎤
⎢ ⎥
⎣0 0 −5 ⎦
z Since we have an impossible
equation, there is no solution.
The two lines are parallel and
do not intersect.
3
4.3 Gauss Jordan Elimination
1
Matrix representations of consistent,
inconsistent and dependent systems
⎛1 0 0 3⎞ ⎛1 2 3 4⎞
⎜ ⎟ ⎜ ⎟
⎜0 1 0 4⎟ ⎜0 0 0 6⎟
⎜ ⎟ ⎜0 0 0 0⎟
⎝0 0 1 5⎠ ⎝ ⎠
⎛ 1 3 0 0 −2 ⎞
⎜ ⎟
⎜0 0 1 0 7 ⎟
⎜0 0 0 1 8 ⎟
⎝ ⎠
2
Solving a system using Gauss-Jordan
Elimination
z Problem:
Example. Solve:
x + y – z = -2
2x – y + z = 5
-x + 2y + 2z = 1
Example
z solution
3
Example continued:
Row 1 is unchanged:
-2 times row 1 is added to row 2
Row 3 is unchanged
Example continued:
Row 1 is unchanged
Row 2 is unchanged
Row 1 is added to Row 3
Example continued:
4
Example continued:
Row 1 is unchanged
Row 2 is unchanged
-3 times row 2 is added to row 3
Example continued:
z To obtain a 1 in the
third position of the
third row, we divide that
row by 4. Rows 1 and 2
do not change.
Example continued:
⎜ ⎟
R1 and replace R1 with the
⎝0 0 1 2 ⎠
sum . Row 3 will not be
changed. All that remains to
obtain reduced row echelon
form is to eliminate the 1 in the
first row, 2nd position.
5
Example continued:
Final result:
Example 2
6
Example 2 continued
Continuation of example 2
Continuation of example 2:
7
Final result:
Representation of a solution of a
dependent system
8
4.4 Matrices: Basic Operations
A + B = ⎡⎣ aij + bij ⎤⎦
A − B = ⎡⎣ aij − bij ⎤⎦
An example:
1
Subtraction of matrices
Scalar Multiplication
kA = ⎡⎣ kaij ⎤⎦
2
Alternate definition of subtraction of
matrices:
An example
Matrix product
3
Arthur Cayley (1821-1895)
4
Revenue of a car dealer
z We represent the number of each model sold using a row matrix (4X1) and we
use a 1X4 column matrix to represent the sales price of each model. When a
4X1 matrix is multiplied by a 1X4 matrix, the result is a 1X1 matrix of a single
number.
⎡12,500 ⎤
⎢11,800 ⎥
[10 5 8 3] ⎢ ⎥ = [10(12,500) + 5(11,800) + 8(15,900) + 3(25,300)] = [387,100]
⎢15,900 ⎥
⎢ ⎥
⎣25,300⎦
Matrix Product
5
Multiplying a 2X4 matrix by a 4X3
matrix to obtain a 4X2
Final result
6
More examples:
⎡1 6⎤
Given A = ⎡3 1 −1⎤ B= ⎢ 3 −5⎥⎥
⎢2 0 3 ⎥ ⎢
⎣ ⎦
⎢⎣ −2 4 ⎥⎦
Solution:
z Since A is a 2 x 3 matrix and B is a
⎡3 1 −1⎤ ⎡
1 6⎤ 3 x 2 matrix, AB will be a 2 x 2
⎢2 0 3 ⎥ ⎢ 3 −5⎥⎥
matrix.
⎣ ⎦ ⎢ z 1. Multiply first row of A by first
column of B :
⎢⎣ −2 4 ⎥⎦ z 3(1) + 1(3) +(-1)(-2)=8
z 2. First row of A times second
column of B:
z 3(6)+1(-5)+ (-1)(4)= 9
z 3. Proceeding as above the final
result is
⎡8 9⎤
⎢ −4 24 ⎥
⎣ ⎦
7
Practical application
⎡3 4⎤
[10 15 20] ⎢⎢4 2⎥⎥
Qty sold of each item
on Tuesday
⎣⎢1 3 ⎥⎦
z Then your total revenue for the two days is =[110 130]
Price Quantity=Revenue
8
4.5 Inverse of a Square
Matrix
In this section, we will learn how to find an
inverse of a square matrix (if it exists) and learn
the definition of the identity matrix.
Identity matrices
2 x 2 identity matrix: 3 x 3 identity matrix
⎡1 0 0 ⎤
⎡1 0 ⎤ ⎢0 1 0 ⎥
⎢0 1 ⎥ ⎢ ⎥
⎣ ⎦ ⎢⎣0 0 1 ⎥⎦
1
Identity Matrix Multiplication
AI = A (Verify the multiplication)
We can also show that IA = A and in general
AI = IA = A for all square matrices A.
Inverse of a Matrix
All real numbers For example
(excluding 0) have an
1
inverse. 5⋅ = 1
5
1
a⋅ =1 .
Matrix Inverses
Some (not all) square Then,
matrices also have
matrix inverses
A ⋅ A −1 = A − 1 ⋅ A = I n
If the inverse of a matrix A,
exists, we shall call it A−1
2
Inverse of a 2 x 2 matrix
There is a simple procedure to find the inverse
of a two by two matrix. This procedure only
works for the 2 x 2 case.
An example will be used to illustrate the
procedure:
Inverse of a 2 x 2 matrix
Step 1: Determine whether or not
Find the inverse of the inverse actually exists. We will
⎡2 3⎤
define
as
⎢1 2⎥ (2)2- 1(3);
⎡2 3⎤
main diagonal consisting of the
two 2’s. In this case, no apparent
⎢1 2⎥ change is noticed.
⎣ ⎦ Step 3. Reverse the signs of the
other diagonal entries 3 and 1 so
⎡ 2 −3 ⎤ they become -3 and -1
3
Solution
To verify that this is the inverse, we
The inverse of the will multiply the original matrix by
matrix is then its inverse and hopefully obtain the
2 x 2 identity matrix:
⎡ 2 −3 ⎤ ⎡ 2 3 ⎤ ⎡ 2 −3 ⎤
⎢ −1 2 ⎥
⎢ 1 2 ⎥ ⎢ −1 2 ⎥
=
⎣ ⎦ ⎣ ⎦ ⎣ ⎦
⎡ 4 − 3 −6 + 6 ⎤ ⎡1 0 ⎤
⎢ 2 − 2 −3 + 4 ⎥ = ⎢ 0 1 ⎥
⎣ ⎦ ⎣ ⎦
⎡ 1 −1 3 ⎤
⎢ 2 1 2⎥
⎢ ⎥
⎣⎢ −2 −2 1 ⎥⎦
1. 2. Use elementary row operations to transform the matrix on the left side
of the vertical line to the 3 x 3 identity matrix. The row operation is
used for the entire row so that the matrix on the right hand side of the
vertical line will also change.
4
Procedure
Here are the necessary row operations:
Step 1: Get zeros below the 1 in the first column by multiplying row 1 by -2 and
adding the result to R2. Row 2 is replaced by this sum.
Step2. Multiply R1 by 2, add result to R3 and replace R3 by that result.
Step 3. Multiply row 2 by (1/3) to get a 1 in the second row first position.
Continuation of procedure:
Step 4. Add R1 to R2 and replace R1 by that sum.
Step 5. Multiply R2 by 4, add result to R3 and replace R3 by that sum.
Step 6. Multiply R3 by 3/5 to get a 1 in the third row, third position.
Final result
Step 7. Eliminate the 5/3 in the first row third position by multiplying row
3 by -5/3 and adding result to Row 1.
Step 8. Eliminate the -4/3 in the second row, third position by multiplying
R3 by 4/3 and adding result to R2.
Step 9. You now have the identity matrix on the left, which is our goal.
5
The inverse matrix
The inverse matrix appears on the right hand side of the vertical line and
is displayed below. Many calculators as well as computers have software
programs that can calculate the inverse of a matrix quite easily. If you
have access to a TI 83, consult the manual to determine how to find the
inverse using a calculator.
6
4.6 Matrix Equations and
Systems of Linear Equations
Matrix equations
Let’s review one property of solving equations
involving real numbers. Recall
If ax = b then x = 1 or b
b
a a
A similar property of matrices will be used to solve
systems of linear equations.
−1
X=A B
1
An example:
Use matrix inverses to solve the 1. Determine the matrix of
system below: coefficients, A, the matrix X,
containing the variables x, y,
and z. and the column matrix B,
x + y +2 z = 1 containing the numbers on the
right hand side of the equal
2x + y =2 sign.
x +2 y +2 z = 3 ⎡1 1 2⎤ ⎡1 ⎤
⎡ x⎤
A = ⎢⎢ 2 1 0 ⎥⎥ X = ⎢ y ⎥
⎢ ⎥ B = ⎢⎢ 2 ⎥⎥
⎢⎣1 2 2 ⎥⎦ ⎢⎣ z ⎦⎥
⎣⎢ 3 ⎦⎥
Continuation:
2. Form the matrix equation
x + y +2 z = 1 AX=B . Multiply the 3 x 3 matrix
A by the 3 x 1 matrix X to verify
2x + y =2 that this multiplication produces
the 3 x 3 system on the left:
x +2 y +2 z = 3
⎡1 1 2 ⎤ ⎡ x ⎤ ⎡1 ⎤
⎢2 1 0⎥ ⎢ ⎥ = ⎢2⎥
⎢ ⎥ ⎢ y⎥ ⎢ ⎥
⎢⎣1 2 2 ⎥⎦ ⎢ z ⎥ ⎣⎢ 3 ⎦⎥
⎣ ⎦
Problem continued:
If the matrix A inverse exists, The inverse matrix A can be
then the solution is determined determined by the methods of a
by multiplying A inverse by the previous section or by using a
column matrix B. Since A computer or calculator. The
inverse is 3 x 3 and B is 3 x 1, display is shown below:
the resulting product will have
dimensions 3 x1 and will store ⎡1 1 −1 ⎤
the values of x , y and z. ⎢2 2 2 ⎥ ⎡1 ⎤
⎢ ⎥
X = ⎢ −1 0 1 ⎥ ⎢⎢ 2 ⎥⎥
X = A −1 B ⎢ 3 −1 −1 ⎥ ⎣⎢ 3 ⎦⎥
⎢ ⎥
⎣4 4 4⎦
2
Solution
When the product of A inverse and The solution can be
matrix B is found the result is as
follows: interpreted from the X
−1
matrix: x = 0, y = 2 and
X=A B z = -1/2 . Written as an
⎡1 1 −1 ⎤ ordered triple of
⎢2 2 2 ⎥ ⎡1 ⎤
⎢
X = ⎢ −1 0
⎥
1 ⎥ ⎢⎢ 2 ⎥⎥
numbers, the solution is
⎢ 3 −1 −1 ⎥ ⎢⎣ 3 ⎥⎦ (0 , 2 , -1/2)
⎢ ⎥
⎣4 4 4⎦
⎡ ⎤
⎢0⎥
⎢ ⎥
X =⎢ 2 ⎥
⎢ −1 ⎥
⎢ ⎥
⎣2⎦
Application
Production scheduling: Labor and material costs for manufacturing two
guitar models are given in the table below: Suppose that in a given
week $1800 is used for labor and $1200 used for materials. How many
of each model should be produced to use exactly each of these
allocations?
A $30 $20
B $40 $30
3
Solution
Let A be the number of This gives us the system of
model A guitars to produce linear equations:
and B represent the number 30A+ 40B = 1800
of model B guitars. Then, 20A+30B=1200
multiplying the labor costs
We can write this as a matrix
for each guitar by the
number of guitars produced, equation:
we have ⎡30 40 ⎤ ⎡ A⎤ ⎡1800 ⎤
30x + 40y = 1800 ⎢ 20 30 ⎥ ⎢ B ⎥ = ⎢1200 ⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
Since the material costs are
$20 and $30 for models A
and B respectively, we have
20A + 30B = 1200.
solution
Using the result Produce 60 model A
−1
X=A B guitars and no model B
guitars.
⎡ 30 40⎤
A=⎢ ⎥
⎣ 20 30 ⎦
The inverse of matrix A is
⎡ 0.3 −0.4 ⎤
⎢ −0.2 0.3 ⎥
⎣ ⎦
4
4.7 Leontief Input-Output
Analysis
• In this section, we • This branch of applied
will study an mathematics is called
important economic input-output
application of matrix analysis and was first
inverses and matrix proposed by Wassily
multiplication. Leontief, who won
the Nobel Prize in
economics in 1973 for
his work in this area.
• Born: 1906
Place of Birth: St. Petersburg, Russia
Residence: U.S.A.
Affiliation: Harvard University, Cambridge, Wassily Leontief was born
August 5th, 1905 in St. Petersburg, the son of Wassily W. Leontief and his
wife Eugenia. A brilliant student, he enrolled in the newly renamed
University of Leningrad at only 15 years old.
• He got in trouble by expressing vehement opposition to the lack of
intellectual and personal freedom under the country's Communist regime,
which had taken power three years earlier. He was arrested several times.
Wassily Leontief
http://www.iioa.org/leontief/Life.html
• Wassily Leontief in
1983. Photo taken by
Gregory Edwards For
more information on
Professor Leontief,
click on the link at the
top of this slide.
1
Two industry model
• We start with an economy that • 0.20 of agriculture and 0.10 of
has only two industries : energy. So, both industries
agriculture and energy to have an internal demand for
illustrate the method and then each others resources. Let us
this method will generalized to suppose there is an external
three or more industries. These demand of 12 million dollars
two industries depend upon of agriculture and 9 million
each other . For example, each dollars of energy.
dollar’s worth of agriculture
produced requires 0.40 dollars
of agriculture and 0.20 dollars
of energy. Each dollar’s worth
of energy produced requires
Matrix equations
• Let x represent the total output • The external demand of 12 and
from agriculture and y 9 million must also be met so
represent the total output of the revised equations are :
energy. • x = 0.4x+0.2 y + 12
• The equations • y = 0.2x + 0.1y + 9
• x = 0.4x+0.2y • These equations can be
• y = 0.2x + 0.1y represented by the following
• can be used to represent the matrix equation:
internal demand for agriculture
⎡ x ⎤ ⎡0.4 0.2 ⎤ ⎡ x ⎤ ⎡12 ⎤
⎢ y ⎥ = ⎢0.2 0.1⎥ ⎢ y ⎥ + ⎢ 9 ⎥
and energy.
⎣ ⎦ ⎣ ⎦⎣ ⎦ ⎣ ⎦
2
Matrix equations
⎡ x ⎤ ⎡0.4 0.2 ⎤ ⎡ x ⎤ ⎡12 ⎤
⎢ y ⎥ = ⎢0.2 0.1⎥ ⎢ y ⎥ + ⎢ 9 ⎥
⎣ ⎦ ⎣ ⎦⎣ ⎦ ⎣ ⎦
We can represent these matrices symbolically as
follows: X = MX+D
X – MX = D
IX – MX = D
(I – M)X = D
X = ( I − M ) −1 D
if the inverse of (I – M) exists.
Solution
• We will now find
X = ( I − M ) −1 D
1.First, find (I – M):
Solution:
• After finding the inverse of (I – M), multiply that result
by the external demand matrix D . The answer is to
produce a total of 25.2 million dollars of agriculture and
15.6 million dollars of energy to meet both the internal
demands of each resource and the external demand.
3
Advantages of method
• Suppose consumer demand changes from $12
million dollars of agriculture to $8 million dollars
and energy consumption changes from $9 million
to $5 million. Find the output for each sector that
is needed to satisfy this final demand.
Solution:
• Recall that our general solution of the
problem is
X = ( I − M ) −1 D
The only change in the problem is the external
demand matrix. (I – M) did not change. Therefore,
our solution is to multiply the inverse of (I –M) by
the new external demand matrix, D.
Solution
X = ( I − M ) −1 D
⎡1.8 .4 ⎤ ⎡8 ⎤ ⎡16.4 ⎤
⎢ .4 1.2 ⎥ ⎢5⎥ = ⎢ 9.2 ⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
4
More than two sectors of the
economy
• This method can also be used if there are
more than two sectors of the economy. If
there are three sectors, say agriculture,
building and energy, the technology matrix
M will be a 3 x 3 matrix. The solution to
the problem will still be X = ( I − M ) −1 D
• although, in this case, it is necessary to
determine the inverse of a 3 x 3 matrix.