Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I become very bad in linear algebra when matrices are involved in the calculation. Here is one equation:

$$H = (A_2 - a_2p)(A_1 - a_1p)^{-1}$$


$H$, $A_1$ and $A_2$ are $3\times3$ matrices, $a_1$ and $a_2$ are $3\times 1$ matrices $p$ is a $1\times3$ matrix.

$p$ is the only unknown I want to find. How can I do please?


share|cite|improve this question
@David: No, I think he is fine. $a_i$ is $3\times 1$ and $p$ is $1\times 3$, so $a_i\times p$ is $3\times 3$. – William Jan 8 '12 at 12:58
Well, what have you tried and where did you get stuck? Perhaps you should try multiplying both sides on the right by $(A_1 - a_1p)$, and then using what you know about matrix arithmetic? – William Jan 8 '12 at 13:02
My confusion is mainly on the side multiplication. I'm not confident rather I'm suppose to multiply at the left or at the right of one matrices, because it seems the results are not the same depending on the side. But it's ok, I'll take the time to learn linear algebra in detail, for now I just need to implement one algorithm. Thanks a lot – Gatsu Jan 8 '12 at 13:07
Of course they cannot be the same in general, since matrix multiplication is not commutative (that is, in general, $AB \neq BA$. Therefore, to "cancel" $(A_1 - a_1p)^{-1}$, you must multiply on the correct side - in this case, it is on the right, since on the left you have $(A_2 - a_2p)$ "blocking the way." Hope this explanation helps. – William Jan 8 '12 at 13:13
Thank you again. At least this will help me to go further next time! – Gatsu Jan 8 '12 at 13:26
up vote 3 down vote accepted

Multiplying on the right by $A_1-a_1p$, one gets $$ K=bp\quad\text{with}\quad K=A_2-HA_1\quad\text{and}\quad b=a_2-Ha_1. $$ Recall that $K=(K_{ij})_{1\leqslant i,j\leqslant3}$ is a $3\times3$ matrix, $b=(b_i)_{1\leqslant i\leqslant3}$ is a $3\times1$ (column) vector and one looks for a $1\times3$ (line) vector $p=(p_j)_{1\leqslant j\leqslant 3}$.

That is, $K=bp$ is a shorthand for the condition that $K_{ij}=b_ip_j$ for every $(i,j)$. Thus, $K=bp$ is solved by $$ p_j=K_{ij}/b_i $$ for every $(i,j)$ if $K_{ij}/b_i$ does not depend on $i$, and has no solution otherwise. Recall finally that, by definition, $$ K_{ij}=(A_2)_{ij}-\sum\limits_{k=1}^3H_{ik}(A_1)_{kj}\quad\text{and}\quad b_i=(a_2)_i-\sum\limits_{k=1}^3H_{ik}(a_1)_k. $$ Edit (This is due to @David Mitra in a comment.) Drawing the matrices $K$ and $bp$ may help to see what is going on: $$ \underbrace{ \left[ \matrix {K_{11} & K_{12}& K_{13}\cr K_{21}& K_{22}& K_{23}\cr K_{31}& K_{32}& K_{33}\cr } \right]}_{K=A_2-HA_1}= \underbrace{ \left[ \matrix { b_1p_1& b_1p_2& b_1p_3 \cr b_2p_1& b_2p_2& b_2p_3 \cr b_3p_1& b_3p_2& b_3p_3 \cr } \right]}_{bp=(a_2-Ha_1)p }. $$

share|cite|improve this answer
I don't know how you are managing to be able to write so many other equations from the initial one....but that's just great! Thank you – Gatsu Jan 8 '12 at 13:28
This may help to see whats going on (and, thank you Didier for pointing out the gross error in my "solution"): $$\underbrace{ \left[ \matrix {K_{11}& K_{12}&K_{13}\cr K_{21}& K_{22}&K_{23}\cr K_{31}& K_{32}&K_{33}\cr } \right]}_{HA_1-A_2}= \underbrace{ \left[ \matrix { b_1p_1& b_1p_2& b_1p_3 \cr b_2p_1& b_2p_2& b_2p_3 \cr b_3p_1& b_3p_2& b_3p_3 \cr } \right]}_{(Ha_1-a_2)p } $$ – David Mitra Jan 8 '12 at 13:38
Gatsu: Thanks. $ $ – Did Jan 8 '12 at 15:08
@DavidMitra: Included your (helpful) comment in my post. Hope you do not mind. – Did Jan 8 '12 at 22:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.