Home > Mathematics > Linear Systems > Gaussian elimination
Gaussian elimination
Tuesday 18 July 2006, by
All the versions of this article: [English] [français]
Gaussian elimination is an algorithm in linear algebra for determining the solutions of a system of linear equations. First we do a forward elimination: Gaussian elimination reduces a given system to either triangular. Next, we do a backward elimination to solve the linear system
Problem
We want to solve the following linear system of
equations with
unknowns
:

In the matrix form, we have
![]()
with
![Ax=
\[ \left(
\begin{array}{c c c c }
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{array} \right)
\]
\[ \left(
\begin{array}{c }
x_1 \\
x_2 \\
\vdots \\
x_n
\end{array} \right)
\]=
\[ \left(
\begin{array}{c }
b_1 \\
b_2 \\
\vdots \\
b_n
\end{array} \right)
\]=b
Ax=
\[ \left(
\begin{array}{c c c c }
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{array} \right)
\]
\[ \left(
\begin{array}{c }
x_1 \\
x_2 \\
\vdots \\
x_n
\end{array} \right)
\]=
\[ \left(
\begin{array}{c }
b_1 \\
b_2 \\
\vdots \\
b_n
\end{array} \right)
\]=b](local/cache-vignettes/L340xH95/48a22f227e8aafdd2fab64131721f920-cfc88.png)
Example of resolution
Consider the following system:

with
![A=\[ \left(
\begin{array}{ccc}
1 & 2 & 2 \\
1 & 3 & -2\\
3 & 5 & 8
\end{array} \right)
\]
,
x=\[ \left(
\begin{array}{c}
x_1\\
x_2\\
x_3
\end{array} \right)
\],b=\[ \left(
\begin{array}{c}
2\\
-1\\
8
\end{array} \right)
\]
A=\[ \left(
\begin{array}{ccc}
1 & 2 & 2 \\
1 & 3 & -2\\
3 & 5 & 8
\end{array} \right)
\]
,
x=\[ \left(
\begin{array}{c}
x_1\\
x_2\\
x_3
\end{array} \right)
\],b=\[ \left(
\begin{array}{c}
2\\
-1\\
8
\end{array} \right)
\]](local/cache-vignettes/L300xH71/cdd921e6fcebc85bf7fe2093f363d79b-c0aa0.png)
First step of the Gaussian elimination: we eliminate
in the lines
and
:

Second step of the Gaussian elimination: we eliminate ![]()
in the line
:

By backward elimination we solve the linear system, we get the solution
:
![x=\[ \left(
\begin{array}{c}
3\\
-1\\
1/2
\end{array} \right)
\]
x=\[ \left(
\begin{array}{c}
3\\
-1\\
1/2
\end{array} \right)
\]](local/cache-vignettes/L88xH71/f93445b16cb71e5e69fa810b1a19ec04-29cd3.png)
Gaussian Elimination algorithm: forward elimination and triangular form

Let
the triangular upper matrix, we have
![]()
Gaussian Elimination algorithm: backward elimination
Now the matrix
is in triangular form
, we can solve:
![]()
with
the second member after the same operations than
.
We use a backward elimination for solving
:

