Cramer's Rule
2026-02-21 20:37 Diff

Properties of Cramer's rule are:
 

  1. Cramer’s rule solves systems of linear equations using determinants.

  2. Values of the variables can be determined by the determinants.

  3. One determinant comes from the coefficients of variables (coefficient matrix).

  4. Another determinant is created by replacing one column with the constants (right-hand side).

  5. 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 = Apply the cofactor expansion

\((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 \(D_x\)=   \(\begin{bmatrix} 3 & 1 & 1\\[0.3em] 0& -1&-1 \\[0.3em] 0& 2&1\end{bmatrix}\)

\(D_x\) = Apply the cofactor expansion

\((3) (-1) (1) = -3\\ (1) (-1) (0) = 0\\ (1) (0) (2) = 0\\ (1) (-1) (0) = 0\\ (1) (-1) (0) = 0\\ (3) (2) (1) = 6\)

\(D_x = −3 + 0 + 0 − 0 − 0 − 6 = −3 + 6 = 3\)

Thus, \(D_x = 3\)

\(D_y\) =  \(\begin{bmatrix} 2 & 3& 1\\[0.3em] 1& 0&-1 \\[0.3em] 1& 0&1\end{bmatrix}\)

\(D_y\) = Apply the cofactor expansion

\((2) (0) (1) = 0\\ (3) (-1) (1) = -3\\ (1) (1) (0) = 0\\ (1) (0) (1) = 0\\ (1) (-1) (2) = -2\\  (2) (0) (1) = 0 \)

\(D_y = 0 − 3 + 0 − 0 + 2 − 0 = −3 + 2 = −6\)

\(D_y = -6\)

\(D_z\) = \(\begin{bmatrix} 2 & 1& 3\\[0.3em] 1& -1&0 \\[0.3em] 1& 2&0\end{bmatrix}\)

\(D_z\) = Apply the cofactor expansion

\((2) (-1) (0) = 0\\ (1) (0) (1) = 0\\ (3) (1) (2) = 6\\ (3) (-1) (1) = -3\\ (2) (0) (2) = 0\\ (2) (1) (0) = 0\)

\(D_z = 0 + 0 + 6 − (−3) = 6 + 3 = 9\)

\(D_z = 9\)


Now, we can apply Cramer’s rule. 

\( x = \frac{D_x}{D} = \frac{3}{3} = 1 \)

\( y = \frac{D_y}{D} = \frac{-6}{3} = -2 \)

\( z = \frac{D_z}{D} = \frac{9}{3} = 3 \)

So, the values for the variables:

\(x = 1\\ y = -2\\ z = 3\)