Lesson Explainer: Solving a System of Two Equations Using a Matrix Inverse | Nagwa Lesson Explainer: Solving a System of Two Equations Using a Matrix Inverse | Nagwa

Lesson Explainer: Solving a System of Two Equations Using a Matrix Inverse Mathematics • First Year of Secondary School

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 det𝐴=0. 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 det𝑂=0. 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 𝐴=2589,𝐴𝑥𝑦=28, what is the value of 𝑦?

Answer

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 𝐴𝐴𝑥𝑦=𝐴28.

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 𝑥𝑦=258928.

Computing this matrix multiplication, we obtain 𝑥𝑦=2×(2)+(5)×8(8)×(2)+(9)×8=4456.

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 𝑥=44,𝑦=56.

In particular, the example asks for the value of 𝑦, which is 𝑦=56.

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 det𝐴0.

Formula: Inverse of a 2 × 2 Matrix

Let 𝐴=𝑎𝑏𝑐𝑑 such that det𝐴0. Then, 𝐴=1𝐴𝑑𝑏𝑐𝑎,det where det𝐴=𝑎𝑑𝑏𝑐. If det𝐴=0, matrix 𝐴 is not invertible.

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

Example 2: Solving Equations of Matrices Using Their Inverses

Given that 5818𝑥𝑦=431, determine the values of 𝑥 and 𝑦.

Answer

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 2×2 matrix 5818. Hence, this can be written as

𝑥𝑦=5818431,(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 det𝑎𝑏𝑐𝑑=𝑎𝑑𝑏𝑐.

Applying this formula to the given 2×2 matrix, det5818=5×(8)8×1=48.

Since the determinant is nonzero, we can proceed to find its inverse. We recall the formula for the inverse of a 2×2 matrix: 𝐴=1𝐴𝑑𝑏𝑐𝑎.det

Hence, using the determinant of the matrix we found earlier, 5818=1488815.

Substituting this expression into equation (2), 𝑥𝑦=1488815431.

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 𝑥𝑦=148(8)×(43)+(8)×1(1)×(43)+5×1=14833648.

Finally, computing the scalar multiplication, 𝑥𝑦=336484848=71.

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 𝑥=7,𝑦=1.

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 2×2 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 4𝑥2𝑦=0,3𝑦+5𝑥=11.

  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.

Answer

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 5𝑥 and 3𝑦 are written in the opposite order. We can rearrange this pair of simultaneous equations to say 4𝑥2𝑦=0,5𝑥+3𝑦=11.

Then, we can write 4253𝑥𝑦=011.

Part 2

In this part, we need to find the inverse of the coefficient matrix. In the previous part, we found the coefficient matrix 4253. 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 det𝑎𝑏𝑐𝑑=𝑎𝑑𝑏𝑐.

Applying this formula to the coefficient matrix, det4253=4×3(2)×5=22.

Since the determinant is nonzero, we can proceed to find its inverse. We recall the formula for the inverse of a 2×2 matrix: 𝐴=1𝐴𝑑𝑏𝑐𝑎.det

Hence, using the determinant of the matrix we found earlier, 4253=1223254.

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 4253𝑥𝑦=011.

Multiplying both sides of the equation by the inverse of the coefficient matrix, we have 42534253𝑥𝑦=4253011.

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 42534253=𝐼.

Since 𝐼 is the identity matrix, which is multiplied by the variable matrix, we can neglect this term. This leads to 𝑥𝑦=4253011.

We can now substitute the inverse matrix from the previous part: 𝑥𝑦=1223254011.

Computing this matrix multiplication, we obtain 𝑥𝑦=1223×0+2×(11)5×0+4×(11)=1222244.

Finally, computing the scalar multiplication, 𝑥𝑦=22224422=12.

Hence, the solution to the matrix equation is 𝑥𝑦=12.

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 𝑥+5𝑦=8,3𝑥+𝑦=8.

Answer

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 1. 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: 1𝑥+5𝑦=8,3𝑥+1𝑦=8.

Then, we can write the matrix equation

1531𝑥𝑦=88.(3)

We can solve this matrix equation by multiplying from the left the inverse of the coefficient matrix 1531 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 det𝑎𝑏𝑐𝑑=𝑎𝑑𝑏𝑐.

Applying this formula to the coefficient matrix, det1531=(1)×15×(3)=14.

Since the determinant is nonzero, we can proceed to find its inverse. We recall the formula for the inverse of a 2×2 matrix: 𝐴=1𝐴𝑑𝑏𝑐𝑎.det

Hence, using the determinant of the matrix we found earlier, 1531=1141531.

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 𝑥𝑦=114153188.

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 𝑥𝑦=1141×8+(5)×83×8+(1)×8=1143216.

Finally, computing the scalar multiplication, 𝑥𝑦=32141614=16787.

This gives us the solution of the matrix equation 𝑥𝑦=16787.

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 𝑥=167,𝑦=87.

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.

Answer

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, perimeter=2(𝑥+𝑦).

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 𝑥=2𝑦+6.

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

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: 𝑥2𝑦=6,2𝑥𝑦=39.

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

1221𝑥𝑦=639.(4)

We can solve this matrix equation by multiplying from the left the inverse of the coefficient matrix 1221 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 det𝑎𝑏𝑐𝑑=𝑎𝑑𝑏𝑐.

Applying this formula to the coefficient matrix, det1221=1×(1)(2)×2=3.

Since the determinant is nonzero, we can proceed to find its inverse. We recall the formula for the inverse of a 2×2 matrix: 𝐴=1𝐴𝑑𝑏𝑐𝑎.det

Hence, using the determinant of the matrix we found earlier, 1221=131221.

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 𝑥𝑦=131221639.

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 𝑥𝑦=131×6+2×392×6+1×39=137227.

Finally, computing the scalar multiplication, 𝑥𝑦=723273=249.

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 𝑥=24,𝑦=9.

This leads to the perimeter of the rectangle: 2(𝑥+𝑦)=2(24+9)=66.cm

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

Then, taking our message two letters at a time, we write each two-letter section as a 2×1 matrix: help=85,=1216. Next, to encode our message, we choose an invertible 2×2 matrix as our coding matrix 𝐶 and multiply each of the above 2×1 matrices on the left by 𝐶. For instance, choosing 𝐶=1245, our message encodes as 124585=1857,12451216=44128.

Therefore, we transmit the message 185744128.

Now, recall that for a matrix 𝐶=𝑎𝑏𝑐𝑑 with det𝐶0, its multiplicative inverse is given by 𝐶=1𝐶𝑑𝑏𝑐𝑎,det where det𝐶=𝑎𝑑𝑏𝑐. In this case, we have det𝐶=(1×5)(2×4)=3, so 𝐶=135241=53234313. Once the message 185744128 has been received, to decode it we must multiply each of these 2×1 matrices on the left by 𝐶. This will “undo” the effect of 𝐶 and give us back the original pair of 2×1 matrices 851216. 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: 𝑥𝑦=𝑎𝑏𝑐𝑑𝑒𝑓.

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy