Cramer's Rule solves a square system of linear equations by using determinants. Replace one column at a time, compute a determinant, and divide by the determinant of the original coefficient matrix. It works only when det(A)0\det(A) \ne 0.

If the system is written as

Ax=bAx = b

and AA is square with det(A)0\det(A) \ne 0, then the system has a unique solution and Cramer's Rule can find each variable directly.

Cramer's Rule formula

For the variable xix_i, the rule is

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

where AiA_i is the matrix formed by replacing the iith column of AA with the constants from bb.

The condition matters. If det(A)=0\det(A) = 0, the denominator is zero, so Cramer's Rule does not give a unique solution.

When you can use Cramer's Rule

Use it only when all of these are true:

  1. The system has the same number of equations and unknowns.
  2. The coefficient matrix is square.
  3. The determinant of the coefficient matrix is not zero.

If one condition fails, stop there. For example, a zero determinant means the system may have no solution or infinitely many solutions, so Cramer's Rule is not the right tool for a unique solve.

Solve 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

Now 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

Again 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.

Why Cramer's Rule matters

Cramer's Rule is not usually the fastest method for a large system. Students learn it because it connects three ideas cleanly:

  • solving linear systems
  • determinants
  • the condition for a unique solution

If det(A)0\det(A) \ne 0, the system has one unique solution. If det(A)=0\det(A) = 0, something breaks: there may be no solution or infinitely many solutions.

Common mistakes with Cramer's Rule

Using it when det(A)=0\det(A) = 0

This is the main check. Cramer's Rule relies on dividing by det(A)\det(A), so a zero determinant means the method does not apply for a unique solution.

Replacing the wrong column

To solve for xx, replace the xx-column. To solve for yy, replace the yy-column. The constants column does not get appended; it replaces one column at a time.

Treating it as the best method for every system

For larger systems, row reduction or numerical methods are usually more practical. Cramer's Rule is most useful for small systems and for understanding the role of determinants.

When Cramer's Rule is used

You will usually see Cramer's Rule in algebra and linear algebra courses when the goal is understanding rather than speed. It is especially useful when you want to show how each variable depends on the coefficients and constants.

In practice, it is most comfortable for 2×22 \times 2 systems and sometimes 3×33 \times 3 systems. Beyond that, the determinant work grows quickly, so it stops being the default method.

Try a similar problem

Try solving

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

First compute det(A)\det(A). If it is nonzero, replace one column at a time and solve for xx and yy. After you finish by hand, compare your setup with a matrix solver to check the determinants as well as the final answer.

Need help with a problem?

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

Open GPAI Solver →