Matrices & linear systems

Gaussian elimination

Gaussian elimination is the systematic recipe for solving a linear system A*x = b by hand or by computer. It is the workhorse algorithm behind most linear-equation solving.

The idea: use simple row operations — swap two rows, scale a row, or add a multiple of one row to another — to knock out unknowns one at a time, until the system reaches a tidy triangular (echelon) shape with zeros below the diagonal. None of these moves changes the solution.

Once the system is triangular, the last equation gives one unknown immediately. You then plug that value upward into the equation above, and so on — this final stage is called back-substitution. Step by step, every unknown falls out.

[[1,1,5],[1,-1,1]] -> [[1,1,5],[0,-2,-4]] -> y=2, then x=3

Subtract row 1 from row 2 to triangulate, then back-substitute.

The three allowed row operations never change the solution set, which is why the method is trustworthy.

Also called
row reductionGauss elimination高斯消元法高斯消元行消去法