Inverser une matrice avec la formule de la comatrice
Pour inverser une matrice carrée, une méthode puissante et directe, alternative au pivot de Gauss, est celle qui utilise la comatrice. Cette technique est particulièrement efficace pour les matrices de petite taille (2×2 et 3×3).
L’inverse d’une matrice carrée $A$ est donné par la formule : $$A^{-1} = \frac{1}{\det(A)} \cdot \text{com}(A)^T$$ où $\det(A)$ est le déterminant de A et $\text{com}(A)^T$ est la transposée de la comatrice de A.
Condition essentielle : Cette formule n’est applicable que si le déterminant de A est non nul. Si $\det(A)=0$, la matrice n’est pas inversible.
Exemple 1 : Matrice 3×3 inversible
Inversons la matrice A : $$A = \begin{pmatrix} 3 & 0 & 2 \\ 2 & 0 & -2 \\ 0 & 1 & 1 \end{pmatrix}$$
Étape 1 : Calculer le déterminant
On développe par rapport à la deuxième colonne (qui contient beaucoup de zéros) : $$\det(A) = -0 \cdot \dots + 0 \cdot \dots – 1 \cdot \begin{vmatrix} 3 & 2 \\ 2 & -2 \end{vmatrix} = -1(-6 – 4) = 10$$ Le déterminant est 10 (non nul), la matrice est donc inversible.
Étape 2 : Calculer la comatrice
On calcule chaque cofacteur $C_{ij} = (-1)^{i+j} \det(A_{ij})$ :
$$ \text{com}(A) = \begin{pmatrix} \begin{vmatrix} 0 & -2 \\ 1 & 1 \end{vmatrix} & -\begin{vmatrix} 2 & -2 \\ 0 & 1 \end{vmatrix} & \begin{vmatrix} 2 & 0 \\ 0 & 1 \end{vmatrix} \\ -\begin{vmatrix} 0 & 2 \\ 1 & 1 \end{vmatrix} & \begin{vmatrix} 3 & 2 \\ 0 & 1 \end{vmatrix} & -\begin{vmatrix} 3 & 0 \\ 0 & 1 \end{vmatrix} \\ \begin{vmatrix} 0 & 2 \\ 0 & -2 \end{vmatrix} & -\begin{vmatrix} 3 & 2 \\ 2 & -2 \end{vmatrix} & \begin{vmatrix} 3 & 0 \\ 2 & 0 \end{vmatrix} \end{pmatrix} = \begin{pmatrix} 2 & -2 & 2 \\ 2 & 3 & -3 \\ 0 & 10 & 0 \end{pmatrix} $$Étape 3 : Transposer la comatrice
$$\text{com}(A)^T = \begin{pmatrix} 2 & 2 & 0 \\ -2 & 3 & 10 \\ 2 & -3 & 0 \end{pmatrix}$$Étape 4 : Appliquer la formule
$$A^{-1} = \frac{1}{10} \begin{pmatrix} 2 & 2 & 0 \\ -2 & 3 & 10 \\ 2 & -3 & 0 \end{pmatrix} = \begin{pmatrix} 1/5 & 1/5 & 0 \\ -1/5 & 3/10 & 1 \\ 1/5 & -3/10 & 0 \end{pmatrix}$$Exemple 2 : Matrice 2×2
La formule est très rapide pour une matrice 2×2. Soit $B = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$.
1. Déterminant : $\det(B) = ad – bc$
2. Comatrice et transposée : $ \text{com}(B)^T = \begin{pmatrix} d & -b \\ -c & a \end{pmatrix} $
3. Inverse : Si $ad-bc \neq 0$, alors $B^{-1} = \frac{1}{ad-bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$
Pour $ B = \begin{pmatrix} 4 & 7 \\ 2 & 6 \end{pmatrix} $, $\det(B) = 24 – 14 = 10$. Donc $B^{-1} = \frac{1}{10} \begin{pmatrix} 6 & -7 \\ -2 & 4 \end{pmatrix} = \begin{pmatrix} 3/5 & -7/10 \\ -1/5 & 2/5 \end{pmatrix}$.
Exemple 3 : Matrice non-inversible
Soit la matrice C :
$$C = \begin{pmatrix} 1 & 0 & -1 \\ -2 & 1 & 4 \\ 3 & -1 & -5 \end{pmatrix}$$Calculons le déterminant :
$$\det(C) = 1 \begin{vmatrix} 1 & 4 \\ -1 & -5 \end{vmatrix} – 0 \cdot \dots + (-1) \begin{vmatrix} -2 & 1 \\ 3 & -1 \end{vmatrix}$$ $$\det(C) = 1(-5 – (-4)) – 1(2 – 3) = -1 – 1(-1) = -1 + 1 = 0$$Comme le déterminant est nul, la formule $A^{-1}$ nécessiterait une division par zéro, ce qui est impossible. La matrice C n’est donc pas inversible.