Back to: Mathematics – Linear Algebra
Cramer’s Rule for Solving Systems of Linear Equations
😊 Hello, students! Cramer’s Rule is a beautiful formula that lets us solve square systems of linear equations using determinants. It’s elegant, theoretical, and perfect for small systems—but it also reveals deep connections between matrices, geometry, and solutions. Let’s explore it in full detail!
1. Applicability: Square, Non-Singular Systems
Cramer’s Rule applies only to a system of \( n \) linear equations in \( n \) unknowns: \[ A\mathbf{x} = \mathbf{b} \] where \( A \) is an \( n \times n \) matrix, **and** \( \det(A) \ne 0 \).
If \( \det(A) = 0 \), the system is either inconsistent or has infinitely many solutions—Cramer’s Rule **does not apply**.
2. The Rule Itself
Let \( A = (a_{ij}) \) be an \( n \times n \) matrix with \( \det(A) \ne 0 \). Let \( A_i(\mathbf{b}) \) be the matrix obtained by replacing the \( i \)-th column of \( A \) with the vector \( \mathbf{b} \).
Then the unique solution to \( A\mathbf{x} = \mathbf{b} \) is: \[ x_i = \frac{\det(A_i(\mathbf{b}))}{\det(A)}, \quad \text{for } i = 1, 2, \dots, n \]
💡 Why it works: This comes from properties of determinants and the inverse: \( \mathbf{x} = A^{-1}\mathbf{b} = \frac{1}{\det(A)} \operatorname{adj}(A) \mathbf{b} \), and the \( i \)-th component turns out to be \( \det(A_i(\mathbf{b}))/\det(A) \).
3. Example: 2×2 Non-Homogeneous System
Solve: \[ \begin{cases} 2x + y = 5 \\ x – y = 1 \end{cases} \]
Matrix form: \( A = \begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix},\ \mathbf{b} = \begin{bmatrix} 5 \\ 1 \end{bmatrix} \)
Compute \( \det(A) = (2)(-1) – (1)(1) = -2 – 1 = -3 \ne 0 \) ⇒ Cramer’s Rule applies.
Replace column 1 with \( \mathbf{b} \): \[ A_1(\mathbf{b}) = \begin{bmatrix} 5 & 1 \\ 1 & -1 \end{bmatrix},\quad \det(A_1) = -5 – 1 = -6 \]
Replace column 2 with \( \mathbf{b} \): \[ A_2(\mathbf{b}) = \begin{bmatrix} 2 & 5 \\ 1 & 1 \end{bmatrix},\quad \det(A_2) = 2 – 5 = -3 \]
So: \[ x = \frac{-6}{-3} = 2,\quad y = \frac{-3}{-3} = 1 \]
✅ Solution: \( (x, y) = (2, 1) \)
4. Example: 3×3 System
Solve: \[ \begin{cases} x + 2y – z = 3 \\ 2x + 5y + 3z = 8 \\ -x – y = -1 \end{cases} \]
Matrix form:
Compute \( \det(A) = 1(0 + 3) – 2(0 + 3) -1(-2 + 5) = 3 – 6 – 3 = -6 \ne 0 \)
Now compute each \( \det(A_i) \):
- \( \det(A_1) = \begin{vmatrix} 3 & 2 & -1 \\ 8 & 5 & 3 \\ -1 & -1 & 0 \end{vmatrix} = 12 \)
- \( \det(A_2) = \begin{vmatrix} 1 & 3 & -1 \\ 2 & 8 & 3 \\ -1 & -1 & 0 \end{vmatrix} = 6 \)
- \( \det(A_3) = \begin{vmatrix} 1 & 2 & 3 \\ 2 & 5 & 8 \\ -1 & -1 & -1 \end{vmatrix} = 18 \)
So: \[ x = \frac{12}{-6} = -2,\quad y = \frac{6}{-6} = -1,\quad z = \frac{18}{-6} = -3 \]
⚠️ Wait! Check: Plug into first equation: \( -2 + 2(-1) – (-3) = -2 -2 +3 = -1 \ne 3 \)
Let’s recompute \( \det(A) \) carefully:
\( \det(A) = 1(5\cdot0 – 3\cdot(-1)) – 2(2\cdot0 – 3\cdot(-1)) + (-1)(2\cdot(-1) – 5\cdot(-1)) \)
\( = 1(0 + 3) – 2(0 + 3) -1(-2 + 5) = 3 – 6 – 3 = -6 \) ✓
Now \( \det(A_1) \):
\( 3(0 + 3) – 2(0 + 3) -1(-8 + 5) = 9 – 6 -1(-3) = 3 + 3 = 6 \)
So \( x = 6 / (-6) = -1 \), and so on.
✅ Final correct solution: \( x = -1,\ y = 2,\ z = 0 \) (matches RREF)
5. Homogeneous Systems: \( A\mathbf{x} = \mathbf{0} \)
For \( A\mathbf{x} = \mathbf{0} \):
- If \( \det(A) \ne 0 \), then only the **trivial solution** \( \mathbf{x} = \mathbf{0} \) exists.
- If \( \det(A) = 0 \), then **non-trivial solutions** exist (infinitely many).
Cramer’s Rule gives \( x_i = \frac{0}{\det(A)} = 0 \) when \( \det(A) \ne 0 \).
System: \[ \begin{cases} x + y + z = 0 \\ 2x + 3y + z = 0 \\ x + 2y = 0 \end{cases} \]
\( \det(A) = \begin{vmatrix} 1&1&1\\2&3&1\\1&2&0 \end{vmatrix} = 1(0-2) -1(0-1) +1(4-3) = -2 +1 +1 = 0 \)
So Cramer’s Rule **does not apply**—and indeed, non-trivial solutions exist (e.g., \( (1,-1,0) \)).
6. When (Not) to Use Cramer’s Rule
⚠️ Limitations:
- Only for **square** systems (\( n \) equations, \( n \) unknowns)
- Only when \( \det(A) \ne 0 \) (unique solution)
- Computationally expensive for large \( n \) (requires \( n+1 \) determinants)
- Not suitable for systems with parameters or symbolic entries (unless small)
✅ Best for: 2×2 or 3×3 systems on exams, theoretical proofs, or when determinants are easy.
7. Geometric Meaning
In 2D, \( \det(A) \) is the **signed area** of the parallelogram spanned by the column vectors of \( A \).
\( \det(A_1(\mathbf{b})) \) is the area spanned by \( \mathbf{b} \) and the second column.
Then \( x = \frac{\text{Area with } \mathbf{b}}{\text{Area with columns of } A} \) — a **ratio of areas**!
Similarly in 3D: **ratio of volumes**.
📌 Key Takeaways:
- Cramer’s Rule: \( x_i = \dfrac{\det(A_i(\mathbf{b}))}{\det(A)} \)
- Only for square, non-singular systems
- Homogeneous: trivial solution iff \( \det(A) \ne 0 \)
- Beautiful but impractical for large systems
Cramer’s Rule – Questions & Full Solutions
😊 Hello students! Below are all Cramer’s Rule questions from your documents, each with a complete, detailed solution. Master these to solve 2×2 and 3×3 systems quickly and accurately!
Q1. Use Cramer’s Rule to solve:
Solution:
Matrix form: \( A = \begin{bmatrix} 2 & 1 & -1 \\ 1 & -3 & 4 \\ 3 & 2 & -2 \end{bmatrix},\ \mathbf{b} = \begin{bmatrix} 6 \\ 7 \\ 4 \end{bmatrix} \)
Compute \( \det(A) \):
Now compute determinants with columns replaced:
- \( \det(A_1) = \begin{vmatrix} 6 & 1 & -1 \\ 7 & -3 & 4 \\ 4 & 2 & -2 \end{vmatrix} = -4 \)
- \( \det(A_2) = \begin{vmatrix} 2 & 6 & -1 \\ 1 & 7 & 4 \\ 3 & 4 & -2 \end{vmatrix} = 3 \)
- \( \det(A_3) = \begin{vmatrix} 2 & 1 & 6 \\ 1 & -3 & 7 \\ 3 & 2 & 4 \end{vmatrix} = -2 \)
Thus:
✅ Solution: \( (4, -3, 2) \)
Q2. Solve using Cramer’s Rule:
Solution:
\( A = \begin{bmatrix} 1 & 2 & -1 \\ 2 & 5 & 3 \\ -1 & -1 & 0 \end{bmatrix},\ \mathbf{b} = \begin{bmatrix} 3 \\ 8 \\ -1 \end{bmatrix} \)
\( \det(A) = 1(0 + 3) – 2(0 + 3) -1(-2 + 5) = 3 – 6 – 3 = -6 \)
Compute:
- \( \det(A_1) = \begin{vmatrix} 3 & 2 & -1 \\ 8 & 5 & 3 \\ -1 & -1 & 0 \end{vmatrix} = 6 \)
- \( \det(A_2) = \begin{vmatrix} 1 & 3 & -1 \\ 2 & 8 & 3 \\ -1 & -1 & 0 \end{vmatrix} = 6 \)
- \( \det(A_3) = \begin{vmatrix} 1 & 2 & 3 \\ 2 & 5 & 8 \\ -1 & -1 & -1 \end{vmatrix} = 18 \)
So:
✅ Solution: \( (-1, -1, -3) \)
Q3. Solve using Cramer’s Rule:
Solution:
\( A = \begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix},\ \mathbf{b} = \begin{bmatrix} 5 \\ 1 \end{bmatrix} \)
\( \det(A) = -2 – 1 = -3 \)
\( \det(A_1) = \begin{vmatrix} 5 & 1 \\ 1 & -1 \end{vmatrix} = -6,\quad \det(A_2) = \begin{vmatrix} 2 & 5 \\ 1 & 1 \end{vmatrix} = -3 \)
\( x = \frac{-6}{-3} = 2,\ y = \frac{-3}{-3} = 1 \)
✅ Solution: \( (2, 1) \)
Q4. Discuss the use of Cramer’s Rule for the homogeneous system:
Solution:
Homogeneous system: \( A\mathbf{x} = \mathbf{0} \)
Compute \( \det(A) = \begin{vmatrix} 1 & 1 & 1 \\ 2 & 3 & 1 \\ 1 & 2 & 0 \end{vmatrix} = 1(0 – 2) – 1(0 – 1) + 1(4 – 3) = -2 + 1 + 1 = 0 \)
Since \( \det(A) = 0 \), Cramer’s Rule **does not apply**.
✅ But we know: homogeneous system with \( \det(A) = 0 \) has **non-trivial solutions** (e.g., \( (1, -1, 0) \)).
Q5. For what values of \( \lambda \) does the system have a unique solution?
Solution:
Unique solution ⇔ \( \det(A) \ne 0 \)
\( A = \begin{bmatrix} 1 & 1 & 1 \\ 2 & 3 & 1 \\ 1 & 1 & \lambda \end{bmatrix} \)
\( \det(A) = 1(3\lambda – 1) – 1(2\lambda – 1) + 1(2 – 3) = 3\lambda – 1 – 2\lambda + 1 – 1 = \lambda – 1 \)
So \( \det(A) \ne 0 \) ⇔ \( \lambda \ne 1 \)
✅ For all \( \lambda \ne 1 \), Cramer’s Rule gives a unique solution.
Q6. Solve using Cramer’s Rule:
Solution:
\( A = \begin{bmatrix} 2 & 3 \\ 4 & -1 \end{bmatrix},\ \mathbf{b} = \begin{bmatrix} 7 \\ 1 \end{bmatrix} \)
\( \det(A) = -2 – 12 = -14 \)
\( \det(A_1) = \begin{vmatrix} 7 & 3 \\ 1 & -1 \end{vmatrix} = -7 – 3 = -10 \)
\( \det(A_2) = \begin{vmatrix} 2 & 7 \\ 4 & 1 \end{vmatrix} = 2 – 28 = -26 \)
\( x = \frac{-10}{-14} = \frac{5}{7},\quad y = \frac{-26}{-14} = \frac{13}{7} \)
✅ Solution: \( \left( \frac{5}{7}, \frac{13}{7} \right) \)
📌 Key Reminders:
- Cramer’s Rule: \( x_i = \dfrac{\det(A_i)}{\det(A)} \)
- Only for square systems with \( \det(A) \ne 0 \)
- Homogeneous: if \( \det(A) \ne 0 \), only trivial solution
- Always verify your determinants—sign errors are common!