Solving a System of Linear Equations Using Matrices
We have seen how to write a system of equations with an augmented matrix, and then how to use row operations and back-substitution to obtain row-echelon form. Now, we will take row-echelon form a step farther to solve a 3 by 3 system of linear equations. The general idea is to eliminate all but one variable using row operations and then back-substitute to solve for the other variables.
Example 6: Solving a System of Linear Equations Using Matrices
Solve the system of linear equations using matrices.
x−y+z=82x+3y−z=−23x−2y−9z=9
Solution
First, we write the augmented matrix.
123−13−21−1−9∣8−29
Next, we perform row operations to obtain row-echelon form.
Using back-substitution, we obtain the solution as (4,−3,1).
Example 7: Solving a Dependent System of Linear Equations Using Matrices
Solve the following system of linear equations using matrices.
−x−2y+z=−12x+3y=2y−2z=0
Solution
Write the augmented matrix.
−120−23110−2∣−120
First, multiply row 1 by −1 to get a 1 in row 1, column 1. Then, perform row operations to obtain row-echelon form.
−R1→120231−10−2120
R2↔R3→102213−1−20∣102
−2R1+R3=R3→10021−1−1−22∣100
R2+R3=R3→100210−1−20∣210
The last matrix represents the following system.
x+2y−z=1y−2z=00=0
We see by the identity 0=0 that this is a dependent system with an infinite number of solutions. We then find the generic solution. By solving the second equation for y and substituting it into the first equation we can solve for z in terms of x.
x+2y−z=1y=2zx+2(2z)−z=1x+3z=1z=31−x
Now we substitute the expression for z into the second equation to solve for y in terms of x.
y−2z=0z=31−xy−2(31−x)=0y=32−2x
The generic solution is (x,32−2x,31−x).
Try It 5
Solve the system using matrices.
x+4y−z=42x+5y+8z=15x+3y−3z=1
Solution
Q & A
Can any system of linear equations be solved by Gaussian elimination?
Yes, a system of linear equations of any size can be solved by Gaussian elimination.
How To: Given a system of equations, solve with matrices using a calculator.
Save the augmented matrix as a matrix variable [A],[B],[C],….
Use the ref( function in the calculator, calling up each matrix variable as needed.
Example 8: Solving Systems of Equations with Matrices Using a Calculator
Solve the system of equations.
5x+3y+9z=−1−2x+3y−z=−2−x−4y+5z=1
Solution
Write the augmented matrix for the system of equations.
5−2−133−49−15∣5−2−1
On the matrix page of the calculator, enter the augmented matrix above as the matrix variable [A].
[A]=5−2−133−49−15−1−21
Use the ref( function in the calculator, calling up the matrix variable [A].
Using back-substitution, the solution is (18761,−18792,−18724).
Example 9: Applying 2 × 2 Matrices to Finance
Carolyn invests a total of $12,000 in two municipal bonds, one paying 10.5% interest and the other paying 12% interest. The annual interest earned on the two investments last year was $1,335. How much was invested at each rate?
Solution
We have a system of two equations in two variables. Let x= the amount invested at 10.5% interest, and y= the amount invested at 12% interest.
x+y=12,0000.105x+0.12y=1,335
As a matrix, we have
[10.10510.12∣12,0001,335]
Multiply row 1 by −0.105 and add the result to row 2.
[1010.015∣12,00075]
Then,
0.015y=75y=5,000
So 12,000−5,000=7,000.
Thus, $5,000 was invested at 12% interest and $7,000 at 10.5% interest.
Example 10: Applying 3 × 3 Matrices to Finance
Ava invests a total of $10,000 in three accounts, one paying 5% interest, another paying 8% interest, and the third paying 9% interest. The annual interest earned on the three investments last year was $770. The amount invested at 9% was twice the amount invested at 5%. How much was invested at each rate?
Solution
We have a system of three equations in three variables. Let x be the amount invested at 5% interest, let y be the amount invested at 8% interest, and let z be the amount invested at 9% interest. Thus,
x+y+z=10,0000.05x+0.08y+0.09z=7702x−z=0
As a matrix, we have
10.05210.08010.09−1∣10,0007700
Now, we perform Gaussian elimination to achieve row-echelon form.
The third row tells us −31z=−2,000; thus z=6,000.
The second row tells us y+34z=9,000. Substituting z=6,000, we get
y+34(6,000)=9,000y+8,000=9,000y=1,000
The first row tells us x+y+z=10,000. Substituting y=1,000 and z=6,000, we get
x+1,000+6,000=10,000x=3,000
The answer is $3,000 invested at 5% interest, $1,000 invested at 8%, and $6,000 invested at 9% interest.
Try It 6
A small shoe company took out a loan of $1,500,000 to expand their inventory. Part of the money was borrowed at 7%, part was borrowed at 8%, and part was borrowed at 10%. The amount borrowed at 10% was four times the amount borrowed at 7%, and the annual interest on all three loans was $130,500. Use matrices to find the amount borrowed at each rate.
Solution