Summarize this article:
Last updated on September 18, 2025
Cramer’s Rule is a mathematical method used to solve a system of equations when the number of variables matches the number of equations. In the 1750s, mathematician Gabriel Cramer introduced this rule, which allows us to find any variable directly without calculating the others. Suppose in the equations there are 3 variables, such as x, y, and z. Normally, finding z requires knowing x and y, but Cramer’s rule allows us to calculate z directly without finding the others first. In this article, we will explore Cramer’s rule in detail.
• Cramer’s rule solves systems of linear equations using determinants.
• Values of the variables can be determined by the determinants.
• One determinant comes from the coefficients of variables (coefficient matrix).
• Another determinant is created by replacing one column with the constants (right-hand side).
• The value of a variable = determinant with replaced column ÷ coefficient determinant.
Let us see how Cramer’s rule works in the following system of equations:
2x + y + z = 3
x - y - z = 0
x + 2y + z = 0
Write the given equations with all coefficients:
2x + 1y + 1z = 3
1x - 1y - 1z = 0
1x + 2y + 1z = 0
Create the coefficient matrix and identify its determinant (D):
\(D= \begin{bmatrix} 2 & 1 & 1\\[0.3em] 1& -1 &-1 \\[0.3em] 1 & 2 &1 \end{bmatrix}\)
Here, the matrix only contains the coefficients of x, y and z.
The answer column:
\(\begin{bmatrix} 3\\[0.3em] 0 \\[0.3em] 0 \end{bmatrix}\)
Now, form Dx by replacing the 1st column with the answer column:
Dx = \( \begin{bmatrix} 3 & 1 & 1\\[0.3em] 0& -1 &-1 \\[0.3em] 0 & 2 &1 \end{bmatrix}\)
Here, the determinant with x-values is replaced.
Create Dy and Dz by replacing the 2nd and 3rd columns with the answer column.
Dy = \(\begin{bmatrix} 2 & 3 & 1\\[0.3em] 1& 0 &-1 \\[0.3em] 1& 0&1 \end{bmatrix}\)
Dz = \(\begin{bmatrix} 2 & 1 & 3\\[0.3em] 1& -1&0 \\[0.3em] 1& 2&0\end{bmatrix}\)
We can use cofactor expansion (3 × 3 rule). For a general 3 × 3 matrix, the formula is:
\(\begin{bmatrix} a& b& c\\[0.3em] d& e&f \\[0.3em] g& h&i\end{bmatrix} = aei +bfg + cdh - ceg -bdi - afh\)
D = \(\begin{bmatrix} 2 & 1 & 1\\[0.3em] 1& -1&-1 \\[0.3em] 1& 2&1\end{bmatrix}\)
D = (2) (-1) (1) = -2
(1) (-1) (1) = -1
(1) (1) (2) = 2
(1) (-1) (1) = -1
(1) (-1) (1) = -1
(2) (1) (2) = 4
D = (−2) + (−1) + 2 − (−1) − (−1) − 4 = −1 − 4 + 2 + 1 + 1 = -1
Hence, D = 3
Next Dx= \(\begin{bmatrix} 3 & 1 & 1\\[0.3em] 0& -1&-1 \\[0.3em] 0& 2&1\end{bmatrix}\)
Dx = (3) (-1) (1) = -3
(1) (-1) (0) = 0
(1) (0) (2) = 0
(1) (-1) (0) = 0
(1) (-1) (0) = 0
(3) (2) (1) = 6
Dx = −3 + 0 + 0 − 0 − 0 − 6 = −3 + 6 = 3
Thus, Dx = 3
Dy = \(\begin{bmatrix} 2 & 3& 1\\[0.3em] 1& 0&-1 \\[0.3em] 1& 0&1\end{bmatrix}\)
Dy = (2) (0) (1) = 0
(3) (-1) (1) = -3
(1) (1) (0) = 0
(1) (0) (1) = 0
(1) (-1) (2) = -2
(2) (0) (1) = 0
Dy = 0 − 3 + 0 − 0 + 2 − 0 = −3 + 2 = −6
Dy = -6
Dz = \(\begin{bmatrix} 2 & 1& 3\\[0.3em] 1& -1&0 \\[0.3em] 1& 2&0\end{bmatrix}\)
Dz = (2) (-1) (0) = 0
(1) (0) (1) = 0
(3) (1) (2) = 6
(3) (-1) (1) = -3
(2) (0) (2) = 0
(2) (1) (0) = 0
Dz = 0 + 0 + 6 − (−3) = 6 + 3 = 9
Dz = 9
Now, we can apply Cramer’s rule.
x = Dx / D = 3 / 3 = 1
y = Dy / D = -6 / 3 = -2
z = Dz / D = 9 / 3 = 3
So, the values for the variables:
x = 1
y = -2
z = 3
Using Cramer’s rule, if a system has five equations in five unknowns, we can solve for just one variable if that is all we need. The system of equations consists of n variables x1, x2, x3…..xn can be written in the matrix form as:
AX = B
Here,
A = the square matrix that represents the coefficient matrix.
X = the column matrix with variables.
B = the column matrix which contains the constants (present on the right side of the equations).
For finding the value of x, we use the formula shown in the diagram.
By using the above formula, we can determine the individual values of x, y, and z.
There are specific conditions for Cramer’s rule. There are two important conditions for this rule, they are :
First condition: It happens when D is equal to zero, and there is an infinite number of solutions. At least one determinant of the numerator, such as DX, Dy, etc, is also 0.
Second condition: It happens when none of the numerators are zero, but D is equal to zero, and there is no solution.
When the determinant of the coefficient matrix (D) is not equal to zero, then Cramer’s rule is applicable. The system has a unique solution, and we can find a single value for each variable. If D is equal to zero, then there is an endless number of solutions or no solution for the system.
Using Cramer’s rule, let’s solve 2 systems of 2 equations with 2 variables. The equations are:
Writing the system in matrix form as:
AX = B
Where A = the coefficient matrix
\( \begin{bmatrix} a_1 & b_1 & c_1\\[0.3em] d_2& e_2 & f_2 \\[0.3em] g_3 & h_3 &i_3\end{bmatrix}\)
X = the variable matrix
\( \begin{bmatrix} x\\[0.3em] y \\[0.3em] z\end{bmatrix}\)
B = The constant matrix
\( \begin{bmatrix} d_1\\[0.3em] d_2 \\[0.3em] d_3\end{bmatrix}\)
Next, we can calculate the three determinants of the system.
The system has a unique solution when D is not equal to zero.
x = Dx / D
y = Dy / D
z = Dz / D
Determinant calculation example:
Suppose a system is
a1x + b1y + c1z = d1
a2x + b2y + c2z = d2
a3x + b3y + c3z = d3
Then the coefficient matrix A is
| a1 b1 c1 |
| a2 b2 c2 |
| a3 b3 c3 |
The determinant D is calculated as,
D = a1(b2c3 - b3c2) - b1(a2c3 - a3c2) + c1(a2b3 - a3b2)
Cramer's Rule Chart
When D ≠ 0, Cramer’s rule is applicable, then the system has a unique solution. The system has an infinite number of solutions when D = 0. There is no solution for the system when none of the numerators is 0. Here is a visual representation of Cramer’s rule, and it explains what type of solution it might have.
To solve systems of linear equations, students need proper knowledge of Cramer’s rule, which is a fundamental method in mathematics. Children often make mistakes when working with determinants and equations. Here are some errors and their helpful solutions to prevent these mistakes in calculations.
We can apply Cramer’s rule when we need to solve multiple variables and equations. This mathematical method has several real-world applications in various fields, ranging from economics to engineering.
Solve: 2x + 3y = 8 and 4x - y = 2
x = 1
y = 2
First, we can calculate the determinant (D):
D =
\(\begin{bmatrix}2&3 \\[0.3em] 4 &-1 \end{bmatrix}\)
D = a1b2 - a2b1
= (2) (-1) - (4) (3)
= -2 - 12 = -14
D = -14
Next, calculate Dx:
Dx = \(\begin{bmatrix}8&3 \\[0.3em]2 &-1 \end{bmatrix}\)
Dx = c1b2 - c2b1
= (8) (-1) - (2) (3)
= -8 - 6 = -14
Dx = -14
Now, find Dy:
Dy = \(\begin{bmatrix}2&8 \\[0.3em] 4 &2 \end{bmatrix}\)
Dy = a1c2 - a2c1
Dy = (2) (2) - (4) (8)
= 4 - 32 = -28
Dy = -28
Next, find x and y:
x = Dx / D
= -14 / -14 = 1
y = Dy / D
= -28 / -14 = 2
Therefore, x = 1
y = 2
Solve x + y = 5 and 2x - y = 4
x = 3
y = 2
First, we can find the value of D:
We can find D, Dx, and Dy using the above formulas.
D = \(\begin{bmatrix}1&1 \\[0.3em] 2 &-1\end{bmatrix}\)
D = a1b2 - a2b1
D = (1) (-1) - (2) (1)
= -1 - 2 = -3
Dx =
\(\begin{bmatrix}5&1 \\[0.3em] 4 &-1\end{bmatrix}\)
Dx = c1b2 - c2b1
Dx= (5) (-1) - (4) (1)
= -5 - 4 = -9
Dy = \(\begin{bmatrix}1&5 \\[0.3em] 2 &4\end{bmatrix}\)
Dy = a1c2 - a2c1
Dy = (1) (4) - (2) (5)
= 4 - 10 = -6
Now, find the value of x and y:
x = Dx / D
= -9 / -3 = 3
y = Dy / D
= -6 / -3 = 2
Hence, x = 3 and y = 2
Solve 3x - y = 7 and 2x + 5y = -1
x = 2
y = -1
First we can find the value of D:
D = \(\begin{bmatrix}3&-1 \\[0.3em] 2 &5\end{bmatrix}\)
D = a1b2 - a2b1
= (3) (5) - (2) (-1)
= 15 + 2 = 17
Dx = \(\begin{bmatrix}7&-1 \\[0.3em] -1 &5\end{bmatrix}\)
Dx = c1b2 - c2b1
Dx = (7) (5) - (-1) (-1)
= 35 - 1 = 34
Dy = \(\begin{bmatrix}3&7 \\[0.3em] 2&-1\end{bmatrix}\)
Dy = a1c2 - a2c1
Dy = (3) (-1) - (2) (7)
= -3 - 14 = -17
Now, find the value of x and y:
x = Dx / D
= 34 / 17 = 2
y = Dy / D
= -17 / 17 = -1
Therefore, x = 2 and y = -1.
Solve x + y + z = 6; 2x - y + 3z = 14; x + 4y - z = -2
x = -4 / 3
y = 4 / 3
z = 18 / 3 = 6
The 3 × 3 determinant formulas are:
a1x + b1y + c1z = d1
a2x + b2y + c2z = d2
a3x + b3y + c3z = d3
Now, we can find D:
\(D= \begin{bmatrix} 1 & 1 & 1\\[0.3em] 2& -1 &3\\[0.3em] 1 & 4 &-1 \end{bmatrix}\)
D = a1 (b2 c3 - b3 c2) - b1 (a2 c3 - a3 c2) + c1 (a2 b3 - a3 b2)
= 1 (−1 × −1 − 3 × 4) − 1 (2 × −1 − 3 × 1) + 1 (2 × 4 − (−1) × 1)
= 1 (1 − 12) − 1 (−2 − 3) + 1 (8 + 1)
= −11 + 5 + 9 = 3
Dx = \( \begin{bmatrix} 6 & 1 & 1\\[0.3em] 14& -1 &3\\[0.3em] -2 & 4 &-1 \end{bmatrix}\)
To find the value of Dx, use the same formula:
Dx = 6 (−1 × −1 − 3 × 4) −1 (14 × −1 − 3 × −2) + 1 (14 × 4 − (−1) × −2)
= 6 (1 − 12) − (−14 + 6) + (56 − 2)
= −66 + 8 + 54 = −4
Dy = \( \begin{bmatrix} 1 & 6 & 1\\[0.3em] 2& 14 &3\\[0.3em] 1 &-2 &-1 \end{bmatrix}\)
Dy = 1 (14 × −1 − 3 × −2) − 6 (2 × −1 − 3 × 1) + 1 (2 × −2 − 14 × 1)
= 1 (−14 + 6) − 6 (−2 − 3) + (−4 − 14)
= −8 + 30 − 18 = 4
Dz = \( \begin{bmatrix} 1 & 1 & 6\\[0.3em] 2& -1&14\\[0.3em] 1 &4&-2 \end{bmatrix}\)
Dz = 1 (−1 × −2 − 14 × 4) − 1 (2 × −2 − 14 × 1) + 6 (2 × 4 − (−1) × 1)
= 1 (2 − 56) − (−4 − 14) + 6 (8 + 1)
= −54 + 18 + 54 = 18
Next, find x, y and z:
Therefore, x = -4 / 3
y = 4 / 3
z = 18 / 3 = 6
Solve: x - 2y = 4 and 3x + y = 5
x = 2
y = -1
First, we can find the value of D:
D = \(\begin{bmatrix}1&-2\\[0.3em] 3 &1\end{bmatrix}\)
D = a1b2 - a2b1
= (1) (1) - (3) (-2)
= 1 + 6 = 7
Dx = \(\begin{bmatrix}4&-2\\[0.3em] 5&1\end{bmatrix}\)
Dx = c1b2 - c2b1
= (4) (1) - (5) (-2)
= 4 + 10 = 14
Dy = \(\begin{bmatrix}1&4\\[0.3em] 3&5\end{bmatrix}\)
Dy = a1c2 - a2c1
= (1) (5) - (3) (4)
= 5 - 12 = -7
Now, find the value of x and y:
x = Dx / D
= 14 / 7 = 2
y = Dy / D
= -7 / 7 = -1
Therefore, x = 2 and y = -1
Jaskaran Singh Saluja is a math wizard with nearly three years of experience as a math teacher. His expertise is in algebra, so he can make algebra classes interesting by turning tricky equations into simple puzzles.
: He loves to play the quiz with kids through algebra to make kids love it.