Cramer’s rule, named after Swiss mathematician Gabriel Cramer, is an explicit rule for calculating the solution to a system of linear equations using determinants. We saw in the section on determinants that the solution to the system of linear equations
\[\begin{split} \begin{pmatrix} a & b \\ c & d \end{pmatrix}
\begin{pmatrix} x_1 \\ x_2 \end{pmatrix} =
\begin{pmatrix} e \\ f \end{pmatrix}\end{split}\]
We can recognise that the solution to both variables includes the determinant of the coefficient matrix, \(ad - bc\), in the denominator. But what about the numerator? If we consider the solution to \(x_1\) then in \(de - bf\) we can see that the constant values \(e\) and \(f\) are included, and we have the subtraction of two products which is similar to the determinant of a \(2 \times 2\) matrix, i.e.,
\[\begin{split} \begin{align*}
de - bf = \begin{vmatrix} e & b \\ f & d \end{vmatrix}.
\end{align*} \end{split}\]
Doing similar for the solution to \(x_2\) we see that the numerator is
\[\begin{split} \begin{align*}
af - ce = \begin{vmatrix} a & e \\ c & f \end{vmatrix}.
\end{align*} \end{split}\]
These determinants are simply the coefficient matrix \(\begin{pmatrix} a & b \\ c & d \end{pmatrix}\) with columns 1 and 2 replaced by the constant vector \(\begin{pmatrix} e \\ f \end{pmatrix}\) for \(x_1\) and \(x_2\) respectively. This can be extended to larger systems to give us Cramer’s rule.
Theorem 2.2 (Cramer’s rule)
The solution to a non-singular linear system of equations of the form \(A\mathbf{x}=\mathbf{b}\) can be calculated using Cramer’s rule which is
where \(A_i\) is a matrix obtained by replacing column \(i\) of \(A\) with \(\mathbf{b}\).
Proof. The solution to a system of linear equations \(A \mathbf{x} = \mathbf{b}\) can be calculated using \(\mathbf{x} = A^{-1} \mathbf{b}\) where \(A^{-1}\) is the inverse of the coefficient matrix \(A\). The adjoint-determinant formula for calculating the inverse is
Since removing the \(i\)th column from both \(A\) and \(A_i\) (the one with the \(b\) values) results in the same matrix then the cofactors of \(A_i\) are the same as the cofactors of \(A\). If we calculate \(\det(A_i)\) by expanding along the \(i\)th column of \(A_i\) then