πAI Math Solver

Learn

The Gaussian Elimination Method: Row Operations, Echelon Form, and Back-Substitution

A marching band crosses the field in echelon: the front row leads, every row behind steps a little shorter, and nobody falls out of line. The gaussian elimination method puts your equations into exactly that formation - and once they stand like that, the answers simply step out of the rows, one at a time.

Echelon Formation, but for Equations

The name is not decoration. Echelon is the marching formation where each row is shorter than the one in front - and algebra borrowed the word for matrices arranged the same way. The gaussian elimination method takes your equations and shaves variables off them, row by row, until they stand in exactly that shape. Watch the gaussian elimination method do it:

[11140−3−1000515]\left[\begin{array}{ccc|c}1 & 1 & 1 & 4 \\ 0 & -3 & -1 & 0 \\ 0 & 0 & 5 & 15\end{array}\right]

The top row still carries all three variables, the middle row only two, the bottom row just one. That staircase is the destination of the gaussian elimination method, and reading it is the payoff for everything the gaussian elimination method does before. From the last row you read z=3z = 3 immediately. Carry it up a row and the middle row hands over yy. Carry both up again and the top row hands over xx.

A staircase with rows of blocks, each row shorter
Row 1: x y zRow 2: y zRow 3: z

Echelon formation: the front row leads and every row behind is shorter - the staircase the gaussian elimination method builds before back-substitution reads off the answer.

So before any technique at all, the gaussian elimination method makes one promise. Line the equations up like the band, and the answers step out of the formation on their own. Everything this page adds is just the careful machinery the gaussian elimination method uses to keep that promise.

What the Gaussian Elimination Method Is

The gaussian elimination method is a way to solve a system of linear equations. It turns the numbers into an augmented matrix, then cleans that matrix up with row operations. It carries Carl Friedrich Gauss's name, though the idea is far older - versions of it appear in ancient Chinese mathematics. Why prefer the gaussian elimination method to elimination by hand? One equation after another, the gaussian elimination method works on numbers, not letters. Variables stay parked in their columns; you push numbers only. That is also why every computer on earth solves big systems with some version of the gaussian elimination method inside it.

Four steps, always in this order:

  1. Write the augmented matrix - coefficients left of a bar, constants right of it; this is where the gaussian elimination method trades equations for numbers.
  2. Apply row operations to push zeros below the diagonal - the three moves that give the gaussian elimination method its power.
  3. Reach row-echelon form - leading 11s stepping down like the band, zeros underneath; this is the destination the gaussian elimination method promised.
  4. Back-substitute - solve the bottom row, then feed it upward. That is the gaussian elimination method's payout.

Ground the loop of the gaussian elimination method in a tiny system: x+y=6x + y = 6 and x−y=2x - y = 2. In words, each equation is a number-fact about the same mystery pair. The gaussian elimination method packs both facts into one matrix:

[1161−12]\left[\begin{array}{cc|c}1 & 1 & 6 \\ 1 & -1 & 2\end{array}\right]

Subtracting the second row from the first turns the top row into 0x+2y=40x + 2y = 4, so y=2y = 2, and then x=6−2=4x = 6 - 2 = 4. Matrix in, staircase, values out. That little loop is the gaussian elimination method at toy scale, and the rest of this page makes it careful enough for three-variable systems.

Step 1 of the Gaussian Elimination Method: Write the Augmented Matrix

Line the equations up so every xx-term shares a column, every yy-term shares a column, and so on. Copy each row of coefficients, draw a bar where the equal signs were, and copy the constants after it. The gaussian elimination method then works on numbers alone. The system 3x+4y=73x + 4y = 7 and 4x−2y=54x - 2y = 5 becomes

[3474−25]\left[\begin{array}{cc|c}3 & 4 & 7 \\ 4 & -2 & 5\end{array}\right].

Two habits keep the gaussian elimination method safe from here, and both are about copying honestly. First, write every equation in standard form ax+by+cz=dax + by + cz = d before copying. A missing variable contributes a 00 - so x+y=5x + y = 5 inside a three-variable system contributes the entries (1,1,0)(1, 1, 0), and the gaussian elimination method reads that zero as an honest absent variable.

Second, respect the bar. The left block holds the equations' left sides and the right block their right sides, and the gaussian elimination method must never let a number cross that fence. Every later move rearranges whole rows - the gaussian elimination method reshuffles equations, never fragments one.

Step 2 of the Gaussian Elimination Method: The Three Row Operations

Only three moves are legal, and the gaussian elimination method uses nothing else - every step you will ever see is one of them:

