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

So I'm trying to invert a matrix of the $\begin{pmatrix} A & B \\ C & D \end{pmatrix}$ where $A$ and $D$ are square, $D$ is much larger than $A$, and $D$ is diagonal. $A$ $B$ and $C$ have no particular structure. Is there a fast way to do this that takes advantage of D's being diagonal?

share|cite|improve this question
With diagonal matrices being very easy to invert, the second version of the formula at Wikipedia Blockwise Inversion should help – Ronald Apr 29 '12 at 22:44
Also, you can write your matrix as $D'+A'$, where $D'$ is diagonal and $A'$ is sparse. You may then use the matrix inversion lemma combined with blockwise inversion for potential speedups. You may also want to look into schemes for inverting sparse matrices. – sai Apr 29 '12 at 22:51

Copied from Wikipedia (for archive purposes):

$\begin{bmatrix} \mathbf{A} & \mathbf{B} \\ \mathbf{C} & \mathbf{D} \end{bmatrix}^{-1} = \begin{bmatrix} (\mathbf{A}-\mathbf{BD}^{-1}\mathbf{C})^{-1} & -(\mathbf{A}-\mathbf{BD}^{-1}\mathbf{C})^{-1}\mathbf{BD}^{-1} \\ -\mathbf{D}^{-1}\mathbf{C}(\mathbf{A}-\mathbf{BD}^{-1}\mathbf{C})^{-1} & \mathbf{D}^{-1}+\mathbf{D}^{-1}\mathbf{C}(\mathbf{A}-\mathbf{BD}^{-1}\mathbf{C})^{-1}\mathbf{BD}^{-1}\end{bmatrix}$

In this case we only need to invert D (easy) and $\mathbf{A-BD^{-1}C}$ (hopefully small).

share|cite|improve this answer

If all the diagonal elements of $D$ were all nonzero, then you could use row and column operations to change the matrix to $X\begin{pmatrix} A & B \\ C & D \end{pmatrix}Y =\begin{pmatrix} \overline{A} & 0 \\ 0 & D \end{pmatrix}$ and being nonsingular this has an inverse $Z$:

$\begin{pmatrix} A & B \\ C & D \end{pmatrix}YZX =I$

If $\overline{A}$ is small, its inverse would not be computationally complex, and likewise D is easy to invert, and the rest is row/column operations.

share|cite|improve this answer

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.