Maths Experte Graphes & Matrices matricesproduit matricielpuissancesinversesystèmes linéairestransformations géométriquesmatrice identité

Matrices

Résumé de cours, théorèmes et méthodes : matrices, matrices ligne, colonne, carrée, identité ; addition, produit par un réel, produit matriciel (non commutatif), puissances d'une matrice carrée, inverse (formule 2×2, calculatrice pour 3×3), résolution de systèmes linéaires, transformations géométriques du plan, algorithme Python (Terminale, maths expertes).

Faire le quiz →

Définitions

Définition 1 — matrice. Une matrice de taille m×nm \times n (mm lignes, nn colonnes) est un tableau de m×nm \times n nombres réels. On note A=(aij)A = (a_{ij}) où aija_{ij} est le coefficient situé à la ligne ii et à la colonne jj. Deux matrices sont égales si elles ont la même taille et les mêmes coefficients.

Exemple : A=(2−10435)A = \begin{pmatrix} 2 & -1 & 0 \\ 4 & 3 & 5 \end{pmatrix} est de taille 2×32 \times 3, avec a12=−1a_{12} = -1 et a23=5a_{23} = 5. Tableau de ventes, matrice d’adjacence d’un graphe, coefficients d’un système : toutes ces situations se codent par une matrice.

Définition 2 — matrices particulières. Une matrice ligne a une seule ligne (exemple : (0,30,7)\begin{pmatrix} 0{,}3 & 0{,}7 \end{pmatrix}, une distribution de probabilité) ; une matrice colonne a une seule colonne (exemple : (xy)\begin{pmatrix} x \\ y \end{pmatrix}, les coordonnées d’un point). Une matrice carrée d’ordre nn a nn lignes et nn colonnes ; ses coefficients a11,…,anna_{11}, \ldots, a_{nn} forment la diagonale, et elle est diagonale si tous ses coefficients hors diagonale sont nuls. La matrice identité InI_n a des 11 sur la diagonale et des 00 ailleurs (I2=(1001)I_2 = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}) ; la matrice nulle a tous ses coefficients nuls.

Définition 3 — somme et produit par un réel. Pour deux matrices de même taille, l’addition et le produit par un réel se font coefficient par coefficient : (A+B)ij=aij+bij(A + B)_{ij} = a_{ij} + b_{ij} et (λA)ij=λ aij(\lambda A)_{ij} = \lambda\, a_{ij}, avec les propriétés habituelles (A+B=B+AA + B = B + A, λ(A+B)=λA+λB\lambda(A + B) = \lambda A + \lambda B).

Exemple : (1234)+2(01−10)=(1414)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} + 2\begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix} = \begin{pmatrix} 1 & 4 \\ 1 & 4 \end{pmatrix}.

Définition 4 — produit de deux matrices. Si AA est de taille m×pm \times p et BB de taille p×np \times n, le produit ABAB est la matrice de taille m×nm \times n de coefficients (AB)ij=ai1b1j+ai2b2j+⋯+aipbpj=∑k=1paik bkj:(AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \dots + a_{ip}b_{pj} = \sum_{k=1}^{p} a_{ik}\, b_{kj} : on multiplie la ligne ii de AA par la colonne jj de BB terme à terme, puis on additionne. Le produit n’existe que si le nombre de colonnes de AA égale le nombre de lignes de BB.

Exemple : (2113)(xy)=(2x+yx+3y)\begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 2x + y \\ x + 3y \end{pmatrix} : c’est ainsi que les matrices codent systèmes linéaires et transformations du plan.

Définition 5 — puissances d’une matrice carrée. Pour AA carrée : A0=InA^0 = I_n, A1=AA^1 = A et An+1=An×AA^{n+1} = A^n \times A (donc A2=AAA^2 = AA, A3=AAAA^3 = AAA…). On a ApAq=Ap+qA^pA^q = A^{p+q}.

Définition 6 — matrice inversible. Une matrice carrée AA d’ordre nn est inversible s’il existe une matrice carrée BB d’ordre nn telle que AB=BA=InAB = BA = I_n. Cette matrice BB est alors unique : on la note A−1A^{-1}. On admet que pour des matrices carrées, AB=InAB = I_n suffit à entraîner BA=InBA = I_n.

Théorèmes et propriétés

Théorème 1 (règles de calcul) (admis). Pour des tailles compatibles : A(BC)=(AB)CA(B+C)=AB+AC(A+B)C=AC+BC(λA)B=λ(AB)A(BC) = (AB)C \qquad A(B + C) = AB + AC \qquad (A + B)C = AC + BC \qquad (\lambda A)B = \lambda(AB) et InI_n est neutre : AIn=ImA=AAI_n = I_mA = A pour AA de taille m×nm \times n. Mais le produit n’est pas commutatif : avec A=(1101)A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} et B=(1011)B = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}, AB=(2111)≠BA=(1112)AB = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix} \neq BA = \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix}. Conséquences : (A+B)2=A2+AB+BA+B2(A + B)^2 = A^2 + AB + BA + B^2 (qui ne vaut A2+2AB+B2A^2 + 2AB + B^2 que si AB=BAAB = BA), et AB=0AB = 0 n’entraîne pas A=0A = 0 ou B=0B = 0 : (0100)2=0\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}^2 = 0.

