TITLE: When do addition and inversion of matrices commute?
QUESTION [6 upvotes]: Can you guys help me out with the following problem:
Problem: Find conditions that the matrices $A$ and $B$ have to satisfy in order for the following to be valid: $(A+B)^{-1} = A^{-1} + B^{-1}$.
My solution. The first condition is that $A$ and $B$ have to have the same dimensions. Then by expanding the two equalities: $(A+B) \cdot (A^{-1} + B^{-1})=I $ and $(A^{-1} + B^{-1}) \cdot (A+B)=I$, I deduced the second condition: $A$ and $B$ have both to be invertible, and third condition is: $A^{-1} \cdot B=B \cdot A^{-1}$. Is my answer correct?

REPLY [13 votes]: To elaborate slightly on @MichaelHardy's comment, from:
$$A\;B^{-1} + B\;A^{-1} = -I$$
consider as well that:
$$(A\;B^{-1})^{-1} = B\;A^{-1}$$
So when we are talking about all possible solutions, these can be generated by finding $M$ such that:
$$M + M^{-1} = -I$$
i.e. an invertible matrix $M$ such that:
$$M^2 + M + I = 0$$
Then if $M$ has the corresponding characteristic root(s), any invertible matrix $B$ can be paired with an invertible matrix $A$ satisfying the desired relation via:
$$A =  MB$$
so that $M = A\;B^{-1}$ and $M^{-1} = B\;A^{-1}$.
Added: A few more words about $M$ and its characteristic roots are useful.  
Because it satisfies the polynomial above without repeated roots, complex matrix $M$ must be diagonalizable (similar to a diagonal matrix) with eigenvalues in $\{ (-1 \pm i\sqrt{3})/2 \}$, the nontrivial cube roots of unity.  So to construct all such $M$, choose how many of each root so that combined we have $n$ the dimension of $M$, and group them along the diagonal of $D$ having those with positive imaginary part before those with negative imaginary part (for the sake of definiteness).  Then take for arbitrary invertible complex matrix $P$ the similarity transformation:
$$M = P\; D \; P^{-1}$$
If we wanted to restrict $M$ to real matrices, then its eigenvalues must occur in conjugate pairs.  Thus the dimension $n$ must be even and the "real Jordan canonical form" must have diagonal blocks $ \bigl(\begin{smallmatrix}
\frac{-1}{2}&\frac{\sqrt{3}}{2} \\ \frac{-\sqrt{3}}{2}&\frac{-1}{2}
\end{smallmatrix} \bigr)$.  Replace $D$ with such a block diagonal matrix and $P$ with an arbitrary invertible real matrix in our above similarity recipe, and you get the construction of all real solutions $M$.