Linear Algebra/Gauss' Method
From Wikibooks, the open-content textbooks collection
- Definition 1.1
A linear equation in variables
has the form
where the numbers
are the equation's coefficients and
is the constant. An n-tuple
is a solution of, or satisfies, that equation if substituting the numbers s1, ..., sn for the variables gives a true statement:
.
A system of linear equations
has the solution
if that n-tuple is a solution of all of the equations in the system.
- Example 1.2
The ordered pair ( − 1,5) is a solution of this system.
In contrast, (5, − 1) is not a solution.
Finding the set of all solutions is solving the system. No guesswork or good fortune is needed to solve a linear system. There is an algorithm that always works. The next example introduces that algorithm, called Gauss' method. It transforms the system, step by step, into one with a form that is easily solved.
- Example 1.3
To solve this system
we repeatedly transform it until it is in a form that is easy to solve.
The third step is the only nontrivial one. We've mentally multiplied both sides of the first row by − 1, mentally added that to the old second row, and written the result in as the new second row.
Now we can find the value of each variable. The bottom equation shows that x3 = 3. Substituting 3 for x3 in the middle equation shows that x2 = 1. Substituting those two into the top equation gives that x1 = 3 and so the system has a unique solution: the solution set is
.
Most of this subsection and the next one consists of examples of solving linear systems by Gauss' method. We will use it throughout this book. It is fast and easy. But, before we get to those examples, we will first show that this method is also safe in that it never loses solutions or picks up extraneous solutions.
- Theorem 1.4 (Gauss' method)
If a linear system is changed to another by one of these operations
- an equation is swapped with another
- an equation has both sides multiplied by a nonzero constant
- an equation is replaced by the sum of itself and a multiple of another
then the two systems have the same set of solutions.
Each of those three operations has a restriction. Multiplying a row by 0 is not allowed because obviously that can change the solution set of the system. Similarly, adding a multiple of a row to itself is not allowed because adding − 1 times the row to itself has the effect of multiplying the row by 0. Finally, swapping a row with itself is disallowed to make some results in the fourth chapter easier to state and remember (and besides, self-swapping doesn't accomplish anything).
- Proof
We will cover the equation swap operation here and save the other two cases for Problem 14.
Consider this swap of row i with row j.
} The n-tuple
satisfies the system before the swap if and only if substituting the values, the s's, for the variables, the x's, gives true statements:
and ...
and ...
and ...
.
In a requirement consisting of statements and-ed together we can rearrange the order of the statements, so that this requirement is met if and only if
and ...
and ...
and ...
. This is exactly the requirement that
solves the system after the row swap.
- Definition 1.5
The three operations from Theorem 1.4 are the elementary reduction operations, or row operations, or Gaussian operations. They are swapping, multiplying by a scalar or rescaling, and pivoting.
When writing out the calculations, we will abbreviate "row i" by "ρi". For instance, we will denote a pivot operation by kρi + ρj, with the row that is changed written second. We will also, to save writing, often list pivot steps together when they use the same ρi.
- Example 1.6
A typical use of Gauss' method is to solve this system.
The first transformation of the system involves using the first row to eliminate the x in the second row and the x in the third. To get rid of the second row's 2x, we multiply the entire first row by - 2, add that to the second row, and write the result in as the new second row. To get rid of the third row's x, we multiply the first row by − 1, add that to the third row, and write the result in as the new third row.
(Note that the two ρ1 steps − 2ρ1 + ρ2 and − ρ1 + ρ3 are written as one operation.) In this second system, the last two equations involve only two unknowns. To finish we transform the second system into a third system, where the last equation involves only one unknown. This transformation uses the second row to eliminate y from the third row.
Now we are set up for the solution. The third row shows that z = 0. Substitute that back into the second row to get y = − 1, and then substitute back into the first row to get x = 1.
- Example 1.7
For the Physics problem from the start of this chapter, Gauss' method gives this.
So c = 4, and back-substitution gives that h = 1. (The Chemistry problem is solved later.)
- Example 1.8
The reduction
shows that z = 3, y = − 1, and x = 7.
As these examples illustrate, Gauss' method uses the elementary reduction operations to set up back-substitution.
- Definition 1.9
In each row, the first variable with a nonzero coefficient is the row's leading variable. A system is in echelon form if each leading variable is to the right of the leading variable in the row above it (except for the leading variable in the first row).
- Example 1.10
The only operation needed in the examples above is pivoting. Here is a linear system that requires the operation of swapping equations. After the first pivot
the second equation has no leading y. To get one, we look lower down in the system for a row that has a leading y and swap it in.
(Had there been more than one row below the second with a leading y then we could have swapped in any one.) The rest of Gauss' method goes as before.
Back-substitution gives w = 1, z = 2 , y = − 1, and x = − 1.
Strictly speaking, the operation of rescaling rows is not needed to solve linear systems. We have included it because we will use it later in this chapter as part of a variation on Gauss' method, the Gauss-Jordan method.
All of the systems seen so far have the same number of equations as unknowns. All of them have a solution, and for all of them there is only one solution. We finish this subsection by seeing for contrast some other things that can happen.
- Example 1.11
Linear systems need not have the same number of equations as unknowns. This system
has more equations than variables. Gauss' method helps us understand this system also, since this
shows that one of the equations is redundant. Echelon form
gives y = 1 and x = − 2. The "0 = 0" is derived from the redundancy.
That example's system has more equations than variables. Gauss' method is also useful on systems with more variables than equations. Many examples are in the next subsection.
Another way that linear systems can differ from the examples shown earlier is that some linear systems do not have a unique solution. This can happen in two ways.
The first is that it can fail to have any solution at all.
- Example 1.12
Contrast the system in the last example with this one.
Here the system is inconsistent: no pair of numbers satisfies all of the equations simultaneously. Echelon form makes this inconsistency obvious.
The solution set is empty.
- Example 1.13
The prior system has more equations than unknowns, but that is not what causes the inconsistency— Example 1.11 has more equations than unknowns and yet is consistent. Nor is having more equations than unknowns necessary for inconsistency, as is illustrated by this inconsistent system with the same number of equations as unknowns.
The other way that a linear system can fail to have a unique solution is to have many solutions.
- Example 1.14
In this system
any pair of numbers satisfying the first equation automatically satisfies the second. The solution set
is infinite; some of its members are (0,4), ( − 1,5), and (2.5,1.5). The result of applying Gauss' method here contrasts with the prior example because we do not get a contradictory equation.
Don't be fooled by the "0 = 0" equation in that example. It is not the signal that a system has many solutions.
- Example 1.15
The absence of a "0 = 0" does not keep a system from having many different solutions. This system is in echelon form
has no "0 = 0", and yet has infinitely many solutions. (For instance, each of these is a solution: (0,1, − 1), (0,1 / 2, − 1 / 2), (0,0,0), and (0, − π,π). There are infinitely many solutions because any triple whose first component is 0 and whose second component is the negative of the third is a solution.)
Nor does the presence of a "0 = 0" mean that the system must have many solutions. Example 1.11 shows that. So does this system, which does not have many solutions— in fact it has none— despite that when it is brought to echelon form it has a "0 = 0" row.
We will finish this subsection with a summary of what we've seen so far about Gauss' method.
Gauss' method uses the three row operations to set a system up for back substitution. If any step shows a contradictory equation then we can stop with the conclusion that the system has no solutions. If we reach echelon form without a contradictory equation, and each variable is a leading variable in its row, then the system has a unique solution and we find it by back substitution. Finally, if we reach echelon form without a contradictory equation, and there is not a unique solution (at least one variable is not a leading variable) then the system has many solutions.
The next subsection deals with the third case— we will see how to describe the solution set of a system with many solutions.
[edit] Exercises
- This exercise is recommended for all readers.
- Problem 1
Use Gauss' method to find the unique solution for each system.
- Answer
Gauss' method can be performed in different ways, so these simply exhibit one possible way to get the answer.
- Gauss' method
- Gauss' method here
- This exercise is recommended for all readers.
- Problem 2
Use Gauss' method to solve each system or conclude "many solutions" or "no solutions".
- Answer
- Gaussian reduction
- Gauss' method
- Row reduction
- Row reduction
- Gauss' method
- Here Gauss' method gives
- This exercise is recommended for all readers.
- Problem 3
There are methods for solving linear systems other than Gauss' method. One often taught in high school is to solve one of the equations for a variable, then substitute the resulting expression into other equations. That step is repeated until there is an equation with only one variable. From that, the first number in the solution is derived, and then back-substitution can be done. This method takes longer than Gauss' method, since it involves more arithmetic operations, and is also more likely to lead to errors. To illustrate how it can lead to wrong conclusions, we will use the system
from Example 1.12.
- Solve the first equation for x and substitute that expression into the second equation. Find the resulting y.
- Again solve the first equation for x, but this time substitute that expression into the third equation. Find this y.
What extra step must a user of this method take to avoid erroneously concluding a system has a solution?
- Answer
- From x = 1 − 3y we get that 2(1 − 3y) + y = − 3, giving y = 1.
- From x = 1 − 3y we get that 2(1 − 3y) + 2y = 0, leading to the conclusion that y = 1 / 2.
Users of this method must check any potential solutions by substituting back into all the equations.
- This exercise is recommended for all readers.
- Problem 4
For which values of k are there no solutions, many solutions, or a unique solution to this system?
- Answer
Do the reduction
to conclude this system has no solutions if
and if k = 3 then it has infinitely many solutions. It never has a unique solution.
- This exercise is recommended for all readers.
- Problem 5
This system is not linear, in some sense,
and yet we can nonetheless apply Gauss' method. Do so. Does the system have a solution?
- Answer
Let x = sinα, y = cosβ, and z = tanγ:
gives z = 0, y = 1, and x = 2. Note that no α satisfies that requirement.
- This exercise is recommended for all readers.
- Problem 6
What conditions must the constants, the b's, satisfy so that each of these systems has a solution? Hint. Apply Gauss' method and see what happens to the right side (Anton 1987).
- Answer
- Gauss' method
- Reduction
- Problem 7
True or false: a system with more unknowns than equations has at least one solution. (As always, to say "true" you must prove it, while to say "false" you must produce a counterexample.)
- Answer
This system with more unknowns than equations
has no solution.
- Problem 8
Must any Chemistry problem like the one that starts this subsection— a balance the reaction problem— have infinitely many solutions?
- Answer
Yes. For example, the fact that the same reaction can be performed in two different flasks shows that twice any solution is another, different, solution (if a physical reaction occurs then there must be at least one nonzero solution).
- This exercise is recommended for all readers.
- Problem 9
Find the coefficients a, b, and c so that the graph of f(x) = ax2 + bx + c passes through the points (1,2), ( − 1,6), and (2,3).
- Answer
Because f(1) = 2, f( − 1) = 6, and f(2) = 3 we get a linear system.
Gauss' method
shows that the solution is f(x) = 1x2 − 2x + 3.
- Problem 10
Gauss' method works by combining the equations in a system to make new equations.
- Can the equation 3x − 2y = 5 be derived, by a sequence of Gaussian reduction steps, from the equations in this system?
- Can the equation 5x − 3y = 2 be derived, by a sequence of Gaussian reduction steps, from the equations in this system?
- Can the equation 6x − 9y + 5z = − 2 be derived, by a sequence of Gaussian reduction steps, from the equations in the system?
- Answer
- Yes, by inspection the given equation results from − ρ1 + ρ2.
- No. The given equation is satisfied by the pair (1,1). However, that pair does not satisfy the first equation in the system.
- Yes. To see if the given row is c1ρ1 + c2ρ2, solve the system of equations relating the coefficients of x, y, z, and the constants:
- Problem 11
Prove that, where
are real numbers and
, if
- ax + by = c
has the same solution set as
- ax + dy = e
then they are the same equation. What if a = 0?
- Answer
If
then the solution set of the first equation is
. Taking y = 0 gives the solution (c / a,0), and since the second equation is supposed to have the same solution set, substituting into it gives that
, so c = e. Then taking y = 1 in x = (c − by) / a gives that
, which gives that b = d. Hence they are the same equation.
When a = 0 the equations can be different and still have the same solution set: e.g., 0x + 3y = 6 and 0x + 6y = 12.
- This exercise is recommended for all readers.
- Problem 12
Show that if
then
has a unique solution.
- Answer
We take three cases: that
, that a = 0 and
, and that both a = 0 and c = 0.
For the first, we assume that
. Then the reduction
shows that this system has a unique solution if and only if
; remember that
so that back substitution yields a unique x (observe, by the way, that j and k play no role in the conclusion that there is a unique solution, although if there is a unique solution then they contribute to its value). But − (cb / a) + d = (ad − bc) / a and a fraction is not equal to 0 if and only if its numerator is not equal to 0. Thus, in this first case, there is a unique solution if and only if
.
In the second case, if a = 0 but
, then we swap
to conclude that the system has a unique solution if and only if
(we use the case assumption that
to get a unique x in back substitution). But— where a = 0 and
— the condition "
" is equivalent to the condition "
". That finishes the second case.
Finally, for the third case, if both a and c are 0 then the system
might have no solutions (if the second equation is not a multiple of the first) or it might have infinitely many solutions (if the second equation is a multiple of the first then for each y satisfying both equations, any pair (x,y) will do), but it never has a unique solution. Note that a = 0 and c = 0 gives that ad − bc = 0.
- This exercise is recommended for all readers.
- Problem 13
In the system
each of the equations describes a line in the xy-plane. By geometrical reasoning, show that there are three possibilities: there is a unique solution, there is no solution, and there are infinitely many solutions.
- Answer
Recall that if a pair of lines share two distinct points then they are the same line. That's because two points determine a line, so these two points determine each of the two lines, and so they are the same line.
Thus the lines can share one point (giving a unique solution), share no points (giving no solutions), or share at least two points (which makes them the same line).
- Problem 14
Finish the proof of Theorem 1.4.
- Answer
For the reduction operation of multiplying ρi by a nonzero real number k, we have that
satisfies this system
if and only if
by the definition of "satisfies". But, because
, that's true if and only if
(this is straightforward cancelling on both sides of the i-th equation), which says that
solves
as required.
For the pivot operation kρi + ρj, we have that
satisfies
if and only if
again by the definition of "satisfies". Subtract k times the i-th equation from the j-th equation (remark: here is where
is needed; if i = j then the two di's above are not equal) to get that the previous compound statement holds if and only if
which, after cancellation, says that
solves
as required.
- Problem 15
Is there a two-unknowns linear system whose solution set is all of
?
- Answer
Yes, this one-equation system:
- 0x + 0y = 0
is satisfied by every
.
- This exercise is recommended for all readers.
- Problem 16
Are any of the operations used in Gauss' method redundant? That is, can any of the operations be synthesized from the others?
- Answer
Yes. This sequence of operations swaps rows i and j
so the row-swap operation is redundant in the presence of the other two.
- Problem 17
Prove that each operation of Gauss' method is reversible. That is, show that if two systems are related by a row operation
then there is a row operation to go back
.
- Answer
Swapping rows is reversed by swapping back.
Multiplying both sides of a row by
is reversed by dividing by k.
Adding k times a row to another is reversed by adding − k times that row.
Remark: observe for the third case that if we were to allow i = j then the result wouldn't hold.
- ? Problem 18
A box holding pennies, nickels and dimes contains thirteen coins with a total value of 83 cents. How many coins of each type are in the box? (Anton 1987)
- Answer
Let p, n, and d be the number of pennies, nickels, and dimes. For variables that are real numbers, this system
has infinitely many solutions. However, it has a limited number of solutions in which p, n, and d are non-negative integers. Running through d = 0, ..., d = 8 shows that (p,n,d) = (3,4,6) is the only sensible solution.
- ? Problem 19
Four positive integers are given. Select any three of the integers, find their arithmetic average, and add this result to the fourth integer. Thus the numbers 29, 23, 21, and 17 are obtained. One of the original integers is:
- 19
- 21
- 23
- 29
- 17
(Salkind 1975, 1955 problem 38)
- Answer
Solving the system
we obtain a = 12, b = 9, c = 3, d = 21. Thus the second item, 21, is the correct answer.
- This exercise is recommended for all readers.
- ? Problem 20
Laugh at this: AHAHA + TEHE = TEHAW. It resulted from substituting a code letter for each digit of a simple example in addition, and it is required to identify the letters and prove the solution unique (Ransom & Gupta 1935).
- Answer
This is how the answer was given in the cited source.
A comparison of the units and hundreds columns of this addition shows that there must be a carry from the tens column. The tens column then tells us that A < H, so there can be no carry from the units or hundreds columns. The five columns then give the following five equations.
The five linear equations in five unknowns, if solved simultaneously, produce the unique solution: A = 4, T = 5, H = 7, W = 6 and E = 2, so that the original example in addition was 47474 + 5272 = 52746.
- ? Problem 21
The Wohascum County Board of Commissioners, which has 20 members, recently had to elect a President. There were three candidates (A, B, and C); on each ballot the three candidates were to be listed in order of preference, with no abstentions. It was found that 11 members, a majority, preferred A over B (thus the other 9 preferred B over A). Similarly, it was found that 12 members preferred C over A. Given these results, it was suggested that B should withdraw, to enable a runoff election between A and C. However, B protested, and it was then found that 14 members preferred B over C! The Board has not yet recovered from the resulting confusion. Given that every possible order of A, B, C appeared on at least one ballot, how many members voted for B as their first choice (Gilbert, Krusemeyer & Larson 1993, Problem number 2)?
- Answer
This is how the answer was given in the cited source.
Eight commissioners voted for B. To see this, we will use the given information to study how many voters chose each order of A, B, C.
The six orders of preference are ABC, ACB, BAC, BCA, CAB, CBA; assume they receive a, b, c, d, e, f votes respectively. We know that
from the number preferring A over B, the number preferring C over A, and the number preferring B over C. Because 20 votes were cast, we also know that
from the preferences for B over A, for A over C, and for C over B.
The solution is a = 6, b = 1, c = 1, d = 7, e = 4, and f = 1. The number of commissioners voting for B as their first choice is therefore c + d = 1 + 7 = 8.
Comments. The answer to this question would have been the same had we known only that at least 14 commissioners preferred B over C.
The seemingly paradoxical nature of the commissioners's preferences (A is preferred to B, and B is preferred to C, and C is preferred to A), an example of "non-transitive dominance", is not uncommon when individual choices are pooled.
- ? Problem 22
"This system of n linear equations with n unknowns," said the Great Mathematician, "has a curious property."
"Good heavens!" said the Poor Nut, "What is it?"
"Note," said the Great Mathematician, "that the constants are in arithmetic progression."
"It's all so clear when you explain it!" said the Poor Nut. "Do you mean like 6x + 9y = 12 and 15x + 18y = 21?"
"Quite so," said the Great Mathematician, pulling out his bassoon. "Indeed, the system has a unique solution. Can you find it?"
"Good heavens!" cried the Poor Nut, "I am baffled."
Are you? (Dudley, Lebow & Rothman 1963)
- Answer
This is how the answer was given in the cited source.
We have not used "dependent" yet; it means here that Gauss' method shows that there is not a unique solution. If
the system is dependent and the solution is not unique. Hence n < 3. But the term "system" implies n > 1. Hence n = 2. If the equations are
then x = − 1, y = 2.
[edit] References
- Anton, Howard (1987), Elementary Linear Algebra, John Wiley & Sons.
- Dudley, Underwood (proposer); Lebow, Arnold (proposer); Rothman, David (solver) (Jan. 1963), "Elemantary problem 1151", American Mathematical Monthly 70 (1): 93.
- Gilbert, George T.; Krusemeyer, Mark; Larson, Loren C. (1993), The Wohascum County Problem Book, The Mathematical Association of America.
- Ransom, W. R. (proposer); Gupta, Hansraj (solver) (Jan. 1935), "Elementary problem 105", American Mathematical Monthly 42 (1): 47.
- Salkind, Charles T. (1975), Contest Problem Book No 1: Annual High School Mathematics Examinations 1950-1960.




![\begin{array}{rcl}
\quad
&\xrightarrow[]{ \text{swap row 1 with row 3} }
&\begin{array}{*{3}{rc}r}
\frac{1}{3}x_1 &+ &2x_2 & & &= &3 \\
x_1 &+ &5x_2 &- &2x_3 &= &2 \\
& & & &3x_3 &= &9
\end{array} \\
&\xrightarrow[]{ \text{multiply row 1 by 3} }
&\begin{array}{*{3}{rc}r}
x_1 &+ &6x_2 & & &= &9 \\
x_1 &+ &5x_2 &- &2x_3 &= &2 \\
& & & &3x_3 &= &9
\end{array} \\
&\xrightarrow[]{ \text{add }-1\text{ times row 1 to row 2} }
&\begin{array}{*{3}{rc}r}
x_1 &+ &6x_2 & & &= &9 \\
& &-x_2 &- &2x_3 &= &-7 \\
& & & &3x_3 &= &9
\end{array}
\end{array}](http://upload.wikimedia.org/math/5/2/1/521d0e495a898d7d2deb2f043a269d10.png)
![\begin{array}{*{4}{rc}r}
a_{1,1}x_1 &+ &a_{1,2}x_2 &+ &\cdots &&a_{1,n}x_n &= &d_1 \\
& & & & & & &\vdots \\
a_{i,1}x_1 &+ &a_{i,2}x_2 &+ &\cdots &&a_{i,n}x_n &= &d_i \\
& & & & & & &\vdots \\
a_{j,1}x_1 &+ &a_{j,2}x_2 &+ &\cdots &&a_{j,n}x_n &= &d_j \\
& & & & & & &\vdots \\
a_{m,1}x_1 &+ &a_{m,2}x_2 &+ &\cdots &&a_{m,n}x_n &= &d_m
\end{array}
\xrightarrow[]{}
\begin{array}{*{4}{rc}r}
a_{1,1}x_1 &+ &a_{1,2}x_2 &+ &\cdots &&a_{1,n}x_n &= &d_1 \\
& & & & & & &\vdots \\
a_{j,1}x_1 &+ &a_{j,2}x_2 &+ &\cdots &&a_{j,n}x_n &= &d_j \\
& & & & & & &\vdots \\
a_{i,1}x_1 &+ &a_{i,2}x_2 &+ &\cdots &&a_{i,n}x_n &= &d_i \\
& & & & & & &\vdots \\
a_{m,1}x_1 &+ &a_{m,2}x_2 &+ &\cdots &&a_{m,n}x_n &= &d_m
\end{array}](http://upload.wikimedia.org/math/0/4/b/04b1a16475ce10c16279ebe484e3b2c5.png)

![\begin{array}{rcl}
&\xrightarrow[-\rho_1 +\rho_3]{-2\rho_1 +\rho_2}
&\begin{array}{*{3}{rc}r}
x &+ &y & & &= &0 \\
& &-3y&+ &3z &= &3 \\
& &-3y&- &z &= &3
\end{array}
\end{array}](http://upload.wikimedia.org/math/a/3/1/a31c0c2c1f273207f4fd23056f6bfcdb.png)
![\begin{array}{rcl}
&\xrightarrow[]{-\rho_2 +\rho_3}
&\begin{array}{*{3}{rc}r}
x &+ &y & & &= &0 \\
& &-3y&+ &3z &= &3 \\
& & & &-4z&= &0
\end{array}
\end{array}](http://upload.wikimedia.org/math/9/9/f/99fa454ef13d48324f608fef813a1ba5.png)
![\begin{array}{rcl}
\begin{array}{*{2}{rc}r}
40h &+ &15c &= &100 \\
-50h &+ &25c &= &50
\end{array}
&\xrightarrow[]{5/4\rho_1 +\rho_2}
&\begin{array}{*{2}{rc}r}
40h &+ &15c &= &100 \\
& &(175/4)c &= &175
\end{array}
\end{array}](http://upload.wikimedia.org/math/1/0/0/1009dc3c9f4d77f55bf33e8f56cff739.png)
![\begin{array}{rcl}
\begin{array}{*{3}{rc}r}
x &+ &y &+ &z &= &9 \\
2x &+ &4y &- &3z &= &1 \\
3x &+ &6y &- &5z &= &0
\end{array}
&\xrightarrow[-3\rho_1 +\rho_3]{-2\rho_1 +\rho_2}
&\begin{array}{*{3}{rc}r}
x &+ &y &+ &z &= &9 \\
& &2y &- &5z &= &-17\\
& &3y &- &8z&= &-27
\end{array} \\
&\xrightarrow[]{-(3/2)\rho_2+\rho_3}
&\begin{array}{*{3}{rc}r}
x &+ &y &+ &z &= &9 \\
& &2y &- &5z &= &-17\\
& & & &-(1/2)z &= &-(3/2)
\end{array}
\end{array}](http://upload.wikimedia.org/math/2/9/c/29c75c990adafe3d15d3169fb61d053c.png)
![\begin{array}{rcl}
\begin{array}{*{4}{rc}r}
x &- &y & & & & &= &0 \\
2x &- &2y &+ &z &+ &2w &= &4 \\
& &y & & &+ &w &= &0 \\
& & & &2z &+ &w &= &5
\end{array}
&\xrightarrow[]{-2\rho_1 +\rho_2}
&\begin{array}{*{4}{rc}r}
x &- &y & & & & &= &0 \\
& & & &z &+ &2w &= &4 \\
& &y & & &+ &w &= &0 \\
& & & &2z &+ &w &= &5
\end{array}
\end{array}](http://upload.wikimedia.org/math/6/6/a/66a2aae56b5e1b67ce36b010340af0bb.png)
![\begin{array}{rcl}
&\xrightarrow[]{\rho_2 \leftrightarrow\rho_3}
&\begin{array}{*{4}{rc}r}
x &- &y & & & & &= &0 \\
& &y & & &+ &w &= &0 \\
& & & &z &+ &2w &= &4 \\
& & & &2z &+ &w &= &5
\end{array}
\end{array}](http://upload.wikimedia.org/math/b/d/8/bd878da8e85ccf21d59dfc6d1268a73b.png)
![\begin{array}{rcl}
&\xrightarrow[]{-2\rho_3 +\rho_4}
&\begin{array}{*{4}{rc}r}
x &- &y & & & & &= &0 \\
& &y & & &+ &w &= &0 \\
& & & &z &+ &2w &= &4 \\
& & & & & &-3w&= &-3
\end{array}
\end{array}](http://upload.wikimedia.org/math/b/e/5/be5580845d17dfb0265ca0b8d93c0e46.png)

![\begin{array}{rcl}
&\xrightarrow[-2\rho_1 +\rho_3]{-2\rho_1 +\rho_2}
&\begin{array}{*{2}{rc}r}
x &+ &3y &= &1 \\
& &-5y &= &-5 \\
& &-4y &= &-4
\end{array}
\end{array}](http://upload.wikimedia.org/math/d/8/4/d84f971271e74e63d4c32b2e3ccd93cc.png)
![\begin{array}{rcl}
&\xrightarrow[]{-(4/5)\rho_2 +\rho_3}
&\begin{array}{*{2}{rc}r}
x &+ &3y &= &1 \\
& &-5y &= &-5 \\
& &0 &= &0
\end{array}
\end{array}](http://upload.wikimedia.org/math/f/5/a/f5a55036dfdb033218e696c843fbe4b0.png)
![\begin{array}{rcl}
\begin{array}{*{2}{rc}r}
x &+ &3y &= &1 \\
2x &+ &y &= &-3 \\
2x &+ &2y &= &0
\end{array}
&\xrightarrow[-2\rho_1 +\rho_3]{-2\rho_1 +\rho_2}
&\begin{array}{*{2}{rc}r}
x &+ &3y &= &1 \\
& &-5y &= &-5 \\
& &-4y &= &-2
\end{array}
\end{array}](http://upload.wikimedia.org/math/d/a/6/da6b80b50df453da5a6b12283717b247.png)
![\begin{array}{rcl}
&\xrightarrow[]{-(4/5)\rho_2 +\rho_3}
&\begin{array}{*{2}{rc}r}
x &+ &3y &= &1 \\
& &-5y &= &-5 \\
& &0 &= &2
\end{array}
\end{array}](http://upload.wikimedia.org/math/b/1/4/b148073afbb53516e0b3161edb6231d7.png)
![\begin{array}{rcl}
\begin{array}{*{2}{rc}r}
x &+ &2y &= &8 \\
2x &+ &4y &= &8
\end{array}
&\xrightarrow[]{-2\rho_1 + \rho_2}
&\begin{array}{*{2}{rc}r}
x &+ &2y &= &8 \\
& &0 &= &-8
\end{array}
\end{array}](http://upload.wikimedia.org/math/8/3/7/837c1a45172b3c8ed256e2c72f499e5b.png)

![\begin{array}{rcl}
&\xrightarrow[]{-2\rho_1 + \rho_2}
&\begin{array}{*{2}{rc}r}
x &+ &y &= &4 \\
& &0 &= &0
\end{array}
\end{array}](http://upload.wikimedia.org/math/a/4/6/a46844c93da03a6c7b7d50d38f92be33.png)

![\begin{array}{rcl}
\begin{array}{*{3}{rc}r}
2x & & &- &2z &= &6 \\
& &y &+ &z &= &1 \\
2x &+ &y &- &z &= &7 \\
& &3y &+ &3z &= &0
\end{array}
&\xrightarrow[]{-\rho_1 +\rho_3}
&\begin{array}{*{3}{rc}r}
2x & & &- &2z &= &6 \\
& &y &+ &z &= &1 \\
& &y &+ &z &= &1 \\
& &3y &+ &3z &= &0
\end{array} \\
&\xrightarrow[-3\rho_2 +\rho_4]{-\rho_2 +\rho_3}
&\begin{array}{*{3}{rc}r}
2x & & &- &2z &= &6 \\
& &y &+ &z &= &1 \\
& & & &0 &= &0 \\
& & & &0 &= &-3
\end{array}
\end{array}](http://upload.wikimedia.org/math/f/8/d/f8d63610623e4651bf1d9260f333b164.png)


![\xrightarrow[]{-(1/2)\rho_1+\rho_2}\;
\begin{array}{*{2}{rc}r}
2x &+ &3y &= &13 \\
&- &(5/2)y &= &-15/2
\end{array}](http://upload.wikimedia.org/math/c/4/f/c4f18557f96f4ae61f16e9076fcf077e.png)
![\xrightarrow[\rho_1+\rho_3]{-3\rho_1+\rho_2}\;
\begin{array}{*{3}{rc}r}
x & & &- &z &= &0 \\
& &y &+ &3z &= &1 \\
& &y & & &= &4
\end{array}
\;\xrightarrow[]{-\rho_2+\rho_3}\;
\begin{array}{*{3}{rc}r}
x & & &- &z &= &0 \\
& &y &+ &3z &= &1 \\
& & & &-3z &= &3
\end{array}](http://upload.wikimedia.org/math/3/7/a/37a48701dce4d862b2672d17d5c5161a.png)






![\begin{array}{rcl}
&\xrightarrow[]{-(1/2)\rho_1+\rho_2}
&\begin{array}{*{2}{rc}r}
2x &+ &2y &= &5 \\
& &-5y &= &-5/2
\end{array}
\end{array}](http://upload.wikimedia.org/math/1/1/b/11b56b63f6faa0c700f32427007c0a04.png)
![\begin{array}{rcl}
&\xrightarrow[]{\rho_1+\rho_2}
&\begin{array}{*{2}{rc}r}
-x &+ &y &= &1 \\
& &2y &= &3
\end{array}
\end{array}](http://upload.wikimedia.org/math/8/6/e/86eb0163a58cdf9e29025c21e33e85ee.png)
![\begin{array}{rcl}
&\xrightarrow[]{-\rho_1+\rho_2}
&\begin{array}{*{3}{rc}r}
x &- &3y &+ &z &= &1 \\
& &4y &+ &z &= &13
\end{array}
\end{array}](http://upload.wikimedia.org/math/7/6/f/76f64a0ccd16194e5b55b631f1d1e4ef.png)
![\begin{array}{rcl}
&\xrightarrow[]{-3\rho_1+\rho_2}
&\begin{array}{*{2}{rc}r}
-x &- &y &= &1 \\
& &0 &= &-1
\end{array}
\end{array}](http://upload.wikimedia.org/math/b/c/4/bc4448fc368a78b72cdd62e70e953189.png)
![\xrightarrow[]{\rho_1\leftrightarrow\rho_4}\;
\begin{array}{*{3}{rc}r}
x &+ &y &- &z &= &10 \\
2x &- &2y &+ &z &= &0 \\
x & & &+ &z &= &5 \\
& &4y &+ &z &= &20
\end{array}
\;\xrightarrow[-\rho_1+\rho_3]{-2\rho_1+\rho_2}\;
\begin{array}{*{3}{rc}r}
x &+ &y &- &z &= &10 \\
& &-4y &+ &3z &= &-20\\
& &-y &+ &2z &= &-5 \\
& &4y &+ &z &= &20
\end{array}
\;\xrightarrow[\rho_2+\rho_4]{-(1/4)\rho_2+\rho_3}\;
\begin{array}{*{3}{rc}r}
x &+ &y &- &z &= &10 \\
& &-4y &+ &3z &= &-20\\
& & & &(5/4)z &= &0 \\
& & & &4z &= &0
\end{array}](http://upload.wikimedia.org/math/1/1/6/116a23c642d69d88638cbe0bfc9f4ce8.png)
![\xrightarrow[-2\rho_1+\rho_4]{-(3/2)\rho_1+\rho_3}\;
\begin{array}{*{4}{rc}r}
2x & & &+ &z &+ &w &= &5 \\
& &y & & &- &w &= &-1 \\
& & &- &(5/2)z &- &(5/2)w &= &-15/2 \\
& &y & & &- &w &= &-1
\end{array}
\;\xrightarrow[]{-\rho_2+\rho_4}\;
\begin{array}{*{4}{rc}r}
2x & & &+ &z &+ &w &= &5 \\
& &y & & &- &w &= &-1 \\
& & &- &(5/2)z &- &(5/2)w &= &-15/2 \\
& & & & & &0 &= &0
\end{array}](http://upload.wikimedia.org/math/b/1/9/b19b774c2298f1808e8855cb2870bbaa.png)


![\begin{array}{rcl}
&\xrightarrow[]{-3\rho_1+\rho_2}
&\begin{array}{*{2}{rc}r}
x &- &y &= &1 \\
& &0 &= &-3+k
\end{array}
\end{array}](http://upload.wikimedia.org/math/2/3/9/239ded5f28bc290b2ddf0a09da6c8c0a.png)

![\begin{array}{rcl}
\begin{array}{*{3}{rc}r}
2x &- &y &+ &3z &= &3 \\
4x &+ &2y &- &2z &= &10 \\
6x &- &3y &+ &z &= &9
\end{array}
&\xrightarrow[-3\rho_1+\rho_3]{-2\rho_1+\rho_2}
&\begin{array}{*{3}{rc}r}
2x &- &y &+ &3z &= &3 \\
& &4y &- &8z &= &4 \\
& & & &-8z &= &0
\end{array}
\end{array}](http://upload.wikimedia.org/math/7/a/f/7af8db9149e64c3c6e5a4cc88afcd4a1.png)


![\xrightarrow[\begin{array}{c}\\[-19pt]\scriptstyle -\rho_1+\rho_3 \\[-5pt]\scriptstyle -2\rho_1+\rho_4\end{array}]{-3\rho_1+\rho_2}\;
\begin{array}{*{2}{rc}r}
x &- &3y &= &b_1 \\
& &10y &= &-3b_1+b_2 \\
& &10y &= &-b_1+b_3 \\
& &10y &= &-2b_1+b_4
\end{array}
\;\xrightarrow[-\rho_2+\rho_4]{-\rho_2+\rho_3}\;
\begin{array}{*{2}{rc}r}
x &- &3y &= &b_1 \\
& &10y &= &-3b_1+b_2 \\
& &0 &= &2b_1-b_2+b_3 \\
& &0 &= &b_1-b_2+b_4
\end{array}](http://upload.wikimedia.org/math/4/5/1/4510cfce100276c67a0690bb48691ee6.png)
![\xrightarrow[-\rho_1+\rho_3]{-2\rho_1+\rho_2}\;
\begin{array}{*{3}{rc}r}
x_1 &+ &2x_2 &+ &3x_3 &= &b_1 \\
& &x_2 &- &3x_3 &= &-2b_1+b_2 \\
& &-2x_2 &+ &5x_3 &= &-b_1+b_3
\end{array}
\;\xrightarrow[]{2\rho_2+\rho_3}\;
\begin{array}{*{3}{rc}r}
x_1 &+ &2x_2 &+ &3x_3 &= &b_1 \\
& &x_2 &- &3x_3 &= &-2b_1+b_2 \\
& & & &-x_3 &= &-5b_1++2b_2+b_3
\end{array}](http://upload.wikimedia.org/math/4/3/f/43ff1b0c06916429ec8f6eaaf6ae6195.png)


![\begin{array}{rcl}
\xrightarrow[-4\rho_1+\rho_2]{-\rho_1+\rho_2}\;
\begin{array}{*{3}{rc}r}
a &+ &b &+ &c &= &2 \\
& &-2b& & &= &4 \\
& &-2b&- &3c &= &-5
\end{array}
&\xrightarrow[]{-\rho_2+\rho_3}
&\begin{array}{*{3}{rc}r}
a &+ &b &+ &c &= &2 \\
& &-2b& & &= &4 \\
& & & &-3c&= &-9
\end{array}
\end{array}](http://upload.wikimedia.org/math/4/a/7/4a7004dbf84b94953ff6aeaa4ebba3b9.png)





![\begin{array}{rcl}
&\xrightarrow[]{-(c/a)\rho_1+\rho_2}
&\begin{array}{*{2}{rc}r}
ax &+ &by &= &j \\
& &(-\frac{cb}{a}+d)y &= &-\frac{cj}{a}+k
\end{array}
\end{array}](http://upload.wikimedia.org/math/8/d/3/8d31d346a882f4ee82e4a507c15e6ea4.png)











![\xrightarrow[]{\rho_i+\rho_j}\quad
\xrightarrow[]{-\rho_j+\rho_i}\quad
\xrightarrow[]{\rho_i+\rho_j}\quad
\xrightarrow[]{-1\rho_i}](http://upload.wikimedia.org/math/0/c/c/0cc98f53200497dfae9ac469f7897456.png)
![\begin{array}{rcl}
\begin{array}{*{3}{rc}r}
a_{1,1}x_1 &+ &\cdots &+ &a_{1,n}x_n &= &d_1 \\
& & & & &\vdots \\
a_{m,1}x_1 &+ &\cdots &+ &a_{m,n}x_n &= &d_m
\end{array}
&\xrightarrow[]{\rho_i\leftrightarrow\rho_j}\;
\xrightarrow[]{\rho_j\leftrightarrow\rho_i}
&\begin{array}{*{3}{rc}r}
a_{1,1}x_1 &+ &\cdots &+ &a_{1,n}x_n &= &d_1 \\
& & & & &\vdots \\
a_{m,1}x_1 &+ &\cdots &+ &a_{m,n}x_n &= &d_m
\end{array}
\end{array}](http://upload.wikimedia.org/math/7/c/0/7c07366fcf1fbf44efaa6308eaee7f25.png)
![\begin{array}{rcl}
\begin{array}{*{3}{rc}r}
a_{1,1}x_1 &+ &\cdots &+ &a_{1,n}x_n &= &d_1 \\
& & & & &\vdots \\
a_{m,1}x_1 &+ &\cdots &+ &a_{m,n}x_n &= &d_m
\end{array}
&\xrightarrow[]{k\rho_i}\;
\xrightarrow[]{(1/k)\rho_i}
&\begin{array}{*{3}{rc}r}
a_{1,1}x_1 &+ &\cdots &+ &a_{1,n}x_n &= &d_1 \\
& & & & &\vdots \\
a_{m,1}x_1 &+ &\cdots &+ &a_{m,n}x_n &= &d_m
\end{array}
\end{array}](http://upload.wikimedia.org/math/4/a/1/4a18f127277d97ce1f372edc6533ecd2.png)
![\begin{array}{rcl}
\begin{array}{*{3}{rc}r}
a_{1,1}x_1 &+ &\cdots &+ &a_{1,n}x_n &= &d_1 \\
& & & & &\vdots \\
a_{m,1}x_1 &+ &\cdots &+ &a_{m,n}x_n &= &d_m
\end{array}
&\xrightarrow[]{k\rho_i+\rho_j}\;
\xrightarrow[]{-k\rho_i+\rho_j}
&\begin{array}{*{3}{rc}r}
a_{1,1}x_1 &+ &\cdots &+ &a_{1,n}x_n &= &d_1 \\
& & & & &\vdots \\
a_{m,1}x_1 &+ &\cdots &+ &a_{m,n}x_n &= &d_m
\end{array}
\end{array}](http://upload.wikimedia.org/math/f/a/e/fae4afc13584e0227a2fad885f706312.png)
![\begin{array}{*{2}{rc}r}
3x &+ &2y &= &7
\end{array}
\;\xrightarrow[]{2\rho_1+\rho_1}\;
\begin{array}{*{2}{rc}r}
9x &+ &6y &= &21
\end{array}
\;\xrightarrow[]{-2\rho_1+\rho_1}\;
\begin{array}{*{2}{rc}r}
-9x &- &6y &= &-21
\end{array}](http://upload.wikimedia.org/math/a/5/6/a56c3c683e88800d8406bbc7f626365b.png)
![\begin{array}{rcl}
\begin{array}{*{3}{rc}r}
p &+ &n &+ &d &= &13 \\
p &+ &5n &+ &10d &= &83
\end{array}
&\xrightarrow[]{-\rho_1+\rho_2}
&\begin{array}{*{3}{rc}r}
p &+ &n &+ &d &= &13 \\
& &4n &+ &9d &= &70
\end{array}
\end{array}](http://upload.wikimedia.org/math/f/d/2/fd26e1f78cf9ae6cc0fe6f78a3c4f2bb.png)




