Solves a₁x + b₁y = c₁ and a₂x + b₂y = c₂ for x and y. When a₁b₂ − a₂b₁ is zero there is no unique solution.
Explanation
Two linear equations in two unknowns are solved together for the pair (x,y) that satisfies both at once.
a1x+b1y=c1,a2x+b2y=c2 Substitution and elimination both work, but Cramer's rule writes the answer straight from the coefficients.
x=a1b2−a2b1c1b2−c2b1,y=a1b2−a2b1a1c2−a2c1 - a1, b1, c1 — the coefficients and the right-hand side of the first equation
- a2, b2, c2 — the same for the second equation
- the shared denominator a1b2−a2b1 is the determinant of the coefficient matrix
Example
Solve 2x+3y=12 together with x−y=1, so a1=2, b1=3, c1=12, a2=1, b2=−1, c2=1. The denominator first:
a1b2−a2b1=2×(−1)−1×3=−5 x=−512×(−1)−1×3=−5−15=3,y=−52×1−1×12=−5−10=2 So x=3 and y=2. Substituting back, 2×3+3×2=12 and 3−2=1: both equations hold.
Notes
- When the denominator a1b2−a2b1 is zero there is no unique solution, and the calculator reports it.
- Geometrically the two lines are then either parallel, never meeting, so there is no solution at all, or identical, so every point on the line is a solution. Either way the coefficient ratios match.
- Rearrange each equation into the form ax+by=c before reading off coefficients. Something like y=2x+1 has to be rewritten as −2x+y=1.
- Always substitute your answer back into both original equations as a check.