Why Replacing a Column Reveals a Coordinate
For a square system \(\mathbf{A}\mathbf{x}=\mathbf{b}\), the unknown vector \(\mathbf{x}\) has coordinates \(x_1,\dots,x_n\). Cramer's rule expresses each coordinate as a quotient of determinants. The key idea is to replace one column of \(\mathbf{A}\) with \(\mathbf{b}\): because \(\mathbf{b}\) is a combination of the columns of \(\mathbf{A}\), determinant linearity expands the new determinant into several terms. Every term vanishes except the one involving the coordinate of the replaced column.
Throughout, \(\mathbf{A}\in\mathbb{R}^{n\times n}\), \(\mathbf{x},\mathbf{b}\in\mathbb{R}^n\), and vectors are columns. Write the columns of \(\mathbf{A}\) as \(\mathbf{a}_1,\dots,\mathbf{a}_n\). For each \(i\in\{1,\dots,n\}\), define \(\mathbf{A}_i(\mathbf{b})\) to be the matrix obtained from \(\mathbf{A}\) by replacing its \(i\)-th column with \(\mathbf{b}\), leaving every other column in its original position.
The linearity property means, for example, that replacing column \(i\) by \(c\mathbf{u}+d\mathbf{v}\) makes the determinant equal to \(c\) times the determinant with column \(i\) equal to \(\mathbf{u}\), plus \(d\) times the determinant with column \(i\) equal to \(\mathbf{v}\). Repeated-column vanishing is what removes the unwanted terms in the derivation.
The Replacement-Column Identity
Proof. By the definition of matrix-vector multiplication, \(\mathbf{b}=x_1\mathbf{a}_1+\cdots+x_n\mathbf{a}_n\). In \(\mathbf{A}_i(\mathbf{b})\), only column \(i\) differs from \(\mathbf{A}\). Apply linearity of the determinant in that column:
When \(j\ne i\), the displayed determinant has \(\mathbf{a}_j\) in both column \(j\) and column \(i\), so it is zero by the repeated-column property. When \(j=i\), the columns are exactly \(\mathbf{a}_1,\dots,\mathbf{a}_n\), so that term is \(x_i\det(\mathbf{A})\). If \(n=1\), there are no terms with \(j\ne i\), and the same conclusion follows from the sole term \(j=i=1\). Thus the identity holds for every \(i\) and every positive integer \(n\). \(\square\)
The identity is a statement about any vector \(\mathbf{x}\) and its corresponding right-hand side \(\mathbf{b}=\mathbf{A}\mathbf{x}\). It does not yet require \(\mathbf{A}\) to be invertible. The nonzero determinant condition enters when we divide by \(\det(\mathbf{A})\).
Proof. Since \(\det(\mathbf{A})\ne0\), the determinant test for invertibility gives that \(\mathbf{A}\) is invertible. Hence the system has a unique solution \(\mathbf{x}\). For this solution, \(\mathbf{b}=\mathbf{A}\mathbf{x}\), so the replacement-column identity gives \(\det(\mathbf{A}_i(\mathbf{b}))=x_i\det(\mathbf{A})\) for every \(i\). Dividing by the nonzero number \(\det(\mathbf{A})\) yields the stated formula for each coordinate. The solution is unique because \(\mathbf{A}\) is invertible. \(\square\)
The hypothesis \(\det(\mathbf{A})\ne0\) is essential to the quotient formula: it guarantees both that the system has a unique solution and that the denominator can be divided by. The replacement-column identity itself remains valid when \(\det(\mathbf{A})=0\), but it then reads \(0=0\) for any solution and does not determine the coordinates.
Using the Formula in a Two-Variable System
Worked Example: Replacing Each Column
Solve the system represented by \(\mathbf{A}\mathbf{x}=\mathbf{b}\), where $$ \mathbf{A}=\begin{bmatrix}2&1\\1&1\end{bmatrix}, \qquad \mathbf{b}=\begin{bmatrix}5\\3\end{bmatrix}. $$
First compute the denominator:
To find \(x_1\), replace column 1 by \(\mathbf{b}\):
To find \(x_2\), replace column 2:
Therefore \(x_1=2/1=2\) and \(x_2=1/1=1\), so \(\mathbf{x}=(2,1)^\top\).
Check: Multiplying back gives \(\mathbf{A}\mathbf{x}=(2\cdot2+1\cdot1,\;1\cdot2+1\cdot1)^\top=(5,3)^\top=\mathbf{b}\). The computed vector solves the original system.
A Three-Variable Calculation
Worked Example: Three Replacement Determinants
Use Cramer's rule for $$ \mathbf{A}=\begin{bmatrix}1&3&0\\0&1&1\\1&1&1\end{bmatrix}, \qquad \mathbf{b}=\begin{bmatrix}7\\1\\2\end{bmatrix}. $$
Expanding \(\det(\mathbf{A})\) along the first row gives \(1(1\cdot1-1\cdot1)-3(0\cdot1-1\cdot1)+0=0-3(-1)=3\), which is nonzero. Replace column 1 by \(\mathbf{b}\):
Replace column 2 by \(\mathbf{b}\):
Replace column 3 by \(\mathbf{b}\):
Divide each replacement determinant by \(\det(\mathbf{A})=3\): \(x_1=3/3=1\), \(x_2=6/3=2\), and \(x_3=-3/3=-1\). Thus \(\mathbf{x}=(1,2,-1)^\top\).
Check: $$ \mathbf{A}\mathbf{x} = \begin{bmatrix} 1\cdot1+3\cdot2+0\cdot(-1)\\ 0\cdot1+1\cdot2+1\cdot(-1)\\ 1\cdot1+1\cdot2+1\cdot(-1) \end{bmatrix} = \begin{bmatrix}7\\1\\2\end{bmatrix} =\mathbf{b}. $$
What Changes When the Determinant Is Zero?
A zero determinant means the formula cannot be used as a quotient. It does not, by itself, decide whether the system is inconsistent or has infinitely many solutions. A singular system may have no solutions or more than one; the determinant ratio is not a way to distinguish those cases.
Worked Example: A Singular System
Consider $$ \mathbf{A}=\begin{bmatrix}1&2\\2&4\end{bmatrix}, \qquad \mathbf{b}=\begin{bmatrix}3\\6\end{bmatrix}. $$
The denominator is \(\det(\mathbf{A})=1\cdot4-2\cdot2=0\). The replacement determinants are also zero: $$ \det\bigl(\mathbf{A}_1(\mathbf{b})\bigr) = \det\begin{bmatrix}3&2\\6&4\end{bmatrix} =12-12=0, \qquad \det\bigl(\mathbf{A}_2(\mathbf{b})\bigr) = \det\begin{bmatrix}1&3\\2&6\end{bmatrix} =6-6=0. $$
Neither coordinate can be obtained by dividing its replacement determinant by \(\det(\mathbf{A})\), because both quotients would be \(0/0\), which is undefined. The system itself is consistent: its two equations are \(x_1+2x_2=3\) and \(2x_1+4x_2=6\), with the second twice the first. For any real \(t\), setting \(x_2=t\) and \(x_1=3-2t\) gives a solution.
Check: For \(\mathbf{x}=(3-2t,t)^\top\), the product is \(\mathbf{A}\mathbf{x}=(3-2t+2t,\;6-4t+4t)^\top=(3,6)^\top=\mathbf{b}\). There are multiple solutions, as expected for this singular system, while Cramer's quotient formula does not apply.
Common Pitfall: Replacing a Row Instead of a Column
The coordinate \(x_i\) is isolated by replacing column \(i\), not row \(i\). The column choice is forced by the identity \(\mathbf{b}=\sum_{j=1}^n x_j\mathbf{a}_j\): it lets determinant linearity act on the column containing that sum, while the repeated-column terms vanish.
For a concrete error, take \(\mathbf{A}=\begin{bmatrix}1&2\\3&4\end{bmatrix}\) and \(\mathbf{b}=(5,6)^\top\). Here \(\det(\mathbf{A})=4-6=-2\). The correct first replacement is \(\mathbf{A}_1(\mathbf{b})=\begin{bmatrix}5&2\\6&4\end{bmatrix}\), whose determinant is \(20-12=8\). Thus \(x_1=8/(-2)=-4\).
A wrong calculation replaces the first row instead, obtaining \(\begin{bmatrix}5&6\\3&4\end{bmatrix}\), with determinant \(20-18=2\), and then incorrectly reports \(x_1=2/(-2)=-1\). The correction is to replace the first column, as the definition of \(\mathbf{A}_1(\mathbf{b})\) requires. In fact, the full correct solution is \((-4,9/2)^\top\): multiplying gives \((-4+9,\,-12+18)^\top=(5,6)^\top\).
Why the Derivation Matters
The useful feature of Cramer's rule is not only the quotient itself; the derivation explains exactly why the numerator represents one coordinate. Each replacement determinant contains a linear combination of the original columns in one position. All contributions from the other coordinates create repeated columns and vanish, leaving only \(x_i\det(\mathbf{A})\). This also pinpoints the limit of the method: if \(\det(\mathbf{A})=0\), that identity no longer permits division.
For a nonsingular square system, the formula gives a separate determinant expression for each coordinate. It is most valuable when the determinant expressions themselves are the object of interest or when only selected coordinates are needed. The derivation does not claim that evaluating many determinants is always the fastest way to solve a system; it establishes the formula and its exact conditions of use.
Check Your Understanding
Use column linearity and the repeated-column property to justify each answer, and verify any computed solution by multiplying back.
- For \(\mathbf{A}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\) and \(\mathbf{b}=(5,2)^\top\), compute \(\det(\mathbf{A})\), both replacement determinants, and the solution.
- In the replacement-column identity, why does the term indexed by \(j\ne i\) vanish?
- State the condition that allows division by \(\det(\mathbf{A})\) in Cramer's rule.
- For \(\mathbf{A}=\begin{bmatrix}1&1\\2&2\end{bmatrix}\) and \(\mathbf{b}=(1,2)^\top\), explain why the quotient formula cannot determine a solution even though the system is consistent.
- In your own words, explain why replacing row \(i\) does not establish the formula for \(x_i\).