# Lesson Explainer: Solving a System of Two Equations Using a Matrix Inverse Mathematics

In this explainer, we will learn how to solve a system of two linear equations using the inverse of the matrix of coefficients.

We can solve a system of two linear equations, which are also called simultaneous equations, using the substitution or elimination methods, so it is fair to ask why we need to learn a different method to solve the same system. In fact, using a matrix inverse to solve a system of two linear equations is more involved than the previous two methods, which further justifies this question. We are studying this method as a model to understand the relationship between a system of linear equations and matrices. Since the system of two linear equations is the simplest model that relates a system of equations to matrices, it makes sense to start here.

The method we will learn in this explainer can be used for a system containing a larger number of linear equations and unknown variables, although we will not discuss larger systems here. While it is not too difficult to solve a system of two linear equations without using matrices, it is more challenging to do this when we have three or more equations involved. Understanding the relationship between a system of linear equations and matrices lets us organize the given system of equations into a concise matrix equation, which can be solved using a method analogous to what we will discuss here.

Before we discuss how to solve simultaneous equations using matrices, we need to understand how to solve a matrix equation. Recall the inverse matrix.

### Definition: Inverse Matrices

Given a square matrix , the inverse matrix is a square matrix of the same order satisfying where is the identity matrix of the same order. If such a matrix exists, we say that matrix is invertible.

Consider a matrix equation , where and are known and matrices, respectively, and is an unknown matrix. We further assume that is an invertible matrix. We know that, in order to multiply a pair of matrices, the number of columns of the first matrix must equal the number of rows of the second matrix. We can see that the matrix multiplication is well defined.

Since matrix is invertible, there exists an inverse matrix . Multiplying from the left by on both sides of the equation , we obtain

 𝐴𝐴𝑋=𝐴𝐵. (1)

On the left-hand side of the equation, we know that , where is the multiplicative identity. Hence,

Substituting this expression to the left-hand side of equation (1), we can write

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. For a simple example, we can think of the case where , where is a zero matrix.

We know that is not invertible since . The matrix equation has no solution if is a nonzero matrix, since the multiplication of a zero matrix by any matrix results in a zero matrix. On the other hand, if is a zero matrix of the natural order resulting from this matrix multiplication, any matrix satisfies the equation . This means that this matrix equation has an infinite number of solutions.

In our first example, we will solve a matrix equation using the inverse matrix.

### Example 1: Solving Equations of Matrices Using Their Inverses

Given that what is the value of ?

In this example, we are given a matrix equation. Matrix is an unknown matrix. If we find this matrix, we can find the value of .

The example does not give us what matrix is, but it gives us the inverse of this matrix . Recall that the inverse of a square matrix , if it exists, is a matrix satisfying where is the identity matrix. We can multiply from the left by on both sides of the given equation to obtain

We know that , which is a multiplicative identity, so we can neglect the factor and fill in the provided expression for on the right-hand side to write

Computing this matrix multiplication, we obtain

This leads to the unknown matrix. We know that a pair of matrices are equal if each pair of corresponding entries in the matrices are equal. Hence, this leads to

In particular, the example asks for the value of , which is

In the previous example, we solved a matrix equation when we were given the inverse matrix . If we are not provided the expression for , we can find the inverse matrix by using the following formula, as long as .

### Formula: Inverse of a 2 × 2 Matrix

Let such that . Then, where . If , matrix is not invertible.

Let us consider an example where we solve a matrix equation by first finding the inverse of a matrix.

### Example 2: Solving Equations of Matrices Using Their Inverses

Given that determine the values of and .

In this example, we are given a matrix equation. Matrix is an unknown matrix. If we find this matrix, we can find the values of and .

We recall that, given matrices and , an unknown matrix satisfying the equation is given by if the inverse matrix exists and the matrix multiplication can be defined. In our given example, this matrix corresponds to the matrix . Hence, this can be written as

 𝑥𝑦=581−8−431, (2)

if the inverse matrix exists and the matrix multiplication is well defined. Hence, we need to begin by finding the inverse of this matrix, if it exists.

We know that the inverse of a square matrix exists if its determinant is not equal to zero. Let us first compute the determinant of this matrix. We know that

Applying this formula to the given matrix,

Since the determinant is nonzero, we can proceed to find its inverse. We recall the formula for the inverse of a matrix:

Hence, using the determinant of the matrix we found earlier,

Substituting this expression into equation (2),

We know that, in order to multiply a pair of matrices, the number of columns of the first matrix must equal the number of rows of the second matrix. Computing this matrix multiplication, we obtain

Finally, computing the scalar multiplication,

This leads to the unknown matrix. We know that a pair of matrices are equal if each pair of corresponding entries in the matrices are equal. Hence, this leads to

