Systems of linear equations in this visualization
A system of linear equations asks for values of the unknowns that make several linear equations true at once. Collect the coefficients in a matrix A, the unknowns in a vector x and the right sides in a vector b, and the whole system becomes Ax = b. This page works with square systems, two equations in x and y or three in x, y and z, and draws each system twice: once by rows and once by columns.
Read by rows, an equation in x and y with a coefficient other than 0 is a line, and a solution is a point that satisfies every equation. Read by columns, the same equations say that x copies of the first column a₁ plus y copies of the second column a₂ make b. So both pictures show the same pair of numbers: the crossing on the left is the recipe for b on the right. The right picture has axes ① and ②, one for each equation, so its points are right sides, not values of x and y.
A linear system has exactly one solution, none, or infinitely many. If det A ≠ 0 there is exactly one, whatever b is. If det A = 0, the rows are dependent and so are the columns, so both pictures degenerate at the same moment. On the left the lines become parallel or fall onto one line, unless an equation has lost all its coefficients. On the right the columns fall onto one line, so some right sides can no longer be reached. If b is one of them, the equations contradict each other, and elimination ends in an impossible equation such as 0 = 1. Otherwise there are infinitely many solutions.
Eliminate runs Gauss–Jordan elimination one step at a time. It turns the system into a simpler one with exactly the same solutions. Each step adds a multiple of one equation to another, multiplies an equation by a nonzero number, or swaps two equations. Every step can be undone, so no solution is lost and none is gained. When a multiple of one equation is added to another and the lines cross, the changed line turns about the crossing, so the solution never moves. If the lines are parallel, it slides off to infinity instead and leaves 0 = c. If they are the same line, it stays put and becomes 0 = 0. In the column picture the same step is a shear, and the recipe stays the same. Swaps and multiplication by a negative number appear as jumps, because doing them gradually could pass through systems with other solutions.
A unique solution can still be very sensitive. When two lines are nearly parallel, changing a right side by 0.01 can move the crossing a long way.
With three unknowns, an equation with a coefficient other than 0 is a plane. Three planes can meet in one point, along a line, in a whole plane, or nowhere. They can have no common point even when no two of them are parallel: each pair then meets in a line, and the three lines run side by side like the edges of a prism. The two 3D views turn together only to make them easier to compare, not because their axes match.
Controls
- Dragging the solution point keeps the coefficients and changes the right sides to match. Dragging a line moves it without turning it, which changes only its right side.
- Every point you can drag also moves with the arrow keys. With three unknowns, Page Up and Page Down change its third entry.