# Matrix Equation – Explanation & Examples

matrix equation is just like algebraic equations. We have variables in algebraic equations, and in matrix equations, we deal with matrices that act as a variable.

So, what are matrix equations?

A matrix equation is an equation in which a whole matrix stands for a variable.

In this lesson, we will see a matrix equation, how to write matrix equations, and how to solve matrix equations. Let’s start!

## What is a Matrix Equation?

matrix equation is an equation in which a matrix acts as a variable. We can solve simple matrix equations using the operations such as matrix addition, matrix subtraction, and scalar multiplication.

We will also look at very simple matrix equations in which matrix multiplication is performed, and the idea of a matrix inverse is used.

## How to Write a Matrix Equation

Let’s look at some common algebraic equation examples:

$x + 5 = 10$

$x – 7 = { – 5 }$

$3x + 6 = 8$

$2x = 18$

• For the first equation, to solve for $x$, we do the process of subtraction.
• For the second equation, to solve for $x$, we do the process of addition.
• For the third equation, to solve for $x$, we combine subtraction and division.
• For the last equation, to solve for $x$, we use division.

We can have similar forms of matrix equations in which we have to perform the same operations BUT on matrices! Let’s check some examples of how to write matrix equations:

$\begin{bmatrix} { a } & { b } \\ { c } & { d } \end {bmatrix} + X = \begin{bmatrix} { e } & { f } \\ { g } & { h } \end {bmatrix}$

$\begin{bmatrix} { a } & { b } \\ { c } & { d } \end {bmatrix} – X = \begin{bmatrix} { e } & { f } \\ { g } & { h } \end {bmatrix}$

$3 \times \begin{bmatrix} { a } & { b } \\ { c } & { d } \end {bmatrix} = \begin{bmatrix} { 6 } & { 12 } \\ { – 18 } & { 9 } \end {bmatrix}$

$X \begin{bmatrix} { a } & { b } \\ { c } & { d } \end {bmatrix} = \begin{bmatrix} { e } & { f } \\ { g } & { h } \end {bmatrix}$

These $4$ equations are matrix equations. We would need to perform the same operations, but on matrices, to solve for the unknown matrix! We will look at how to solve these types of matrix equations, next.

## How to Solve Matrix Equations

As we mentioned earlier, the way we solve matrix equations is simply following the basic arithmetic operations but keeping in mind the rules of matrix addition, matrix subtraction, scalar multiplication, and matrix multiplication.

Let’s check a simple problem of matrix addition:

$A – \begin{bmatrix} { 3 } & { – 3 } \\ { 1 } & { 0 } \end {bmatrix} = \begin{bmatrix} { – 10 } & { 2 } \\ { – 1 } & { 1 } \end {bmatrix}$

Note that $A$ is a matrix.

Like equations, to solve for matrix $A$, we can add the first matrix with the second matrix. The process is shown below:

$A = \begin{bmatrix} { – 10 } & { 2 } \\ { – 1 } & { 1 } \end {bmatrix} + \begin{bmatrix} { 3 } & { – 3 } \\ { 1 } & { 0 } \end {bmatrix}$

$A = \begin{bmatrix} { – 10 + 3 } & { 2 + ( – 3 ) } \\ { -1 + 1 } & { 1 + 0 } \end {bmatrix}$

$A = \begin{bmatrix} { – 7 } & { – 1 } \\ { 0 } & { 1 } \end {bmatrix}$

To add two matrices, the first condition has to be that both the matrices’ order needs to be equal! Both matrices here were $2 \times 2$ matrices. To perform matrix addition, we added each corresponding entry to each other. Learn more about matrix addition by checking this article out!

Let’s take a look at a couple of examples!

#### Example 1

Solve for the matrix $B$:

