Tutorials › Linear Algebra › Inverting Block-Diagonal Matrices

Elementary Matrices and Inverses · Tutorial 107 of 1000

Inverting Block-Diagonal Matrices

You will learn to invert block-diagonal matrices by inverting each square diagonal block and checking the result with block multiplication.

Beginner 9 min read

What You'll Learn

  • Identify the square diagonal blocks and their sizes in a block-diagonal matrix.
  • Construct a candidate inverse when every diagonal block is invertible.
  • Verify the candidate by multiplying in both orders.
  • Prove that a block-diagonal matrix is invertible exactly when each diagonal block is invertible.
  • Recognize why a singular diagonal block prevents the whole matrix from being invertible.
  • Correct a common mistake about which blocks to invert.

Reading a Block-Diagonal Matrix

A large matrix sometimes acts on separate groups of coordinates without mixing them. In that case, it can be written in blocks: square matrices appear on the diagonal, and zero matrices appear everywhere else. This structure can simplify inversion. Rather than row-reducing the entire matrix, we can invert each diagonal block separately and place those inverses in the corresponding positions. The key is to check the block sizes and verify the proposed inverse by multiplication.

Throughout, the matrices have real entries. For a matrix \(\mathbf{A}\in\mathbb{R}^{n\times n}\), an inverse is a matrix \(\mathbf{B}\in\mathbb{R}^{n\times n}\) satisfying both \(\mathbf{A}\mathbf{B}=\mathbf{I}_n\) and \(\mathbf{B}\mathbf{A}=\mathbf{I}_n\). In that case, \(\mathbf{A}\) is invertible and \(\mathbf{B}=\mathbf{A}^{-1}\). A block is itself a matrix, and its size determines which other blocks can be multiplied with it.

Definition: A block-diagonal matrix with \(k\) square diagonal blocks \(\mathbf{A}_1,\dots,\mathbf{A}_k\) is written \(\operatorname{diag}(\mathbf{A}_1,\dots,\mathbf{A}_k)\). It has \(\mathbf{A}_i\) in diagonal block position \(i\) and zero blocks in every off-diagonal position. If \(\mathbf{A}_i\) is \(n_i\times n_i\), the whole matrix is square of size \(n_1+\cdots+n_k\).

For example, with two blocks the structure is

$$ \operatorname{diag}(\mathbf{A}_1,\mathbf{A}_2) = \begin{bmatrix} \mathbf{A}_1 & \mathbf{O}\\ \mathbf{O} & \mathbf{A}_2 \end{bmatrix}, $$

where each zero block has the dimensions required by its position. Block multiplication follows the usual row-by-column rule, treating each block as a matrix. In particular, when the products are defined, multiplying two block-diagonal matrices with the same block sizes multiplies corresponding diagonal blocks and leaves zero blocks off the diagonal:

$$ \begin{bmatrix} \mathbf{A}_1 & \mathbf{O}\\ \mathbf{O} & \mathbf{A}_2 \end{bmatrix} \begin{bmatrix} \mathbf{B}_1 & \mathbf{O}\\ \mathbf{O} & \mathbf{B}_2 \end{bmatrix} = \begin{bmatrix} \mathbf{A}_1\mathbf{B}_1 & \mathbf{O}\\ \mathbf{O} & \mathbf{A}_2\mathbf{B}_2 \end{bmatrix}. $$

The off-diagonal products are zero because, for instance, the upper-right block is \(\mathbf{A}_1\mathbf{O}+\mathbf{O}\mathbf{B}_2=\mathbf{O}\). This simple multiplication rule is the reason the inverse formula works.

The Inverse Formula and Its Proof

Theorem: Let \(\mathbf{A}=\operatorname{diag}(\mathbf{A}_1,\dots,\mathbf{A}_k)\), where each \(\mathbf{A}_i\) is a square real matrix. Then \(\mathbf{A}\) is invertible if and only if every \(\mathbf{A}_i\) is invertible. When these blocks are invertible, \(\mathbf{A}^{-1}=\operatorname{diag}(\mathbf{A}_1^{-1},\dots,\mathbf{A}_k^{-1})\).

