Skip to content

System of Equations Solver

x
y
=
x
y
=

Solution

x = 2, y = 1

Step-by-step (Cramer's rule)
  1. Equation 1: 1x + 1y = 3
  2. Equation 2: 1x + -1y = 1
  3. Compute determinant of the coefficient matrix A
  4. det(A) = 1·-1 − 1·1 = -2
  5. det(A_x) = -4 det(A_y) = -2
  6. x = det(A_x)/det(A) = -4/-2 = 2
  7. y = det(A_y)/det(A) = -2/-2 = 1

Estimates for educational purposes — not financial, medical, or legal advice. See terms.

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:

  1. det(A) = 1·(−1) − 1·1 = −2
  2. det(A_x) = 3·(−1) − 1·1 = −4
  3. det(A_y) = 1·1 − 3·1 = −2
  4. x = −4 / −2 = 2
  5. 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.

Frequently asked questions

What is Cramer's rule?

A closed-form method for solving linear systems Ax = b. Each unknown x_i equals det(A_i) / det(A), where A_i is the matrix A with the i-th column replaced by the vector b. It's not the most efficient method for large systems (Gaussian elimination is faster asymptotically), but for 2×2 and 3×3 it's the clearest — you can write down the answer directly, without intermediate substitution, and the derivation matches what's taught in linear algebra textbooks.

What does 'no solution' mean?

It means the system is inconsistent — no single pair (or triple) of values satisfies all equations simultaneously. Geometrically, it's two parallel lines (2×2) or three planes that never all meet at a single point (3×3). The tool detects this by checking whether the rank of the augmented matrix [A|b] exceeds the rank of A alone; if yes, at least one equation is incompatible with the others. Example: x + y = 3 and x + y = 5 can never both be true.

What does 'infinite solutions' mean?

It means the system is dependent — one equation is a linear combination of the others, so there's not enough independent information to pin down a unique answer. Geometrically, two coincident lines (2×2) or planes that share a common line of intersection (3×3). The tool detects this when det(A) = 0 and the ranks of A and [A|b] match — the system is consistent but underdetermined. Example: x + y = 3 and 2x + 2y = 6, which is literally the same equation twice.

Why use Cramer's rule instead of Gaussian elimination?

For small systems, Cramer's rule is more transparent — you can see each unknown as an explicit ratio of determinants, which maps cleanly to how the method is introduced in a linear algebra class. Gaussian elimination is faster for large systems (cubic time vs. factorial-ish for Cramer), but for 2×2 and 3×3 the difference is irrelevant and Cramer's rule produces a cleaner step-by-step derivation. Under the hood, the tool falls back to Gaussian-style rank detection for the singular case, where Cramer's rule alone can't distinguish dependent from inconsistent.

What if my coefficients are very small or very close to zero?

The tool uses a numeric tolerance of about 1e-12 when checking whether a value is effectively zero for rank detection, which handles ordinary floating-point noise but not pathological near-singular systems. If your matrix is ill-conditioned (determinant much smaller than the magnitude of its entries), the computed solution may have large numerical error. For serious linear algebra work — numerical stability, least squares, non-square systems — use a proper numerical library like NumPy, Julia, or Eigen.