Linear Systems Solvers
Choose a solver below
Solving Systems
Decompositions
Vector Spaces
Need Help?
Check the educational content below each solver for detailed explanations.
View all tutorials →Cramer's Rule Calculator: Solve Systems Using Determinants
Solve linear systems of equations using Cramer's Rule: to \(x_i = \frac{\det(A_i)}{\det(A)}\). This method works for square systems where the coefficient matrix is invertible (det ≠ 0).
Calculator
Enter your matrix below and click "Calculate" to see the step-by-step solution.
Enter a square coefficient matrix A and constant vector b, then click "Apply Cramer's Rule".
Cramer's Rule shows each determinant calculation step by step.
Learn About Cramers_Rule
Understanding the concepts behind the calculations.
📑 Quick Navigation
What is Cramer's Rule?
Cramer's Rule is an explicit formula for solving a system of linear equations with the same number of equations as unknowns. Named after Swiss mathematician Gabriel Cramer (1704-1752), this rule expresses the solution in terms of determinants of the coefficient matrix.
Key Insight: For a system Ax = b with a square invertible matrix A, each variable equals the ratio of two determinants: the determinant of a modified matrix divided by the determinant of A.
Where:
- A is the n×n coefficient matrix
- b is the constant vector (right-hand side)
- A_i is the matrix formed by replacing the i-th column of A with b
- det(A) ≠ 0 (matrix must be invertible)
When to Use Cramer's Rule
✅ Ideal For:
- 2×2 and 3×3 systems (quick calculations)
- When you need only one variable
- Learning the relationship between determinants and solutions
- Theoretical proofs and derivations
❌ Not Ideal For:
- Large systems (n > 3) - computationally expensive (O(n!))
- When det(A) = 0 (system is singular)
- Numerical computation with floating-point errors
- Systems with many variables (use Gaussian elimination instead)
💡 Tip: For 2×2 and 3×3 systems, Cramer's Rule is excellent for learning. For larger systems, Gaussian elimination or LU decomposition is faster and more stable.
The Formula
For a 2×2 System
Given:
The solution is:
For a 3×3 System
Given:
The solution is:
Where:
A_xreplaces column 1 with[b₁, b₂, b₃]ᵀA_yreplaces column 2 with[b₁, b₂, b₃]ᵀA_zreplaces column 3 with[b₁, b₂, b₃]ᵀ
Step-by-Step Guide
Step 1: Verify the System is Square
Cramer's Rule only works when the number of equations equals the number of unknowns.
Step 2: Compute det(A)
If det(A) = 0, the system either has no solution or infinite solutions. Cramer's Rule cannot be applied.
Step 3: For Each Variable xᵢ
- Create matrix
Aᵢby replacing column i with the constant vectorb - Compute
det(Aᵢ) - Calculate
xᵢ = det(Aᵢ) / det(A)
Step 4: Verify Your Solution
Substitute the values back into the original equations to check correctness.
Complete Examples
Example 1: 2×2 System
Problem: Solve for x and y:
Step 1: Compute det(A)
Step 2: Compute det(Aₓ) (replace column 1 with constants)
Step 3: Compute det(Aᵧ) (replace column 2 with constants)
Step 4: Calculate variables
Solution: x = 1, y = 2
Check: 2(1) + 3(2) = 8 ✓ and 4(1) - 2 = 2 ✓
Example 2: 3×3 System
Problem: Solve for x, y, and z:
Step 1: Compute det(A)
Step 2: Compute det(Aₓ) (replace column 1)
Step 3: Compute det(Aᵧ) (replace column 2)
Step 4: Compute det(A₂) (replace column 3)
Step 5: Calculate variables
Solution: x = -1, y = -15/7, z = -18/7
Example 3: When Cramer's Rule Fails
System:
Compute det(A):
Conclusion: Since det(A) = 0, Cramer's Rule cannot be applied. This system has infinite solutions (the second equation is 2 times the first). Use Gaussian elimination instead.
Advantages & Disadvantages
✅ Advantages
- Exact formula - No iterative approximations
- Direct computation - Each variable independent
- Great for 2×2 and 3×3 - Simple mental calculations
- Theoretical value - Proves existence/uniqueness
- Single variable - Compute one variable without others
❌ Disadvantages
- Computationally expensive - O(n!) operations vs O(n³) for elimination
- Numerically unstable - Division by small determinants
- Requires square systems - Equal equations and unknowns
- Fails when det(A)=0 - Singular matrices
- Impractical for n>3 - Too many determinant calculations
📊 Comparison: For a 10×10 system, Cramer's Rule requires ~10! ≈ 3.6 million operations, while Gaussian elimination needs ~670 operations. That's why we only recommend Cramer's Rule for small systems!
Frequently Asked Questions
Q: Does Cramer's Rule work for all square systems?
A: No! It only works when det(A) ≠ 0 (matrix is invertible). If det(A) = 0, the system either has no solution or infinite solutions.
Q: Can I use Cramer's Rule for 4×4 or larger systems?
A: Technically yes, but it's computationally expensive. For 4×4, you need to compute 5 determinants of 4×4 matrices. Gaussian elimination is much faster and more stable.
Q: Why is Cramer's Rule taught if it's inefficient?
A: It provides a beautiful theoretical connection between determinants and solutions. Plus, it's excellent for 2×2 and 3×3 systems by hand.
Q: What if I only need one variable?
A: Cramer's Rule is perfect for this! You only need to compute det(A) and det(Aᵢ) for that one variable, ignoring the others.
Q: How do I compute determinants quickly?
A: For 2×2: ad - bc. For 3×3: Use the Rule of Sarrus or cofactor expansion. Our calculator does it automatically!
Practice Problems
Beginner
-
Solve using Cramer's Rule:
$$ \begin{cases} 3x + 2y = 7 \\\\ x - y = -1 \end{cases} $$ -
Solve using Cramer's Rule:
$$ \begin{cases} 2x + 5y = 11 \\\\ 3x - 2y = 7 \end{cases} $$
Intermediate
-
Solve the 3×3 system:
$$ \begin{cases} 2x - y + z = 4 \\\\ x + 2y - z = 1 \\\\ 3x + y + 2z = 9 \end{cases} $$ -
Determine if Cramer's Rule can be applied:
$$ \begin{cases} x + 2y = 5 \\\\ 2x + 4y = 10 \end{cases} $$
Advanced
-
For what value of
kdoes Cramer's Rule fail for this system?$$ \begin{cases} 2x + ky = 4 \\\\ 3x + 6y = 12 \end{cases} $$
Click to reveal solutions
1. x = 1, y = 2
2. x = 3, y = 1
3. x = 1, y = 2, z = 1
4. No - det(A) = 0 (infinite solutions)
5. k = 4 (makes det(A) = 0)
Summary
Key Takeaways
- Cramer's Rule:
xᵢ = det(Aᵢ) / det(A) - Requires: Square system + det(A) ≠ 0
- Best for: 2×2 and 3×3 systems, or finding single variables
- Not for: Large systems or when det(A) = 0
- Alternatives: Gaussian elimination, inverse method
💡 Pro Tip: Use our calculator above to check your work! Enter your coefficients and constants, and watch Cramer's Rule in action with step-by-step determinant calculations.
Try It Yourself!
Use the calculator above to solve systems using Cramer's Rule:
- Enter your coefficients in the matrix A
- Enter your constants in vector b
- Click "Calculate" to see:
- det(A) computation
- Each det(Aᵢ) calculation
- Final values for each variable
- Step-by-step verification
📐 Try these examples:
- 2×2 System:
2x + 3y = 8, 4x - y = 2 - 3×3 System:
x + y + z = 6, 2x - y + z = 3, x + 2y - z = 3 - Singular System:
x + 2y = 3, 2x + 4y = 6(see what happens when det(A) = 0!)
💡 Pro Tip: Cramer's Rule is great for 2×2 and 3×3 systems. For larger systems, try Gaussian Elimination instead—it's much faster!
Summary
Key Takeaways
- Cramer's Rule:
xᵢ = det(Aᵢ) / det(A) - Requires: Square system + det(A) ≠ 0
- Best for: 2×2 and 3×3 systems, or finding single variables
- Not for: Large systems (n > 3) or when det(A) = 0
- Alternatives: Gaussian Elimination, Inverse Method
💬 Still have questions? Check out our FAQ section or try the Gaussian Elimination calculator for a different approach.