# Any trick on finding the inverse of this matrix?

Supposing I have a matrix, $\pmatrix{0&0&\lambda\\0&\lambda&-1\\ \lambda&-1&0}$.

Without question you can work out the inverse if this matrix. But since it is highly structured, I suppose there should be some quick way to find out the inverse of it?

-
thank you Henning for your help on editing it. – SoManyProb_for_a_broken_heart. Nov 4 '11 at 2:09
[retracted unfair comment] – user16299 Nov 4 '11 at 3:48

The determinant of the matrix is easily seen to be $-\lambda^3$, so Cramer's formula will quickly invert it.

If I've got all of the minors correct, it should be $$A^{-1}=\frac{-1}{\lambda^3}\pmatrix{-1&-\lambda&-\lambda^2\\ -\lambda&-\lambda^2&0 \\ -\lambda^2&0&0}$$

-

Let $A$ be your matrix. Then $J=\pmatrix{0&0&-1\\0&-1&0\\ -1&0&0}A$ (switching the first and third rows and switching signs) is the Jordan block with $-\lambda$ on the diagonal. You can take the inverse of Jordan blocks using the approach shown in this Wikipedia article on matrix functions. This yields $J^{-1}=\pmatrix{\frac{-1}{\lambda}&\frac{-1}{\lambda^2}&\frac{-1}{\lambda^3}\\0&\frac{-1}{\lambda}&\frac{-1}{\lambda^2}\\ 0&0&\frac{-1}{\lambda}}$, simply by evaluating $f(-\lambda)$, $f'(-\lambda)$, and $f''(-\lambda)$, where $f(x)=\frac{1}{x}$. Then note that $A^{-1}=J^{-1}\pmatrix{0&0&-1\\0&-1&0\\ -1&0&0}$, so you switch the first and third columns and switch signs again to get the same result as percusse.

-

I would have done with a detour: Call the original matrix $A$, we can spot with a permutation matrix $P$ that $$PA = \pmatrix{&&1\\&1&\\1&&}A = \pmatrix{\lambda&-1&0\\ 0&\lambda&-1\\ 0&0&\lambda} =: B$$ Inverse of this Jordan-like upper triangular $B$ is slightly easier but admittedly requires some affinity: (See Jonas' answer for detailed version) $$B^{-1} = \left(\begin{array}{ccc} \frac{1}{\mathrm{\lambda}} & \frac{1}{{\mathrm{\lambda}}^2} & \frac{1}{{\mathrm{\lambda}}^3}\\ 0 & \frac{1}{\mathrm{\lambda}} & \frac{1}{{\mathrm{\lambda}}^2}\\ 0 & 0 & \frac{1}{\mathrm{\lambda}} \end{array}\right)$$ Finally, $$A^{-1} = B^{-1}P = \pmatrix{\frac{1}{\lambda^3}&\frac{1}{\lambda^2}&\frac{1}{\lambda}\\\frac{1}{\lambda^2}&\frac{1}{\lambda}&0\\\frac{1}{\lambda}&0&0}$$

-
Thanks! That is something really nice. Does " requires some affinity" means the inverse of upper triangular is upper triangular? And what do you mean by "done with a detour" here? You mean you want to change the structure of it? – SoManyProb_for_a_broken_heart. Nov 4 '11 at 2:25
@SoManyProblems Actually, everything except the matrices is wrong in my post :) it is indeed upper triangular yes! Man, I really need coffee. By detour I mean I permute it and compute the inverse and permute back. And Jonas' answer has the affinity part. I did inverse of Jordan blocks too many times that I can identify the inverses more or less correctly. That's what I meant. – user13838 Nov 4 '11 at 2:30
Note that $$B/\lambda=\pmatrix{1&-\frac{1}{\lambda}&0\\ 0&1&-\frac{1}{\lambda}\\ 0&0&1}=I-U/\lambda$$ where $U$ is the superdiagonal matrix. Since the superdiagonal matrix is nilpotent, $(I-U/\lambda)^{-1}=I+U/\lambda+U^2/\lambda^2+\dots$ converges. Thus, \begin{align}B^{-1}&=(B/\lambda)^{-1}/\lambda\\&=(I+U/\lambda+U^2/\lambda^2+\do‌​ts)/\lambda\\&=\pmatrix{ \frac{1}{\lambda} &\frac{1}{\lambda^2}&\frac{1}{\lambda^3}\\0&\frac{1}{\lambda}&\frac{1}{\lambda^2}‌​\\0&0&\frac{1}{\lambda}}\end{align} – robjohn Nov 4 '11 at 8:46

