Skip to main content

Section 7.2 Cramer's Rule

Recall that for a \(2 \times 2\) system of the form,
\begin{align*} a x_1 + b x_2 \amp = y_1 \\ c x_1 + d x_2 \amp = y_2 \end{align*}
Its (unique) solution is given by,
\begin{equation*} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} \frac{1}{\Delta} \brac{d y_1 - b y_2} \\ \frac{1}{\Delta} \brac{a y_2 - c y_1} \end{bmatrix} \end{equation*}
where \(\Delta = ad - bc\text{,}\) and provided that \(\Delta \neq 0\text{.}\)
More explicitly,
\begin{equation*} x_1 = \frac{dy_1 - by_2}{ad - bc} \qquad x_2 = \frac{ay_2 - cy_1}{ad - bc} \end{equation*}
Notice that the numerator has the form of a \(2 \times 2\) determinant, being a difference of products. For \(x_1\text{,}\) \(dy_1 - by_2\) has a similar form as \(ad - bc\text{,}\) except with \(y_1\) and \(y_2\) instead of \(a\) and \(c\text{,}\) respectively. Thus, the numerator is,
\begin{equation*} \det{\begin{bmatrix} y_1 \amp b \\ y_2 \amp d \end{bmatrix}} \end{equation*}
Similarly, for \(x_2\text{,}\) here \(y_2\) and \(y_1\) replace \(d\) and \(b\text{,}\) respectively, and so the numerator is,
\begin{equation*} \det{\begin{bmatrix} a \amp y_1 \\ c \amp y_2 \end{bmatrix}} \end{equation*}
Thus, the unique solution can be written as a ratio of two determinants,
\begin{equation*} x_1 = \frac{\begin{vmatrix} y_1 \amp b \\ y_2 \amp d \end{vmatrix}}{\begin{vmatrix} a \amp b \\ c \amp d \end{vmatrix}} \qquad x_2 = \frac{\begin{vmatrix} a \amp y_1 \\ c \amp y_2 \end{vmatrix}}{\begin{vmatrix} a \amp b \\ c \amp d \end{vmatrix}} \end{equation*}
Consider the pattern in the numerator matrix we are taking the determinant of. If we consider \(x\) and \(y\) to be the 1st and 2nd variables, respectively, then for the \(i\)th variable, the matrix in the numerator is the coefficient matrix, with the \(i\)th column replaced by the constant vector \((y_1, y_2)\text{.}\)

Subsection 7.2.1 The \(3 \times 3\) Case

A similar pattern is true for a \(3 \times 3\) system,
\begin{equation*} \begin{array}{rrrrr} a_{11} x \amp + a_{12} y \amp + a_{13} z \amp = \amp b_1 \\ a_{21} x \amp + a_{22} y \amp + a_{23} z \amp = \amp b_2 \\ a_{31} x \amp + a_{32} y \amp + a_{33} z \amp = \amp b_3 \end{array} \end{equation*}
\begin{equation*} x = \frac{\begin{vmatrix} b_1 \amp a_{12} \amp a_{13} \\ b_2 \amp a_{22} \amp a_{23} \\ b_3 \amp a_{32} \amp a_{33} \end{vmatrix}}{\begin{vmatrix} a_{11} \amp a_{12} \amp a_{13} \\ a_{21} \amp a_{22} \amp a_{23} \\ a_{31} \amp a_{32} \amp a_{33} \end{vmatrix}} \quad y = \frac{\begin{vmatrix} a_{11} \amp b_1 \amp a_{13} \\ a_{21} \amp b_2 \amp a_{23} \\ a_{31} \amp b_3 \amp a_{33} \end{vmatrix}}{\begin{vmatrix} a_{11} \amp a_{12} \amp a_{13} \\ a_{21} \amp a_{22} \amp a_{23} \\ a_{31} \amp a_{32} \amp a_{33} \end{vmatrix}} \quad z = \frac{\begin{vmatrix} a_{11} \amp a_{12} \amp b_1 \\ a_{21} \amp a_{22} \amp b_2 \\ a_{31} \amp a_{32} \amp b_3 \end{vmatrix}}{\begin{vmatrix} a_{11} \amp a_{12} \amp a_{13} \\ a_{21} \amp a_{22} \amp a_{23} \\ a_{31} \amp a_{32} \amp a_{33} \end{vmatrix}} \end{equation*}
\(i\)with the \(i\)th column replaced by the constant vector

Subsection 7.2.2 Cramer's Rule

This pattern generalizes to any system of \(n\) equations in \(n\) unknowns, and the resulting theorem is called Cramer's rule. First, for an \(n \times n\) matrix \(A\) and vector \(\vec{b} \in \mathbb{R}^n\text{,}\) let \(A_i(\vec{b})\) denote the matrix obtained from \(A\) by replacing column \(i\) by the vector \(\vec{b}\text{,}\)
\begin{equation*} A_i(\vec{b}) = \begin{bmatrix} \vec{a}_1 \amp \dots \amp \vec{a}_{i-1} \amp \vec{b} \amp \vec{a}_{i+1} \amp \dots \vec{a}_n \end{bmatrix} \end{equation*}
Then,
Cramer's rule gives a concise and rather explcit form of the solution of a linear system. However, it isn't particularly useful for solving linear systems, because it involves evaluating many determinants, making it very inefficient. Computing just one determinant takes about as much work as solving \(A\vec{x} = \vec{b}\) by row reduction.
On the other hand, it is useful for other theoretical calculations. For example, it can be used to examine how the sensitivity of the solution of \(A\vec{x} = \vec{b}\text{,}\) i.e. how the solutions changes when the entires of \(\vec{b}\) changes.