# Cramer’s Rule

Cramer’s Rule uses determinants to solve systems of linear equations .  Consider the system of two linear equations in two variables:
$\begin{array}{l}ax+by=c\\ dx+ey=f\end{array}$

Using the linear combination method, you can verify that

$x=\frac{ce-bf}{ae-bd}$ and $y=\frac{af-cd}{ae-bd}$ if $ae-bd\ne 0$

Note that the denominators are equal to the determinant of the coefficients.

$D=|\begin{array}{cc}a& b\\ d& e\end{array}|$

The numerators are equal to the determinants ${D}_{x}$ and ${D}_{y}$ where

${D}_{x}=|\begin{array}{cc}c& b\\ f& e\end{array}|$ and ${D}_{y}=|\begin{array}{cc}a& c\\ d& f\end{array}|$

${D}_{x}$ is formed by replacing the column of coefficients of $x$ in $D$ with the column of constants and ${D}_{y}$ is formed by replacing the column of coefficients of $y$ in $D$ with the column of constants.

By substitution,

$x=\frac{|\begin{array}{cc}c& b\\ f& e\end{array}|}{|\begin{array}{cc}a& b\\ d& e\end{array}|}=\frac{{D}_{x}}{D}$ and $y=\frac{|\begin{array}{cc}a& c\\ d& f\end{array}|}{|\begin{array}{cc}a& b\\ d& e\end{array}|}=\frac{{D}_{y}}{D}$ .

Example:

Use determinants to solve the system of equations: $\left\{\begin{array}{l}x-5y=2\\ 2x+y=4\end{array}$

$\begin{array}{l}x=\frac{{D}_{x}}{D}=\frac{|\begin{array}{rr}\hfill 2& \hfill -5\\ \hfill 4& \hfill 1\end{array}|}{|\begin{array}{rr}\hfill 1& \hfill -5\\ \hfill 2& \hfill 1\end{array}|}=\frac{2+20}{1+10}=\frac{22}{11}=2\\ y=\frac{{D}_{y}}{D}=\frac{|\begin{array}{rr}\hfill 1& \hfill 2\\ \hfill 2& \hfill 4\end{array}|}{|\begin{array}{rr}\hfill 1& \hfill -5\\ \hfill 2& \hfill 1\end{array}|}=\frac{4-4}{1+10}=\frac{0}{11}=0\end{array}$

Therefore, the solution is $\left(2,0\right)$ .

Determinants can also be used to solve a system of linear equations in three variables:

$\begin{array}{l}{a}_{1}x+{b}_{1}y+{c}_{1}z={d}_{1}\\ {a}_{2}x+{b}_{2}y+{c}_{2}z={d}_{2}\\ {a}_{3}x+{b}_{3}y+{c}_{3}z={d}_{3}\end{array}$

Then,

$\begin{array}{cc}D=|\begin{array}{ccc}{a}_{1}& {b}_{1}& {c}_{1}\\ {a}_{2}& {b}_{2}& {c}_{2}\\ {a}_{3}& {b}_{3}& {c}_{3}\end{array}|\ne 0& {D}_{x}=|\begin{array}{ccc}{d}_{1}& {b}_{1}& {c}_{1}\\ {d}_{2}& {b}_{2}& {c}_{2}\\ {d}_{3}& {b}_{3}& {c}_{3}\end{array}|\\ {D}_{y}=|\begin{array}{ccc}{a}_{1}& {d}_{1}& {c}_{1}\\ {a}_{2}& {d}_{2}& {c}_{2}\\ {a}_{3}& {d}_{3}& {c}_{3}\end{array}|& {D}_{z}=|\begin{array}{ccc}{a}_{1}& {b}_{1}& {d}_{1}\\ {a}_{2}& {b}_{2}& {d}_{2}\\ {a}_{3}& {b}_{3}& {d}_{3}\end{array}|\end{array}$

And,

$x=\frac{{D}_{x}}{D},y=\frac{{D}_{y}}{D},z=\frac{{D}_{z}}{D}$ .

This method can be generalized for a system of $n$ linear equations in $n$ variables.

It was named for the Swiss mathematician Gabriel Cramer.