Cramer's Rule solves a square system of linear equations using determinants. The whole method rests on one formula: for the variable xix_i,

xi=det(Ai)det(A)x_i = \frac{\det(A_i)}{\det(A)}

where AA is the coefficient matrix and AiA_i is the matrix formed by replacing the iith column of AA with the constants from bb. If the system is written as Ax=bAx = b with AA square and det(A)0\det(A) \ne 0, the system has a unique solution and this formula finds each variable directly.

Why The Formula Holds

The symbols mean: det(A)\det(A) is the determinant of the original coefficient matrix, and each det(Ai)\det(A_i) is the determinant after one column has been replaced by the constants column bb. The condition det(A)0\det(A) \ne 0 is essential, because the formula divides by det(A)\det(A).

This is why the determinant doubles as the test for solvability. If det(A)0\det(A) \ne 0, the system has one unique solution. If det(A)=0\det(A) = 0, the denominator is zero, so the rule does not apply: there may be no solution or infinitely many. Cramer's Rule is learned precisely because it connects three ideas cleanly: solving linear systems, determinants, and the condition for a unique solution. Use it only when the system has the same number of equations and unknowns, the coefficient matrix is square, and det(A)0\det(A) \ne 0.

Worked Example: A 2×22 \times 2 System Step By Step

Solve

{2x+y=5xy=1\begin{cases} 2x + y = 5 \\ x - y = 1 \end{cases}

First identify the coefficient matrix and the constants column:

A=[2111],b=[51]A = \begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix}, \qquad b = \begin{bmatrix} 5 \\ 1 \end{bmatrix}

Compute the determinant of AA:

det(A)=2111=2(1)1(1)=3\det(A) = \begin{vmatrix} 2 & 1 \\ 1 & -1 \end{vmatrix} = 2(-1) - 1(1) = -3

Because det(A)=30\det(A) = -3 \ne 0, the system has a unique solution, so Cramer's Rule applies.

Find xx

Replace the first column of AA with bb:

Ax=[5111]A_x = \begin{bmatrix} 5 & 1 \\ 1 & -1 \end{bmatrix}

Then

det(Ax)=5111=5(1)1(1)=6\det(A_x) = \begin{vmatrix} 5 & 1 \\ 1 & -1 \end{vmatrix} = 5(-1) - 1(1) = -6

Divide by the original determinant:

x=det(Ax)det(A)=63=2x = \frac{\det(A_x)}{\det(A)} = \frac{-6}{-3} = 2

Find yy

Replace the second column of AA with bb:

Ay=[2511]A_y = \begin{bmatrix} 2 & 5 \\ 1 & 1 \end{bmatrix}

Then

det(Ay)=2511=2(1)5(1)=3\det(A_y) = \begin{vmatrix} 2 & 5 \\ 1 & 1 \end{vmatrix} = 2(1) - 5(1) = -3

Divide by det(A)\det(A):

y=det(Ay)det(A)=33=1y = \frac{\det(A_y)}{\det(A)} = \frac{-3}{-3} = 1

So the solution is

(x,y)=(2,1)(x,y) = (2,1)

That is the full pattern: one determinant for the original matrix, then one more determinant for each variable.

Practice And The Traps To Avoid

Try the same routine on

{3x+2y=8xy=0\begin{cases} 3x + 2y = 8 \\ x - y = 0 \end{cases}

Compute det(A)\det(A) first; if it is nonzero, replace one column at a time and solve for xx and yy. After finishing by hand, compare your setup with a matrix solver to check the determinants as well as the final answer.

Three calculation traps recur:

  • Using it when det(A)=0\det(A) = 0. This is the main check. The method divides by det(A)\det(A), so a zero determinant means it does not apply for a unique solution.
  • Replacing the wrong column. To solve for xx, replace the xx-column; for yy, replace the yy-column. The constants column replaces one column at a time, it is not appended.
  • Treating it as the best method for every system. For larger systems, row reduction or numerical methods are usually more practical.

When Cramer's Rule Is Used

You will see it in algebra and linear algebra courses when the goal is understanding rather than speed, especially when you want to show how each variable depends on the coefficients and constants. It is most comfortable for 2×22 \times 2 and sometimes 3×33 \times 3 systems. Beyond that, the determinant work grows quickly, so it stops being the default.

Frequently Asked Questions

What is Cramer’s Rule?
Cramer’s Rule solves a square system of linear equations using determinants. For each variable, replace the matching column of the coefficient matrix with the constants column, compute that determinant, and divide it by the determinant of the original coefficient matrix. It gives each variable directly without elimination steps.
When does Cramer’s Rule not work?
Cramer’s Rule requires the same number of equations and unknowns, a square coefficient matrix, and a nonzero determinant. If the determinant is zero, the denominator in the formula is zero, and the system may have no solution or infinitely many solutions, so the rule cannot produce a unique answer.
How do you solve a 2x2 system with Cramer’s Rule?
First compute the determinant of the coefficient matrix and check it is nonzero. Then, for x, replace the first column with the constants and compute that determinant; for y, replace the second column. Divide each new determinant by the original one. The example in this guide gives x equals 2 and y equals 1.
What does a zero determinant mean for a system of equations?
A zero determinant of the coefficient matrix means the system does not have a unique solution. It may have no solution at all or infinitely many solutions. In that case, stop using Cramer’s Rule, because dividing by the zero determinant is undefined, and use another method to analyze the system.

Need help with a problem?

Upload your question and get a verified, step-by-step solution in seconds.

Open GPAI Solver →