AcademyDeterminants
Academy
Cramer's Rule
Level 1 - Linear Algebra topic page in Determinants.
Principle
Cramer's Rule solves a square linear system using determinants. It gives each unknown as a ratio of determinants, provided the coefficient determinant is non-zero.
It is most useful for theory and small systems, not for large numerical computation.
Notation
\(A\mathbf x=\mathbf b\)
a square linear system
\(A_i(\mathbf b)\)
matrix obtained from A by replacing column i with \mathbf b
\(x_i\)
unknown i in the solution vector
\(\det A\)
coefficient determinant
\(\mathbf b\)
right-hand side vector
The Core Method
For \(A\mathbf x=\mathbf b\), if \(A\) is \(n\) by \(n\) and \(\det A\ne0\), then
Cramer's Rule
\[x_i=\frac{\det A_i(\mathbf b)}{\det A}\]
where \(A_i(\mathbf b)\) is formed by replacing column \(i\) of \(A\) with \(\mathbf b\).
For a \(2\) by \(2\) system
Two by two system
\[\begin{pmatrix}a&b\\c&d\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}e\\f\end{pmatrix}\]
the solution is
Two by two Cramer formula
\[x=\frac{\det\begin{pmatrix}e&b\\f&d\end{pmatrix}}{ad-bc},\qquad y=\frac{\det\begin{pmatrix}a&e\\c&f\end{pmatrix}}{ad-bc}\]
Worked Cases
Question
Use Cramer's Rule to solve \(2x+y=5\), \(x+3y=7\).
Answer
The coefficient matrix is \(A=\begin{pmatrix}2&1\\1&3\end{pmatrix}\), and \(\det A=2\cdot3-1\cdot1=5\). Replace the first column with \(\mathbf b=(5,7)\): \(A_1=\begin{pmatrix}5&1\\7&3\end{pmatrix}\), so \(\det A_1=15-7=8\). Thus \(x=8/5\). Replace the second column: \(A_2=\begin{pmatrix}2&5\\1&7\end{pmatrix}\), so \(\det A_2=14-5=9\). Thus \(y=9/5\).
Examples
Question
For a \(3\) by \(3\) system \(A\mathbf x=\mathbf b\), what is \(A_2(\mathbf b)\)?
Answer
The matrix \(A_2(\mathbf b)\) is obtained by replacing the second column of \(A\) with the right-hand side vector \(\mathbf b\), while leaving columns \(1\) and \(3\) unchanged. Its determinant is used to compute \(x_2\).