How to Find Unknown Variables by Cramers Rule?
The concept of the matrix determinant appeared in Germany and Japan at almost identical times. Seki wrote about it first in 1683 with his Method of Solving the Dissimulated Problems. Seki developed the pattern for determinants for $2 \times 2$, $3 \times 3$,
$4 \times 4$, and $5 \times 5$ matrices and used them to solve equations. In the same year, G. Leibniz wrote about a method for solving a
system of equations. This method is well known as Cramer's Rule. The determinant of a square matrix $A$ is a unique, real number which is an attribute of the matrix $A$. The determinant of the matrix $A$ is denoted by $det(A)$ or $|A|$.
Cramer's rule is a formula for the solution of a system of linear equations. It derives the solution in terms of the determinants of the matrix and of matrices obtained from it by replacing one column by the column vector of right sides of the equations. It is named by Gabriel Cramer (17041752), and the rule for an arbitrary number of unknowns is published in the paper [Cramer, G. (1750), Introduction a l'Analyse des lignes Courbes alg' ebriques" (in French). Geneva: Europeana. pp. 656--659].
To solve a system of linear equations using Cramer's rule we need to follow the next steps:
- Calculate a determinant of the square (main) matrix, $D$;
- Replace the $x^{th}$ column of the main matrix by the vector of right sides of the equations and calculate its determinant, $D_x$.
- To find the $x$ solution of the system of linear equations using Cramer's rule divide the determinant $D_x$ by the main determinant $D$;
- Repeat the previous step for each variable;
If the main determinant is zero the system of linear equations is either inconsistent or has infinitely many solutions.
Cramer's Rule in Two Variables: Let us consider the system of equations:
$$\begin{align} &a_1x+b_1y=\color{blue}{c_1}\\
&a_2x+b_2y=\color{blue}{c_2}\end{align} $$
The main determinant is $$D=\left|
\begin{array}{cc}
a_1 & b_1 \\
a_2 &b_2 \\
\end{array}
\right|$$
and other two determinants are
$$D_x=\left|
\begin{array}{cc}
\color{blue}{c_1} & b_1 \\
\color{blue}{c_2} &b_2 \\
\end{array}
\right|\quad\mbox{and}\quad D_y=\left|
\begin{array}{cc}
a_1 & \color{blue}{c_1} \\
a_2 &\color{blue}{c_2} \\
\end{array}
\right|$$
With help of determinants, $x$ and $y$ can be found with Cramer's rule as
$$x=\frac{D_x}{D}=
\frac{\left|
\begin{array}{cc}
\color{blue}{c_1} & b_1 \\
\color{blue}{c_2} &b_2 \\
\end{array}
\right|}{\left|
\begin{array}{cc}
a_1 & b_1 \\
a_2 &b_2 \\
\end{array}
\right|}\quad\mbox{and}\quad y=\frac{D_y}{D}=\frac{\left|
\begin{array}{cc}
a_1 & \color{blue}{c_1} \\
a_2 &\color{blue}{c_2} \\
\end{array}
\right|}{\left|
\begin{array}{cc}
a_1 & b_1 \\
a_2 &b_2 \\
\end{array}
\right|}$$
If every determinant is zero, the system is consistent and equations are dependent. The system has infinitely many solutions. If $D=0$ and $D_x$ or $D_y$ is not zero, the system is inconsistent and does not have a solution.
Cramer's Rule in Three Variables: Let us consider the system of equations:
$$\begin{align} &a_1x+b_1y+c_1z=\color{blue}{d_1}\\
&a_2x+b_2y+c_2z=\color{blue}{d_2}\\
&a_3x+b_3y+c_3z=\color{blue}{d_3}\\
\end{align} $$
The main determinant is $$D=\left|
\begin{array}{ccc}
a_1 & b_1 &c_1\\
a_2 &b_2 &c_2\\
a_3 &b_3 &c_3\\
\end{array}
\right|$$
and other three determinant are
$$D_x=\left|
\begin{array}{ccc}
\color{blue}{d_1} & b_1 &c_1\\
\color{blue}{d_2} &b_2 &c_2\\
\color{blue}{d_3} &b_3 &c_3\\
\end{array}
\right|\quad D_y=\left|
\begin{array}{ccc}
a_1 & \color{blue}{d_1} &c_1\\
a_2 &\color{blue}{d_2} &c_2\\
a_3 &\color{blue}{d_3} &c_3\\
\end{array}
\right|\quad\mbox{and}\quad D_z=\left|
\begin{array}{ccc}
a_1 & b_1 &\color{blue}{d_1}\\
a_2 &b_2 &\color{blue}{d_2}\\
a_3 &b_3 &\color{blue}{d_3}\\
\end{array}
\right|$$
The solution of the system of three equations is
$$x=\frac{D_x}{D},\quad y=\frac{D_y}{D},\quad \mbox{and}\quad z=\frac{D_z}{D}$$
For example, let us solve the system of linear equations:
$$\begin{align} &3x+4y+5z=10\\
&5x+6y+7z=12\\
&4x+5y+0z=15\\
\end{align} $$
Firstly, we calculate the main determinant:
$$\begin{align} D&=\left|
\begin{array}{ccc}
3 & 4 &5\\
5 &6 &7\\
4 &5 &0\\
\end{array}
\right|\&=\left|\begin{array}{ccc|cc}
3 & 4 & 5&3 & 4 \\
5& 6 & 7&5& 6 \\
4 &5 & 0&4&5 \\
\end{array}
\right.=3\cdot6\cdot0+4\cdot7\cdot4+5\cdot5\cdot 5-5\cdot6\cdot4-3\cdot7\cdot5-4\cdot6\cdot0=12\end{align}$$
Similarly,
$$ D_x=\left|
\begin{array}{ccc}
\color{blue}{10} & 4 &5\\
\color{blue}{12} &6 &7\\
\color{blue}{15} &5 &0\\
\end{array}
\right|=-80,\quad D_y=\left|
\begin{array}{ccc}
3 & \color{blue}{10} &5\\
5 &\color{blue}{12} &7\\
4 &\color{blue}{15} &0\\
\end{array}
\right|=100,\quad D_z=\left|
\begin{array}{ccc}
3 & 4 &\color{blue}{10}\\
5 &6 &\color{blue}{12}\\
4 &5 &\color{blue}{15}\\
\end{array}
\right|=-8$$