Linear equation solver

Solve a single linear equation ax + b = 0, or a 2×2 / 3×3 system using Cramer's rule. Detects unique, no, and infinitely-many solutions.

Linear system inputs

Solution
x = 3

Cramer's rule

For Ax = b with non-singular A, each variable is the ratio of two determinants:

xi = det(Ai) ÷ det(A)

where Ai is A with its i-th column replaced by b. If det(A) = 0, the system has no unique solution — and you check the substituted determinants to distinguish "no solution" (inconsistent) from "infinitely many" (dependent).

2×2 example

Solve 2x + 3y = 13 and 4x − y = 5.

  • det(A) = 2(−1) − 3(4) = −2 − 12 = −14
  • det(Ax) = 13(−1) − 3(5) = −13 − 15 = −28
  • det(Ay) = 2(5) − 13(4) = 10 − 52 = −42
  • x = −28 ÷ −14 = 2, y = −42 ÷ −14 = 3

FAQ

Why use Cramer's rule and not Gaussian elimination?

Cramer's rule is concise for small systems (2×2, 3×3) and gives an exact closed-form. For larger systems, Gaussian elimination or matrix-inversion methods are vastly more efficient.

What's a singular matrix?

A matrix whose determinant is zero. Geometrically, it collapses the coordinate space to a lower dimension — rows or columns are linearly dependent. The system either has no solution or infinitely many.

Related calculators