Sistemi lineari, con l’eliminazione di Gauss

Considera il sistema lineare

\displaystyle Ax = b

\displaystyle \begin{bmatrix}a_{11} & a_{12} & a_{13} \\a_{21} & a_{22} & a_{23} \\a_{31} & a_{32} & a_{33}\end{bmatrix}\cdot \begin{bmatrix}x_1 \\x_2 \\x_3\end{bmatrix} = \begin{bmatrix}b_1 \\b_2 \\b_3\end{bmatrix}

Applica l’eliminazione di Gauss alla matrice A affiancata da b

A | b

G\cdot A | G\cdot b

T | c

\displaystyle \begin{bmatrix}a_{11} & a_{12} & a_{13} & | & b_1 \\a_{21} & a_{22} & a_{23} & | &  b_2 \\a_{31} & a_{32} & a_{33} &  | & b_3\end{bmatrix}

\displaystyle \begin{bmatrix}t_{11} & t_{12} & t_{13} & | & c_{1} \\0 & t_{22} & t_{23} & | & c_{2} \\0 & 0 & t_{33} & | & c_{3} \\\end{bmatrix}

Si ottiene un sistema, con le stesse soluzioni

\displaystyle Tx = c

\displaystyle \begin{bmatrix}t_{11} & t_{12} & t_{13} \\0 & t_{22} & t_{23} \\0 & 0 & t_{33}\end{bmatrix}\cdot \begin{bmatrix}x_1 \\x_2 \\x_3\end{bmatrix} = \begin{bmatrix}c_1 \\c_2 \\c_3\end{bmatrix}

Il sistema è facilmente risolvibile calcolando i valori delle variabili partendo dal basso e sostituendo, verso l’alto, i valori ottenuti

x_3 = c_{3}/t_{33}

x_2 = (c_{2}-t_{23} x_3) / t_{22}

x_1 = (c_{1}-t_{12} x_2-t_{13} x_3) / t_{11}


Eliminazione di Gauss-Jordan

Se si applicano le manipolazioni che trasformano A in una matrice diagonale la fase finale risulta ancora più semplice

\displaystyle \begin{bmatrix}d_{11} & 0 & 0 \\0 & d_{22} & 0 \\0 & 0 & d_{33}\end{bmatrix}\cdot \begin{bmatrix}x_1 \\x_2 \\x_3\end{bmatrix} = \begin{bmatrix}e_1 \\e_2 \\e_3\end{bmatrix}

x_1 = e_{1}/d_{11}

x_2 = e_{2}/d_{22}

x_3 = e_{3}/d_{33}

Se si applicano le manipolazioni che trasformano A nella matrice identità la soluzione del sistema lineare è data dal vettore dei termini noti!

\displaystyle \begin{bmatrix}1 & 0 & 0 \\0 & 1 & 0 \\0 & 0 & 1\end{bmatrix}\cdot \begin{bmatrix}x_1 \\x_2 \\x_3\end{bmatrix} = \begin{bmatrix}f_1 \\f_2 \\f_3\end{bmatrix}

x_1 = f_{1}

x_2 = f_{2}

x_3 = f_{3}


Esempio 2×2

\displaystyle \begin{cases}x_1+2\, x_2 = 4\\3\, x_1+4\, x_2 = 10\end{cases}

\displaystyle \begin{bmatrix}1 & 2 & | & 4\\3 & 4 & | & 10\end{bmatrix}

m_1 = \displaystyle\frac{a_{21}}{a_{11}} = \displaystyle\frac{3}{1} = 3

R_2 \leftarrow R_2 -m_1 \cdot R_1
= R_2 -3\cdot R_1
=[3 4 10] – 3*[1 2 4]
=[3 4 10] – [3 6 12]
= \begin{bmatrix}0 & -2 & -2\end{bmatrix}

\displaystyle \begin{bmatrix}1 & 2 & | & 4\\0 & -2 & | & -2\end{bmatrix}

\displaystyle \begin{cases}x_1+2\, x_2 = 4\\-2 x_2 = -2\end{cases}

\displaystyle \begin{cases}\dots \\ x_2 = \displaystyle \frac{-2}{-2} = 1\end{cases}

\displaystyle \begin{cases}x_1 = 4-2(1) = 2  \\ x_2 = 1\end{cases}


Altrimenti, continua con l’eliminazione di Jordan

\displaystyle \begin{bmatrix}1 & 2 & | & 4\\0 & -2 & | & -2\end{bmatrix}

m_2 = \displaystyle\frac{a_{12}}{a_{22}} = \frac{2}{-2} = -1

R_1 \leftarrow R_1 -m_2 \cdot R_2
= R_1 -(-1) R_2
= R_1 + R_2
= [1 2 4] + [0 -2 -2]
= \begin{bmatrix}1 & 0 & 2\end{bmatrix}

\displaystyle \begin{bmatrix}1 & 0 & | & 2\\0 & -2 & | & -2\end{bmatrix}

\displaystyle \begin{cases}x_1 = 2 \\ -2 x_2 = -2\end{cases}

\displaystyle \begin{cases}x_1 = 2 \\ x_2 = \displaystyle \frac{-2}{-2} = 1\end{cases}


Altrimenti, continua …

\displaystyle \begin{bmatrix}1 & 0 & | & 2\\0 & -2 & | & -2\end{bmatrix}

\displaystyle R_2 \leftarrow \frac{R_2}{m_{22}} = \displaystyle \frac{R_2}{-2}} = \begin{bmatrix}0 & 1 & 1\end{bmatrix}

\displaystyle \begin{bmatrix}1 & 0 & | & 2\\0 & 1 & | & 1\end{bmatrix}

\displaystyle \begin{cases}x_1 = 2 \\ x_2 = 1\end{cases}