OperationWrittenWhat it does
Swap two rowsR1↔R2R_1 \leftrightarrow R_2The order of equations never mattered, so the gaussian elimination method trades rows freely - usually to put a handy 11 at the top of a column.
Scale a rowkR1kR_1Every entry of the row - the constants after the bar too - gets multiplied by the same number. Dividing a row by 22 is scaling by 12\tfrac{1}{2}.
Replace a rowR2+cR1R_2 + cR_1Work out cc times row 1, add it to row 2, and row 2 is the only row that changes. This is the workhorse move - ordinary elimination wearing a matrix costume, and the one the gaussian elimination method repeats most. Master it and the gaussian elimination method has no secrets left.

The third move deserves a warning label. When you compute R2+3R1R_2 + 3R_1, you use R1R_1 but you never change it - the next matrix must show row 1 untouched. Students who edit both rows have quietly written two different equations, and no row operation the gaussian elimination method allows can undo that. Say the notation out loud as you work. It names the row that was used and the row that was worked on. That is exactly the pair the gaussian elimination method needs you to keep straight.

Step 3 of the Gaussian Elimination Method: Row-Echelon Form

The gaussian elimination method aims at this silhouette:

(1ab01c001)\begin{pmatrix}1 & a & b \\ 0 & 1 & c \\ 0 & 0 & 1\end{pmatrix}

A leading 11 starts each row, each leading 11 sits below and to the right of the one above, and everything underneath the staircase is 00. Entries above the staircase may be anything at all - that is normal at this stage of the gaussian elimination method. Reach this staircase and the gaussian elimination method is one back-substitution away from done. To steer toward the shape, the gaussian elimination method works column by column. Get a leading 11 in row 1, then sweep zeros down the first column.

Get a leading 11 in row 2 and sweep the second column. Continue like that down the matrix. If a column starts with 00, the gaussian elimination method promotes another row into the lead with a swap. Once the staircase stands, the gaussian elimination method finishes with back-substitution - the reward step. The bottom row is a one-variable equation, so read zz, carry it up for yy, carry both up for xx, and the gaussian elimination method is done.

Worked Example 1 - the Gaussian Elimination Method on a 2x2 System

Solve: 3x+2y=123x + 2y = 12 and x−4y=−10x - 4y = -10.

Answer: x=2x = 2, y=3y = 3, so (x,y)=(2,3)(x, y) = (2, 3). The gaussian elimination method gets there in four labeled moves.

Steps. The gaussian elimination method starts by packing the system into an augmented matrix. The top row's leading entry is 33, but row 2 starts with 11 - so swap rows, a free move, instead of dividing:

[32121−4−10]  →  R1↔R2    [1−4−103212]\left[\begin{array}{cc|c}3 & 2 & 12 \\ 1 & -4 & -10\end{array}\right]\;\xrightarrow{\;R_1 \leftrightarrow R_2\;}\;\left[\begin{array}{cc|c}1 & -4 & -10 \\ 3 & 2 & 12\end{array}\right]

Next, clear the 33 below the leading 11 by replacing row 2 with R2+(−3)R1R_2 + (-3)R_1 - row 1 is used and untouched:

[1−4−103212]  →  R2+(−3)R1    [1−4−1001442]\left[\begin{array}{cc|c}1 & -4 & -10 \\ 3 & 2 & 12\end{array}\right]\;\xrightarrow{\;R_2 + (-3)R_1\;}\;\left[\begin{array}{cc|c}1 & -4 & -10 \\ 0 & 14 & 42\end{array}\right]

Scale row 2 by 114\tfrac{1}{14} and the gaussian elimination method has built its staircase:

[1−4−1001442]  →  114R2    [1−4−10013]\left[\begin{array}{cc|c}1 & -4 & -10 \\ 0 & 14 & 42\end{array}\right]\;\xrightarrow{\;\frac{1}{14}R_2\;}\;\left[\begin{array}{cc|c}1 & -4 & -10 \\ 0 & 1 & 3\end{array}\right]

Now back-substitute, the step where the gaussian elimination method collects: the bottom row says y=3y = 3. Carry it upstairs: x−4(3)=−10x - 4(3) = -10 gives x=2x = 2. Check both originals: 3(2)+2(3)=123(2) + 2(3) = 12 and 2−4(3)=−102 - 4(3) = -10. Notice the budget: the gaussian elimination method spent one swap, one replacement, and one scaling - all three legal row operations inside a three-line problem. Ordinary elimination would have demanded matched multipliers; the gaussian elimination method simply tidies the matrix, one labeled move at a time.

Worked Example 2 - a 3x3 System, Every Row Operation Labeled

Solve: 3x+4y+5z=263x + 4y + 5z = 26, then x+2y+z=8x + 2y + z = 8, then 2x+2y−z=32x + 2y - z = 3.

