Solving Systemsof Equationsusing Matrices May 2014
Solving Systemsof Equationsusing Matrices May 2014
What is a Matrix?
A matrix is a compact grid or array of numbers. It can be created from a system of equations and
used to solve the system of equations. Matrices have many applications in science, engineering, and
math courses. This handout will focus on how to solve a system of linear equations using matrices.
The constant matrix is a single column matrix consisting of the solutions to the equations.
9
[5 ]
7
To create the augmented matrix, add the constant matrix as the last column of the
coefficient matrix.
−3 −2 4 9
[ 0 3 −2 5]
4 −3 2 7
For the Gaussian elimination method, once the augmented matrix has been created, use elementary
row operations to reduce the matrix to Row-Echelon form. There are three basic types of
elementary row operations: (1) row swapping, (2) row multiplication, and (3) row addition. Row
multiplication and row addition can be combined together.
(1) In row swapping, the rows exchange positions within the matrix. The matrix resulting from a row
operation or sequence of row operations is called row equivalent to the original matrix.
Example: Swap row one and row three
Solution:
−3 −2 4 9 𝑅1 ↔𝑅3 4 −3 2 7
[ 0 3 −2 5] → [ 0 3 −2 5]
4 −3 2 7 −3 −2 4 9
(2) In row multiplication, every entry in a row is multiplied by the same constant.
Example: Multiply row one by −13
Solution:
−3 −2 4 9 − 1𝑅1 1 2/3 −4/3 −3
3
[ 0 3 −2 5] → [0 3 −2 5]
4 −3 2 7 4 −3 2 7
Provided by Tutoring Services 2 Solving Systems of Linear Equations Using Matrices
Summer 2014
(3) In row addition, the column elements of row “A” are added to the column elements of row “B”.
The resulting sums replace the column elements of row “B” while row “A” remains unchanged.
The previous examples all started from the original augmented matrix. In order to solve a system of
equations, these row operations are performed back to back on the resulting matrix, instead of
returning to the original matrix each time, until Row-Echelon form is achieved.
Row-Echelon form is characterized by having the furthest left non-zero entry in a row, the leading
entry, with all zeros below it, and the leading entry of each row is in a column to the right of the
leading entry in the row above it. For Pre-Calculus students, the leading entry in each row should be
reduced to a 1; for Linear Algebra students, this leading entry could be any number unless otherwise
specified in your assignment.
Example: Are the following matrices in Row-Echelon form?
1 −9 2 7 1 6 −8 11 1 5 12
a) [0 0 1 4] b) [0 1 1 −3] c) [0 1 −7]
0 1 7 −6 0 0 0 1 0 0 1
Solution a): No, this matrix is not in Row-Echelon form since the leading entry in row
three is in a column to the left of the leading entry in row two. Please note: If we swapped
row two and row three, then the matrix would be in Row-Echelon form.
entry is allowed to skip columns, but it cannot be to the left of the leading entry in any row
above it.
Solution c): Yes, this matrix is in Row-Echelon form. Each leading entry in each row is to
the right of the leading entry in the row above it, and each leading entry contains only 0’s
below it.
The following example will demonstrate how to use the elementary row operations to reduce the
augmented matrix from a system of equations to Row-Echelon form. After Row-Echelon form is
achieved, back substitution can be used to find the solution to the system of equations.
Example: Solve the following system of equations using Gaussian Elimination:
−3𝑥 − 2𝑦 + 4𝑧 = 9
3𝑦 − 2𝑧 = 5
4𝑥 − 3𝑦 + 2𝑧 = 7
Solution: First, create the augmented matrix for the system.
−3 −2 4 9
[ 0 3 −2 5]
4 −3 2 7
Next use the elementary row operations to reduce the matrix to Row-Echelon form.
−3 −2 4 9 −1𝑅1 1 2
3
−
4
3
−3 −4𝑅 +𝑅 1 2
3
−3 − 3 𝑅
−
4
3
3 1 3 17 3
[ 0 3 −2 5] → [0 3 −2 5] → [0 3 −2 5] →
4 −3 2 7 4 −3 2 7 0 −
17
3
22
3
19
−3 −3𝑅 +𝑅 1 −3
2 4
1 23 − −3
4
3 1 23 −
4
3 3
−
3 17
𝑅
𝑅3 ↔𝑅2 2 3 32 3
[0 3 −2 5] → [0 1 −22
17
− ]→
57
17
[0 1 −
22
17
−
57
17 ]→
0 1 −
22
17
−
57
17 0 3 −2 5 0 0 32
17
256
17
Finally, rewrite the matrix as a system of reduced equations and back substitute to find the
solution.
2 4
1𝑥 + 3𝑦 − 3𝑧 = −3
22 57
1𝑦 − 17𝑧 = −17
1𝑧 = 8
The reduced equations show that 𝑧 = 8. Substitute 8 for 𝑧 and solve for 𝑦 in the second
equation.
22 57
1𝑦 − 17(8) = −17
176 57
𝑦− 17
= −17
𝑦=7
Substitute 8 for 𝑧 and 7 for 𝑦 in the first equation and solve for 𝑥.
2 4
𝑥 + 3(7) − 3(8) = −3
14 32
𝑥+ 3
− 3
= −3
𝑥 − 6 = −3
𝑥=3
The solution to the system of equations is (3,7,8).
An alternative method, the Gauss-Jordan elimination method, can be used to solve the system of
equations. This involves reducing the augmented matrix to Reduced Row-Echelon form. The
Reduced Row-Echelon form is similar to the Row-Echelon form except that the leading entry in
each row must be a 1 and all other entries in the same column as a leading entry must be 0. Unlike
the Row-Echelon form, there is one and only one Reduced Row-Echelon form for a system of
equations.
Example: Solve the following system of equations using Gauss-Jordan Elimination:
−3𝑥 − 2𝑦 + 4𝑧 = 9
Next, use the elementary row operations to reduce the matrix to Reduced Row-Echelon
form.
−3 −2 4 9 −1𝑅1 1 2
3
−
4
3
−3 −4𝑅 +𝑅 1 2
3
− −3 − 3 𝑅
4
3
3 1 3 17 3
[ 0 3 −2 5] → [0 3 −2 5] → [0 3 −2 5] →
4 −3 2 7 4 −3 2 7 0 −
17
3
22
3
19
1 2
3
− −3
4
3 𝑅3 ↔𝑅2
1 23 −
4
3
−3 −3𝑅 +𝑅 1 23 −43 −3 17𝑅
2 3 57 32 3
[0 3 −2 5] → [0 1 −22 17
− ]→
57
17
[0 1 −22
17
− ]→
17
0 1 −22 17
−
57
17 0 3 −2 5 0 0 32
17
256
17
1 2
3
−
4
3
−3 22𝑅 +𝑅 1 23 −43 −3 4𝑅 +𝑅 1 23 0 23 3
2
− 𝑅2 +𝑅1
3 2 3 3 1
[0 57] 17 3
1 −17 −17 →
22 [0 1 0 7] → [0 1 0 7 ] →
0 0 1 8 0 0 1 8 0 0 1 8
1 0 0 3
[0 1 0 7]
0 0 1 8
The solution to the system can be written directly from the Reduced Row-Echelon form by
converting the matrix back to equation form.
𝑥=3
𝑦=7
𝑧=8
Thus, the solution to the system of equations is (3,7,8). This is the same solution obtained
by using the Gaussian elimination method in the previous example.
The system of equations above is an example of a consistent system of equations. A consistent system
of equations is characterized by having a leading coefficient in each column of the coefficient matrix
Provided by Tutoring Services 6 Solving Systems of Linear Equations Using Matrices
Summer 2014
when it is row reduced to either Row-Echelon form or Reduced Row-Echelon form. In other
words, each variable represented by a column can be solved for a specific number. With an
inconsistent system of equations, the leading coefficient in one of the rows will be in the last column of
the augmented matrix.
A system of equations can also be dependent. In the case of a dependent system, one of the columns of
the coefficient portion of the augmented matrix will lack a leading coefficient. In some cases, the
row corresponding to the missing leading coefficient will contain only 0’s. In other cases, there will
be fewer rows than columns. Be careful because the presence of a row of 0’s does not automatically
indicate a dependent system. If a system of three equations contains only two variables, then a row
of 0’s does not indicate a dependent system. However, a system of three equations with three
variables that contains a row of 0s indicates a dependent system.
1 −
3
2
−
21
2 2
𝑅 1 −
3
2
−
21
2 −7𝑅2 +𝑅3
1 −
3
2
−
21
2
3
𝑅 +𝑅1 1 0 −3
13 2 2 2
[0 13
2
65
2
]→ [0 1 5] → [0 1 5] → [0 1 5]
0 7 35 0 7 35 0 0 0 0 0 0
This system of equations is consistent even though there is a row of 0’s at the bottom. The
original system of equations had only two variables, 𝑥 and 𝑦, thus the solution to the system
only contains two numbers. The solution to the system of equations is (−3,5).
This system is dependent because the “𝑧” column does not have a leading coefficient, and
the last row of the matrix contains only 0s. Next, solve for the dependent solution to the
system of equations.
To begin, write the resulting system of equations.
𝑥 + 4𝑦 − 2𝑧 = −3
𝑦 − 𝑧 = −2
0=0
Then, solve the second equation for y in terms of z.
𝑦 − 𝑧 = −2
𝑦 =𝑧−2
Substitute the result for y into the first equation, and solve for x in terms of z.
𝑥 + 4𝑦 − 2𝑧 = −3
Provided by Tutoring Services 9 Solving Systems of Linear Equations Using Matrices
Summer 2014
𝑥 + 4(𝑧 − 2) − 2𝑧 = −3
𝑥 + 4𝑧 − 8 − 2𝑧 = −3
𝑥 + 2𝑧 − 8 = −3
𝑥 − 8 = −2𝑧 − 3
𝑥 = −2𝑧 + 5
The solution to the dependent system of equations is (−2𝑧 + 5, 𝑧 − 2, 𝑧).
2. 𝑥 + 3𝑦 + 4𝑧 = 11 5. 𝑥 − 3𝑦 + 2𝑧 = 0
2𝑥 + 3𝑦 + 2𝑧 = 7 2𝑥 − 5𝑦 − 2𝑧 = 0
4𝑥 + 9𝑦 + 10𝑧 = 20 4𝑥 − 11𝑦 + 2𝑧 = 0
3𝑥 − 2𝑦 + 𝑧 = 1
6. 2𝑥 + 5𝑦 + 2𝑧 = −1
3. 𝑡 − 𝑢 + 2𝑣 − 3𝑤 = 9 𝑥 + 2𝑦 − 3𝑧 = 5
4𝑡 + 11𝑣 − 10𝑤 = 46 5𝑥 + 12𝑦 + 𝑧 = 10
3𝑡 − 𝑢 + 8𝑣 − 6𝑤 = 27
Solutions
1. (2, −1,3)
2. No Solution
27 5
3. ( 2 𝑐 + 39, 2 𝑐 + 10, −4𝑐 − 10, 𝑐)
12 13
4. ( 5 , −1, 5 )
5. (16𝑐, 6𝑐, 𝑐)
6. No Solution