Théorème 2 (inverse d’une matrice 2×2). Soit A=(abcd)A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}. Si ad−bc≠0ad - bc \neq 0, alors AA est inversible et A−1=1ad−bc(d−b−ca);A^{-1} = \frac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix} ; si ad−bc=0ad - bc = 0, AA n’est pas inversible. La formule se vérifie par le produit : (abcd)(d−b−ca)=(ad−bc) I2\begin{pmatrix} a & b \\ c & d \end{pmatrix}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix} = (ad - bc)\,I_2.

Théorème 3 (propriétés de l’inverse). Si AA et BB sont inversibles de même ordre : (A−1)−1=A(A^{-1})^{-1} = A, (AB)−1=B−1A−1(AB)^{-1} = B^{-1}A^{-1} (l’ordre s’inverse) et (An)−1=(A−1)n(A^n)^{-1} = (A^{-1})^n. Unicité de l’inverse : si AB=IAB = I et CA=ICA = I, alors C=C(AB)=(CA)B=BC = C(AB) = (CA)B = B.

Théorème 4 (système linéaire). (démonstration exigible) Si AA est inversible, le système AX=BAX = B admet une unique solution : X=A−1BX = A^{-1}B.

Démonstration : si AX=BAX = B, en multipliant à gauche par A−1A^{-1} : A−1AX=A−1BA^{-1}AX = A^{-1}B, soit X=A−1BX = A^{-1}B ; réciproquement A(A−1B)=BA(A^{-1}B) = B. Si AA n’est pas inversible, le système a zéro ou une infinité de solutions (on le traite par substitution ou combinaison).

Théorème 5 (puissances usuelles).

  1. Matrice diagonale : (a00b)n=(an00bn)\begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix}^n = \begin{pmatrix} a^n & 0 \\ 0 & b^n \end{pmatrix} (de même à l’ordre 3).
  2. (1101)n=(1n01)\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}^n = \begin{pmatrix} 1 & n \\ 0 & 1 \end{pmatrix}, et plus généralement, si A=λI+NA = \lambda I + N avec N2=0N^2 = 0 : An=λnI+nλn−1NA^n = \lambda^n I + n\lambda^{n-1}N.
  3. Si A=PDP−1A = PDP^{-1} avec DD diagonale, alors An=PDnP−1A^n = PD^nP^{-1}.

Chaque formule se démontre par récurrence en calculant An+1=AnAA^{n+1} = A^nA ; pour la troisième : An+1=PDnP−1⋅PDP−1=PDn+1P−1A^{n+1} = PD^nP^{-1} \cdot PDP^{-1} = PD^{n+1}P^{-1}.

Théorème 6 (transformations du plan). Dans un repère orthonormé d’origine OO, une matrice carrée MM d’ordre 22 définit la transformation X↦X′=MXX \mapsto X' = MX (qui fixe OO) :

TransformationMatriceImage de (x ;y)(x\,;y)
Homothétie de centre OO, rapport kk(k00k)\begin{pmatrix} k & 0 \\ 0 & k \end{pmatrix}(kx ;ky)(kx\,;ky)
Symétrie d’axe (Ox)(Ox)(100−1)\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}(x ;−y)(x\,;-y)
Symétrie d’axe (Oy)(Oy)(−1001)\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}(−x ;y)(-x\,;y)
Symétrie de centre OO(−100−1)\begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}(−x ;−y)(-x\,;-y)
Rotation de centre OO, angle θ\theta(cos⁡θ−sin⁡θsin⁡θcos⁡θ)\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}(xcos⁡θ−ysin⁡θ ; xsin⁡θ+ycos⁡θ)(x\cos\theta - y\sin\theta\,;\ x\sin\theta + y\cos\theta)
Projection sur (Ox)(Ox)(1000)\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}(x ;0)(x\,;0)

Appliquer M1M_1 puis M2M_2 revient à appliquer la matrice M2M1M_2M_1 (attention à l’ordre) ; la transformation réciproque a pour matrice M−1M^{-1}.

Méthodes

Méthode 1 — calculer un produit de matrices.

  1. Vérifier les tailles : (m×p)(p×n)(m \times p)(p \times n) existe et donne une matrice m×nm \times n.
  2. Pour chaque coefficient (i,j)(i, j) : multiplier la ligne ii de AA par la colonne jj de BB terme à terme, puis additionner.
  3. Contrôler un coefficient simple (ligne ou colonne contenant des 00 ou des 11).

Exemple : (1234)(5678)=(1×5+2×71×6+2×83×5+4×73×6+4×8)=(19224350)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} = \begin{pmatrix} 1\times5 + 2\times7 & 1\times6 + 2\times8 \\ 3\times5 + 4\times7 & 3\times6 + 4\times8 \end{pmatrix} = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}.