So far, we have considered a few examples where we solved matrix equations using the inverse matrix. Let us turn our attention to the system of two linear equations.

### How To: Representing Systems of Two Equations as Matrix Equations

Consider a system of equations given by for some known constants , , , , , . We can write this system of two equations as one matrix equation

If we carry out the matrix multiplication on the left-hand side of the matrix equation, this is the same as

Equating the corresponding entries of the matrices on both sides of this equation leads back to the system of two linear equations. Hence, this matrix equation is equivalent to the system of two linear equations. Since we can write the system of equations as a matrix equation, we can solve this system using the matrix inverse.

We can see that the coefficients of and in the system of equations became the matrix in the matrix equation. This is called the coefficient matrix, because its entries come from the coefficients of the simultaneous equations. When writing down the coefficient matrix, we need to be careful with the order of the entries. Since the variable matrix has as its first entry, the coefficients of go in the first column. Hence, the same coefficient matrix is used even if the first equation in the system is written as . Rather than following the order of the coefficients written in the given equation, we need to consider which variable it is the coefficient of.

We also note that the column matrix on the right-hand side of the matrix equation contains the constant terms from the right-hand sides of the simultaneous equations. The order of these constants must be consistent with the coefficient matrix. Since the coefficients of the first equation, , are written in the first row of the coefficient matrix, the constant from this equation must also appear in the first row of this matrix equation.

Just like we discussed when solving matrix equations, this also means that the system of equations has either no solution or an infinite number of solutions when the coefficient matrix is not invertible.

In the next example, we will write a pair of simultaneous equations into a matrix equation and then solve the matrix equation using the matrix inverse.

### Example 3: Solving a Pair of Simultaneous Equations Using Matrices

Consider the simultaneous equations

1. Express the given simultaneous equations as a matrix equation.
2. Write down the inverse of the coefficient matrix.
3. Multiply through by the inverse, on the left-hand side, to solve the matrix equation.

Part 1

Recall that a pair of simultaneous equations given by can be written as the matrix equation

Here, it is important to note that the coefficient matrix is the coefficient of the simultaneous equations in the order given in the variable matrix . This means that the first column of the coefficient matrix contains the coefficients of variable , while the second column contains the coefficients of variable . In particular, we should first notice that and are written in the opposite order. We can rearrange this pair of simultaneous equations to say

Then, we can write

Part 2

In this part, we need to find the inverse of the coefficient matrix. In the previous part, we found the coefficient matrix . We know that the inverse of a square matrix exists if its determinant is not equal to zero. Let us first compute the determinant of this matrix. We know that

Applying this formula to the coefficient matrix,

Since the determinant is nonzero, we can proceed to find its inverse. We recall the formula for the inverse of a matrix:

Hence, using the determinant of the matrix we found earlier,

Part 3

In this part, we need to multiply through by the inverse on the left-hand side and solve the matrix equation. We begin with the matrix equation

Multiplying both sides of the equation by the inverse of the coefficient matrix, we have

On the left-hand side of this equation, the inverse of the coefficient matrix is multiplied by the coefficient matrix. Recall that, for any invertible matrix , we have where is the identity matrix. This means

Since is the identity matrix, which is multiplied by the variable matrix, we can neglect this term. This leads to

We can now substitute the inverse matrix from the previous part:

Computing this matrix multiplication, we obtain

Finally, computing the scalar multiplication,

Hence, the solution to the matrix equation is

In the previous example, we solved the matrix equation corresponding to a given pair of simultaneous equations. While we did not explicitly verify this, it can be shown that the values we found for and satisfy the given simultaneous equations. In the next problem, we will solve a pair of simultaneous equations by using matrices.

### Example 4: Solving a System of Two Equations Using Matrices

Use matrices to solve the system

In this example, we need to solve the system of two linear equations by using matrices. We know that we can write a system of two linear equations into an equivalent matrix equation. Let us recall this process. Given the system of equations we can write an equivalent matrix equation

Here, it is important to note that the coefficient matrix is the coefficient of the simultaneous equations in the order given in the variable matrix . This means that the first column of the coefficient matrix contains the coefficients of variable , while the second column contains the coefficients of variable .

We note that the variable in the first equation is only accompanied by a negative sign. This indicates that the coefficient of in this equation is . Also, the variable in the second equation does not display any coefficients meaning that its coefficient is equal to 1. We can rewrite this pair of simultaneous equations with this information:

Then, we can write the matrix equation

 −15−31𝑥𝑦=88. (3)

We can solve this matrix equation by multiplying from the left the inverse of the coefficient matrix if it exists. We know that the inverse of a square matrix exists if its determinant is not equal to zero. Let us first compute the determinant of this matrix. We know that

