Simultaneous Equations

Change any coefficient and watch both lines move. The solution is where they cross, and the determinant below tells you before you solve whether there is exactly one crossing.

Loading interactive simulation...
Lesson

The theory — Simultaneous Equations247 words

Two linear equations in two unknowns describe two straight lines, and solving them means finding where the lines meet. How well that meeting point is determined is a separate question from whether it exists, and it has its own number.

What each symbol means

Δ
the determinant a₁b₂ − a₂b₁. Zero means parallel; non-zero means exactly one crossing.
κ
the condition number. It measures how much the answer can move for a given wobble in the coefficients, and unlike Δ it does not change when you multiply an equation through by ten.
Assumes
That the coefficients are exact. When they come from measurement, the crossing point inherits their uncertainty and multiplies it.
Breaks when
The determinant tells you whether there is an answer; it does not tell you how much to trust it, and it cannot, because scaling one equation by 10 scales Δ by 10 while changing nothing about the geometry. The condition number does the job Δ cannot. For this page’s Almost parallel preset it is 312, and the meaning is a licence: a relative error of 0.1% anywhere in the four coefficients can arrive as roughly 31% in the crossing point. That is not a bound anybody would accept in a bridge, and it is invisible in the determinant, in the algebra, and in the answer itself. The step after this one meets the same quantity again with more rows, where it decides whether the arithmetic is worth doing at all.

One number decides whether there is a single crossing at all 🖖

Before solving anything, compute a₁b₂ − a₂b₁. If it is not zero the lines cross exactly once and there is a single answer. If it is zero they are parallel, and then only the constants decide whether that means no solution or every point on the line. Press the three presets and watch the determinant: −3, then 0, then 0 again with a different verdict. This is the same determinant that runs the matrix tools further along the site: the same question about whether two directions are genuinely different, asked in the smallest case where it can be asked.

A small determinant is not a small problem 🖖

Press Almost parallel. The determinant is −0.02, so there is one crossing and the algebra finds it without complaint: (−146, 300). Now look at the sensitivity readout. Nudging a₁ by 0.01 drags that crossing about 108, which is a rate of 10,767 per unit. Nothing is wrong with the arithmetic. The trouble is that the answer depends on the coefficients far more than the coefficients deserve, and if they came from measurements the answer means almost nothing. Two lines meeting at a shallow angle have a perfectly definite crossing point and a perfectly useless one, and no step in the solving reveals that. Only the determinant does.

Elimination is one legal move applied twice 🖖

The steps under the chart never do anything new. Multiply an equation through by a non-zero number, which keeps every solution because you can divide it back out. Subtract one equation from another, which keeps every solution because any pair satisfying both satisfies the difference. That is the whole method. What makes it feel like a technique is choosing the multipliers so that one unknown cancels, and that choice is arithmetic rather than insight: multiply the first row by b₂ and the second by b₁ and the y terms are identical by construction. The same two moves in three unknowns is Gaussian elimination, and in n unknowns it is what every direct linear solver still does.

Problems solved in full

  1. Two coffees and a cake costing 8 when coffee costs 1 more 7 steps

    Two coffees and a cake cost 8. One coffee minus one cake is 1 (the coffee costs 1 more than the cake). What does each cost, and how much would you trust the answer if the prices had been read off a blurry receipt?

    1. Write both facts with the same two unknowns. Getting these two lines right is the modelling; everything after is mechanical.

    2. Check the determinant before solving. It is not zero, so there is exactly one answer and it is worth looking for.

    3. Eliminate y. Multiply the second equation by 1 and add, or equivalently multiply the first by −1 and subtract — the y terms are built to cancel.

    4. Three for the coffee. Substitute back into either equation to get the cake, and use the OTHER equation to check, because substituting into the one you just used proves nothing.

    5. Now the receipt. Suppose the second equation was mistyped and the coefficient of the cake moves from −1 to 0.49. The determinant falls from −3 to −0.02.

    6. The answer is still unique, and it has moved to (−146, 300): a coffee costing −146. The algebra never complained. It had no way to.

    7. Which is where this stops being algebra. A negative price is the arithmetic telling you the model is wrong, not the coffee. The tool will happily report it, the determinant will quietly warn you first, and nothing in the method knows that prices cannot be negative.

    Answer

    Coffee 3, cake 2. The determinant is −3, so one crossing, and both original equations check. Drift one coefficient toward parallel and the same method returns −146 without a murmur — which is why the determinant is worth reading before the answer, not after.

  2. Two parallel lines, and how close they come to having a solution 6 steps

    2x + y = 8 and 4x + 2y = 10. The determinant is 0, which does not say which of the two zero-determinant verdicts applies. Work out which one it is, then decide how close the system comes to being solvable.

    1. The determinant is zero, so there is no single crossing. It cannot say more than that: parallel and distinct, and the same line written twice, both give zero.

    2. Eliminate anyway and the answer arrives. Scale the first equation by 2 to match the second, subtract, and what is left has no unknowns in it. The steps under the chart print it as 0x + 0y = 6, and 0 is not 6.

    3. The ratios say the same thing with no working at all. The two left-hand sides are in the ratio 1 : 2 and the two constants are not, so the lines share a direction and differ in position.

    4. How far apart? Divide the second equation by 2 and both lines carry the identical left side, so the gap is a difference of constants over the length of the coefficient pair.

    5. Which raises the question the tool stops short of. If no point satisfies both, which point comes closest? Minimise the two squared residuals together. Writing u for 2x + y, the second residual is twice the first at any u, so it counts four times as heavily, and the minimum lands at u = 5.6 rather than midway at 6.5.

    6. That is a warning about least squares rather than about these two lines. The answer moved because the second equation was written with bigger numbers, not because it is better evidence. Scale each equation so its coefficient pair has length 1 and the closest point sits exactly halfway, 0.671 from each line.

    Answer

    No solution, and the two lines are 1.342 apart. The determinant says the crossing is gone; the constants say which of the two ways it went. The point that comes closest to both depends on how the equations happen to be written: as given, least squares lands on 2x + y = 5.6, and only after both are normalised does it settle midway at 6.5.

Learning path

Solving for x, from the minus sign upward

Leads to Three or more at once elimination, and the determinant that decides in advance whether a pair of lines meets once, never, or everywhere.

References (1)

Example problems

  • They cross once - 2x + y = 8 and x − y = 1 meet at (3, 2). The determinant is −3, comfortably away from zero, and nudging a coefficient by 0.01 moves the crossing by about 1.4 per unit.
  • Parallel: no solution - The second equation is the first one doubled, except for the constant. The determinant is 0, the lines never meet, and no amount of algebra will find a point that is not there.
  • The same line twice - Now the constant is doubled too, so the second equation says nothing the first did not. Same determinant, same parallel lines, opposite conclusion: every point on the line is a solution.
  • Almost parallel - A determinant of −0.02 rather than 0. There is still exactly one crossing, at (−146, 300), and nudging a₁ by 0.01 drags it about 108, a rate of 10,767 per unit. The answer is fine and worthless at the same time.