Proof. First suppose every diagonal block \(\mathbf{A}_i\) is invertible. Define \(\mathbf{D}=\operatorname{diag}(\mathbf{A}_1^{-1},\dots,\mathbf{A}_k^{-1})\). In the product \(\mathbf{A}\mathbf{D}\), the \(i\)-th diagonal block is \(\mathbf{A}_i\mathbf{A}_i^{-1}=\mathbf{I}_{n_i}\), and every off-diagonal block is zero by block multiplication. Thus \(\mathbf{A}\mathbf{D}=\mathbf{I}_{n_1+\cdots+n_k}\). In the reverse order, the \(i\)-th diagonal block is \(\mathbf{A}_i^{-1}\mathbf{A}_i=\mathbf{I}_{n_i}\), and the off-diagonal blocks are again zero. Thus \(\mathbf{D}\mathbf{A}=\mathbf{I}_{n_1+\cdots+n_k}\), so \(\mathbf{D}\) is the inverse of \(\mathbf{A}\). Conversely, suppose \(\mathbf{A}\) is invertible and write \(\mathbf{X}=\mathbf{A}^{-1}\) in blocks \(\mathbf{X}_{ij}\), where \(\mathbf{X}_{ij}\) has \(n_i\) rows and \(n_j\) columns. From \(\mathbf{A}\mathbf{X}=\mathbf{I}\), the \(i\)-th diagonal block gives \(\mathbf{A}_i\mathbf{X}_{ii}=\mathbf{I}_{n_i}\). From \(\mathbf{X}\mathbf{A}=\mathbf{I}\), the same diagonal position gives \(\mathbf{X}_{ii}\mathbf{A}_i=\mathbf{I}_{n_i}\). Therefore \(\mathbf{X}_{ii}\) is a two-sided inverse of \(\mathbf{A}_i\), so every diagonal block is invertible. This proves both directions and the stated formula. \(\square\)

The two product checks in the proof matter: an inverse is defined by both orders. The theorem also gives a useful exact condition. If even one diagonal block is not invertible, the whole block-diagonal matrix cannot be invertible.

Worked Inversions

Worked Example: Two Two-by-Two Blocks

Find the inverse of the block-diagonal matrix with blocks \(\mathbf{B}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\) and \(\mathbf{C}=\begin{bmatrix}2&1\\1&1\end{bmatrix}\).

First find and check the inverse of each block. For \(\mathbf{B}\), take \(\mathbf{B}^{-1}=\begin{bmatrix}1&-2\\0&1\end{bmatrix}\). The products in both orders are

$$ \mathbf{B}\mathbf{B}^{-1} = \begin{bmatrix}1&-2+2\\0&1\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}, \qquad \mathbf{B}^{-1}\mathbf{B} = \begin{bmatrix}1&2-2\\0&1\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

For \(\mathbf{C}\), take \(\mathbf{C}^{-1}=\begin{bmatrix}1&-1\\-1&2\end{bmatrix}\). Direct multiplication gives

$$ \mathbf{C}\mathbf{C}^{-1} = \begin{bmatrix}2-1&-2+2\\1-1&-1+2\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}, \qquad \mathbf{C}^{-1}\mathbf{C} = \begin{bmatrix}2-1&1-1\\-2+2&-1+2\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

Both blocks are invertible, so the theorem gives the candidate inverse by placing their inverses in the same diagonal positions:

$$ \mathbf{A} = \begin{bmatrix} 1&2&0&0\\ 0&1&0&0\\ 0&0&2&1\\ 0&0&1&1 \end{bmatrix}, \qquad \mathbf{A}^{-1} = \begin{bmatrix} 1&-2&0&0\\ 0&1&0&0\\ 0&0&1&-1\\ 0&0&-1&2 \end{bmatrix}. $$

Check: the first diagonal block of either product is \(\mathbf{I}_2\), the second diagonal block is \(\mathbf{I}_2\), and each off-diagonal block is zero. Hence \(\mathbf{A}\mathbf{A}^{-1}=\mathbf{I}_4\) and \(\mathbf{A}^{-1}\mathbf{A}=\mathbf{I}_4\).

Worked Example: Blocks of Different Sizes

Invert the matrix whose diagonal blocks are the scalar \([3]\), the matrix \(\mathbf{D}=\begin{bmatrix}1&1\\2&3\end{bmatrix}\), and the scalar \([-2]\). The block sizes are \(1,2,1\), so the full matrix is \(4\times4\).

The scalar blocks have inverses \([1/3]\) and \([-1/2]\), since \(3(1/3)=1\) and \((-2)(-1/2)=1\). For the middle block, use \(\mathbf{D}^{-1}=\begin{bmatrix}3&-1\\-2&1\end{bmatrix}\). Check each order:

$$ \mathbf{D}\mathbf{D}^{-1} = \begin{bmatrix}3-2&-1+1\\6-6&-2+3\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}, \qquad \mathbf{D}^{-1}\mathbf{D} = \begin{bmatrix}3-2&3-3\\-2+2&-2+3\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

Thus the full matrix and its proposed inverse are

$$ \mathbf{A} = \begin{bmatrix} 3&0&0&0\\ 0&1&1&0\\ 0&2&3&0\\ 0&0&0&-2 \end{bmatrix}, \qquad \mathbf{A}^{-1} = \begin{bmatrix} \frac13&0&0&0\\ 0&3&-1&0\\ 0&-2&1&0\\ 0&0&0&-\frac12 \end{bmatrix}. $$

Check: in the product \(\mathbf{A}\mathbf{A}^{-1}\), the three diagonal blocks are \(3(1/3)=1\), \(\mathbf{D}\mathbf{D}^{-1}=\mathbf{I}_2\), and \((-2)(-1/2)=1\); all off-diagonal blocks are zero. In \(\mathbf{A}^{-1}\mathbf{A}\), they are \( (1/3)3=1\), \(\mathbf{D}^{-1}\mathbf{D}=\mathbf{I}_2\), and \((-1/2)(-2)=1\), again with zero off-diagonal blocks. Both products equal \(\mathbf{I}_4\).

Worked Example: A Singular Diagonal Block

Consider the block-diagonal matrix with blocks \([2]\) and \(\mathbf{S}=\begin{bmatrix}1&2\\2&4\end{bmatrix}\). The second block is singular: its two rows are multiples, and direct multiplication gives \(\mathbf{S}\begin{bmatrix}-2\\1\end{bmatrix}=\begin{bmatrix}0\\0\end{bmatrix}\).

The full matrix is \(\mathbf{A}=\begin{bmatrix}2&0&0\\0&1&2\\0&2&4\end{bmatrix}\). With \(\mathbf{x}=\begin{bmatrix}0\\-2\\1\end{bmatrix}\), we obtain

$$ \mathbf{A}\mathbf{x} = \begin{bmatrix} 2(0)\\ 1(-2)+2(1)\\ 2(-2)+4(1) \end{bmatrix} = \begin{bmatrix}0\\0\\0\end{bmatrix}, \qquad \mathbf{x}\ne\mathbf{0}. $$

This matrix cannot have an inverse: if \(\mathbf{A}^{-1}\) existed, then \(\mathbf{x}=\mathbf{I}_3\mathbf{x}=\mathbf{A}^{-1}\mathbf{A}\mathbf{x}=\mathbf{A}^{-1}\mathbf{0}=\mathbf{0}\), contradicting the displayed nonzero vector. The example illustrates why the theorem requires every diagonal block to be invertible.

Common Mistake: Keep the Blocks in Their Places

A frequent error is to invert one diagonal block but leave another unchanged. Using the first example, a mistaken candidate is \(\operatorname{diag}(\mathbf{B}^{-1},\mathbf{C})\), rather than \(\operatorname{diag}(\mathbf{B}^{-1},\mathbf{C}^{-1})\). Multiplying the second block by itself gives

$$ \mathbf{C}\mathbf{C} = \begin{bmatrix}2&1\\1&1\end{bmatrix} \begin{bmatrix}2&1\\1&1\end{bmatrix} = \begin{bmatrix}5&3\\3&2\end{bmatrix} \ne \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

So the mistaken candidate fails the inverse check. The correction is to invert each diagonal block, not to copy the original blocks into the proposed inverse. Then multiply in both orders: each corresponding block product must be an identity matrix, and every off-diagonal block must be zero.

Block structure also gives a practical advantage. If the matrix has many blocks, each inverse can be computed and checked separately; no multiplication between different diagonal blocks is needed. This is useful when the blocks are small even if the full matrix is large. The method does not bypass the need to establish that each block is invertible, and it does not allow blocks of incompatible sizes to be placed or multiplied arbitrarily. First identify the block partition, then find the inverse of each square block, then assemble and verify.

Check Your Understanding

For each question, pay attention to the block sizes and to which product is being checked.

  1. If \(\mathbf{A}=\operatorname{diag}(\mathbf{A}_1,\mathbf{A}_2)\) and both blocks are invertible, what is the block form of \(\mathbf{A}^{-1}\)?
  2. For \(\mathbf{A}=\operatorname{diag}([4],[2])\), write the inverse and verify both multiplication orders.
  3. Explain why a block-diagonal matrix with a noninvertible diagonal block cannot be invertible.
  4. For blocks of sizes \(2\times2\), \(1\times1\), and \(3\times3\), what is the size of the full block-diagonal matrix?
  5. State why checking only \(\mathbf{A}\mathbf{B}=\mathbf{I}\) is not, by itself, the definition of an inverse used in this tutorial.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon