# Solving Matrix Equations

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

You can solve the simpler matrix equations using matrix addition and scalar multiplication .

Examples 1:

Solve for the matrix $X$ : $X+\left[\begin{array}{cc}\hfill 3& \hfill 2\\ \hfill 1& \hfill 0\end{array}\right]=\left[\begin{array}{rr}\hfill 6& \hfill 3\\ \hfill 7& \hfill -1\end{array}\right]$

$\begin{array}{r}X+\left[\begin{array}{cc}\hfill 3& \hfill 2\\ \hfill 1& \hfill 0\end{array}\right]-\left[\begin{array}{cc}\hfill 3& \hfill 2\\ \hfill 1& \hfill 0\end{array}\right]=\left[\begin{array}{cc}\hfill 6& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}3\\ \hfill 7& \hfill -1\end{array}\right]-\left[\begin{array}{cc}\hfill 3& \hfill 2\\ \hfill 1& \hfill 0\end{array}\right]\\ X+\left[\begin{array}{cc}\hfill 0& \hfill 0\\ \hfill 0& \hfill 0\end{array}\right]=\left[\begin{array}{cc}\hfill 6-3& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}3-2\\ \hfill 7-1& \hfill -1-0\end{array}\right]\\ X=\left[\begin{array}{cc}\hfill 3& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}1\\ \hfill 6& \hfill -1\end{array}\right]\end{array}$

Examples 2:

Solve for the matrix $X$ : $X-\left[\begin{array}{cc}\hfill -9& \hfill -3\\ \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}6& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\end{array}\right]=\left[\begin{array}{cc}\hfill 4& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\\ \hfill 12& \hfill -10\end{array}\right]$

$\begin{array}{r}X-\left[\begin{array}{cc}\hfill -9& \hfill -3\\ \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}6& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\end{array}\right]=\left[\begin{array}{cc}\hfill 4& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\\ \hfill 12& \hfill -10\end{array}\right]\\ X-\left[\begin{array}{cc}\hfill -9& \hfill -3\\ \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}6& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\end{array}\right]+\left[\begin{array}{cc}\hfill -9& \hfill -3\\ \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}6& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\end{array}\right]=\left[\begin{array}{cc}\hfill 4& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\\ \hfill 12& \hfill -10\end{array}\right]+\left[\begin{array}{cc}\hfill -9& \hfill -3\\ \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}6& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\end{array}\right]\\ X-\left[\begin{array}{cc}\hfill 0& \hfill 0\\ \hfill 0& \hfill 0\end{array}\right]=\left[\begin{array}{cc}\text{\hspace{0.17em}}\text{\hspace{0.17em}}4+\left(-9\right)\hfill & \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0+\left(-3\right)\hfill \\ 12+\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}6\hfill & -10+\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\hfill \end{array}\right]\\ X=\left[\begin{array}{cc}\hfill -5& \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}-3\\ \hfill 18& \hfill -10\end{array}\right]\end{array}$

## Solving systems of linear equations using matrices:

Matrix equations can be used to solve systems of linear equations by using the left and right sides of the equations.

Examples 3:

Solve the system of equations using matrices:  $\left\{\begin{array}{l}7x+5y=3\\ 3x-2y=22\end{array}$

$\begin{array}{c}7x+5y=3\\ 3x-2y=22\end{array}\to \left[\begin{array}{c}7x+5y\\ 3x-2y\end{array}\right]=\left[\begin{array}{c}\hfill 3\\ \hfill 22\end{array}\right]$

Write the matrix on the left as the product of coefficients and variables.

$\left[\begin{array}{cc}7& 5\\ 3& -2\end{array}\right]\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left[\begin{array}{c}x\\ y\end{array}\right]\text{\hspace{0.17em}}\text{\hspace{0.17em}}=\text{\hspace{0.17em}}\left[\begin{array}{c}3\\ 22\end{array}\right]$

$\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}↑\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}↑\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}↑$

$\begin{array}{l}\text{coefficient}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{variable}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{constant}\\ \text{matrix}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{matrix}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{matrix}\end{array}$

First, find the inverse of the coefficient matrix.  The inverse of $\left[\begin{array}{rr}\hfill 7& \hfill 5\\ \hfill 3& \hfill -2\end{array}\right]$ is

$\begin{array}{l}\hfill \frac{1}{7\left(-2\right)-\left(3\right)\left(5\right)}\left[\begin{array}{rr}\hfill -2& \hfill -5\\ \hfill -3& \hfill 7\end{array}\right]\\ =-\frac{1}{29}\left[\begin{array}{rr}\hfill -2& \hfill -5\\ \hfill -3& \hfill 7\end{array}\right]\\ =\left[\begin{array}{rr}\hfill \frac{2}{29}& \hfill \frac{5}{29}\\ \hfill \frac{3}{29}& \hfill -\frac{7}{29}\end{array}\right]\end{array}$

Next, multiply each side of the matrix equation by the inverse matrix .  Since matrix multiplication is not commutative, the inverse matrix should be at the left on each side of the matrix equation.

$\left[\begin{array}{cc}\hfill \frac{2}{29}& \hfill \frac{5}{29}\\ \hfill \frac{3}{29}& \hfill -\frac{7}{29}\end{array}\right]\left[\begin{array}{rr}\hfill 7& \hfill 5\\ \hfill 3& \hfill -2\end{array}\right]\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]=\left[\begin{array}{rr}\hfill \frac{2}{29}& \hfill \frac{5}{29}\\ \hfill \frac{3}{29}& \hfill -\frac{7}{29}\end{array}\right]\left[\begin{array}{c}\hfill 3\\ \hfill 22\end{array}\right]$

$\left[\begin{array}{cc}\hfill 1& \hfill 0\\ \hfill 0& \hfill 1\end{array}\right]\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]=\left[\begin{array}{r}\hfill 4\\ \hfill -5\end{array}\right]$

The identity matrix on the left verifies that the inverse matrix was calculated correctly.

$\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]=\left[\begin{array}{r}\hfill 4\\ \hfill -5\end{array}\right]$

The solution is $\left(4,-5\right)$ .