Answer: (x,y,z)=(1,2,3)(x, y, z) = (1, 2, 3).

Steps. Write the augmented matrix first - the gaussian elimination method always opens with one - and label every move as the gaussian elimination method works column by column:

[34526121822−13]\left[\begin{array}{ccc|c}3 & 4 & 5 & 26 \\ 1 & 2 & 1 & 8 \\ 2 & 2 & -1 & 3\end{array}\right]

(a) Swap. Row 2 already starts with 11, so the gaussian elimination method trades rows 1 and 2 first. It prefers a free swap to a fraction-heavy division.

[34526121822−13]  →  R1↔R2    [12183452622−13]\left[\begin{array}{ccc|c}3 & 4 & 5 & 26 \\ 1 & 2 & 1 & 8 \\ 2 & 2 & -1 & 3\end{array}\right]\;\xrightarrow{\;R_1 \leftrightarrow R_2\;}\;\left[\begin{array}{ccc|c}1 & 2 & 1 & 8 \\ 3 & 4 & 5 & 26 \\ 2 & 2 & -1 & 3\end{array}\right]

(b) Replace, twice. Here the gaussian elimination method clears the whole first column in two moves. Row 2: R2+(−3)R1R_2 + (-3)R_1 gives (0,−2,2 ∣ 2)(0, -2, 2 \,|\, 2). Row 3: R3+(−2)R1R_3 + (-2)R_1 gives (0,−2,−3 ∣ −13)(0, -2, -3 \,|\, -13). Row 1 was used twice and changed neither time - the gaussian elimination method keeps that promise every single move.

[12183452622−13]  →  [12180−22222−13]  →  [12180−2220−2−3−13]\left[\begin{array}{ccc|c}1 & 2 & 1 & 8 \\ 3 & 4 & 5 & 26 \\ 2 & 2 & -1 & 3\end{array}\right]\;\rightarrow\;\left[\begin{array}{ccc|c}1 & 2 & 1 & 8 \\ 0 & -2 & 2 & 2 \\ 2 & 2 & -1 & 3\end{array}\right]\;\rightarrow\;\left[\begin{array}{ccc|c}1 & 2 & 1 & 8 \\ 0 & -2 & 2 & 2 \\ 0 & -2 & -3 & -13\end{array}\right]

(c) Replace. The gaussian elimination method now works the second column, and one replacement does it: R3−R2R_3 - R_2 gives the bottom row (0,0,−5 ∣ −15)(0, 0, -5 \,|\, -15).

(d) Scale. Multiply row 3 by −15-\tfrac{1}{5}. The row becomes (0,0,1 ∣ 3)(0, 0, 1 \,|\, 3), and the matrix reaches row-echelon form - the staircase this whole process was marching toward:

[12180−2220013]\left[\begin{array}{ccc|c}1 & 2 & 1 & 8 \\ 0 & -2 & 2 & 2 \\ 0 & 0 & 1 & 3\end{array}\right]

(e) Back-substitute. With the staircase standing, the gaussian elimination method collects: bottom row, z=3z = 3. Middle row: −2y+2(3)=2-2y + 2(3) = 2, so y=2y = 2. Top row: x+2(2)+3=8x + 2(2) + 3 = 8, so x=1x = 1. Check in the equation the gaussian elimination method never touched first: 3(1)+4(2)+5(3)=263(1) + 4(2) + 5(3) = 26. A swap, three replacements, one scaling - and every move was one of the three legal types, which is why a gaussian elimination solution can be audited line by line.

When the Gaussian Elimination Method Reports No Solution or Infinitely Many

What if the staircase never completes? The gaussian elimination method still finishes - it just reports honestly. Suppose the gaussian elimination method sweeps a column and produces the row (0,0 ∣ 5)(0, 0 \,|\, 5). In equation language that says 0=50 = 5, which is impossible: the system has no solution, and the gaussian elimination method has proven it rather than guessed. Now suppose the bottom row comes out as all zeros, like (0,0 ∣ 0)(0, 0 \,|\, 0). That row says 0=00 = 0 - true, but it carries no information, because two of the original equations were saying the same thing. The system has infinitely many solutions, and the rows the gaussian elimination method left standing describe them with a free variable. Both verdicts are ordinary outcomes: run the gaussian elimination method exactly as always, and read the verdict off the bottom of the staircase. The gaussian elimination method needs no special procedure: it simply reports what the staircase says.

Gaussian vs. Gauss-Jordan: How Far Do You Push?