Applying this formula to the coefficient matrix,

Since the determinant is nonzero, we can proceed to find its inverse. We recall the formula for the inverse of a matrix:

Hence, using the determinant of the matrix we found earlier,

Recall that, for any invertible matrix , we have where is the identity matrix. This means that we will be able to remove the coefficient matrix from the left-hand side of equation (3) by multiplying from the left the inverse of the coefficient matrix. Multiplying both sides of the equation by the inverse of the coefficient matrix, we have

We know that, in order to multiply a pair of matrices, the number of columns of the first matrix must equal the number of rows of the second matrix. We can see that the matrix multiplication on the right-hand side of the equation above is well defined. Computing this matrix multiplication, we obtain

Finally, computing the scalar multiplication,

This gives us the solution of the matrix equation

We know that a pair of matrices are equal if each pair of corresponding entries are equal. Hence, we obtain the solution to the given system of equations

In our final example, we will solve a real-world problem involving a system of two equations using matrices.

### Example 5: Solving Two Equations with Two Unknowns Using Matrices

The length of a rectangle is 6 cm more than twice its width, and twice its length is 39 cm more than its width. Given this, use matrices to determine the perimeter of the rectangle.

In this example, we need to find the perimeter of the rectangle whose length and width are related according to the given description. We know that the perimeter of a rectangle is given by twice the sum of its length and width. Let us begin by denoting the length and width of the rectangle by unknown constants and respectively. Then,

Let us begin by writing down the relationship between and in the form of equations. First, we are given that the length of a rectangle is 6 cm more than twice its width. This can be written as

Second, we are given that twice the length is 39 cm more than its width. This can be written as

Let us rearrange these equations so that the left-hand sides of the equations contain the variables and the right-hand sides contain the constants:

Now, we will solve this system of equations by using matrices. Recall that the system of equations can be written as the matrix equation

Hence, we can write our system of equations as

 1−22−1𝑥𝑦=639. (4)

We can solve this matrix equation by multiplying from the left the inverse of the coefficient matrix if it exists. We know that the inverse of a square matrix exists if its determinant is not equal to zero. Let us first compute the determinant of this matrix. We know that

Applying this formula to the coefficient matrix,

Since the determinant is nonzero, we can proceed to find its inverse. We recall the formula for the inverse of a matrix:

Hence, using the determinant of the matrix we found earlier,

Recall that, for any invertible matrix , we have where is the identity matrix. This means that we will be able to remove the coefficient matrix from the left-hand side of equation (4) by multiplying from the left the inverse of the coefficient matrix. Multiplying both sides of the equation by the inverse of the coefficient matrix, we have

We know that, in order to multiply a pair of matrices, the number of columns of the first matrix must equal the number of rows of the second matrix. We can see that the matrix multiplication on the right-hand side of the equation above is well defined. Computing this matrix multiplication, we obtain

Finally, computing the scalar multiplication,

We know that a pair of matrices are equal if each pair of corresponding entries are equal. Hence, we obtain the solution to the given system of equations

This leads to the perimeter of the rectangle:

Lastly, we note that matrices and their multiplicative inverses can be applied in the field of cryptography. In this context, the aim is to encode a message before it is transmitted, to prevent it from being understood if it is intercepted during transmission. The message can then be decoded once it reaches its desired destination.

As an illustration, we might want to transmit the message “help”. We start by representing each letter as a number, using the following simple alphabet table.

 a: 1 b: 2c: 3d: 4e: 5f: 6g: 7 h: 8i: 9j: 10k: 11l: 12m: 13n: 14 o: 15p: 16q: 17r: 18s: 19t: 20u: 21 v: 22w: 23x: 24y: 25z: 26

Then, taking our message two letters at a time, we write each two-letter section as a matrix: Next, to encode our message, we choose an invertible matrix as our coding matrix and multiply each of the above matrices on the left by . For instance, choosing , our message encodes as

Therefore, we transmit the message .

Now, recall that for a matrix with , its multiplicative inverse is given by where . In this case, we have , so Once the message has been received, to decode it we must multiply each of these matrices on the left by . This will “undo” the effect of and give us back the original pair of matrices . We can then read off the message “help” from these four numbers by looking up the corresponding letters in the alphabet table.

Let us finish by recapping a few important concepts from the explainer.

### Key Points

• Let be an invertible matrix and be a matrix such that the multiplication is defined. Matrix satisfying the equation is given by
• If matrix is not invertible, the matrix equation has either an infinite number of solutions or no solution.
• Consider a system of equations given by for some known constants , , , , , . We can write this system of two equations as one matrix equation This equation can then be solved using the matrix inverse: