Inversion of matrices¶
Exercises · Vectors and matrices · with worked solutions · Lecture notes (PDF) · Chapter 4.3: Inversion of matrices
Exercise 1
Using the formula for the inverse of a \(2\times 2\) matrix, compute (if it exists) the inverse of
Solution
Recall that, if \(ad-bc\neq 0\), \(\begin{pmatrix} a & b\\ c & d\end{pmatrix}^{-1} = \frac{1}{ad-bc}\begin{pmatrix} d & -b\\ -c & a\end{pmatrix}\).
-
\(\det(\boldsymbol A) = 3\cdot 2 - 5\cdot 1 = 1\), hence
\[ \boldsymbol A^{-1} = \begin{pmatrix} 2 & -5\\ -1 & 3\end{pmatrix}. \qquad \text{Check: } \begin{pmatrix} 3 & 5\\ 1 & 2\end{pmatrix}\begin{pmatrix} 2 & -5\\ -1 & 3\end{pmatrix} = \begin{pmatrix} 6-5 & -15+15\\ 2-2 & -5+6\end{pmatrix} = \boldsymbol I. \] -
\(\det(\boldsymbol B) = 4\cdot 4 - 2\cdot 3 = 10\), hence
\[ \boldsymbol B^{-1} = \frac{1}{10}\begin{pmatrix} 4 & -2\\ -3 & 4\end{pmatrix} = \begin{pmatrix} \tfrac{2}{5} & -\tfrac{1}{5}\\[0.8ex] -\tfrac{3}{10} & \tfrac{2}{5}\end{pmatrix}. \] -
\(\det(\boldsymbol C) = 2\cdot 6 - 4\cdot 3 = 0\): the matrix \(\boldsymbol C\) is singular and \(\boldsymbol C^{-1}\) does not exist (the second row is \(\tfrac{3}{2}\) times the first one).
Exercise 2
Compute the inverse of
with the method of Gauss–Jordan, and verify the result.
Solution
We apply elementary row operations to \(\left(\boldsymbol A \mid \boldsymbol I\right)\):
Hence
Check (row by column): \(\boldsymbol A\boldsymbol A^{-1} = \begin{pmatrix} 3-2 & -2+2 & 1-1\\ 3-4+1 & -2+4-1 & 1-2+1\\ -2+2 & 2-2 & -1+2 \end{pmatrix} = \boldsymbol I\).
Exercise 3
Compute the inverse of
with the method of Gauss–Jordan.
Solution
Since \(a_{11}=0\), we start with a row swap. Later, we swap rows 2 and 3 to get a pivot equal to \(1\) (and avoid fractions):
Hence
Exercise 4
Apply the method of Gauss–Jordan to
Is \(\boldsymbol A\) invertible?
Solution
A zero row appears in the left block: the method stops and \(\boldsymbol A\) is not invertible. Indeed, the third row of \(\boldsymbol A\) is the sum of the first two rows, and
Exercise 5
Consider, for \(k\in\R\), the matrix
-
For which values of \(k\) is \(\boldsymbol A(k)\) invertible?
-
Compute \(\boldsymbol A(0)^{-1}\) with the method of Gauss–Jordan.
Solution
-
We compute \(\det(\boldsymbol A(k))\) by Gaussian elimination (row additions only):
\[\begin{align*} &\left( \begin{array}{ccc} 1 & 1 & 1 \\ 1 & k & 1 \\ 1 & 1 & k^2 \\ \end{array} \right) \\[2ex] &\left( \begin{array}{ccc} 1 & 1 & 1 \\ 0 & k-1 & 0 \\ 1 & 1 & k^2 \\ \end{array} \right) \hspace{1em} \text{(} R_2 \leftarrow R_2 - R_1 \text{)} \\[2ex] &\left( \begin{array}{ccc} 1 & 1 & 1 \\ 0 & k-1 & 0 \\ 0 & 0 & k^2-1 \\ \end{array} \right) \hspace{1em} \text{(} R_3 \leftarrow R_3 - R_1 \text{)} \end{align*}\]The last matrix is upper triangular, hence
\[ \det(\boldsymbol A(k)) = 1\cdot(k-1)\cdot(k^2-1) = (k-1)^2(k+1). \]Therefore \(\boldsymbol A(k)\) is invertible if and only if \(k\neq 1\) and \(k\neq -1\).
-
For \(k=0\) we have \(\det(\boldsymbol A(0)) = 1\), and:
\[\begin{align*} &\left( \begin{array}{ccc|ccc} 1 & 1 & 1 & 1 & 0 & 0 \\ 1 & 0 & 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 0 & 0 & 1 \\ \end{array} \right) \\[2ex] &\left( \begin{array}{ccc|ccc} 1 & 1 & 1 & 1 & 0 & 0 \\ 0 & -1 & 0 & -1 & 1 & 0 \\ 1 & 1 & 0 & 0 & 0 & 1 \\ \end{array} \right) \hspace{1em} \text{(} R_2 \leftarrow R_2 - R_1 \text{)} \\[2ex] &\left( \begin{array}{ccc|ccc} 1 & 1 & 1 & 1 & 0 & 0 \\ 0 & -1 & 0 & -1 & 1 & 0 \\ 0 & 0 & -1 & -1 & 0 & 1 \\ \end{array} \right) \hspace{1em} \text{(} R_3 \leftarrow R_3 - R_1 \text{)} \\[2ex] &\left( \begin{array}{ccc|ccc} 1 & 1 & 1 & 1 & 0 & 0 \\ 0 & 1 & 0 & 1 & -1 & 0 \\ 0 & 0 & -1 & -1 & 0 & 1 \\ \end{array} \right) \hspace{1em} \text{(} R_2 \leftarrow -R_2 \text{)} \\[2ex] &\left( \begin{array}{ccc|ccc} 1 & 1 & 1 & 1 & 0 & 0 \\ 0 & 1 & 0 & 1 & -1 & 0 \\ 0 & 0 & 1 & 1 & 0 & -1 \\ \end{array} \right) \hspace{1em} \text{(} R_3 \leftarrow -R_3 \text{)} \\[2ex] &\left( \begin{array}{ccc|ccc} 1 & 0 & 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 & -1 & 0 \\ 0 & 0 & 1 & 1 & 0 & -1 \\ \end{array} \right) \hspace{1em} \text{(} R_1 \leftarrow R_1 - R_2 \text{)} \\[2ex] &\left( \begin{array}{ccc|ccc} 1 & 0 & 0 & -1 & 1 & 1 \\ 0 & 1 & 0 & 1 & -1 & 0 \\ 0 & 0 & 1 & 1 & 0 & -1 \\ \end{array} \right) \hspace{1em} \text{(} R_1 \leftarrow R_1 - R_3 \text{)} \end{align*}\]Hence
\[ \boldsymbol A(0)^{-1}= \begin{pmatrix} -1 & 1 & 1\\ 1 & -1 & 0\\ 1 & 0 & -1 \end{pmatrix}. \]
Exercise 6
Consider, for \(k\in\R\), the matrix \( \boldsymbol A(k)= \begin{pmatrix} k & 1\\ 4 & k \end{pmatrix}. \) For which values of \(k\) is \(\boldsymbol A(k)\) invertible? For these values, write \(\boldsymbol A(k)^{-1}\), and compute \(\boldsymbol A(3)^{-1}\).
Solution
We have \(\det(\boldsymbol A(k)) = k^2 - 4 = (k-2)(k+2)\), so \(\boldsymbol A(k)\) is invertible if and only if \(k\neq 2\) and \(k\neq -2\). In this case
For \(k=3\): \(\det(\boldsymbol A(3)) = 5\) and
Exercise 7
Compute the inverse of
with the adjugate (cofactor) formula \(\boldsymbol A^{-1} = \frac{1}{\det(\boldsymbol A)}\,\mathrm{adj}(\boldsymbol A)\).
Solution
Laplace expansion along the first row: \(\det(\boldsymbol A) = 2\cdot(1-0) - 0 + 1\cdot(3-0) = 5\neq 0\). The cofactors \(C_{ij} = (-1)^{i+j}\det(\boldsymbol A_{ij})\) are:
The adjugate matrix is the transpose of the cofactor matrix:
Exercise 8
Let \( \boldsymbol A= \begin{pmatrix} 2 & 1\\ 1 & 1 \end{pmatrix} \) and \( \boldsymbol B= \begin{pmatrix} 1 & 2\\ 0 & 3 \end{pmatrix}. \)
-
Compute \(\boldsymbol A^{-1}\), \(\boldsymbol B^{-1}\) and then \((\boldsymbol A\boldsymbol B)^{-1}\) using the properties of the inverse. Check the result by inverting \(\boldsymbol A\boldsymbol B\) directly.
-
Show that \(\boldsymbol A^{-1}\boldsymbol B^{-1} \neq (\boldsymbol A\boldsymbol B)^{-1}\).
-
Compute \((\boldsymbol B')^{-1}\) and \(\det\big((\boldsymbol A\boldsymbol B)^{-1}\big)\).
Solution
-
\(\det(\boldsymbol A) = 1\) and \(\det(\boldsymbol B) = 3\), hence
\[ \boldsymbol A^{-1} = \begin{pmatrix} 1 & -1\\ -1 & 2\end{pmatrix}, \qquad \boldsymbol B^{-1} = \frac{1}{3}\begin{pmatrix} 3 & -2\\ 0 & 1\end{pmatrix}, \]\[ (\boldsymbol A\boldsymbol B)^{-1} = \boldsymbol B^{-1}\boldsymbol A^{-1} = \frac{1}{3}\begin{pmatrix} 3 & -2\\ 0 & 1\end{pmatrix}\begin{pmatrix} 1 & -1\\ -1 & 2\end{pmatrix} = \frac{1}{3}\begin{pmatrix} 5 & -7\\ -1 & 2\end{pmatrix}. \]Check: \(\boldsymbol A\boldsymbol B = \begin{pmatrix} 2 & 7\\ 1 & 5\end{pmatrix}\), \(\det(\boldsymbol A\boldsymbol B) = 10-7 = 3\), and the \(2\times 2\) formula gives \((\boldsymbol A\boldsymbol B)^{-1} = \frac{1}{3}\begin{pmatrix} 5 & -7\\ -1 & 2\end{pmatrix}\).
-
\(\boldsymbol A^{-1}\boldsymbol B^{-1} = \frac{1}{3}\begin{pmatrix} 1 & -1\\ -1 & 2\end{pmatrix}\begin{pmatrix} 3 & -2\\ 0 & 1\end{pmatrix} = \frac{1}{3}\begin{pmatrix} 3 & -3\\ -3 & 4\end{pmatrix} \neq (\boldsymbol A\boldsymbol B)^{-1}\).
-
\((\boldsymbol B')^{-1} = (\boldsymbol B^{-1})' = \frac{1}{3}\begin{pmatrix} 3 & 0\\ -2 & 1\end{pmatrix}\) (check with the \(2\times 2\) formula applied to \(\boldsymbol B' = \begin{pmatrix} 1 & 0\\ 2 & 3\end{pmatrix}\)). Moreover
\[ \det\big((\boldsymbol A\boldsymbol B)^{-1}\big) = \frac{1}{\det(\boldsymbol A\boldsymbol B)} = \frac{1}{\det(\boldsymbol A)\det(\boldsymbol B)} = \frac{1}{3}. \]
Exercise 9
-
Let \(\boldsymbol A\in\R^{n\times n}\) be invertible and \(\lambda\in\R\), \(\lambda\neq 0\). Show that \(\lambda\boldsymbol A\) is invertible and \((\lambda\boldsymbol A)^{-1} = \frac{1}{\lambda}\boldsymbol A^{-1}\).
-
Let \(\boldsymbol A\in\R^{n\times n}\) satisfy \(\boldsymbol A^2 - 3\boldsymbol A + \boldsymbol I = \boldsymbol 0\). Show that \(\boldsymbol A\) is invertible and \(\boldsymbol A^{-1} = 3\boldsymbol I - \boldsymbol A\). Check this on \(\boldsymbol A = \begin{pmatrix} 2 & 1\\ 1 & 1\end{pmatrix}\).
Solution
-
Using the properties of the product by a scalar:
\[ (\lambda\boldsymbol A)\Big(\tfrac{1}{\lambda}\boldsymbol A^{-1}\Big) = \lambda\cdot\tfrac{1}{\lambda}\,\boldsymbol A\boldsymbol A^{-1} = \boldsymbol I, \qquad \Big(\tfrac{1}{\lambda}\boldsymbol A^{-1}\Big)(\lambda\boldsymbol A) = \tfrac{1}{\lambda}\cdot\lambda\,\boldsymbol A^{-1}\boldsymbol A = \boldsymbol I. \] -
From \(\boldsymbol A^2 - 3\boldsymbol A + \boldsymbol I = \boldsymbol 0\) we get \(3\boldsymbol A - \boldsymbol A^2 = \boldsymbol I\), i.e.,
\[ \boldsymbol A(3\boldsymbol I - \boldsymbol A) = \boldsymbol I \quad\text{and}\quad (3\boldsymbol I - \boldsymbol A)\boldsymbol A = \boldsymbol I. \]Hence \(\boldsymbol A^{-1} = 3\boldsymbol I - \boldsymbol A\). For \(\boldsymbol A = \begin{pmatrix} 2 & 1\\ 1 & 1\end{pmatrix}\):
\[ \boldsymbol A^2 = \begin{pmatrix} 5 & 3\\ 3 & 2\end{pmatrix}, \qquad \boldsymbol A^2 - 3\boldsymbol A + \boldsymbol I = \begin{pmatrix} 5-6+1 & 3-3\\ 3-3 & 2-3+1\end{pmatrix} = \boldsymbol 0, \]and \(3\boldsymbol I - \boldsymbol A = \begin{pmatrix} 1 & -1\\ -1 & 2\end{pmatrix}\), which is indeed \(\boldsymbol A^{-1}\).
Exercise 10
Compute the inverse of the upper triangular matrix
with the method of Gauss–Jordan. What kind of matrix is \(\boldsymbol A^{-1}\)?
Solution
The left block is already upper triangular with ones on the diagonal: we only need to eliminate the entries above the pivots, starting from the last column.
Hence
which is again upper triangular with ones on the diagonal.