Matrices

Solving Systems Using Matrices

Solve Using the Inverse

The inverse of a matrix can be used to solve a matrix equation of the form AX=BAX=B.

To solve an algebraic equation of the form ax=bax=b where a0a\neq0, multiply both sides of the equation by the multiplicative inverse of aa. Similarly, to solve a matrix equation of the form AX=BAX=B, multiply both sides of the equation by the inverse of AA.

Since matrix multiplication is not commutative, be sure to multiply both sides by A1A^{-1} in the same order. Use A1A^{-1} as the first factor in each product.

Step-By-Step Example
Solving a Matrix Equation Using the Inverse
Solve the matrix equation CX=DCX=D.
C=[2539]D=[0123]C=\begin{bmatrix} 2 & 5 \\ 3 & 9 \end{bmatrix}\hspace{20pt}D=\begin{bmatrix} \phantom{-}0 & -1 \\ -2 & \phantom{-}3 \end{bmatrix}
Step 1
Write the equation using matrices.
CX=D[2539]X=[0123]\begin{aligned}CX&=D\\\begin{bmatrix} 2 & 5 \\ 3 & 9 \end{bmatrix}X&= \begin{bmatrix} \phantom{-}0 & -1 \\ -2 & \phantom{-}3 \end{bmatrix}\end{aligned}
Step 2
Use any method to identify the inverse of CC.
C1=[353123]C^{-1}=\begin{bmatrix}\phantom{-}3&-\frac{5}{3}\\[0.5em]-1&\phantom{-}\frac{2}{3} \end{bmatrix}
Step 3
Multiply both sides of the matrix equation by C1C^{-1}.
[353123][2539]X=[353123][0123]\begin{bmatrix}\phantom{-}3&-\frac{5}{3}\\[0.5em]-1&\phantom{-}\frac{2}{3} \end{bmatrix} \begin{bmatrix} 2 & 5 \\ 3 & 9 \end{bmatrix}X= \begin{bmatrix}\phantom{-}3&-\frac{5}{3}\\[0.5em]-1&\phantom{-}\frac{2}{3} \end{bmatrix} \begin{bmatrix} \phantom{-}0 & -1 \\ -2 & \phantom{-}3 \end{bmatrix}
Step 4
Simplify the left side of the equation.
[1001]X=[353123][0123]\begin{bmatrix}1&0\\0&1 \end{bmatrix}X=\begin{bmatrix}\phantom{-}3&-\frac{5}{3}\\[0.5em]-1&\phantom{-}\frac{2}{3} \end{bmatrix} \begin{bmatrix} \phantom{-}0 & -1 \\ -2 & \phantom{-}3 \end{bmatrix}
The left side simplifies to IXIX because the product of a matrix and its inverse is the identity matrix.
Step 5
Use matrix multiplication to simplify the right side of the equation.
[1001]X=[353123]Matrix C1[0123]Matrix D\begin{bmatrix}1&0\\0&1 \end{bmatrix}X=\overset{\text{Matrix }C^{-1}}{\begin{bmatrix}\phantom{-}3&-\frac{5}{3}\\[0.5em]-1&\phantom{-}\frac{2}{3} \end{bmatrix}} \overset{\text{Matrix }D}{\begin{bmatrix} \phantom{-}0 & -1 \\ -2 & \phantom{-}3 \end{bmatrix}}
Calculate the entries for the first row. Multiply each entry in row 1 of matrix\text{{\color{#c42126}{row 1 of matrix}}} C1{\color{#c42126}{C^{-1}}} by each entry in all columns of matrix\text{{\color{#0047af}{columns of matrix}}} D{\color{#0047af}{D}}. Then add the products.
30+(53)(2)=1033(1)+(53)3=8\begin{aligned}{\color{#c42126} 3}\cdot{\color{#0047af} 0}+{\color{#c42126} \left(-\frac{5}{3} \right )}\cdot{\color{#0047af} \left(-2 \right )}=\frac{10}{3}\\{\color{#c42126} 3}\cdot{\color{#0047af} \left(-1 \right )}+{\color{#c42126} \left(-\frac{5}{3} \right )}\cdot{\color{#0047af} 3}=-8\end{aligned}
Calculate the entries for the second row. Calculate the entries for the first row. Multiply each entry in row 2 of matrix\text{{\color{#c42126}{row 2 of matrix}}} C1{\color{#c42126}{C^{-1}}} by each entry in all columns of matrix\text{{\color{#0047af}{columns of matrix}}} D{\color{#0047af}{D}}. Then add the products.
10+23(2)=431(1)+233=3\begin{gathered}{\color{#c42126} -1}\cdot{\color{#0047af} 0}+{\color{#c42126} \frac{2}{3} }\cdot{\color{#0047af} \left(-2 \right )}=-\frac{4}{3}\\{\color{#c42126} -1}\cdot{\color{#0047af} \left(-1 \right )}+{\color{#c42126} \frac{2}{3} }\cdot{\color{#0047af} 3}=3\end{gathered}
Write the product on the right side of the equation.
[1001]X=[1038433]\begin{bmatrix}1&0\\0&1 \end{bmatrix}X= \begin{bmatrix}\phantom{-}\frac{10}{3}&-8\\[0.5em] -\frac{4}{3} & \phantom{-}3 \end{bmatrix}
Solution
The matrix on the left side of the equation is the identity matrix, II. Simplify the right side of the equation: IX=XIX = X.
X=[1038433]X= \begin{bmatrix}\phantom{-}\frac{10}{3}&-8\\[0.5em] -\frac{4}{3} & \phantom{-}3 \end{bmatrix}

Solve Using Row Operations

Gaussian elimination is a method of solving systems of linear equations by using an augmented matrix and row operations.
An augmented matrix can be used to represent a system of linear equations. First, check that each equation is written in standard form. Each row of the augmented matrix will represent one of the equations in the system. Use the coefficients of the variable terms as the entries for the left side of the matrix and the constant terms as the entries for the right side. Be sure to include any coefficients of zero.

Linear Equations Matrix

System of Linear Equations Corresponding Augmented Matrix
w+x+y+z=112w+y=9w+4x2y+3z=3x+2y3z=10\begin{aligned} w+x+y+z &=11 \\ 2w+y &=9 \\ -w+4x-2y+3z &=3 \\ x+2y-3z &=10 \end{aligned} [1111112010914233012310]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 2&0&1&0&9\\ -1&4&-2&3&3\\ 0&1&2&-3&10 \\ \end{array}\right]

The Gaussian elimination method is a way to solve systems of linear equations by using row operations. The steps are the same as when using the standard elimination method to solve systems of equations, but using a matrix helps to keep the numbers organized.

After translating the system into an augmented matrix, the goal is to reduce it so that all entries along the main diagonal of the coefficient matrix are 1s and all entries below the main diagonal are zeros. Then translate the matrix back to a system of equations, and use substitution to solve the simplified system.

Step-By-Step Example
Solving a System of Equations Using a Matrix and Row Operations
Solve the system of equations.
w+x+y+z=112w+y=9w+4x2y+3z=3x+2y3z=10\begin{aligned} w+x+y+z &=11 \\ 2w+y &=9 \\ -w+4x-2y+3z &=3 \\ x+2y-3z &=10 \end{aligned}
Step 1
Check that the equations are in standard form, and use the coefficients and constants to represent the system with an augmented matrix.
[1111112010914233012310]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 2&0&1&0&9\\ -1&4&-2&3&3\\ 0&1&2&-3&10 \\ \end{array}\right]
Step 2

Begin to use row operations to get 1s as entries along the main diagonal and 0s as entries below the main diagonal.

Start by getting zeros in the first column of rows 2 and 3.

Multiply the first row by –2, and add the result to row 2.
[1111111(2)+21(2)+01(2)+11(2)+011(2)+914233012310]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 1\cdot (-2)+2&1\cdot (-2)+0&1\cdot (-2)+1&1\cdot (-2)+0&11\cdot (-2)+9\\ -1&4&-2&3&3\\ 0&1&2&-3&10 \\ \end{array}\right]
Replace row 2 with the sum.
[11111102121314233012310]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 0&-2&-1&-2&-13\\ -1&4&-2&3&3\\ 0&1&2&-3&10 \\ \end{array}\right]
Add row 1 to row 3.
[1111110212131+(1)1+41+(2)1+311+3012310]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 0&-2&-1&-2&-13\\ 1+(-1)&1+4&1+(-2)&1+3&11+3\\ 0&1&2&-3&10 \\ \end{array}\right]
Replace row 3 with the sum.
[111111021213051414012310]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 0&-2&-1&-2&-13\\ 0&5&-1&4&14\\ 0&1&2&-3&10 \\ \end{array}\right]
Step 3
Switch rows 2 and 4 so that the entry at a2,2a_{2,2} is 1.
[111111012310051414021213]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 0&1&2&-3&10 \\ 0&5&-1&4&14\\ 0&-2&-1&-2&-13\\ \end{array}\right]
Step 4
Get zeros as entries in the second column at a3,2a_{3,2} and a4,2a_{4,2}. Multiply row 2 by –5, and add the result to row 3.
[1111110123100(5)+01(5)+52(5)+(1)(3)(5)+410(5)+14021213]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 0&1&2&-3&10 \\ 0\cdot (-5)+0&1\cdot (-5)+5&2\cdot (-5)+(-1)&(-3)\cdot (-5)+4&10\cdot (-5)+14\\ 0&-2&-1&-2&-13\\ \end{array}\right]
Replace row 3 with the sum.
[11111101231000111936021213]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 0&1&2&-3&10 \\ 0&0&-11&19&-36\\ 0&-2&-1&-2&-13\\ \end{array}\right]
Multiply row 2 by 2, and add the result to row 4.
[1111110123100011193602+012+222+(1)(3)2+(2)102+(13)]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 0&1&2&-3&10 \\ 0&0&-11&19&-36\\ 0\cdot 2+0&1\cdot 2+-2&2\cdot 2+(-1)&(-3)\cdot 2+(-2)&10\cdot 2+(-13)\\ \end{array}\right]
Replace row 4 with the sum.
[1111110123100011193600387]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\ 0&1&2&-3&10 \\ 0&0&-11&19&-36\\ 0&0&3&-8&7\\ \end{array}\right]
Step 5
Multiply row 3 by 111-\frac{1}{11} so that the entry at a3,3a_{3,3} is 1.
[1111110123100011911361100387 ]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\[0.5em] 0&1&2&-3&10 \\[0.5em] 0&0&1&-\frac{19}{11}&\frac{36}{11}\\[0.5em] 0&0&3&-8&7\ \end{array}\right]
Step 6
Get zero as the entry at a4,3a_{4,3}. Multiply row 3 by –3, and add the result to row 4.
[111111012310001191136110(3)+00(3)+01(3)+31911(3)+(8)3611(3)+7 ]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\[0.5em] 0&1&2&-3&10 \\[0.5em] 0&0&1&-\frac{19}{11}&\frac{36}{11}\\[0.5em] 0\cdot (-3)+0&0\cdot (-3)+0&1\cdot (-3)+3&-\frac{19}{11}\cdot (-3)+(-8)&\frac{36}{11}\cdot (-3)+7\ \end{array}\right]
Replace row 4 with the sum.
[1111110123100011911361100031113111]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\[0.5em] 0&1&2&-3&10 \\[0.5em] 0&0&1&-\frac{19}{11}&\frac{36}{11}\\[0.5em] 0&0&0&-\frac{31}{11}&-\frac{31}{11} \end{array}\right]
Step 7
Multiply row 4 by 1131-\frac{11}{31} so that the entry at a4,4a_{4,4} is 1.
[1111110123100011911361100011]\left[\begin{array}{rrrr|r}1&1&1&1&11 \\[0.5em] 0&1&2&-3&10 \\[0.5em] 0&0&1&-\frac{19}{11}&\frac{36}{11}\\[0.5em] 0&0&0&1&1 \end{array}\right]
Step 8
Translate the augmented matrix back into a system of equations.
w+x+y+z=11x+2y3z=10y1911z=3611z=1\begin{aligned} w+x+y+z &=11 \\ x+2y-3z &=10 \\ y-\frac{19}{11}z &=\frac{36}{11} \\ z &=1 \end{aligned}
Step 9
Substitute the solution for zz into the third equation to find the solution for yy.
y1911(1)=3611y=5511y=5\begin{aligned} y-\frac{19}{11}(1) &=\frac{36}{11} \\y &=\frac{55}{11} \\ y &=5 \end{aligned}
Substitute the solutions for yy and zz into the second equation to find the solution for xx.
x+2(5)3(1)=10x=3\begin{aligned} x+2(5)-3(1) &=10 \\ x &=3 \end{aligned}
Substitute the solutions for xx, yy, and zz into the first equation to find the solution for ww.
w+3+5+1=11w=2\begin{aligned} w+3+5+1 &=11 \\ w &=2 \end{aligned}
Solution
The solution to the system of equations is (2,3,5,1)(2,3,5,1).

