In this explainer, we will learn how to solve a system of three linear equations using the inverse of the matrix of coefficients.
We can solve a system of linear equations, which are also called simultaneous equations, using the substitution or elimination methods, but these methods become convoluted when the number of equations are more than two. Even with a system of three equations, this process is time consuming to solve by hand. But if we want to program a computer to perform this task for us, we need a more systemic approach to this task.
This is where the matrix method comes in. One of the most widely used applications of matrix operations is to formalize this process by means of the matrix inverse so that we can easily program a computer to perform this task. We will see further below in this explainer how to write these systems of linear equations as one matrix equation of the form , where is a square matrix of order and and are matrices of order . is the unknown matrix (i.e., its elements are unknown). Let us begin first by discussing how to solve a matrix equation of the form using the matrix inverse.
We know that is a square matrix. Recall that the inverse of a square matrix exists if its determinant is not equal to zero. Given a matrix with , the inverse matrix is the matrix satisfying where is the identity matrix.
Now, to solve the matrix equation , where and are known and matrices, respectively, we need to multiply from the left by on both sides of the equation to obtain
Since , this equation simplifies to
Both and are known matrices; hence, this gives the solution to the matrix equation .
How To: Solving Matrix Equations
Let be an invertible matrix and be a matrix such that the multiplication is defined. Matrix satisfying the equation is given by
This method gives us a way to solve any matrix equation of the form if matrix is invertible. However, this method cannot be used when is not invertible. This could happen if is not a square matrix or if is square and . In such cases, the matrix equation has either an infinite number of solutions or no solution. We will not focus on these scenarios in this explainer, and we will check that the coefficient matrix is invertible before proceeding.
In our first example, we will solve a matrix equation when the inverse of a matrix is provided.
Example 1: Solving a Matrix Equation Involving a 3 × 3 Matrix
Given that solve the following matrix equation for :
Answer
In this example, we need to solve a matrix equation to find the unknown matrix . To solve this equation, we want to rearrange the equation so that is the subject. We can begin by subtracting both sides of the equation by the leftmost matrix in the equation:
Now, we can multiply both sides of the equation by to write
Finally, we can multiply from the left by the provided inverse matrix on both sides of the equation to write
We know that, for any invertible square matrix , where is the identity matrix of the same order. Hence, the multiplication of the two matrices on the left-hand side of the equation will result in the identity matrix, which simplifies the equation to
Hence, we can finish by working out the matrix multiplication:
In the previous example, we solved a matrix equation using a matrix inverse. However, we were given the inverse of the matrix, which is usually the most difficult part. If we are not given the inverse matrix, we will need to first find the inverse matrix. Let us recall the adjoint method for finding the inverse of a matrix.
How To: Finding the Inverse of a 3 × 3 Matrix with the Adjoint Method
For a matrix with , we can find the inverse matrix by the following steps:
- Find the determinant of and make sure that it is nonzero.
- For each , find the determinants of matrix minor , which is the matrix obtained by removing the row and column of .
- Write the cofactor matrix, which is the matrix , with
- Find the adjoint matrix by transposing the cofactor matrix:
- Multiply the adjoint matrix by the reciprocal of the determinant of to obtain the inverse matrix:
As we can see above, finding the inverse of a matrix is a tedious process. The same method can be used for square matrices of higher order; it would be too lengthy to even compute the determinant of the matrix by hand, let alone the inverse. For this reason, many scientific calculators or mathematical programs have built-in functions for computing the inverse of a matrix.
For a matrix, we can compute the inverse matrix by hand using the adjoint method. In the next example, we will find the inverse of a matrix using the adjoint method and use it to solve a given matrix equation.
Example 2: Solving a Matrix Equation by Finding the Inverse of a Matrix
Solve using the inverse of a matrix.
Answer
In this example, we need to solve a matrix equation. To solve this equation, we need to multiply from the left by the inverse of the given matrix on both sides of the equation. Let us begin by finding the inverse of the matrix:
Recall that a square matrix is invertible if its determinant is nonzero. Let us begin by computing the determinant of this matrix and making sure that it is nonzero.
We recall that, for a matrix , its determinant can be computed by where are matrix minors obtained by taking the row and column from matrix . We can apply this formula to our coefficient matrix to obtain
Since , we know that the inverse matrix exists. We can find the inverse matrix by using the adjoint method as follows:
- Find the cofactor matrix where
- Find the adjoint matrix by transposing the cofactor matrix:
- Multiply the adjoint matrix by the reciprocal of the determinant of to obtain the inverse matrix:
Let us first find the cofactor matrix. Entries of the cofactor matrix are the determinants of the corresponding matrix minors multiplied by the alternating sign . We need to compute the determinants of 9 matrix minors with the corresponding sign for this purpose:
This leads to the cofactor matrix
We can find the adjoint matrix by taking the transpose:
Finally, by multiplying by the reciprocal of the determinant, which we computed earlier to be 2, we obtain
Now that we have found the inverse matrix, we can multiply this matrix from the left on both sides of the given equation to write
We know that, for any invertible square matrix , where is the identity matrix of the same order. Hence, the multiplication of the two matrices and the scalar on the left-hand side of the equation will result in the identity matrix, which simplifies the equation to
Hence, we can finish by computing the matrix and scalar multiplication on the right-hand side of this equation:
This leads to
Equating the corresponding entries of the matrices above, we obtain
In the previous example, we solved a given matrix equation by first finding the inverse of a matrix. The matrix equation that we solved in this example is equivalent to a system of 3 equations with 3 unknowns. Once we write a system of equations into its matrix form, we can follow this method to solve the system of equations. Let us recall how to write a matrix equation equivalent to a given system of linear equations.
Definition: Matrix Form of a System of Linear Equations
Consider a general system of linear equations with unknown variables :
The coefficient matrix is defined by
Also, the variable and constant matrices and , respectively, are given by
The given system of linear equations is equivalent to the matrix equation
We can see that the number of rows in the coefficient matrix is equal to the number of equations, and the number of its columns is equal to the number of unknown variables. Hence, if we begin with a system of three equations containing three unknowns, the order of the coefficient matrix will be . This means that we need to find the inverse of a matrix in order to solve this matrix equation.
In the next example, we will write a matrix equation that is equivalent to a given system of 3 linear equations and 3 unknowns. We will then solve the matrix equation using the matrix inverse.
Example 3: Solving a Set of Simultaneous Equations Using Matrices
Consider the system of equations
- Express the system as a single matrix equation.
- Work out the inverse of the coefficient matrix.
- Multiply through by the inverse, on the left-hand side, to solve the matrix equation.
Answer
Part 1
In this part, we need to write a matrix equation that is equivalent to the given system of 3 equations. Recall that a system of linear equations is equivalent to the matrix equation
The matrices in the equation above are called the coefficient, variable, and constant matrices, respectively. From the given system of equations, our variables have names , , and , which form the entries of the variable matrix. The constants 4, 14, and 10 on the right-hand sides of the given equations form the entries of the constant matrix. Hence, the variable and constant matrices are, respectively,
To find the coefficient matrix, we need to write down the coefficients of each variable in the correct order (that is, the order of , , and ) for each equation. The coefficients are not explicitly visible in the second equation, since only the negative signs appear in front of the variables. This indicates that the coefficients of , , and in the second equation are . We can write this into the equations:
This leads to the coefficient matrix
Hence, the matrix equation is
Part 2
In this part, we need to find the inverse of the coefficient matrix. We obtained, in the previous part, that the coefficient matrix is
Recall that a square matrix is invertible if its determinant is nonzero. Let us begin by computing the determinant of this matrix and making sure that it is nonzero.
We recall that, for a matrix , its determinant can be computed by where are matrix minors obtained by taking the row and column from matrix . We can apply this formula to our coefficient matrix to obtain
Since , we know that the inverse matrix exists. Let us find the inverse. Recall that we can find the inverse matrix by using the adjoint method as follows:
- Find the cofactor matrix where
- Find the adjoint matrix by transposing the cofactor matrix:
- Multiply the adjoint matrix by the reciprocal of the determinant of to obtain the inverse matrix:
Let us first find the cofactor matrix. Entries of the cofactor matrix are the determinants of the corresponding matrix minors multiplied by the alternating sign . We need to compute the determinants of 9 matrix minors with the corresponding sign for this purpose:
This leads to the cofactor matrix
We can find the adjoint matrix by taking the transpose:
Finally, by multiplying by the reciprocal of the determinant, which we computed earlier to be , we obtain
Part 3
In this part, we need to solve the matrix equation by multiplying through by the inverse on the left-hand side. We recall the matrix equation we obtained in part 1:
If we multiply from the left by the inverse matrix on both sides of the equation, we obtain
We know that the two matrices on the left-hand side of the equation are inverses of each other, which means that their product will be the identity matrix. This simplifies this equation to
We can finish by computing the matrix multiplication on the right-hand side of the equation. This gives us
Computing the scalar multiplication and simplifying, we obtain
Hence,
In the previous example, we wrote a matrix equation that is equivalent to a given system of three linear equations and solved the matrix equation using the matrix inverse. If we equate the corresponding entries of the solution of the matrix equation, we can find the solution of the system of equations.
In the next example, we will solve a given matrix equation and find the unknown constants of the variable matrix.
Example 4: Solving a System of Three Equation Using the Inverse of a Matrix
Use the inverse of a matrix to solve the system of linear equations
Answer
In this example, we need to solve a system of 3 equations with 3 unknowns using matrices. We can begin by writing a matrix equation that is equivalent to the given system of equations. Recall that a system of linear equations is equivalent to the matrix equation
The matrices in the equation above are called the coefficient, variable, and constant matrices, respectively. From the given system of equations, our variables have names , , and , which form the entries of the variable matrix. The constants , , and 7 on the right-hand sides of the given equations form the entries of the constant matrix. Hence, the variable and constant matrices are, respectively,
To find the coefficient matrix, we need to write down the coefficients of each variable in the correct order (that is, the order of , , and ) for each equation. In the final equation, the coefficients of and are not visible, which means that they are and 1, respectively. We can add these to the equation to write
This leads to the coefficient matrix
Hence, the matrix equation is
We can solve this equation by multiplying from the left the inverse of the coefficient matrix on both sides of the equation (1). Let us find the inverse of the coefficient matrix
We can use the adjoint method to obtain the inverse of this matrix, if it exists. Recall that a square matrix is invertible if its determinant is nonzero. Let us begin by computing the determinant of this matrix and making sure that it is nonzero.
We recall that, for a matrix , its determinant can be computed by where are matrix minors obtained by taking the row and column from matrix . We can apply this formula to our coefficient matrix to obtain
Since , we know that the inverse matrix exists. Let us find the inverse. Recall that we can find the inverse matrix by using the adjoint method as follows:
- Find the cofactor matrix where
- Find the adjoint matrix by transposing the cofactor matrix:
- Multiply the adjoint matrix by the reciprocal of the determinant of to obtain the inverse matrix:
Let us first find the cofactor matrix. Entries of the cofactor matrix are the determinants of the corresponding matrix minors multiplied by the alternating sign . We need to compute the determinants of 9 matrix minors with the corresponding sign for this purpose:
This leads to the cofactor matrix
We can find the adjoint matrix by taking the transpose:
Finally, by multiplying by the reciprocal of the determinant, which we computed earlier to be , we obtain
Now that we have found the inverse matrix, let us multiply equation (1) through by the inverse on the left-hand side:
Since any matrix multiplied by its inverse results in the identity matrix, the two matrices and the scalar on the left-hand side of this equation cancel out. This simplifies the equation to
Hence, we can finish by computing the matrix multiplication on the right-hand side of the equation above:
Hence,
Equating the corresponding entries in the matrices above, we obtain
In our final example, we will solve a real-world problem using the inverse of a matrix.
Example 5: Solving a Real-World Problem Using Matrix Inverse
The table below shows the number of different types of rooms in three hotels owned by a company.
Hotel | Single Room | Double Room | Suite |
---|---|---|---|
First Hotel | 45 | 74 | 15 |
Second Hotel | 48 | 74 | 19 |
Third hotel | 49 | 94 | 10 |
All three hotels charge an equal amount for a room of the same size. When all the rooms are booked, the company’s daily income from the first, second, and third hotels are 50 120 LE, 53 560 LE, and 55 660 LE respectively. Find the daily income from a suite.
Answer
In this example, we have three unknown quantities: the costs of a single room, a double room, and a suite. Let us denote these unknowns by constants , , and respectively. We can find the cost in LE of a suite by finding the value of .
We are given that the daily income from the first hotel is 50 120 LE if all rooms are booked. This can be written as the following equation:
Similarly, we can obtain another two equations from the daily income of the second and third hotels respectively:
This gives us a system of three equations with three unknowns. Let us solve this system using matrices. We can begin by writing a matrix equation that is equivalent to the given system of equations. Recall that a system of linear equations is equivalent to the matrix equation
The matrices in the equation above are called the coefficient, variable, and constant matrices respectively. From the given system of equations, our variables have names , , and , which form the entries of the variable matrix. The constants 50 120, 53 560, and 55 660 on the right-hand sides of the given equations form the entries of the constant matrix. Hence, the variable and constant matrices are, respectively,
To find the coefficient matrix, we need to write down the coefficients of each variable in the correct order (that is, the order of , , and ) for each equation. This leads to the coefficient matrix
Hence, the matrix equation is
We can solve this equation by multiplying from the left the inverse of the coefficient matrix on both sides of equation above. Let us find the inverse of the coefficient matrix
We can use the adjoint method to obtain the inverse of this matrix, if it exists. Recall that a square matrix is invertible if its determinant is nonzero. Let us begin by computing the determinant of this matrix and making sure that it is nonzero.
We recall that, for a matrix , its determinant can be computed by where are matrix minors obtained by taking the row and column from matrix . We can apply this formula to our coefficient matrix to obtain
Since , we know that the inverse matrix exists. Let us find the inverse. Recall that we can find the inverse matrix by using the adjoint method as follows:
- Find the cofactor matrix where
- Find the adjoint matrix by transposing the cofactor matrix:
- Multiply the adjoint matrix by the reciprocal of the determinant of to obtain the inverse matrix:
Let us first find the cofactor matrix. Entries of the cofactor matrix are the determinants of the corresponding matrix minors multiplied by the alternating sign . We need to compute the determinants of 9 matrix minors with the corresponding sign for this purpose:
This leads to the cofactor matrix
We can find the adjoint matrix by taking the transpose:
Finally, by multiplying by the reciprocal of the determinant, which we computed earlier to be , we obtain
Recall that we can solve the matrix equation by writing . This leads to
Hence, we can finish by computing the matrix multiplication on the right-hand side of the equation above:
This leads to
Hence, the cost of a suite is 740 LE.
Let us finish by recapping a few important concepts from this explainer.
Key Points
- To solve a system of equations using the matrix inverse when the
coefficient matrix is invertible, we can follow the steps below:
- Write an equivalent matrix equation in the form .
- Find the inverse of the coefficient matrix .
- Multiply from the left by the inverse matrix to write .
- Equate the corresponding entries of the variable matrix and the matrix to find the solution.
- Given a matrix
with , we can find the inverse matrix
by the following steps:
- Find the determinant of and make sure that it is nonzero.
- For each , find the determinants of matrix minor , which is the matrix obtained by removing the row and column of .
- Write the cofactor matrix, which is the matrix , with
- Find the adjoint matrix by transposing the cofactor matrix:
- Multiply the adjoint matrix by the reciprocal of the determinant of to obtain the inverse matrix:
- If the inverse of the coefficient matrix does not exist, the corresponding system of equations either has no solution or an infinite number of solutions.