Chapitre 7 · Semestre 1

Matrices et calcul matriciel

Mathématiques

7.1 Définitions

Une matrice $A$ de dimension $m \times n$ est un tableau de $m$ lignes et $n$ colonnes, noté $A = (a_{ij})$.

Matrice particulière Définition
Carrée $m = n$
Identité $I_n$ Diagonale de 1, zéros ailleurs
Nulle Tous les coefficients sont nuls
Diagonale $a_{ij} = 0$ pour $i \neq j$
Triangulaire supérieure $a_{ij} = 0$ pour $i > j$
Transposée $A^T$ On échange lignes et colonnes
Symétrique $A^T = A$

7.2 Opérations

Opération Condition Règle
Addition $A + B$ Mêmes dimensions Terme à terme
Multiplication par un scalaire $\lambda A$ Chaque coefficient multiplié par $\lambda$
Produit $A \times B$ Colonnes de $A$ = lignes de $B$ $c_{ij} = \sum_k a_{ik}\,b_{kj}$ : ligne $i$ × colonne $j$

⚠️ Le produit matriciel n'est pas commutatif : en général $AB \neq BA$. Et $AB = 0$ n'implique pas $A=0$ ou $B=0$.

Dimensions : $(m \times n) \times (n \times p) = (m \times p)$.

7.3 Déterminant

Matrice $2 \times 2$ : $$A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \quad \Rightarrow \quad \det(A) = ad - bc$$

Matrice $3 \times 3$ — développement suivant la première ligne : $$\det(A) = a_{11}\,\Delta_{11} - a_{12}\,\Delta_{12} + a_{13}\,\Delta_{13}$$ où $\Delta_{1j}$ est le déterminant $2 \times 2$ obtenu en supprimant la ligne 1 et la colonne $j$. ⚠️ Attention à l'alternance des signes $+\;-\;+$.

Propriété Énoncé
$\det(A^T) = \det(A)$ La transposition ne change rien
$\det(AB) = \det(A)\det(B)$ Multiplicativité
Deux lignes identiques ou proportionnelles $\det(A) = 0$
Une ligne (ou colonne) nulle $\det(A) = 0$

7.4 Matrice inverse

$A$ est inversible (régulière) si et seulement si $\det(A) \neq 0$. Alors :

$$A^{-1} = \frac{1}{\det(A)} \cdot \text{com}(A)^T \qquad \text{avec} \qquad A A^{-1} = A^{-1} A = I_n$$

Cas $2 \times 2$ — formule à retenir absolument : $$A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \quad \Rightarrow \quad A^{-1} = \frac{1}{ad-bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$$

📌 Mnémotechnique : on échange $a$ et $d$, on change le signe de $b$ et $c$, on divise par le déterminant.

7.5 Le rang

Le rang d'une matrice est le nombre maximal de lignes (ou de colonnes) linéairement indépendantes. Une matrice carrée d'ordre $n$ est inversible $\Longleftrightarrow$ son rang vaut $n$ $\Longleftrightarrow$ $\det(A) \neq 0$.

Exercice 1

Soient : $$A = \begin{pmatrix} 2 & 1 \\ 3 & 4 \end{pmatrix} \qquad B = \begin{pmatrix} 1 & 0 \\ -2 & 5 \end{pmatrix} \qquad C = \begin{pmatrix} 1 & 2 & 0 \\ 3 & -1 & 2 \\ 0 & 4 & 1 \end{pmatrix}$$

  1. Calculez $A + B$, $3A$ et $A \times B$.
  2. Le produit $B \times A$ est-il égal à $A \times B$ ? Concluez.
  3. Calculez $\det(A)$ puis $A^{-1}$, et vérifiez que $A \times A^{-1} = I_2$.
  4. Calculez $\det(C)$ par développement suivant la première ligne. $C$ est-elle inversible ?
Voir le corrigé

1) Opérations : $$A + B = \begin{pmatrix} 2+1 & 1+0 \\ 3-2 & 4+5 \end{pmatrix} = \begin{pmatrix} 3 & 1 \\ 1 & 9 \end{pmatrix} \qquad 3A = \begin{pmatrix} 6 & 3 \\ 9 & 12 \end{pmatrix}$$

$$A \times B = \begin{pmatrix} 2 & 1 \\ 3 & 4 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ -2 & 5 \end{pmatrix}$$

  • $c_{11} = 2(1) + 1(-2) = 0$ ; $c_{12} = 2(0) + 1(5) = 5$
  • $c_{21} = 3(1) + 4(-2) = -5$ ; $c_{22} = 3(0) + 4(5) = 20$ $$A \times B = \begin{pmatrix} 0 & 5 \\ -5 & 20 \end{pmatrix}$$