This matrix is simple enough that we can find its inverse quite easily by simply writing out the product of it with its inverse: $$\pmatrix{0&0&\lambda\\0&\lambda&-1\\ \lambda&-1&0} \pmatrix{a_{11}&a_{12}&a_{13}\\a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33}} = \pmatrix{1&0&0\\0&1&0\\ 0&0&1}$$ Taking the first row and first column product, $0a_{11}+0a_{21}+\lambda a_{31} = 1$, so $a_{31} = 1/\lambda$. Now the second row and first column gives us $0a_{11}+\lambda a_{21}+-1/\lambda = 0$, so $a_{21} = 1/\lambda^2$ ... and so on for the rest of the matrix.

-
Thank you discipulus! – SoManyProb_for_a_broken_heart. Nov 4 '11 at 2:40

You can partition the matrix into $$\begin{bmatrix} 0 & v^\top \\ v & A \end{bmatrix}$$ where $A$ is a symmetric $2\times2$ matrix and $v$ a $2\times1$ vector, yielding the solution of $$\begin{bmatrix} 0 & v^\top \\ v & A \end{bmatrix}^{-1} = \begin{bmatrix} -(v^\top A^{-1} v)^{-1} & T^\top \\ T & A^{-1}-T v^\top A^{-1} \end{bmatrix}$$ where $T = A^{-1} v (v^\top A^{-1} v)^{-1}$ is the weighted pseudo inverse of $v$, since $T^\top v=1$ and $v^\top T=1$

Proof: $$\begin{bmatrix} -(v^\top A^{-1} v)^{-1} & T^\top \\ T & A^{-1}-T v^\top A^{-1} \end{bmatrix} \begin{bmatrix} 0 & v^\top \\ v & A \end{bmatrix} = \begin{bmatrix} T^\top v & -(v^\top A^{-1} v)^{-1} v^\top+T^\top A \\ A^{-1}v-T v^\top A^{-1} v & T v^\top + A^{-1} A - T v^\top \end{bmatrix}$$

with the simplification $T^\top A = (v^\top A^{-1} v)^{-1} v^\top$ the above becomes

$\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$

Example:

$A = \begin{pmatrix} \lambda & -1 \\ -1 & 0 \end{pmatrix}$, $v = \begin{pmatrix} 0 \\ \lambda \end{pmatrix}$, $T = \begin{pmatrix} \lambda & -1 \\ -1 & 0 \end{pmatrix}^{-1} \begin{pmatrix} 0 \\ \lambda \end{pmatrix} \left(\begin{pmatrix} 0 & \lambda \end{pmatrix} \begin{pmatrix} \lambda & -1 \\ -1 & 0 \end{pmatrix}^{-1} \begin{pmatrix} 0 \\ \lambda \end{pmatrix} \right)^{-1} = \begin{pmatrix} \frac{1}{\lambda^2} \\ \frac{1}{\lambda} \end{pmatrix}$

$$\begin{bmatrix} -(v^\top A^{-1} v)^{-1} & T^\top \\ T & A^{-1}-T v^\top A^{-1} \end{bmatrix} = \begin{bmatrix} \begin{pmatrix} \frac{1}{\lambda^3} \end{pmatrix} & \begin{pmatrix} \frac{1}{\lambda^2} & \frac{1}{\lambda} \end{pmatrix} \\ \begin{pmatrix} \frac{1}{\lambda^2} \\ \frac{1}{\lambda} \end{pmatrix} & \begin{pmatrix} \frac{1}{\lambda} & 0 \\ 0 & 0 \end{pmatrix} \end{bmatrix}$$

-