# Solving for x with matrices

$$\begin{bmatrix} -5 & -9 \\ -6 & -2 \\ \end{bmatrix} X + \begin{bmatrix} -3 & 2 \\ -9 & -3 \\ \end{bmatrix} = \begin{bmatrix} -9 & -7 \\ -2 & -3 \\ \end{bmatrix} X$$

I am asked to solve for matrix X

I combine the x to the right side and get $$\begin{bmatrix} -14 & -16 \\ -8 & -6 \\ \end{bmatrix} X$$

Then I move the other matrix to the right and get

$$\begin{bmatrix} -14 & -16 \\ -8 & -6 \\ \end{bmatrix} X = \begin{bmatrix} 3 & -2 \\ 9 & 3 \\ \end{bmatrix}$$

I then proceed to find the inverse of the x coefficient matrix which comes out to be \begin{bmatrix} 6/44 & -16/44 \\ -8/44 & 14/44 \\ \end{bmatrix}

I know this is the correct inverse because when I multiply it by the original x coefficient matrix I get the identity matrix.

Now as far as I'm aware, all that's left is multiplying the inverse by the right side, but when I do that, my homework system tells me that I'm wrong. Where is the mistake? This is the answer that I get \begin{bmatrix} -63/22 & -15/11 \\ 51/22 & 29/22 \\ \end{bmatrix}

• when you "move" something to the other side it goes there with minus like $-5x+-3=-9x$ is equivalent to $-3 = -4x$ not $-3=-14x$ – jack Feb 18 '16 at 13:52
• @Gyfe Is x a scalar or a matrix? – SchrodingersCat Feb 18 '16 at 14:03
• It's a matrix, sorry for confusion – Allan Feb 18 '16 at 14:07
• write X for a matrix to clarify this confusion – Pieter21 Feb 18 '16 at 14:19

You have a sign error, as

$$\left( \begin{pmatrix} -5 & -9 \\ -6 & -2 \end{pmatrix} - \begin{pmatrix} -9 & -7 \\ -2 & -3 \end{pmatrix} \right) X = \begin{pmatrix} 4 & -2 \\ -4 & 1 \end{pmatrix}X = \begin{pmatrix} 3 & -2 \\ 9 & 3 \end{pmatrix}.$$

• If I multiply the inverse by your right side, I still get the wrong answer – Allan Feb 18 '16 at 14:07
• You need to multiply by the inverse on the left. That is, $x = \begin{pmatrix} 4 & -2 \\ -4 & 1 \end{pmatrix}^{-1} \begin{pmatrix} -3 & 2 \\ -9 & -3 \end{pmatrix}.$ – levap Feb 18 '16 at 14:18
• That was the problem, I was using the wrong matrix for the inverse, however your right matrix is incorrect. $$\begin{bmatrix} 3 & -2 \\ 9 & 3 \\ \end{bmatrix}$$ Using that matrix gives the correct answer – Allan Feb 18 '16 at 14:33
• My right matrix is correct assuming the question you wrote is correct. If you meant to solve $$\begin{bmatrix} -5 & -9 \\ -6 & -2 \\ \end{bmatrix} X + \begin{bmatrix} -3 & 2 \\ -9 & -3 \\ \end{bmatrix} = \begin{bmatrix} -9 & -7 \\ -2 & -3 \\ \end{bmatrix} X$$ (note the plus sign in the left side) then the right matrix should be negated. – levap Feb 18 '16 at 14:42
• @Gyfe: That is correct... but in your original question, you asked about $$\begin{bmatrix} -5 & -9 \\ -6 & -2 \\ \end{bmatrix} X - \begin{bmatrix} -3 & 2 \\ -9 & -3 \\ \end{bmatrix} = \begin{bmatrix} -9 & -7 \\ -2 & -3 \\ \end{bmatrix} X$$ which means that the matrix $\begin{pmatrix} -3 & 2 \\ -9 & -3 \end{pmatrix}$ should be added and not subtracted from both sides of the equation... – levap Feb 18 '16 at 14:53

The +/- signs are wrong on various places. RHS should just be the matrix displayed, because it already has - sign.

Also with the matrix before x you made a sign error

You have made a few mistakes in signs while reversing the sides.

You should have approached the problem as follows:

$$\begin{bmatrix} -5 & -9 \\ -6 & -2 \\ \end{bmatrix} x - \begin{bmatrix} -3 & 2 \\ -9 & -3 \\ \end{bmatrix} = \begin{bmatrix} -9 & -7 \\ -2 & -3 \\ \end{bmatrix} x$$

$$\begin{bmatrix} -5x & -9x \\ -6x & -2x \\ \end{bmatrix} - \begin{bmatrix} -3 & 2 \\ -9 & -3 \\ \end{bmatrix} = \begin{bmatrix} -9x & -7x \\ -2x & -3x \\ \end{bmatrix}$$

$$\begin{bmatrix} -5x+3 & -9x-2 \\ -6x+9 & -2x+3 \\ \end{bmatrix} = \begin{bmatrix} -9x & -7x \\ -2x & -3x \\ \end{bmatrix}$$

By the equality of the matrices, we can say that the corresponding elements are the same.

But there is no $x \in \mathbb{R}$ which satisfies the above equality.

• I was under the impression that OP was looking for a matrix $x$, not a scalar. – Roland Feb 18 '16 at 13:58
• @Roland OP did not mention if x is a matrix or a scalar. But I think you are right. – SchrodingersCat Feb 18 '16 at 14:03
• There is no $x \in \mathbb R$ that satisfies the OP equation; it certainly is not the case for $x=-3/4$. – Zoran Loncarevic Feb 18 '16 at 14:03
• @ZoranLoncarevic Corrected. – SchrodingersCat Feb 18 '16 at 14:04

You have formally $$AX +B = CX$$ You should proceed as follows $$\begin{array}{rll} AX + B &=& CX \\ B &=& CX - AX \\ B &=& (C- A)X \\ (C-A)^{-1} B &=& (C-A)^{-1} (C- A)X \\ (C-A)^{-1} B &=& X \\ \end{array}$$ Now $$C-A = -\begin{bmatrix} 9 & 7 \\ 2 &3 \end{bmatrix} - (-\begin{bmatrix} 5 & 9 \\ 6 &2 \end{bmatrix}) = \begin{bmatrix} -4 & 2 \\ 4 & -1 \end{bmatrix}$$ Then $$(C-A)^{-1} = -\begin{bmatrix} 1/4 & 1/2 \\ 1 &1 \end{bmatrix}$$
and by $(C-A)^{-1} B=X$ the result

$$(C-A)^{-1} B = - \begin{bmatrix} 21/4 & 1 \\ 12 &1 \end{bmatrix} = X$$