Stop at row-echelon form and back-substitute: that is the gaussian elimination method in its plain form. Keep going. Clear the entries above each leading 11 as well, until the left block is the identity matrix. You have then reached reduced row-echelon form, where the answer sits in the last column with no back-substitution at all. The gaussian elimination method stops at the staircase; the fuller sweep is Gauss-Jordan elimination, named for Wilhelm Jordan and not for the river.

Many students prefer a gauss jordan elimination calculator route because the extra moves are mechanical. The gaussian elimination method stops one stage earlier and thinks instead. Both finishes land on the same answer, and no teacher should dock points for the tidier one. The gaussian elimination method is simply the shorter member of the same family.

The row operations are identical in the gaussian elimination method and Gauss-Jordan. That is why this site's gaussian elimination calculator doubles as a gauss jordan elimination calculator. It shows the matrix after every row operation, so you can stop the sweep at either depth. Comparing your scratch work against it is also the fastest way to catch the classic disaster - one wrong entry early on, silently poisoning every row computed afterwards.

Problem 1

A parking lot charges \3percarandper car and$2permotorcycle.Yesterdayitcollectedper motorcycle. Yesterday it collected$26fromfrom11$ vehicles in total. Write the system, run the gaussian elimination method on its augmented matrix, and find how many cars and how many motorcycles used the lot.

⏱ 00:00
Page 1
Problem 2

A jar holds 77 coins - only nickels, dimes, and quarters - worth \0.65intotal,andthereisonemoredimethanquarters.Letin total, and there is one more dime than quarters. Letn,, d,, qbethecountsofnickels,dimes,andquarters,sobe the counts of nickels, dimes, and quarters, son + d + q = 7,, 5n + 10d + 25q = 65(incents),and(in cents), andd - q = 1$. Use the gaussian elimination method on the augmented matrix to find how many of each coin are in the jar.

⏱ 00:00
Page 1

Common Mistakes in the Gaussian Elimination Method

1. Scaling one entry instead of the whole row. Turning (3,2 ∣ 12)(3, 2 \,|\, 12) into (1,2 ∣ 12)(1, 2 \,|\, 12) divides only the first number and destroys the equation. Every row operation the gaussian elimination method allows touches every entry of the row - bar and constants included.

2. Swapping across columns. Rows may trade places freely; columns may not. The gaussian elimination method never performs column operations. Interchange entries across the xx- and yy-columns and you have silently renamed your variables, so the gaussian elimination method now solves a different problem to the very end.

3. Editing the row you only meant to use. In R2+3R1R_2 + 3R_1, row 1 is scratch work, not a target. After the move, row 1 must appear unchanged in the new matrix. Copy the untouched rows first, then overwrite only the target row - the whole discipline of the gaussian elimination method rests on that habit.

4. Dropping a carried value during back-substitution. From the bottom up, each row receives all values found below it. In a 3×33 \times 3 the middle row needs zz before it can give up yy, and the top row needs both before it gives up xx. Write the carried numbers down - the gaussian elimination method moves fast, and memory is not a ledger. Slow arithmetic is forgivable; a lost value is not.

Frequently asked questions

1

What is the gaussian elimination method, in one sentence?

The gaussian elimination method solves a system of linear equations in three moves. Write the system as an augmented matrix, use row operations to reach row-echelon form, then back-substitute from the bottom row upward.

2

Is there a gaussian elimination method solver that shows every step?

Yes. The gaussian elimination method solver on this site ([gaussian elimination calculator](/calculators/gaussian-elimination-calculator)) runs the row operations on your augmented matrix. It shows the matrix after each step, so you can check your scratch work against a clean copy at every stage.

3

How is a Gauss-Jordan elimination calculator different from plain Gaussian elimination?

A gauss jordan elimination calculator keeps working after row-echelon form. It clears the entries above each leading $1$ too, reaching reduced row-echelon form - the answers then sit in the last column with no back-substitution. Plain gaussian elimination stops earlier and back-substitutes instead. Both routes reach the same solution, whichever depth of the gaussian elimination method you choose.

4

Why is it called Gaussian elimination?

It is named for Carl Friedrich Gauss, though the underlying idea is much older and appears in ancient Chinese mathematics. The *echelon* half of the name describes the staircase shape the matrix reaches - like a marching formation with each row shorter than the one in front. Textbooks usually say gaussian elimination method for the full row-operation procedure, and echelon form for its destination.

5

Can the gaussian elimination method fail or give no solution?

The gaussian elimination method never fails to run, and its row-echelon form tells you honestly what kind of answer exists. A row like $(0, 0 \,|\, 5)$ means no solution. A row of all zeros means infinitely many, because two equations were saying the same thing. Either way the gaussian elimination method hands you a verdict instead of a fake answer.

Related practice