\documentclass[svgnames]{report}
\usepackage{pas-exos}
\usetikzlibrary{matrix}
\begin{document}
\chapter*{Inversion de matrices par pivot de Gauss}

Soit la matrice $A=\begin{pmatrix}
2 & 1 & -1\\1 & -1 & 3\\-1 & 0 & 2\end{pmatrix}$. Nous allons voir comment trouver son inverse à l'aide d'un algorithme que nous allons schématiser.

\bigskip

{\large\bfseries Etape 1 : on accole la matrice identité à la matrice A à sa droite}

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
2 & 1 & -1\\
1 & -1 & 3\\
-1 & 0 & 2\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] at (A.east)
{
1 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 1\\
};
\end{tikzpicture}
\end{center}

L'objectif est de faire des manipulations (combinaisons linéaires de lignes) sur ces deux matrices de sorte à faire apparaître à gauche la matrice identité.

\bigskip

{\large\bfseries Etape 2 : nous allons faire apparaître la colonne \og 1 0 0\fg{} à gauche en première position}

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
1 & 2 & -4\\
1 & -1 & 3\\
-1 & 0 & 2\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] (I) at (A.east)
{
1 & -1 & 0\\
0 & 1 & 0\\
0 & 0 & 1\\
};
\node[right] at ($(I-1-3)+(.5,0)$) {$L_1 \leftarrow L_1-L_2$};
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
1 & 2 & -4\\
0 & -1 & 5\\
-1 & 0 & 2\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] (I) at (A.east)
{
1 & -1 & 0\\
0 & 1 & 1\\
0 & 0 & 1\\
};
\node[right] at ($(I-2-3)+(.5,0)$) {$L_2 \leftarrow L_2+L_3$};
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
1 & 2 & -4\\
0 & -1 & 5\\
0 & 2 & -2\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] (I) at (A.east)
{
1 & -1 & 0\\
0 & 1 & 1\\
1 & -1 & 1\\
};
\node[right] at ($(I-3-3)+(.5,0)$) {$L_3 \leftarrow L_1+L_3$};
\end{tikzpicture}
\end{center}

\bigskip

{\large\bfseries Etape 3 : nous allons faire apparaître la colonne \og 0 1 0 \fg{} à gauche en seconde position}

\bigskip

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
1 & 0 & 6\\
0 & -1 & 5\\
0 & 2 & -2\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] (I) at (A.east)
{
1 & 1 & 2\\
0 & 1 & 1\\
1 & -1 & 1\\
};
\node[right] at ($(I-1-3)+(.7,0)$) {$L_1 \leftarrow L_1+2L_2$};
\end{tikzpicture}
\end{center}

\bigskip

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
1 & 0 & 6\\
0 & 1 & -5\\
0 & 2 & -2\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] (I) at (A.east)
{
1 & 1 & 2\\
0 & -1 & -1\\
1 & -1 & 1\\
};
\node[right] at ($(I-2-3)+(.5,0)$) {$L_2 \leftarrow -L_2$};
\end{tikzpicture}
\end{center}

\bigskip

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
1 & 0 & 6\\
0 & 1 & -5\\
0 & 0 & 8\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] (I) at (A.east)
{
1 & 1 & 2\\
0 & -1 & -1\\
1 & 1 & 3\\
};
\node[right] at ($(I-3-3)+(.5,0)$) {$L_3 \leftarrow L_3-2L_2$};
\end{tikzpicture}
\end{center}

\bigskip

{\large\bfseries Etape 4 : nous allons faire apparaître la colonne \og 0 0 1 \fg{} à gauche en troisième position}


\bigskip

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
1 & 0 & 6\\
0 & 1 & -5\\
0 & 0 & 1\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] (I) at (A.east)
{
1 & 1 & 2\\
0 & -1 & -1\\
\frac{1}{8} & \frac{1}{8} & \frac{3}{8}\\
};
\node[right] at ($(I-3-3)+(.5,0)$) {$L_3 \leftarrow \frac{1}{8}L_3$};
\end{tikzpicture}
\end{center}

\bigskip

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
1 & 0 & 6\\
0 & 1 & 0\\
0 & 0 & 1\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] (I) at (A.east)
{
1 & 1 & 2\\
\frac{5}{8} & -\frac{3}{8} & \frac{7}{8}\\
\frac{1}{8} & \frac{1}{8} & \frac{3}{8}\\
};
\node[right] at ($(I-2-3)+(.5,0)$) {$L_2 \leftarrow L_2+5L_3$};
\end{tikzpicture}
\end{center}

\bigskip

\begin{center}
\begin{tikzpicture}
\matrix[matrix of math nodes,left delimiter=(] (A) 
{
1 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 1\\
};
\draw[dashed] (A.north east) -- (A.south east);
\matrix[right,matrix of math nodes,right delimiter=)] (I) at (A.east)
{
\frac{1}{4} & \frac{1}{4} & -\frac{1}{4}\\
\frac{5}{8} & -\frac{3}{8} & \frac{7}{8}\\
\frac{1}{8} & \frac{1}{8} & \frac{3}{8}\\
};
\node[right] at ($(I-1-3)+(.5,0)$) {$L_1 \leftarrow L_1-6L_3$};
\end{tikzpicture}
\end{center}

{\large\bfseries Etape 5 : conclusion}

\bigskip

Notre schéma nous donne alors la matrice identité à gauche et une autre matrice à droite : c'est la matrice inverse de $A$. Donc :

\[ \boxed{A^{-1}=\frac{1}{8}\begin{pmatrix}2 & 2 & -2 \\ 5 & -3 & 7\\ 1 & 1 & 3\end{pmatrix}}\]
\end{document}