Lesson 3: Cramer's Rule
Estimated time: 30-40 minutes
Learning Objectives
- State Cramer's Rule for solving Ax = b
- Apply Cramer's Rule to 2x2 and 3x3 systems
- Understand when Cramer's Rule applies and its limitations
Cramer's Rule
Cramer's Rule: If A is an n x n invertible matrix (det(A) is not zero), then the unique solution of Ax = b has components:
where A_i is the matrix formed by replacing column i of A with the vector b.
Cramer's Rule for 2x2 Systems
Worked Example
Solve: 3x + 2y = 7 and x - y = 1.
A = [3 2; 1 -1], b = [7; 1].
det(A) = 3(-1) - 2(1) = -3 - 2 = -5.
A_1 (replace col 1 with b) = [7 2; 1 -1]. det(A_1) = 7(-1) - 2(1) = -9.
A_2 (replace col 2 with b) = [3 7; 1 1]. det(A_2) = 3(1) - 7(1) = -4.
x = det(A_1)/det(A) = -9/(-5) = 9/5
y = det(A_2)/det(A) = -4/(-5) = 4/5
Verify: 3(9/5) + 2(4/5) = 27/5 + 8/5 = 35/5 = 7. ✓
Cramer's Rule for 3x3 Systems
Worked Example
Solve: x + y + z = 6, 2x + 3y + z = 14, x - y + 2z = 2.
A = [1 1 1; 2 3 1; 1 -1 2]. det(A) = 1(6-(-1)) - 1(4-1) + 1(-2-3) = 7 - 3 - 5 = -1.
A_1 = [6 1 1; 14 3 1; 2 -1 2]. det(A_1) = 6(7) - 1(26) + 1(-20) = 42 - 26 - 20 = -4.
A_2 = [1 6 1; 2 14 1; 1 2 2]. det(A_2) = 1(26) - 6(3) + 1(-10) = 26 - 18 - 10 = -2. Wait, let me recompute carefully.
det(A_2) = 1(28-2) - 6(4-1) + 1(4-14) = 26 - 18 - 10 = -2.
A_3 = [1 1 6; 2 3 14; 1 -1 2]. det(A_3) = 1(6-(-14)) - 1(4-14) + 6(-2-3) = 20 + 10 - 30 = 0.
x = -4/(-1) = 4, y = -2/(-1) = 2, z = 0/(-1) = 0.
When to Use Cramer's Rule
Practical Considerations
- Pros: Gives a direct formula; useful for theoretical work and small systems; can solve for a single variable without finding all others.
- Cons: Very slow for large matrices (computing many determinants); Gaussian elimination is far more efficient for n > 3.
- Requirement: det(A) must not be zero (A must be invertible).
Check Your Understanding
1. Use Cramer's Rule to solve: 2x + y = 5, x - y = 1.
2. Can Cramer's Rule be applied if det(A) = 0?
3. For a 4x4 system, how many determinants must you compute to use Cramer's Rule?
Key Takeaways
- Cramer's Rule: x_i = det(A_i)/det(A) where A_i has column i replaced by b
- Works only when det(A) is not zero (A invertible)
- Best for small systems (2x2, 3x3) or when you need only one variable
- For large systems, Gaussian elimination is more efficient