# Linear Algebra - Find Matrix X

Background Information:

I am studying linear algebra about matrix multiplication, addition, subtraction, and inverses. I came across this question that I have the book solution to, but my own solution is slightly different. I need your feedback about few steps that I am confused about, please go to "My Question" section.

Textbook Question:

Given the following matrices,

find matrix X if any that satisfies the equation BX + AB = CX.

Textbook Solution:

My Solution:

My Question:

Notice the book solutions says the answer is (C - B)^-1 * AB, but my answer is AB * (C - B)^-1. I have calculated the result, and the answer is different. Could you please explain what am I doing wrong? Why does the book says (C - B)^-1 * AB is the answer?

• Never ever use $\frac{1}{C-B}$ when calculating with matrices. – A.Γ. Jun 2 '18 at 22:02
• @A.Γ. I agree I considered 1/c - b as (c-b)^-1 which is wrong, but hey I learned it ;) – Kourosh Jun 2 '18 at 22:04
• In the future, please take the time to enter critical parts of your question as text instead of posting pictures of it. They are neither searchable nor accessible to people using screen readers. You can find a quick reference to using MathJax to format mathematical expressions here. – amd Jun 2 '18 at 22:07
• Yeah thanks for pointing it out, I didn't know how to enter matrices exactly, but from now on I will :) – Kourosh Jun 2 '18 at 22:09
• Short answer: matrix multiplication is not commutative. – amd Jun 2 '18 at 22:09

We have that

$$BX+AB=CX \implies AB=CX-BX \implies(C-B)X=AB\\\implies (C-B)^{-1}(C-B)X=(C-B)^{-1}AB$$

and thus

$$X=(C-B)^{-1}AB$$

• Ohhh, I see, we need to times (C−B)^-1 and (C−B) together to get In which is the identity matrix. In that case, X*In = X – Kourosh Jun 2 '18 at 22:02
• I have a question, is 1 / C- B = (C-B)^-1 ? I believe this is my mistake. – Kourosh Jun 2 '18 at 22:03
• @Kourosh When we deal with matrix the use of the expression $1/A$ for $A^{-1}$ is not used and can lead to mistake since matrix multiplication is not commutative. – gimusi Jun 2 '18 at 22:05
• @Kourosh Just don’t use that notation. Division by matrices is generally undefined. – amd Jun 2 '18 at 22:09
• @Kourosh Of course you can define that and use as $A^{-1}$ but I suggest to avoid that since matrix algebra is very different. – gimusi Jun 2 '18 at 22:10

$$AB = CX-BX=(C-B)X \implies (C-B)^{-1}AB=X$$

That is a left multiplication by $(C-B)^{-1}$

Apparently you had it as a right multiplication.

• Thank you for pointing that out, I actually forgot to ask that question. Could you please explain why is it a left multiplication (C-B)^-1 * AB and not a right multiplication AB * (C-B) ^-1? Is there a mathematics rule that I am missing? – Kourosh Jun 3 '18 at 1:32
• As you know matrix multiplication is not commutative, that is $AB$ is not necessarily the same as $BA$. Therefore we have to be careful with solving matrix equations. $AB=C \implies A=CB^{_-1}$ not $B^{_-1}C$ – Mohammad Riazi-Kermani Jun 3 '18 at 2:42
• I see, but just to make sure I understand the commutative property, I would be grateful if you could please confirm this for me: In your example, AB = C then AB * B^-1 = C * B^-1. The reason B^-1 goes to the right side of C is that B^-1 is on the right side of AB in your equation AB * B^-1 = C * B^-1. Am I right? – Kourosh Jun 3 '18 at 2:53
• Perfect. That is exactly the case with right or left multiplication. – Mohammad Riazi-Kermani Jun 3 '18 at 2:55
• I appreciate your time sir, I'm not sure but I think you are from Iran, so mamnoon :) – Kourosh Jun 3 '18 at 3:06