$B + \begin{bmatrix} { 0 } & { – 1 } & 4 \\ { 11 } & { – 2 } & 0 \\ {3} & {6} & { – 2 } \end {bmatrix} = \begin{bmatrix} { 6 } & { 1 } & – 1 \\ { – 1 } & { 4 } & – 1 \\ { – 1 } & { – 2 } & { – 3 } \end {bmatrix}$

Solution

Like equations, to solve for $B$, we have to subtract the first matrix from the second matrix. They are both $3 \times 3$ matrices and thus matrix $B$ will also be a $3 \times 3$ matrix. The process is shown below:

$B = \begin{bmatrix} { 6 } & { 1 } & – 1 \\ { – 1 } & { 4 } & – 1 \\ { – 1 } & { – 2 } & { – 3 } \end {bmatrix} – \begin{bmatrix} { 0 } & { – 1 } & 4 \\ { 11 } & { – 2 } & 0 \\ {3} & {6} & { – 2 } \end {bmatrix}$

$B = \begin{bmatrix} { 6 – 0 } & { 1 + 1 } & { -1 – 4} \\ { -1 – 11 } & { 4 + 2 } & -1 – 0 \\ { -1 – 3} & {-2 – 6} & { -3 + 2 } \end {bmatrix}$

$B = \begin{bmatrix} { 6 } & { 2 } & { -5} \\ { -12 } & { 6 } & -1 \\ { -4} & {-8} & { -1 } \end {bmatrix}$

#### Example 2

Solve the following matrix equation for the values of $x$ and $y$:

$\begin{bmatrix} { 2 } & {2 } \\ { 3 } & {4 } \end {bmatrix} \begin{bmatrix} { x } \\ y \end {bmatrix} = \begin{bmatrix} { 4 } \\ 8 \end {bmatrix}$

Solution

Treating the second matrix as a variable, we know that we will have to divide the matrix with $4$ and $8$ elements (third matrix) by the $2 \times 2$ matrix (first matrix).

But matrix division isn’t possible!

Instead of dividing, we will have to multiply the inverse of the $2 \times 2$ matrix with the third matrix!

Given matrix $A = \begin{bmatrix} { a } & {b } \\ { c } & {d } \end {bmatrix}$, the inverse of this matrix is $A^{ – 1 } = \frac{1}{ad – bc} \begin{bmatrix} { d } & {-b } \\ {-c } & {a } \end {bmatrix}$.

Let’s find the inverse of the matrix $\begin{bmatrix} { 2 } & {2 } \\ { 3 } & {4 } \end {bmatrix}$ :

$= \frac{1}{ (2)(4) – (2)(3) } \begin{bmatrix} { 4 } & { -2 } \\ { – 3 } & { 2 } \end {bmatrix}$

$= \frac{1}{2} \begin{bmatrix} { 4 } & { -2 } \\ { – 3 } & { 2 } \end {bmatrix}$

$= \begin{bmatrix} { 2 } & { -1 } \\ { – \frac{3}{2} } & { 1 } \end {bmatrix}$

Now, we can solve for our equation:

$\begin{bmatrix} { 2 } & {2 } \\ { 3 } & {4 } \end {bmatrix} \begin{bmatrix} { x } \\ y \end {bmatrix} = \begin{bmatrix} { 4 } \\ 8 \end {bmatrix}$

$\begin{bmatrix} { x } \\ y \end {bmatrix} = \begin{bmatrix} { 2 } & { -1 } \\ { – \frac{3}{2} } & { 1 } \end {bmatrix} \begin{bmatrix} { 4 } \\ 8 \end {bmatrix}$

$\begin{bmatrix} { x } \\ y \end {bmatrix} = \begin{bmatrix} {(2)(4) + (-1)(8)} \\ {(-\frac{3}{2})(4) + (1)(8)}\end {bmatrix}$

$\begin{bmatrix} { x } \\ y \end {bmatrix} = \begin{bmatrix} {8 – 8} \\ {-6 + 8}\end {bmatrix}$

$\begin{bmatrix} { x } \\ y \end {bmatrix} = \begin{bmatrix} {0} \\ 2\end {bmatrix}$