2) Produit dans l'autre sens :

  • $c_{11} = 1(2) + 0(3) = 2$ ; $c_{12} = 1(1) + 0(4) = 1$
  • $c_{21} = -2(2) + 5(3) = 11$ ; $c_{22} = -2(1) + 5(4) = 18$ $$B \times A = \begin{pmatrix} 2 & 1 \\ 11 & 18 \end{pmatrix} \neq A \times B$$ Conclusion : le produit matriciel n'est pas commutatif.

3) Inverse de $A$ : $$\det(A) = 2 \times 4 - 1 \times 3 = 8 - 3 = 5 \neq 0 \quad \Rightarrow \quad A \text{ est inversible}$$ $$A^{-1} = \frac{1}{5}\begin{pmatrix} 4 & -1 \\ -3 & 2 \end{pmatrix} = \begin{pmatrix} 0{,}8 & -0{,}2 \\ -0{,}6 & 0{,}4 \end{pmatrix}$$ Vérification : $$A \times A^{-1} = \frac{1}{5}\begin{pmatrix} 2 & 1 \\ 3 & 4 \end{pmatrix}\begin{pmatrix} 4 & -1 \\ -3 & 2 \end{pmatrix} = \frac{1}{5}\begin{pmatrix} 8-3 & -2+2 \\ 12-12 & -3+8 \end{pmatrix} = \frac{1}{5}\begin{pmatrix} 5 & 0 \\ 0 & 5 \end{pmatrix} = I_2 \quad \checkmark$$

4) Déterminant de $C$ : $$\det(C) = 1 \times \begin{vmatrix} -1 & 2 \\ 4 & 1 \end{vmatrix} - 2 \times \begin{vmatrix} 3 & 2 \\ 0 & 1 \end{vmatrix} + 0 \times \begin{vmatrix} 3 & -1 \\ 0 & 4 \end{vmatrix}$$ $$= 1\big((-1)(1) - (2)(4)\big) - 2\big((3)(1) - (2)(0)\big) + 0$$ $$= 1(-1 - 8) - 2(3) = -9 - 6 = \mathbf{-15}$$ $\det(C) = -15 \neq 0$ : $C$ est inversible, son rang vaut 3.

Exercice 2 — Produit, déterminant et inverse

$A = \begin{pmatrix} 2 & 1 \\ 3 & 4 \end{pmatrix}$ et $B = \begin{pmatrix} 1 & 0 \\ -1 & 2 \end{pmatrix}$.

  1. Calculez $A + B$ et $AB$.
  2. Calculez $\det A$ et $A^{-1}$ ; vérifiez que $AA^{-1} = I$.
  3. Une entreprise vend 2 produits dans 2 magasins. Les quantités sont $Q = \begin{pmatrix} 10 & 20 \\ 30 & 5 \end{pmatrix}$ (lignes : magasins ; colonnes : produits) et les prix $P = \begin{pmatrix} 50 \\ 80 \end{pmatrix}$. Calculez $QP$ et interprétez.
Voir le corrigé

1) $A + B = \begin{pmatrix} 3 & 1 \\ 2 & 6 \end{pmatrix}$ ; $AB = \begin{pmatrix} 2 - 1 & 0 + 2 \\ 3 - 4 & 0 + 8 \end{pmatrix} = \begin{pmatrix} 1 & 2 \\ -1 & 8 \end{pmatrix}$.

2) $\det A = 8 - 3 = 5$ ; $A^{-1} = \dfrac{1}{5}\begin{pmatrix} 4 & -1 \\ -3 & 2 \end{pmatrix}$ ; $AA^{-1} = \dfrac{1}{5}\begin{pmatrix} 5 & 0 \\ 0 & 5 \end{pmatrix} = I$ ✓.

3) $QP = \begin{pmatrix} 10 \times 50 + 20 \times 80 \\ 30 \times 50 + 5 \times 80 \end{pmatrix} = \begin{pmatrix} 2\,100 \\ 1\,900 \end{pmatrix}$ : chiffre d'affaires de chaque magasin.

L'essentiel — Matrices

  • Matrice $n \times p$ : $n$ lignes, $p$ colonnes ; matrices carrée, identité $I$, diagonale, transposée $A^T$.
  • Addition terme à terme (mêmes dimensions) ; produit $AB$ possible si le nombre de colonnes de $A$ = nombre de lignes de $B$ ; en général $AB \neq BA$.
  • Déterminant $2 \times 2$ : $\det \begin{pmatrix} a & b \\ c & d \end{pmatrix} = ad - bc$ ; en $3 \times 3$ : développement ou règle de Sarrus.
  • $A$ inversible si et seulement si $\det A \neq 0$ ; en $2 \times 2$ : $A^{-1} = \dfrac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$.
  • Rang : nombre maximal de lignes (ou colonnes) linéairement indépendantes.
1Le produit AB existe si :
2Le déterminant de [[3, 2], [1, 4]] vaut :
3Une matrice est inversible si et seulement si :
4En général, le produit matriciel est :
5Le produit d'une matrice 2 × 3 par une matrice 3 × 4 est une matrice :