Cramer's Rule

Cramer's Rule uses determinants to solve a square system of linear equations by replacing columns of the coefficient matrix with the constants.

xi=detAidetAx_i = \frac{\det A_i}{\det A}

Solve a problem with Cramer's Rule

Type the problem. The solver will use Cramer's Rule where Cramer's Rule is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Cramer's Rule takes
AA
xix_i
ii
Cramer's Rule
SymbolMeaning
AAThe coefficient matrix, whose entries are the numbers multiplying the variables in your system; if the system has two variables, A is 2×2.
xix_iThe i-th variable (such as xx or yy) that you are solving for; the subscript ii indicates which variable position you are finding.
iiThe index or position number, starting from 1; column 1 corresponds to the first variable xx, column 2 to yy, and so on.

When to use it

When you have a square system of linear equations and want a formula-based approach instead of elimination or substitution.

Level

Usually taught in: Pre-Calculus

Worked examples

1. Solve a 2×2 system with small integer coefficients

Problem

Solve the system 2x+y=52x + y = 5 and xy=1x - y = 1 for both variables.
  1. A=(2111),detA=2(1)1(1)=21=3A = \begin{pmatrix} 2 & 1 \\ 1 & -1 \end{pmatrix}, \quad \det A = 2(-1) - 1(1) = -2 - 1 = -3

    Write the coefficient matrix A and compute its determinant using the 2×2 formula adbcad - bc.

  2. Ax=(5111),detAx=5(1)1(1)=51=6A_x = \begin{pmatrix} 5 & 1 \\ 1 & -1 \end{pmatrix}, \quad \det A_x = 5(-1) - 1(1) = -5 - 1 = -6

    Replace the first column of A with the constants [5,1][5, 1] to form AxA_x, then compute its determinant.

  3. Ay=(2511),detAy=2(1)5(1)=25=3A_y = \begin{pmatrix} 2 & 5 \\ 1 & 1 \end{pmatrix}, \quad \det A_y = 2(1) - 5(1) = 2 - 5 = -3

    Replace the second column of A with the constants [5,1][5, 1] to form AyA_y, then compute this determinant.

  4. x=detAxdetA=63=2,y=detAydetA=33=1x = \frac{\det A_x}{\det A} = \frac{-6}{-3} = 2, \quad y = \frac{\det A_y}{\det A} = \frac{-3}{-3} = 1

    Apply Cramer's Rule: divide each new determinant by detA\det A to find both variables.

Answer: x=2,y=1x = 2, \quad y = 1

Cramer's Rule gives us each variable directly from a determinant ratio, without substitution or elimination. This method is clean and systematic for small systems.

2. Solve a system with negative coefficients and fractional answers

Problem

Solve 2x+3y=52x + 3y = 5 and x2y=1x - 2y = 1 for xx and yy.
  1. A=(2312),detA=2(2)3(1)=43=7A = \begin{pmatrix} 2 & 3 \\ 1 & -2 \end{pmatrix}, \quad \det A = 2(-2) - 3(1) = -4 - 3 = -7

    Set up the coefficient matrix and compute its determinant; verify it is nonzero so Cramer's Rule applies.

  2. Ax=(5312),detAx=5(2)3(1)=103=13A_x = \begin{pmatrix} 5 & 3 \\ 1 & -2 \end{pmatrix}, \quad \det A_x = 5(-2) - 3(1) = -10 - 3 = -13

    Replace the first column with the constants [5,1][5, 1] to form AxA_x and compute its determinant.

  3. Ay=(2511),detAy=2(1)5(1)=25=3A_y = \begin{pmatrix} 2 & 5 \\ 1 & 1 \end{pmatrix}, \quad \det A_y = 2(1) - 5(1) = 2 - 5 = -3

    Replace the second column with the constants [5,1][5, 1] to form AyA_y and compute this determinant.

  4. x=detAxdetA=137=137x = \frac{\det A_x}{\det A} = \frac{-13}{-7} = \frac{13}{7}

    For xx, simplify: two negatives become positive, so 137=137\frac{-13}{-7} = \frac{13}{7}.

  5. y=detAydetA=37=37y = \frac{\det A_y}{\det A} = \frac{-3}{-7} = \frac{3}{7}

    For yy, similarly 37=37\frac{-3}{-7} = \frac{3}{7}, which is already in lowest terms.

Answer: x=137,y=37x = \frac{13}{7}, \quad y = \frac{3}{7}

This example shows that Cramer's Rule handles negative coefficients and fractional answers smoothly; the determinants being negative is normal, and the quotient of two negatives gives a positive result.

3. Find temperature coefficients in a chemistry lab experiment

Problem

