Solve a 2×2 or 3×3 system of linear equations via Cramer’s rule, with step-by-step working. Enter the coefficients for each equation, pick the system size, and the tool computes the determinants, divides them, and reports the solution — or tells you why the system has no solution or infinite solutions.
Cramer’s rule in brief
For a 2×2 system a₁x + b₁y = c₁, a₂x + b₂y = c₂, write it in matrix form Ax = b where
A = |a₁ b₁| b = |c₁|
|a₂ b₂| |c₂|
Cramer’s rule says:
- x = det(A_x) / det(A), where A_x is A with the first column replaced by b
- y = det(A_y) / det(A), where A_y is A with the second column replaced by b
For a 3×3 system it’s the same pattern with three unknowns and three column-replaced matrices. The tool computes these determinants via the standard formulas (ad − bc for 2×2, cofactor expansion for 3×3), then divides.
Three possible outcomes
Unique solution — det(A) ≠ 0. The system has exactly one answer, which the tool reports directly.
No solution — det(A) = 0 and at least one equation contradicts the others. The tool detects this by row-reducing the augmented matrix [A | b] and comparing its rank to the rank of A alone. If they differ, at least one equation sits outside the column space of A, so no vector x satisfies all equations simultaneously.
Infinite solutions — det(A) = 0 and the equations are consistent but one is a linear combination of the others. The tool detects this when the ranks of A and [A | b] are equal but less than the number of unknowns — there’s a whole family of solutions, not a single point.
Example: a 2×2 system
x + y = 3, x − y = 1. Enter a₁=1, b₁=1, c₁=3, a₂=1, b₂=−1, c₂=1. Steps:
- det(A) = 1·(−1) − 1·1 = −2
- det(A_x) = 3·(−1) − 1·1 = −4
- det(A_y) = 1·1 − 3·1 = −2
- x = −4 / −2 = 2
- y = −2 / −2 = 1
Check: 2 + 1 = 3 ✓, 2 − 1 = 1 ✓.
Example: a 3×3 system
x + y + z = 6, x + 2y + 3z = 14, x + 4y + 9z = 36. This is the classic Vandermonde-style system that solves to x = 1, y = 2, z = 3. Plug the coefficients in and the tool confirms via three determinant computations. Check: 1 + 2 + 3 = 6 ✓, 1 + 4 + 9 = 14 ✓, 1 + 8 + 27 = 36 ✓.
Example: no solution
x + y = 3, 2x + 2y = 7. Substituting the second equation simplifies to x + y = 3.5, contradicting the first. det(A) = 1·2 − 1·2 = 0 (singular), and rank([A|b]) > rank(A), so the tool reports “No solution — inconsistent system.” Graphically, the two lines are parallel.
Example: infinite solutions
x + y = 3, 2x + 2y = 6. The second equation is just twice the first — they’re the same line. det(A) = 0, and now rank([A|b]) = rank(A) = 1, so the tool reports “Infinite solutions — dependent system.” Any point on the line x + y = 3 is a valid answer.
Why Cramer’s rule for this tool
For small systems, Cramer’s rule is pedagogically cleaner than Gaussian elimination. Each unknown appears as an explicit ratio of two determinants, which mirrors how the method is introduced in first-year linear algebra courses. The step-by-step output maps directly to a textbook derivation — compute det(A), compute the column-replaced determinants, divide — without requiring the student to track row operations through multiple intermediate states.
For the pathological singular cases (where column-replaced determinants alone can’t tell dependent from inconsistent), the tool falls back to Gaussian row reduction to compute matrix ranks. This hybrid approach gives clean textbook output for the typical case while still handling edge cases correctly.
What this tool does not do
It doesn’t solve systems larger than 3×3. Cramer’s rule scales badly (O(n!) naively, or O(n⁴) with LU), so larger systems need proper numerical methods. For those, use NumPy’s linalg.solve, MATLAB’s backslash, or a dedicated linear algebra library.
It doesn’t handle non-square systems — overdetermined (more equations than unknowns, usually solved via least squares) or underdetermined (fewer equations, usually solved via pseudoinverse). Those need different techniques and the tool doesn’t support them.
It doesn’t show a symbolic or parametric form for infinite-solution cases. When the system is dependent, the tool just reports “Infinite solutions — dependent system” without listing the family of solutions as (x, y, z) = (t, 3 − t, 0) or similar. For symbolic manipulation, use a computer algebra system.
It doesn’t handle numerical conditioning issues. If your coefficient matrix is ill-conditioned (close to singular but not quite), the computed result may have substantial error. The tool uses a small tolerance (1e-12) for zero-detection in the rank step, which is fine for exact integer inputs but not a substitute for a proper condition-number analysis.
It doesn’t parse equations from text. You enter numeric coefficients directly, not strings like “2x + 3y = 7”. If your equations are in string form, decompose them by hand before entering the coefficients. For a single equation in one unknown, the linear equation solver is the right tool; for a single quadratic, use the quadratic equation solver.