Equation Solver

Cramer's rule solves a system of linear equations by computing ratios of determinants. For a 2x2 system a1*x + b1*y = c1 and a2*x + b2*y = c2, the solution is x = Dx/D and y = Dy/D, where D is the determinant of the coefficient matrix. For example, the system 2x + 3y = 8 and x - y = 1 has determinant D = -5, giving x = 2.2 and y = 1.2. This calculator handles both 2-variable and 3-variable systems. Enter the coefficients below to solve instantly.

Quick Answer

For the system 2x + 3y = 8 and x - y = 1, the solution is x = 2.2 and y = 1.2.

Enter coefficients for each equation.

x + y + z =
x + y + z =
x + y + z =

Common Examples

Input Result
2x + 3y = 8, x - y = 1 x = 2.2, y = 1.2
x + y = 10, 2x - y = 5 x = 5, y = 5
3x - 2y = 7, x + 4y = 9 x = 3.286, y = 1.429
x + y + z = 6, 2x - y + z = 3, x + 2y - z = 2 x = 1, y = 2, z = 3
2x + 4y = 10, x + 2y = 3 No solution (parallel lines)

How It Works

The formula

Cramer’s rule provides an explicit formula for each variable in a system of linear equations using determinants. It applies when the coefficient matrix has a nonzero determinant (meaning a unique solution exists).

2x2 system:

\(a_1 x + b_1 y = c_1\) \(a_2 x + b_2 y = c_2\)

The determinant of the coefficient matrix is:

\[D = a_1 b_2 - a_2 b_1\]

The solutions are:

\[x = \frac{D_x}{D} = \frac{c_1 b_2 - c_2 b_1}{D}\] \[y = \frac{D_y}{D} = \frac{a_1 c_2 - a_2 c_1}{D}\]

If D = 0, the system is either inconsistent (no solution, parallel lines) or dependent (infinitely many solutions, same line).

3x3 system:

\(a_1 x + b_1 y + c_1 z = d_1\) \(a_2 x + b_2 y + c_2 z = d_2\) \(a_3 x + b_3 y + c_3 z = d_3\)

Compute D as the determinant of the 3x3 coefficient matrix. Then replace the first, second, or third column with the constants vector to get Dx, Dy, and Dz respectively. Each variable equals its sub-determinant divided by D.

Worked example

Solve the system: 2x + 3y = 8 and x - y = 1.

Coefficient matrix determinant: D = (2)(-1) - (1)(3) = -2 - 3 = -5.

Dx = (8)(-1) - (1)(3) = -8 - 3 = -11. So x = -11 / -5 = 2.2.

Dy = (2)(1) - (1)(8) = 2 - 8 = -6. So y = -6 / -5 = 1.2.

Verification: 2(2.2) + 3(1.2) = 4.4 + 3.6 = 8. And 2.2 - 1.2 = 1. Both equations are satisfied.

Related Calculators

Frequently Asked Questions

When does Cramer's rule not work?
Cramer's rule requires the determinant of the coefficient matrix to be nonzero. If the determinant equals zero, the system is either inconsistent (no solution) or dependent (infinitely many solutions). In either case, Cramer's rule cannot produce a unique answer.
What is the difference between inconsistent and dependent systems?
An inconsistent system has no solution at all. Geometrically, the lines or planes do not share a common intersection point. A dependent system has infinitely many solutions because the equations describe the same line (in 2D) or the same plane (in 3D). The determinant is zero in both cases, but inconsistent systems have at least one nonzero sub-determinant.
Can this solver handle non-integer coefficients?
Yes. Enter any real number as a coefficient, including decimals and negative values. Cramer's rule works the same way regardless of whether the coefficients are integers, fractions, or decimals.
How does Cramer's rule relate to matrix operations?
Cramer's rule expresses each variable as a ratio of two determinants. The denominator is the determinant of the coefficient matrix, and each numerator is the determinant of a modified matrix where one column is replaced by the constants vector. This is mathematically equivalent to computing the inverse matrix and multiplying by the constants vector.
Is Cramer's rule efficient for large systems?
Cramer's rule is practical for 2x2 and 3x3 systems. For larger systems (4 or more variables), Gaussian elimination or LU decomposition is far more efficient. The number of operations in Cramer's rule grows factorially with the system size, making it impractical for large matrices.