Dependent and Inconsistent Systems

Row operations can be used to determine whether a linear system of equations is consistent and independent, inconsistent, or dependent.
An augmented matrix can be used to determine the number of solutions of a system of linear equations. Use row operations to reduce the augmented matrix that represents the system.

Independent, Dependent, and Inconsistent Systems

Type of System Reduced Form (After Row Operations) Number of Solutions Example
Consistent and independent Ones along the main diagonal of the coefficient matrix Exactly one solution [1111110123100011911361100011]\left[\begin{array}{rrrr|r}{\color{#c42126} 1}&1&1&1&11 \\[0.5em] 0&{\color{#c42126} 1}&2&-3&10 \\[0.5em] 0&0&{\color{#c42126} 1}&-\frac{19}{11}&\frac{36}{11}\\[0.5em] 0&0&0&{\color{#c42126} 1}&1 \end{array}\right]
Inconsistent Contains a row in which all entries are zero except the last entry No solution [1456110124100011300003]\left[\begin{array}{rrrr|r}1&4&5&6&11 \\ 0&1&-2&-4&10 \\ 0&0&1&-1&3\\ {\color{#c42126} 0}&{\color{#c42126} 0}&{\color{#c42126} 0}&{\color{#c42126} 0}&{\color{#c42126} -3}\\ \end{array}\right]
Dependent Contains a row in which all entries are zero Infinite number of solutions [10552015180011600000]\left[\begin{array}{rrrr|r}1&0&-5&5&2 \\ 0&1&5&1&8 \\ 0&0&1&-1&6\\ {\color{#c42126} 0}&{\color{#c42126} 0}&{\color{#c42126} 0}&{\color{#c42126} 0}&{\color{#c42126} 0}\\ \end{array}\right]