1.7. Matrix algebra#

Having defined the rules for addition, scalar multiplication and matrix multiplication, we can now consider solving equations involving matrices. Let \(X\) be an \(m \times n\) matrix, whose value we want to find. The basic procedure for solving \(X\) is similar to standard algebra, for any operation we apply to one side of the equation we must apply the equivalent operation to the other side. This is easy for addition, subtraction and scalar multiplication since the rules governing matrices are the same as those for variables. For example, consider the algebraic equation

\[ 2x + a = b, \]

where \(a, b \in \mathbb{R}\). To solve for \(x\) we subtract \(a\) from both sides of the equation and multiply both sides by \(1/2\), i.e.,

\[ x = \frac{1}{2}(b - a). \]

Now consider a similar matrix equation

\[ 2 X + A = B, \]

where \(A\) and \(B\) are \(m \times n\) matrices. Solving for \(X\) is the same procedure as before, i.e.,

\[ X = \frac{1}{2}(B - A). \]

When the unknown matrix is multiplied by another matrix things get slightly more complicated. Using an algebraic example

\[ c x + a = b, \]

where \(a,b,c \in \mathbb{R}\) then its easy to see that the solution is

\[ x = \frac{1}{c}(b - a). \]

However, the equivalent matrix equation

\[ C X + A = B, \]

where \(A, B, C\) are \(n \times n\) matrices. You cannot divide by a matrix but you can multiply by an inverse matrix, if one exists.

\[\begin{split} \begin{align*} C X + A &= B \\ CX &= B - A \\ C^{-1} C X &= C^{-1} (B - A) \\ I X &= C^{-1}(B - A) \\ X &= C^{-1}(B - A). \end{align*} \end{split}\]

Note that for a solution to exist \(C\) must be invertible.

Example 1.16

Solve the following matrix equations for \(X\):

(i)   \(2X + \begin{pmatrix} 1 & 3 \\ 6 & 4 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\);

Solution (click to show)
\[\begin{split} \begin{align*} 2X + \begin{pmatrix} 1 & 3 \\ 6 & 4 \end{pmatrix} &= \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \\ 2X &= \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} - \begin{pmatrix} 1 & 3 \\ 6 & 4 \end{pmatrix} \\ X &= \frac{1}{2} \begin{pmatrix} 0 & -3 \\ -6 & -3 \end{pmatrix} = \begin{pmatrix} 0 & -3/2 \\ -3 & -3/2 \end{pmatrix} \end{align*} \end{split}\]

(ii)   \(\begin{pmatrix} 4 & 1 \\ 2 & 5 \end{pmatrix} X - \begin{pmatrix} 5 & -3 \\ 2 & 4 \end{pmatrix} = \begin{pmatrix} 1 & 1 \\ 3 & 2 \end{pmatrix}\);

Solution (click to show)
\[\begin{split} \begin{align*} \begin{pmatrix} 4 & 1 \\ 2 & 5 \end{pmatrix} X - \begin{pmatrix} 5 & -3 \\ 2 & 4 \end{pmatrix} &= \begin{pmatrix} 1 & 1 \\ 3 & 2 \end{pmatrix} \\ \begin{pmatrix} 4 & 1 \\ 2 & 5 \end{pmatrix} X &= \begin{pmatrix} 1 & 1 \\ 3 & 2 \end{pmatrix} + \begin{pmatrix} 5 & -3 \\ 2 & 4 \end{pmatrix} \\ X &= \begin{pmatrix} 4 & 1 \\ 2 & 5 \end{pmatrix}^{-1} \begin{pmatrix} 6 & -2 \\ 5 & 6 \end{pmatrix} \\ &= \frac{1}{18} \begin{pmatrix} 5 & -1 \\ -2 & 4 \end{pmatrix} \begin{pmatrix} 6 & -2 \\ 5 & 6 \end{pmatrix} \\ &= \begin{pmatrix} 25 & -16 \\ 8 & 28 \end{pmatrix} \end{align*} \end{split}\]

(iii)   \(X^2 = \begin{pmatrix} 4 & 3 \\ 0 & 1 \end{pmatrix}\).

Solution (click to show)

Let \(X = \begin{pmatrix} a & b \\ c & d \end{pmatrix}\) then

\[\begin{split} \begin{align*} X^2 &= \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} a & b \\ c & d \end{pmatrix} = \begin{pmatrix} a^2 + bc & b(a + d) \\ c(a + d) & bc + d^2 \end{pmatrix} = \begin{pmatrix} 4 & 3 \\ 0 & 1 \end{pmatrix} \end{align*} \end{split}\]

Taking the element in row 2 column 1 we have \(c(a+d)=0\) so either \(c=0\) or \(a + d = 0\). When \(c = 0\)

\[\begin{split} \begin{align*} a^2 + bc &= 4 \\ a^2 &= 4 \implies a = \pm 2, \\ bc + d^2 &= 1 \\ d^2 &=1 \implies d = \pm 1. \end{align*} \end{split}\]

So there are four possible solutions

\[\begin{split} \begin{align*} a &= 2, d = 1: & X &= \begin{pmatrix} 2 & 3/(2+1) \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 0 & 1 \end{pmatrix}, \\ a &= 2, d = -1: & X &= \begin{pmatrix} 2 & 3/(2-1) \\ 0 & -1 \end{pmatrix} = \begin{pmatrix} 2 & 3 \\ 0 & -1 \end{pmatrix}, \\ a &= -2, d = 1: & X &= \begin{pmatrix} -2 & 3/(-2+1) \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} -2 & -3 \\ 0 & 1 \end{pmatrix}, \\ a &= -2, d = -1: & X &= \begin{pmatrix} -2 & 3/(-2-1) \\ 0 & -1 \end{pmatrix} = \begin{pmatrix} -2 & -1 \\ 0 & -1 \end{pmatrix}. \end{align*} \end{split}\]

When \(a + d = 0\):

\[\begin{split} \begin{align*} b(a + d) &= 3 \\ 0 &\neq 3, \end{align*} \end{split}\]

which is a contradiction so \(a + d=0\) yields no solutions.