Thus,

$x = 0$ and $y = 2$.

To know more about how we did this multiplication, check out our lesson on matrix multiplication.

### Practice Questions

1. Solve for $a$, $b$, $c$, and $d$.
$3 \begin{bmatrix} { a } & { b } \\ { c } & { d } \end {bmatrix} = \begin{bmatrix} { – 6 } & { 12 } \\ { – 9 } & { – 3 } \end {bmatrix}$
2. Given the matrices:
$A = \begin{bmatrix} 0 & 1 \\ 2 & 6 \end {bmatrix}$
$B = \begin{bmatrix} 3 & -1 \\ 2 & 3 \end {bmatrix}$
$C = \begin{bmatrix} 4 & 3 \\ -2 & 5 \end {bmatrix}$

Solve the matrix equation $X \cdot A + B = C$.

1. This is a  scalar multiplication matrix equation

$3 \begin{bmatrix} { a } & { b } \\ { c } & { d } \end {bmatrix} = \begin{bmatrix} { – 6 } & { 12 } \\ { – 9 } & { – 3 } \end {bmatrix}$

We have to solve for the variables $a$, $b$, $c$, and $d$. On the left hand side, we multiply each entry of the first matrix with the scalar “3”. Let’s do this:

$\begin{bmatrix} { 3a } & {3 b } \\ { 3c } & {3 d } \end {bmatrix} = \begin{bmatrix} { – 6 } & { 12 } \\ { – 9 } & { – 3 } \end {bmatrix}$

Now we have two $2 \times 2$ matrices equal to each other. This means that each corresponding element is equal to each other. We equate each and find the values of all the $4$ variables.

$3a = – 6$

$a = – 2$

Then,

$3b = 12$

$b = 4$

Next,

$3c = – 9$

$c = – 3$

Lastly,

$3d = – 3$

$d = – 1$

So we have $a = – 2$, $b = 4$, $c = – 3$, and $d = -1$. Thus, the unknown matrix can be written as:

$\begin{bmatrix} { -2 } & { 4 } \\ { – 3 } & { – 1 } \end {bmatrix}$

2. Treating $X$ as a variable, we have:

$X \cdot A +B = C$
$X \cdot A = C – B$
$X = \frac{C-B}{A}$

Instead of dividing, we will multiply the inverse of $A$ with the matrix $C-B$. Let’s find $C – B$:

$C – B = \begin{bmatrix} 4 & 3 \\ -2 & 5 \end {bmatrix} – \begin{bmatrix} 3 & -1 \\ 2 & 3 \end {bmatrix}$
$C – B = \begin{bmatrix} 4-3 & 3+1 \\ -2-2 & 5-3 \end {bmatrix}$
$C – B = \begin{bmatrix} 1 & 4 \\ -4 & 2 \end {bmatrix}$

Let’s find $A^{-1}$:
$A^{-1} = \frac{1}{(0)(6)-(1)(2)} \begin{bmatrix} 6 & -1 \\ -2 & 0 \end {bmatrix}$
$A^{-1} = – \frac{1}{2} \begin{bmatrix} 6 & -1 \\ -2 & 0 \end {bmatrix}$
$A^{-1} = \begin{bmatrix} -3 & \frac{1}{2} \\ 1 & 0 \end {bmatrix}$

$X = A^{-1}(C – B)$
$X = \begin{bmatrix} -3 & \frac{1}{2} \\ 1 & 0 \end {bmatrix} \begin{bmatrix} 1 & 4 \\ -4 & 2 \end {bmatrix}$
$X = \begin{bmatrix} (-3)(1) + (\frac{1}{2})(-4) & (-3)(4) + (\frac{1}{2})(2) \\ (1)(1)+(0)(-4) & (1)(4)+(0)(2) \end {bmatrix}$
$X = \begin{bmatrix} -5 & -11 \\ 1 & 4 \end {bmatrix}$