Skip to content

2.e Cramers Rule

Cramer's Rule for Solving Systems of Linear Equations

Cramer's Rule is a method for solving systems of linear equations using determinants. It applies to a system of n linear equations with n unknowns, provided that the coefficient matrix has a non-zero determinant. This rule provides a straightforward way to find the values of the unknown variables by calculating determinants of matrices derived from the coefficient matrix.

1. Cramer’s Rule Overview

Consider a system of linear equations:

\[ a_1x + b_1y + c_1z = d_1 \\ a_2x + b_2y + c_2z = d_2 \\ a_3x + b_3y + c_3z = d_3 \]

This system can be represented in matrix form as:

\[ AX = B \]

Where: - A is the coefficient matrix, - X is the column matrix of unknowns, - B is the column matrix of constants.

\[ A = \begin{bmatrix} a_1 & b_1 & c_1 \\ a_2 & b_2 & c_2 \\ a_3 & b_3 & c_3 \end{bmatrix}, \quad X = \begin{bmatrix} x \\ y \\ z \end{bmatrix}, \quad B = \begin{bmatrix} d_1 \\ d_2 \\ d_3 \end{bmatrix} \]

Formula for Cramer’s Rule

Cramer’s Rule provides the solution for each variable \(x_i\) as:

\[ x_i = \frac{\text{det}(A_i)}{\text{det}(A)} \]

Where: - \(\text{det}(A)\) is the determinant of the coefficient matrix A. - \(A_i\) is the matrix obtained by replacing the \(i\)-th column of A with the constants matrix B.

If \(\text{det}(A)\) is non-zero, the system has a unique solution.


Example 1: Solving a 2x2 System Using Cramer’s Rule

Consider the following system of linear equations:

\[ 2x + 3y = 5 \\ 4x + y = 6 \]

Step 1: Write the system in matrix form

\[ \begin{bmatrix} 2 & 3 \\ 4 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 5 \\ 6 \end{bmatrix} \]

Here, the coefficient matrix A and the constants matrix B are:

\[ A = \begin{bmatrix} 2 & 3 \\ 4 & 1 \end{bmatrix}, \quad B = \begin{bmatrix} 5 \\ 6 \end{bmatrix} \]

Step 2: Find the determinant of A

The determinant of matrix A is:

\[ \text{det}(A) = (2 \times 1) - (3 \times 4) = 2 - 12 = -10 \]

Step 3: Find the determinant for each variable

  1. Determinant for \(x\) (\(\text{det}(A_x)\)): Replace the first column of A with B:
\[ A_x = \begin{bmatrix} 5 & 3 \\ 6 & 1 \end{bmatrix} \]

The determinant of \(A_x\) is:

\[ \text{det}(A_x) = (5 \times 1) - (3 \times 6) = 5 - 18 = -13 \]
  1. Determinant for \(y\) (\(\text{det}(A_y)\)): Replace the second column of A with B:
\[ A_y = \begin{bmatrix} 2 & 5 \\ 4 & 6 \end{bmatrix} \]

The determinant of \(A_y\) is:

\[ \text{det}(A_y) = (2 \times 6) - (5 \times 4) = 12 - 20 = -8 \]

Step 4: Solve for \(x\) and \(y\)

Using Cramer’s Rule:

\[ x = \frac{\text{det}(A_x)}{\text{det}(A)} = \frac{-13}{-10} = 1.3 \]
\[ y = \frac{\text{det}(A_y)}{\text{det}(A)} = \frac{-8}{-10} = 0.8 \]

Thus, the solution is \(x = 1.3\) and \(y = 0.8\).


Example 2: Solving a 3x3 System Using Cramer’s Rule

Consider the following system of equations:

\[ x + 2y + 3z = 9 \\ 2x + 3y + 5z = 19 \\ 3x + 2y + z = 10 \]

Step 1: Write the system in matrix form

\[ \begin{bmatrix} 1 & 2 & 3 \\ 2 & 3 & 5 \\ 3 & 2 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 9 \\ 19 \\ 10 \end{bmatrix} \]

Here: [ A = \begin{bmatrix} 1 & 2 & 3 \ 2 & 3 & 5 \ 3 & 2 & 1 \end{bmatrix}, \quad B = \begin{bmatrix} 9 \ 19 \ 10 \end{bmatrix} ]

Step 2: Find the determinant of A

\[ \text{det}(A) = 1 \times \begin{vmatrix} 3 & 5 \\ 2 & 1 \end{vmatrix} - 2 \times \begin{vmatrix} 2 & 5 \\ 3 & 1 \end{vmatrix} + 3 \times \begin{vmatrix} 2 & 3 \\ 3 & 2 \end{vmatrix} \]

[ = 1 \times (3 \times 1 - 5 \times 2) - 2 \times (2 \times 1 - 5 \times 3) + 3 \times (2 \times 2 - 3 \times 3) ] [ = 1 \times (3 - 10) - 2 \times (2 - 15) + 3 \times (4 - 9) ] [ = 1 \times -7 - 2 \times -13 + 3 \times -5 = -7 + 26 - 15 = 4 ]

Step 3: Find the determinant for each variable

  1. Determinant for \(x\) (\(\text{det}(A_x)\)): Replace the first column of A with B:
\[ A_x = \begin{bmatrix} 9 & 2 & 3 \\ 19 & 3 & 5 \\ 10 & 2 & 1 \end{bmatrix} \]

[ \text{det}(A_x) = 9 \times \begin{vmatrix} 3 & 5 \ 2 & 1 \end{vmatrix} - 2 \times \begin{vmatrix} 19 & 5 \ 10 & 1 \end{vmatrix} + 3 \times \begin{vmatrix} 19 & 3 \ 10 & 2 \end{vmatrix} ] [ = 9 \times (3 - 10) - 2 \times (19 - 50) + 3 \times (38 - 30) ] [ = 9 \times -7 - 2 \times -31 + 3 \times 8 = -63 + 62 + 24 = 23 ]

  1. Determinant for \(y\) (\(\text{det}(A_y)\)): Replace the second column of A with B:
\[ A_y = \begin{bmatrix} 1 & 9 & 3 \\ 2 & 19 & 5 \\ 3 & 10 & 1 \end{bmatrix} \]

After calculating, \(\text{det}(A_y) = 2\).

  1. Determinant for \(z\) (\(\text{det}(A_z)\)): Replace the third column of A with B:
\[ A_z = \begin{bmatrix} 1 & 2 & 9 \\ 2 & 3 & 19 \\ 3 & 2 & 10 \end{bmatrix} \]

After calculating, \(\text{det}(A_z) = 10\).

Step 4: Solve for \(x\), \(y\), and \(z\)

Using Cramer’s Rule:

[ x = \frac{\text{det}(A_x)}{\text{det}(A)} = \frac{23}{4} = 5.75 ] [ y = \frac{\text{det}(A_y)}{\text{det}(A)} = \frac{2}{4} = 0.5 ] [ z = \frac{\text{det}(A_z)}{\text{det}(A)} = \frac{10}{4} = 2.5 ]

Thus, the solution is \(x = 5.75\), \(y = 0.5\), and \(z = 2.5\).


Conclusion

Cramer's Rule is a straightforward and effective method for solving small systems of linear equations using determinants. While it becomes inefficient for large systems, it provides a clear and structured way to solve systems where the determinant of the coefficient matrix is non-zero, offering insight into the relationships between variables.