A chemistry lab measures heat released by two connected reactions. The first reaction contributes 2x+y=122x + y = 12 degrees to the system, and the second contributes x+3y=13x + 3y = 13, where xx and yy are heat coefficients. Find both coefficients.
  1. A=(2113),detA=2(3)1(1)=61=5A = \begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix}, \quad \det A = 2(3) - 1(1) = 6 - 1 = 5

    Set up the coefficient matrix from the two heat equations and compute its determinant.

  2. Ax=(121133),detAx=12(3)1(13)=3613=23A_x = \begin{pmatrix} 12 & 1 \\ 13 & 3 \end{pmatrix}, \quad \det A_x = 12(3) - 1(13) = 36 - 13 = 23

    Replace the first column with the measured heat values [12,13][12, 13] to form AxA_x and find its determinant.

  3. Ay=(212113),detAy=2(13)12(1)=2612=14A_y = \begin{pmatrix} 2 & 12 \\ 1 & 13 \end{pmatrix}, \quad \det A_y = 2(13) - 12(1) = 26 - 12 = 14

    Replace the second column with [12,13][12, 13] to form AyA_y and compute its determinant.

  4. x=detAxdetA=235=4.6x = \frac{\det A_x}{\det A} = \frac{23}{5} = 4.6

    Divide to find x=235x = \frac{23}{5}, which equals 4.6 in decimal form.

  5. y=detAydetA=145=2.8y = \frac{\det A_y}{\det A} = \frac{14}{5} = 2.8

    Similarly, y=145=2.8y = \frac{14}{5} = 2.8, the heat coefficient for the second reaction.

Answer: x=235 or 4.6,y=145 or 2.8x = \frac{23}{5} \text{ or } 4.6, \quad y = \frac{14}{5} \text{ or } 2.8

This real-world scenario demonstrates that Cramer's Rule is practical in science: we find both unknowns directly from determinant ratios without iteration, substitution, or back-substitution.

Common mistakes

Where Cramer's Rule usually goes wrong
Answer came out wrong
Computing x=detAdetAxx = \frac{\det A}{\det A_x} instead of x=detAxdetAx = \frac{\det A_x}{\det A}.
Remember that the modified matrix AxA_x (where you replace the i-th column with constants) goes on top, and the original matrix A goes on the bottom.
Using Cramer's Rule when detA=0\det A = 0, writing x=detAx0x = \frac{\det A_x}{0}.
Always compute detA\det A first; if it is zero, use Gaussian elimination or substitution to analyze the system instead.
Replacing the wrong column—for example, replacing the second column when solving for xx instead of the first.
Keep a clear mental note: to find xix_i, replace column ii with the constants. Double-check which column you are modifying before computing the determinant.
The mistakeWhy it is wrongThe fix
Computing x=detAdetAxx = \frac{\det A}{\det A_x} instead of x=detAxdetAx = \frac{\det A_x}{\det A}.Students confuse which determinant goes in the numerator and which in the denominator, reversing the formula.Remember that the modified matrix AxA_x (where you replace the i-th column with constants) goes on top, and the original matrix A goes on the bottom.
Using Cramer's Rule when detA=0\det A = 0, writing x=detAx0x = \frac{\det A_x}{0}.If the determinant of the coefficient matrix is zero, the system has either no solution or infinitely many solutions, making division undefined.Always compute detA\det A first; if it is zero, use Gaussian elimination or substitution to analyze the system instead.
Replacing the wrong column—for example, replacing the second column when solving for xx instead of the first.Column 1 corresponds to variable xx, column 2 to variable yy, and so on; swapping them gives the value of the wrong variable.Keep a clear mental note: to find xix_i, replace column ii with the constants. Double-check which column you are modifying before computing the determinant.

Tips and when to use something else

  • Cramer's Rule is fast for 2×2 and 3×3 systems, but for 4×4 or larger, Gaussian elimination is significantly more efficient.
  • Always verify that detA0\det A \neq 0 before applying the rule; if the determinant is zero, the system has no unique solution.
  • For systems with many fractions or decimals already present, substitution or elimination may be faster and lead to simpler arithmetic.
  • If you get a fractional answer, leave it as a simplified fraction unless the problem asks for a decimal; fractions are exact.

Frequently asked questions

Can I use Cramer's Rule if the determinant of A is zero?
No. A zero determinant means the system is either inconsistent (no solution) or dependent (infinitely many solutions). Since Cramer's Rule requires division by detA\det A, it fails when the determinant is zero. Use Gaussian elimination to determine which case you have and to find any solutions.
Does Cramer's Rule work for systems with more unknowns than equations, or vice versa?
No, Cramer's Rule applies only to square systems, where the number of equations equals the number of unknowns. For overdetermined (more equations) or underdetermined (more unknowns) systems, use Gaussian elimination or matrix methods instead.
Is Cramer's Rule faster than substitution or elimination?
For 2×2 and 3×3 systems, all three methods are roughly comparable in speed. However, for 4×4 or larger systems, Gaussian elimination becomes much faster computationally because it requires fewer determinant calculations.
What should I do if my answer is a fraction?
Fractions are normal and correct in algebra. Leave your answer as a simplified fraction, or convert to a decimal only if the problem explicitly requests it. Fractions are exact values, while decimals are approximations.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18