Cramer's Rule Calculator

Solve a 2×2 system of linear equations (a₁x + b₁y = c₁, a₂x + b₂y = c₂) with Cramer's Rule: get the coefficient determinant D, the x- and y-determinants, and the exact solution.

Quick Facts

Formula
x = Dx / D, y = Dy / D
D is the coefficient determinant a₁b₂ − a₂b₁; Dx and Dy replace one column of coefficients with the constants c₁, c₂.
Requirement
D ≠ 0 for a unique solution
If D = 0 the two lines are parallel (no solution) or identical (infinite solutions).

Your Results

Calculated
Coefficient determinant (D)
-
a₁b₂ − a₂b₁
x-determinant (Dx)
-
c₁b₂ − c₂b₁
y-determinant (Dy)
-
a₁c₂ − a₂c₁
Solution
-
x = Dx/D, y = Dy/D

Ready

Enter both equations' coefficients and constants, then press Calculate.

How Cramer's Rule works

Cramer's Rule solves a system of linear equations directly from determinants, without the row-by-row elimination steps of Gaussian elimination. For two equations in two unknowns, a₁x + b₁y = c₁ and a₂x + b₂y = c₂, the rule expresses both x and y as a ratio of two 2×2 determinants.

Formula and method

First form the coefficient determinant from the x- and y-coefficients: D = a₁b₂ − a₂b₁. Then build two more determinants by swapping one column of coefficients for the constants column (c₁, c₂):

  • Dx = c₁b₂ − c₂b₁ (the b-column stays, the a-column is replaced by the constants)
  • Dy = a₁c₂ − a₂c₁ (the a-column stays, the b-column is replaced by the constants)

As long as D ≠ 0, the unique solution is x = Dx / D and y = Dy / D. This calculator computes all three determinants and both unknowns in one step.

When there is no unique solution

If D = 0, the coefficient matrix is singular and Cramer's Rule cannot divide by it. Two cases follow: if Dx and Dy are also both zero, the two equations describe the same line, so there are infinitely many (x, y) pairs that satisfy both. If D = 0 but Dx or Dy is nonzero, the two lines are parallel and never cross, so no solution exists.

Checking your result

Plug the computed x and y back into both original equations — each should reduce to the stated constant (c₁ and c₂). You can also sanity-check the determinant itself: if a₁/a₂ equals b₁/b₂, the rows are proportional and D will come out to zero, which is a quick way to predict a degenerate case before you even compute Dx and Dy.

Applications

Cramer's Rule shows up anywhere a small linear system needs an explicit, formulaic solution rather than a numerical routine: circuit analysis with Kirchhoff's voltage and current laws, finding the equilibrium price and quantity where two supply-and-demand lines intersect, and 2D/3D graphics transformations. Because it scales to n×n systems using n×n determinants, the same idea extends to three or more equations, though Gaussian elimination becomes faster for larger systems.

Frequently Asked Questions

What is Cramer's Rule?
Cramer's Rule solves a system of linear equations using determinants instead of substitution or elimination. For two equations a1x + b1y = c1 and a2x + b2y = c2, you compute the coefficient determinant D and two more determinants (Dx and Dy) formed by swapping one column of coefficients for the constants. The solution is x = Dx / D and y = Dy / D.
What does it mean if the determinant D equals zero?
D = 0 means the coefficient matrix is singular, so Cramer's Rule cannot produce a unique solution. If Dx and Dy are also both zero, the two equations describe the same line and there are infinitely many solutions. If D = 0 but Dx or Dy is nonzero, the lines are parallel and never intersect, so there is no solution.
Does Cramer's Rule work for larger systems?
Yes. Cramer's Rule generalizes to any n by n system by using n by n determinants, including 3x3 or larger systems. This calculator focuses on the common 2x2 case of two equations in two unknowns; for larger systems the determinants are more expensive to compute and Gaussian elimination is usually faster in practice.