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 :

Use Cramer’s rule for:

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