Chris Collins

Tools · math

Linear systems, visually

Enter a system of linear equations and see it — lines in 2-D, planes in 3-D — then solve it yourself with exact row operations (swap, scale, add a multiple) with undo, hints and "show me", while the picture updates. Classifies one / none / infinitely many solutions, and shows Cramer's rule and least squares. Plus linear programming with a sliding objective line, and an ill-conditioning demo.

Added · updated 14 October 2026

How to use it

Three tabs, each with its own address: Equations & row reduction (#solve), Inequalities & linear programming (#lp) and Ill-conditioning (#ill).

Type the coefficients of each equation into a row of the grid (integers, decimals or fractions such as 3/4), or pick an example. Systems of any size up to 6 × 6 work; with two unknowns each equation is drawn as a line, with three as a plane in a 3-D view you can orbit, each in its own colour, with the solution point or line highlighted where they meet.

Solve it by hand

Choose a row operation — Rᵢ ← Rᵢ + k·Rⱼ, Rᵢ ← k·Rᵢ or Rᵢ ↔ Rⱼ — and press Apply. All arithmetic is exact. After every step the equations change, so the lines (planes) move — but the dashed originals show that they still meet in exactly the same place: row operations never change the solution set.

  • 💡 Hint names the next pivot and fills in the operation for you; Show me ▸ applies it; RREF ⏭ finishes the reduction.

  • ↶ Undo and ↷ Redo (Ctrl+Z, Ctrl+Shift+Z) step through your history; the list underneath records every operation.

  • The panel classifies the system from the ranks of A and [A | b]: one solution, none (a row reduces to 0 = c), or infinitely many, written in parametric form such as x = 1 + 2t, y = t.

Cramer’s rule and least squares

For square systems the tool shows det A and each det Aᵢ (A with column i replaced by b), and the solution xᵢ = det Aᵢ / det A — or explains why the rule cannot be used when det A = 0.

When a system has no solution, it finds the least-squares answer x̂ from the normal equations AᵀA x̂ = Aᵀb: the projection p = A x̂ of b onto the column space of A and the residual r = b − p. For three equations in two unknowns, tick column picture to see b, the plane spanned by the columns, p, and the residual standing perpendicular to that plane.

Companion to Linear equations and inequalities (chapter 5), Systems of equations (chapter 6 — including systems of linear inequalities and feasible regions) and Conditioning versus stability (chapter 32) of Mathematics, Reconnected. For two equations solved by substitution or elimination with every step written out, see Algebra step by step. See also the Matrix calculator (RREF with steps, LU, QR), Matrix transformations, the Vectors playground, and the graphing calculator.

Inequalities & linear programming

Enter up to five inequalities in x and y — x + y ⇐ 40, 2x + y ⇐ 60, x - y >= -2, 3y < 2x + 1 (⇐ or ≤, >= or ≥; coefficients may be decimals or fractions such as 3/4y or x/2) — and tick x ≥ 0, y ≥ 0 for the usual sign constraints. The feasible region is shaded green; every boundary is drawn in its inequality’s colour (dashed when the inequality is strict), and each corner is labelled with its coordinates and the objective’s value there.

Set the objective c₁x + c₂y to maximise or minimise. The level P slider slides the level line c₁x + c₂y = P (heavy dashed) across the plane: dark while it touches the region, red once it has left it. Changing c₁ or c₂ rotates the level lines, and the best corner jumps from corner to corner; when the level lines lie along an edge, two corners tie and the whole edge is optimal (highlighted). The panel lists every corner with the two boundaries that meet there and its objective value, names the optimum and its binding constraints, and says when the region is empty (infeasible) or the objective has no limit (unbounded).

Ill-conditioning

Two equations, nearly parallel: x + y = 2 and x + 1.001y = 2.001 meet at (1, 1). Nudge b₂ by 0.001 and the crossing jumps to (0, 2). The panel shows both solutions, how far x moved, the relative changes in b and in x and their ratio (the amplification, never more than κ), det A, the angle between the lines and the condition number κ(A) = σ₁/σ₂ (2-norm, as np.linalg.cond) — with the rule of thumb that you lose about log₁₀ κ significant digits. Compare the well-conditioned x + y = 2, x − y = 0, whose lines cross at right angles (κ = 1).

⛶ Full screen gives the current tab’s picture the whole screen — the browser’s full screen where it is allowed, otherwise a full-window layer (iPhone); it is redrawn as the window changes, and ◫ Panels hides the controls beside it. Escape leaves. (F stays with Present.)

Presenting

The lines or planes filling the screen with the augmented matrix and the last row operation in the corner: → (or Space) takes the next Gauss–Jordan step and ← undoes one, so you can talk a room through an elimination. Press ⛶ Present (beside Share link) or F to open it; Esc or F closes it and T switches between dark and light.

Share link → Link options → Open in presentation mode makes a link that opens straight into this view. Browsers only allow real full screen after a click, so a link opened cold shows the view filling the window with a “Click for full screen” button.

Related: Algebra step by step, Matrix calculator, graphing calculator, ODE solver (Euler’s method and energy drift).

Limits

The linear programming tab handles two variables (x and y) and up to five inequalities, and finds the optimum by checking every corner — the book’s method, fine here but hopeless at scale (real solvers use the simplex or interior-point methods). It does not do integer programming. The conditioning tab is for 2 × 2 systems.

Linking to an example

Share link copies a URL that reopens the tool exactly as you have it, on the current tab. Links can also be written by hand; a link without a #tab opens the tab its parameters belong to.

Parameter Meaning Example

example

a book example (list below); other parameters override its values

example=ch06-lp-workshop

lp

the inequalities, separated by ;

lp=x+y⇐40;2x+y⇐60

pos

add x ≥ 0, y ≥ 0 (1 or 0; default on)

pos=1

cx, cy

the objective’s coefficients c₁, c₂

cx=30&cy=20

P

where the level line c₁x + c₂y = P sits

P=800

goal

max or min

goal=max

A

conditioning: the 2 × 2 matrix, rows separated by ;

A=1,1;1,1.001

b

conditioning: the right-hand side

b=2,2.001

db

conditioning: the nudge added to b₂

db=0.001

size

equations tab: the shape of the system (older links)

size=3x3

A + typed straight into an address arrives as a space, so in lp a space between two terms is read as a plus: ?lp=x+y⇐40 means x + y ≤ 40. Links made with Share link encode everything.

Examples:

example= What it shows

ch06-lp-workshop

the workshop: x + y ≤ 40, 2x + y ≤ 60, profit 30x + 20y; best (20, 20) for $1,000

ch06-lp-tie

chair profit 15: the level lines lie along an edge and (30, 0) and (20, 20) tie at 900

ch06-lp-exercise

maximise 3x + 5y subject to x + 2y ≤ 14, 3x + 2y ≤ 18: 36 at (2, 6)

ch06-lp-mastery

maximise 4x + 3y with x + y ≤ 10, x ≤ 6, y ≤ 8: five corners, 36 at (6, 4)

ch06-lp-unbounded

drop the limits: with only x − y ≤ 2 the profit grows without bound

ch06-lp-infeasible

x + y ≤ 10 and x + y ≥ 20 contradict each other: nothing is feasible

ch06-nudge

x + y = 2, x + 1.001y = 2.001: a nudge of 0.001 moves (1, 1) to (0, 2); κ ≈ 4002

ch32-conditioning

x + y = 2, x + 1.0001y = 2.0001: a change in the fifth digit moves (1, 1) to (0, 2); κ ≈ 4 × 10⁴

well-conditioned

for contrast, x + y = 2, x − y = 0: lines at right angles, κ = 1

Runs entirely in your browser; nothing you type leaves this page.