Méthode 2 — calculer les puissances d’une matrice carrée.

  1. Calculer A2A^2, A3A^3 (à la main ou à la calculatrice) et conjecturer une formule pour AnA^n.
  2. Démontrer la conjecture par récurrence en vérifiant que An+1=AnAA^{n+1} = A^nA redonne la formule au rang n+1n + 1.
  3. Reconnaître les cas du Théorème 5 : matrice diagonale ; A=λI+NA = \lambda I + N avec N2=0N^2 = 0 ; décomposition A=PDP−1A = PDP^{-1} fournie par l’énoncé.

Exemple : A=(2102)=2I2+NA = \begin{pmatrix} 2 & 1 \\ 0 & 2 \end{pmatrix} = 2I_2 + N avec N=(0100)N = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}, N2=0N^2 = 0 : An=(2nn 2n−102n)A^n = \begin{pmatrix} 2^n & n\,2^{n-1} \\ 0 & 2^n \end{pmatrix} (récurrence).

def produit(A, B):
    """Produit de A (m x p) par B (p x n)."""
    m, p, n = len(A), len(B), len(B[0])
    C = [[0] * n for _ in range(m)]
    for i in range(m):
        for j in range(n):
            for k in range(p):
                C[i][j] += A[i][k] * B[k][j]
    return C

def puissance(A, n):
    """A^n pour A carrée."""
    taille = len(A)
    P = [[1 if i == j else 0 for j in range(taille)] for i in range(taille)]
    for _ in range(n):
        P = produit(P, A)
    return P

A = [[1, 1], [0, 1]]
print(puissance(A, 5))   # [[1, 5], [0, 1]]

Avec le module numpy : A @ B pour le produit, np.linalg.matrix_power(A, n) pour une puissance, np.linalg.inv(A) pour l’inverse.

Méthode 3 — inverser une matrice.

  1. En taille 2×22 \times 2 : calculer ad−bcad - bc ; s’il est nul, la matrice n’est pas inversible (Théorème 2).
  2. Sinon, appliquer la formule : échanger aa et dd, changer le signe de bb et cc, diviser par ad−bcad - bc.
  3. En taille 3×33 \times 3 : utiliser la calculatrice (touche x−1x^{-1} du menu matrices) ou, si l’énoncé propose un candidat BB, vérifier que AB=I3AB = I_3 (Définition 6).

Exemple : A=(2113)A = \begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix} : ad−bc=6−1=5ad - bc = 6 - 1 = 5, donc A−1=15(3−1−12)A^{-1} = \dfrac15\begin{pmatrix} 3 & -1 \\ -1 & 2 \end{pmatrix} ; et (111011001)−1=(1−1001−1001)\begin{pmatrix} 1 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{pmatrix}^{-1} = \begin{pmatrix} 1 & -1 & 0 \\ 0 & 1 & -1 \\ 0 & 0 & 1 \end{pmatrix}.

Méthode 4 — résoudre un système linéaire.

  1. Écrire le système sous la forme AX=BAX = B (AA : coefficients, XX : inconnues, BB : seconds membres).
  2. Vérifier que AA est inversible (ad−bc≠0ad - bc \neq 0 en taille 2, calculatrice en taille 3).
  3. Calculer X=A−1BX = A^{-1}B (Théorème 4) et vérifier dans le système de départ.

Exemple : {2x+y=5x+3y=10\begin{cases} 2x + y = 5 \\ x + 3y = 10 \end{cases} : X=15(3−1−12)(510)=(13)X = \dfrac15\begin{pmatrix} 3 & -1 \\ -1 & 2 \end{pmatrix}\begin{pmatrix} 5 \\ 10 \end{pmatrix} = \begin{pmatrix} 1 \\ 3 \end{pmatrix} ; vérification : 2+3=52 + 3 = 5 et 1+9=101 + 9 = 10. Application : chercher la parabole y=ax2+bx+cy = ax^2 + bx + c passant par trois points revient à un système 3×33 \times 3 d’inconnues a,b,ca, b, c.

Méthode 5 — utiliser une matrice de transformation.

  1. Représenter le point M(x ;y)M(x\,;y) par la matrice colonne X=(xy)X = \begin{pmatrix} x \\ y \end{pmatrix}.
  2. Calculer X′=MXX' = MX : les coordonnées de l’image (Théorème 6).
  3. Pour une composée, multiplier les matrices dans l’ordre inverse d’application (M1M_1 puis M2M_2 : matrice M2M1M_2M_1) ; pour la transformation réciproque, utiliser M−1M^{-1} (Méthode 3).

Exemple : la rotation d’angle π2\frac{\pi}{2} a pour matrice R=(0−110)R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} ; l’image de M(2 ;1)M(2\,;1) est M′(−1 ;2)M'(-1\,;2). R2=−I2R^2 = -I_2 : deux quarts de tour font un demi-tour, et R4=I2R^4 = I_2.

Quiz — Matrices

10 questions · correction immédiate · sans inscription

Tester →