82. Cramer's Rule
For a square system where is and invertible (i.e., ), each component of the solution is a ratio of determinants:
where is the matrix with its -th column replaced by .
Example
Solve
Then , , and .
Replace column 1:
Replace column 2:
82.1. Why it works (sketch)
Let be the identity with the -th column replaced by . Then (column-by-column), so
(since is upper triangular with on its -th diagonal entry).
82.2. Practical remarks
Cramer’s rule is theoretically beautiful but computationally awful for :
- Computes determinants of matrices
- Cost: via cofactor expansion, or even with row reduction
- Standard methods (Gaussian elimination, LU decomposition) cost
Use Cramer’s rule for:
- Symbolic solutions (small systems with parameters)
- Theoretical proofs
- Closed-form expressions in or cases
Don’t use it for serious numerical work.
82.3. When it fails
If , the formula divides by zero — meaning is singular and the system either has no solution or infinitely many (depending on ). See Linear System Solutions.
82.4. See also
- Determinant
- Matrix Inverse — Cramer’s rule is essentially with the inverse expanded via cofactors
- Adjugate — alternative inverse formula
- Gaussian Elimination — the practical alternative