Example of Solving a System of Linear Equations by Gaussian Elimination.
This solution was made using the calculator presented on the site.
Please note that the coefficients will disappear which located in the "red" positions.
3 | x1 | + | 2 | x2 | + | x3 | + | x4 | = | - 2 | ||||
x1 | - | x2 | + | 4 | x3 | - | x4 | = | - 1 | |||||
- | 2 | x1 | - | 2 | x2 | - | 3 | x3 | + | x4 | = | 9 | ||
x1 | + | 5 | x2 | - | x3 | + | 2 | x4 | = | 4 |
The equation 2 and equation 1 are reversed.
x1 | - | x2 | + | 4 | x3 | - | x4 | = | - 1 | |||||
3 | x1 | + | 2 | x2 | + | x3 | + | x4 | = | - 2 | ||||
- | 2 | x1 | - | 2 | x2 | - | 3 | x3 | + | x4 | = | 9 | ||
x1 | + | 5 | x2 | - | x3 | + | 2 | x4 | = | 4 |
The equation 1 multiplied by -3 is added to the equation 2. more info
( 3 x1 + x1 * ( -3) )
+ ( 2 x2 + ( - x2) * ( -3) )
+ ( x3 + 4 x3 * ( -3) )
+ ( x4 + ( - x4) * ( -3) )
= -2 + ( -1) * ( -3)
The "red" coefficient is zero.
x1 | - | x2 | + | 4 | x3 | - | x4 | = | - 1 | |||||
5 | x2 | - | 11 | x3 | + | 4 | x4 | = | 1 | |||||
- | 2 | x1 | - | 2 | x2 | - | 3 | x3 | + | x4 | = | 9 | ||
x1 | + | 5 | x2 | - | x3 | + | 2 | x4 | = | 4 |
The equation 1 multiplied by 2 is added to the equation 3. more info
( -2 x1 + x1 * 2 )
+ ( -2 x2 + ( - x2) * 2 )
+ ( -3 x3 + 4 x3 * 2 )
+ ( x4 + ( - x4) * 2 )
= 9 + ( -1) * 2
The "red" coefficient is zero.
x1 | - | x2 | + | 4 | x3 | - | x4 | = | - 1 | |||||
5 | x2 | - | 11 | x3 | + | 4 | x4 | = | 1 | |||||
- | 4 | x2 | + | 5 | x3 | - | x4 | = | 7 | |||||
x1 | + | 5 | x2 | - | x3 | + | 2 | x4 | = | 4 |
The equation 1 multiplied by -1 is added to the equation 4. more info
( x1 + x1 * ( -1) )
+ ( 5 x2 + ( - x2) * ( -1) )
+ ( - x3 + 4 x3 * ( -1) )
+ ( 2 x4 + ( - x4) * ( -1) )
= 4 + ( -1) * ( -1)
The "red" coefficient is zero.
x1 | - | x2 | + | 4 | x3 | - | x4 | = | - 1 | |||||
5 | x2 | - | 11 | x3 | + | 4 | x4 | = | 1 | |||||
- | 4 | x2 | + | 5 | x3 | - | x4 | = | 7 | |||||
6 | x2 | - | 5 | x3 | + | 3 | x4 | = | 5 |
The equation 3 is added to the equation 2. more info
( 5 x2 + ( -4 x2) )
+ ( -11 x3 + 5 x3 )
+ ( 4 x4 + ( - x4) )
= 1 + 7
This transformation will allow us to count without fractions for some time.
x1 | - | x2 | + | 4 | x3 | - | x4 | = | - 1 | |||||
x2 | - | 6 | x3 | + | 3 | x4 | = | 8 | ||||||
- | 4 | x2 | + | 5 | x3 | - | x4 | = | 7 | |||||
6 | x2 | - | 5 | x3 | + | 3 | x4 | = | 5 |
The equation 2 multiplied by 4 is added to the equation 3. more info
( -4 x2 + x2 * 4 )
+ ( 5 x3 + ( -6 x3) * 4 )
+ ( - x4 + 3 x4 * 4 )
= 7 + 8 * 4
The "red" coefficient is zero.
x1 | - | x2 | + | 4 | x3 | - | x4 | = | - 1 | |||||
x2 | - | 6 | x3 | + | 3 | x4 | = | 8 | ||||||
- | 19 | x3 | + | 11 | x4 | = | 39 | |||||||
6 | x2 | - | 5 | x3 | + | 3 | x4 | = | 5 |
The equation 2 multiplied by -6 is added to the equation 4. more info
( 6 x2 + x2 * ( -6) )
+ ( -5 x3 + ( -6 x3) * ( -6) )
+ ( 3 x4 + 3 x4 * ( -6) )
= 5 + 8 * ( -6)
The "red" coefficient is zero.
x1 | - | x2 | + | 4 | x3 | - | x4 | = | - 1 | |||||
x2 | - | 6 | x3 | + | 3 | x4 | = | 8 | ||||||
- | 19 | x3 | + | 11 | x4 | = | 39 | |||||||
31 | x3 | - | 15 | x4 | = | - 43 |
The equation 3 multiplied by 31/19 is added to the equation 4. more info
( 31 x3 + ( -19 x3) * 31/19 )
+ ( -15 x4 + 11 x4 * 31/19 )
= -43 + 39 * 31/19
The "red" coefficient is zero.
x1 | - | x2 | + | 4 | x3 | - | x4 | = | - 1 | |||||
x2 | - | 6 | x3 | + | 3 | x4 | = | 8 | ||||||
- | 19 | x3 | + | 11 | x4 | = | 39 | |||||||
56/19 | x4 | = | 392/19 |
We will find the variable x4 from equation 4 of the system.
56/19 x4 = 392/19
x4 = 7
We will find the variable x3 from equation 3 of the system.
- 19 x3 + 11 x4 = 39
- 19 x3 = 39 - 11 x4
- 19 x3 = 39 - 11 * ( 7 )
x3 = 2
We will find the variable x2 from equation 2 of the system.
x2 - 6 x3 + 3 x4 = 8
x2 = 8 + 6 x3 - 3 x4
x2 = 8 + 6 * ( 2 ) - 3 * ( 7 )
x2 = - 1
We will find the variable x1 from equation 1 of the system.
x1 - x2 + 4 x3 - x4 = - 1
x1 = - 1 + x2 - 4 x3 + x4
x1 = - 1 + ( - 1 ) - 4 * ( 2 ) + ( 7 )
x1 = - 3
Result:
x1 = - 3
x2 = - 1
x3 = 2
x4 = 7