---
tag: 0977KZ6PQB
kind: statement
role: theorem
name: Cramer's rule
msc: [15A06, 15A15]
uses: [0C3CFHDN6R, 0JTRMBQ1SA]
sources:
  - url: https://en.wikipedia.org/wiki/Cramer's_rule
    locator: General case
same_as:
  wikidata: Q322666
  wikipedia: Cramer's rule
---

## Statement

Let $F$ be a field, let $A$ be an $n \times n$ matrix over $F$ with $\det A \ne 0$, and let $b \in F^n$.
For $1 \le i \le n$, let $A_i$ be the matrix that results when column $i$ of $A$ is replaced by $b$.
Then the [[linear system|0GT4WWGWH2]] $Ax = b$ has exactly one solution $x = (x_1, \dots, x_n)$, and
$$x_i = \frac{\det A_i}{\det A} \qquad (1 \le i \le n).$$

## Remarks

For $n = 2$, the system $ax + by = e$, $cx + dy = f$ has the solution $x = (ed - bf)/(ad - bc)$ and $y = (af - ec)/(ad - bc)$.
The rule follows from the formula for the inverse with the [[adjugate|07W9H8QF38]].
It needs $n + 1$ determinants, so it is slow for large $n$ compared with [[Gaussian elimination|0JVJ2WCXZH]].

## Explanations

### L1 human

Cramer's rule gives each unknown as a quotient of two determinants.
The denominator is always $\det A$.
For the numerator of unknown $i$, put the right side $b$ in column $i$ of $A$.
