1 Solving two equations in two unknowns
If we have one linear equation
$\phantom{\rule{2em}{0ex}}ax=b$
in which the unknown is $x$ and $a$ and $b$ are constants then there are just three possibilities:
- $a\ne 0$ then $x=\frac{b}{a}={a}^{-1}b$ . In this case the equation $ax=b$ has a unique solution for $x$ .
- $a=0$ , $b=0$ then the equation $ax=b$ becomes $0=0$ and any value of $x$ will do. In this case the equation $ax=b$ has infinitely many solutions .
- $a=0$ and $b\ne 0$ then $ax=b$ becomes $0=b$ which is a contradiction. In this case the equation $ax=b$ has no solution for $x$ .
What happens if we have more than one equation and more than one unknown? We shall find that the solutions to such systems can be characterised in a manner similar to that occurring for a single equation; that is, a system may have a unique solution, an infinity of solutions or no solution at all.
In this Section we examine a method, known as Cramer’s rule and employing determinants, for solving systems of linear equations.
Consider the equations
$\phantom{\rule{2em}{0ex}}ax+by=e$ (1)
$\phantom{\rule{2em}{0ex}}cx+dy=f$ (2)
where $a,b,c,d,e,f$ are given numbers. The variables $x$ and $y$ are unknowns we wish to find. The pairs of values of $x$ and $y$ which simultaneously satisfy both equations are called solutions. Simple algebra will eliminate the variable $y$ between these equations. We multiply equation (1) by $d$ , equation (2) by $b$ and subtract:
$\phantom{\rule{2em}{0ex}}\text{first,}\phantom{\rule{1em}{0ex}}\left(1\right)\times d\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}adx+bdy=ed\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}$
$\phantom{\rule{2em}{0ex}}\text{then},\phantom{\rule{1em}{0ex}}\left(2\right)\times b\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}bcx+bdy=bf\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}$
(we multiplied in this way to make the coefficients of $y$ equal.)
Now subtract to obtain
$\phantom{\rule{2em}{0ex}}\left(ad-bc\right)x=ed-bf$ (3)
Task!
Starting with equations (1) and (2) above, eliminate $x$ .
Multiply equation (1) by $c$ and equation (2) by $a$ to obtain
$\phantom{\rule{2em}{0ex}}acx+bcy=ec\phantom{\rule{2em}{0ex}}\text{and}\phantom{\rule{2em}{0ex}}acx+ady=af.$
Now subtract to obtain
$\phantom{\rule{2em}{0ex}}\left(bc-ad\right)y=ec-af$
If we multiply this last equation in the Task above by $-1$ we obtain
$\phantom{\rule{2em}{0ex}}\left(ad-bc\right)y=af-ec$ (4)
Dividing equations (3) and (4) by $ad-bc$ we obtain the solutions
$\phantom{\rule{2em}{0ex}}x=\frac{ed-bf}{ad-bc}\phantom{\rule{1em}{0ex}},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}y=\frac{af-ec}{ad-bc}$ (5)
There is of course one proviso: if $ad-bc=0$ then neither $x$ nor $y$ has a defined value.
If we choose to express these solutions in terms of determinants we have the formulation for the solution of simultaneous equations known as Cramer’s rule .
If we define $\Delta $ as the determinant $\left|\begin{array}{cc}\hfill a\hfill & \hfill b\hfill \\ \hfill c\hfill & \hfill d\hfill \end{array}\right|$ and provided $\Delta \ne 0$ then the unique solution of the equations
$\phantom{\rule{2em}{0ex}}ax+by=e$
$\phantom{\rule{2em}{0ex}}cx+dy=f$
is by (5) given by
$\phantom{\rule{2em}{0ex}}x=\frac{{\Delta}_{x}}{\Delta},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}y=\frac{{\Delta}_{y}}{\Delta}\phantom{\rule{1em}{0ex}}\text{where}\phantom{\rule{1em}{0ex}}{\Delta}_{x}=\left|\begin{array}{cc}\hfill e\hfill & \hfill b\hfill \\ \hfill f\hfill & \hfill d\hfill \end{array}\right|,\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{\Delta}_{y}=\left|\begin{array}{cc}\hfill a\hfill & \hfill e\hfill \\ \hfill c\hfill & \hfill f\hfill \end{array}\right|$
Now $\Delta $ is the determinant of coefficients on the left-hand sides of the equations. In the expression ${\Delta}_{x}$ the coefficients of $x$ (i.e. $\left(\begin{array}{c}\hfill a\hfill \\ \hfill c\hfill \end{array}\right)$ which is column 1 of $\Delta $ ) are replaced by the terms on the right-hand sides of the equations (i.e. by $\left(\begin{array}{c}\hfill e\hfill \\ \hfill f\hfill \end{array}\right)$ ). Similarly in ${\Delta}_{y}$ the coefficients of $y$ (column 2 of $\Delta $ ) are replaced by the terms on the right-hand sides of the equations.
Key Point 1
Cramer’s Rule for Two Equations
The unique solution to the equations:
If $\Delta =0$ this method of solution cannot be used.
Task!
Use Cramer’s rule to solve the simultaneous equations
$$\begin{array}{rcll}2x+y& =& 7& \text{}\\ 3x-4y& =& 5& \text{}\end{array}$$Calculating $\Delta =\left|\begin{array}{cc}\hfill 2& \hfill 1\\ \hfill 3& \hfill -4\end{array}\right|=-11$ . Since $\Delta \ne 0$ we can proceed with Cramer’s solution.
$\Delta =\left|\begin{array}{cc}\hfill 2& \hfill 1\\ \hfill 3& \hfill -4\end{array}\right|=-11\phantom{\rule{2em}{0ex}}x=\frac{1}{\Delta}\left|\begin{array}{cc}\hfill 7& \hfill 1\\ \hfill 5& \hfill -4\end{array}\right|\phantom{\rule{1em}{0ex}},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}y=\frac{1}{\Delta}\left|\begin{array}{cc}\hfill 2\hfill & \hfill 7\hfill \\ \hfill 3\hfill & \hfill 5\hfill \end{array}\right|$
i.e. $x=\frac{\left(-28-5\right)}{\left(-11\right)}\phantom{\rule{1em}{0ex}},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}y=\frac{\left(10-21\right)}{\left(-11\right)}$ implying: $x=\frac{-33}{-11}=3\phantom{\rule{1em}{0ex}},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}y=\frac{-11}{-11}=1.$
You can check by direct substitution that these are the exact solutions to the equations.
Task!
Use Cramer’s rule to solve the equations
You should have checked $\left|\begin{array}{cc}\hfill 2& \hfill -3\\ \hfill 4& \hfill -6\end{array}\right|$ first, since
$\left|\begin{array}{cc}\hfill 2& \hfill -3\\ \hfill 4& \hfill -6\end{array}\right|=-12-\left(-12\right)=0$ . Hence there is no unique solution in either case.
In the system
- the second equation is twice the first so there are infinitely many solutions. (Here we can give $y$ any value we wish, $t$ say; but then the $x$ value is always $\left(6+3t\right)\u22152$ . So for each value of $t$ there are values for $x$ and $y$ which simultaneously satisfy both equations. There is an infinite number of possible solutions). In
- the equations are inconsistent (since the first is $2x-3y=6$ and the second is $2x-3y=5$ which is not possible). Hence there are no solutions.
Notation
For ease of generalisation to larger systems we write the two-equation system in a different notation:
$$\begin{array}{rcll}{a}_{11}{x}_{1}+{a}_{12}{x}_{2}& =& {b}_{1}& \text{}\\ {a}_{21}{x}_{1}+{a}_{22}{x}_{2}& =& {b}_{2}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}& \text{}\end{array}$$Here the unknowns are ${x}_{1}$ and ${x}_{2}$ , the right-hand sides are ${b}_{1}$ and ${b}_{2}$ and the coefficients are ${a}_{ij}$ where, for example, ${a}_{21}$ is the coefficient of ${x}_{1}$ in equation two. In general, ${a}_{ij}$ is the coefficient of ${x}_{j}$ in equation $i$ .
Cramer’s rule can then be stated as follows:
If $\left|\begin{array}{cc}\hfill {a}_{11}\hfill & \hfill {a}_{12}\hfill \\ \hfill {a}_{21}\hfill & \hfill {a}_{22}\hfill \end{array}\right|\ne 0$ , then the equations
$$\begin{array}{rcll}{a}_{11}{x}_{1}+{a}_{12}{x}_{2}& =& {b}_{1}& \text{}\\ {a}_{21}{x}_{1}+{a}_{22}{x}_{2}& =& {b}_{2}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}& \text{}\end{array}$$have solution
$\phantom{\rule{2em}{0ex}}{x}_{1}=\frac{\left|\begin{array}{cc}\hfill {b}_{1}\hfill & \hfill {a}_{12}\hfill \\ \hfill {b}_{2}\hfill & \hfill {a}_{22}\hfill \end{array}\right|}{\left|\begin{array}{cc}\hfill {a}_{11}\hfill & \hfill {a}_{12}\hfill \\ \hfill {a}_{21}\hfill & \hfill {a}_{22}\hfill \end{array}\right|}\phantom{\rule{1em}{0ex}},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{x}_{2}=\frac{\left|\begin{array}{cc}\hfill {a}_{11}\hfill & \hfill {b}_{1}\hfill \\ \hfill {a}_{21}\hfill & \hfill {b}_{2}\hfill \end{array}\right|}{\left|\begin{array}{cc}\hfill {a}_{11}\hfill & \hfill {a}_{12}\hfill \\ \hfill {a}_{21}\hfill & \hfill {a}_{22}\hfill \end{array}\right|}.$