Title: Default for 8.1 Solution by Cremer's Rule
Course: HELM Workbooks 2023-2024

Solving two equations in two unknowns

If we have one linear equation

\(\qquad ax=b\)

in which the unknown is \(x\) and \(a\) and \(b\) are constants then there are just three possibilities:

- \(a\neq 0\) then \(x=\dfrac{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\neq 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

(1) \(\qquad ax+by=e\)

(2) \(\qquad cx+dy=f\)

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:

\(\qquad \text{first,}\quad (1)\times d\qquad\qquad\qquad ad x+bd y=ed\qquad\qquad\qquad \)

\(\qquad \text{then},\quad (2)\times b\qquad\qquad\qquad bc x+bd y=bf\qquad\qquad\qquad \)

(we multiplied in this way to make the coefficients of \(y\) equal.)

Now subtract to obtain

(3) \(\qquad (ad-bc)x=ed-bf\)

Task: Starting with equations (1) and (2) above, eliminate \(x\).

Eliminating \(x\) using a similar method to the one above for eliminating \(y\), we obtain

(4) \(\qquad  (ad-bc)y=af-ec\)

Dividing equations (3) and (4) by \(ad-bc\) we obtain the solutions

(5) \(\qquad x=\dfrac{ed-bf}{ad-bc}\ ,\ \ \ y=\dfrac{af-ec}{ad-bc}\)

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}a&b\\ c&d\end{array}\right|\) and provided \(\Delta\neq 0\) then the unique solution of the equations

\(\qquad ax+by=e\)

\(\qquad cx+dy=f\)

is by (5) given by

\(\qquad x=\dfrac{\Delta_x}{\Delta},\ \ y=\dfrac{\Delta_y}{\Delta}\quad\text{where}\quad \Delta_x=\left|\begin{array}{cc}e&b\\ f&d\end{array}\right|,\ \ \Delta_y=\left|\begin{array}{cc}a&e\\ c&f\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}a\\ c\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}e\\ f\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

The unique solution to the equations:

\(\qquad ax+by=e\)

\(\qquad cx+dy=f\)

is given by:

\(\qquad x=\dfrac{\Delta_x}{\Delta},\ \ y=\dfrac{\Delta_y}{\Delta}\)

in which

\(\qquad\Delta=\left|\begin{array}{cc}a&b\\ c&d\end{array}\right|,\ \ \Delta_x=\left|\begin{array}{cc}e&b\\ f&d\end{array}\right|,\ \ \Delta_y=\left|\begin{array}{cc}a&e\\ c&f\end{array}\right|.\)

If \(\Delta=0\) this method of solution cannot be used.

Exercise 1 (paper exercise)

Use Cramer’s rule to determine any and all solutions to the equations

\[\text{(a)}\ \ \ \ \begin{array}{rrrrr}2x-3y&=&6\\ 4x-6y&=&12\end{array} \qquad\ \ \ \text{(b)}\ \ \begin{array}{rrrrr}2x-3y&=&6\\ 4x-6y&=&10\end{array}\]

Exercise 1 (paper exercise)

Use Cramer’s rule to determine any and all solutions to the equations

\[\text{(a)}\ \ \ \ \begin{array}{rrrrr}2x-3y&=&6\\ 4x-6y&=&12\end{array} \qquad\ \ \ \text{(b)}\ \ \begin{array}{rrrrr}2x-3y&=&6\\ 4x-6y&=&10\end{array}\]

Solution

You should first have checked \(\begin{vmatrix}2 & -3\\ 4 & -6\end{vmatrix}\) since \[\begin{vmatrix}2 & -3\\ 4 & -6\end{vmatrix}=-12-(-12)=0.\]

Hence there is no unique solution in either case.

In system (a) 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 \((6+3t)/2\). 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 (b) 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{aligned} a_{11}x_1+a_{12}x_2&=&b_1 \\ a_{21}x_1+a_{22}x_2&=&b_2\end{aligned}\]

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}a_{11}&a_{12}\\ a_{21}&a_{22}\end{array}\right|\neq 0\), then the equations \[\begin{aligned} a_{11}x_1+a_{12}x_2&=&b_1\\ a_{21}x_1+a_{22}x_2&=&b_2\end{aligned}\]

have solution

\(\qquad x_1=\dfrac{\left|\begin{array}{cc}b_1&a_{12}\\ b_2&a_{22}\end{array}\right|}{\left|\begin{array}{cc}a_{11}&a_{12}\\ a_{21}&a_{22}\end{array}\right|}\ ,\ \ \ x_2=\dfrac{\left|\begin{array}{cc}a_{11}&b_1\\ a_{21}&b_2\end{array}\right|}{\left|\begin{array}{cc}a_{11}&a_{12}\\ a_{21}&a_{22}\end{array}\right|}.\)

Solving three equations in three unknowns

Cramer’s rule can be extended to larger systems of simultaneous equations but the calculational effort increases rapidly as the size of the system increases. We quote Cramer’s rule for a system of three equations.

Key Point

The unique solution to the system of equations:

\(\begin{eqnarray*}a_{11}x_1+a_{12}x_2+a_{13}x_3&=&b_1\\ a_{21}x_1+a_{22}x_2+a_{23}x_3&=&b_2\\ a_{31}x_1+a_{32}x_2+a_{33}x_3&=&b_3\end{eqnarray*}\)

is

\(x_1=\dfrac{\Delta_{x_1}}{\Delta},\ \ x_2=\dfrac{\Delta_{x_2}}{\Delta},\ \ x_3=\dfrac{\Delta_{x_3}}{\Delta}\)

in which

\(\Delta=\left|\begin{array}{ccc}a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33}\end{array}\right|\)

and

\(\Delta_{x_1}=\left|\begin{array}{ccc}b_1&a_{12}&a_{13}\\ b_2&a_{22}&a_{23}\\ b_3&a_{32}&a_{33}\end{array}\right|\qquad \Delta_{x_2}=\left|\begin{array}{ccc}a_{11}&b_1&a_{13}\\ a_{21}&b_2&a_{23}\\ a_{31}&b_3&a_{33}\end{array}\right|\qquad \Delta_{x_3}=\left|\begin{array}{ccc}a_{11}&a_{12}&b_1\\ a_{21}&a_{22}&b_2\\ a_{31}&a_{32}&b_3\end{array}\right|\)

If \(\Delta=0\) this method of  solution cannot be used.

Notice that the structure of the fractions is similar to that for the two-equation case. For example, the determinant forming the numerator of \(x_1\) is obtained from the determinant of coefficients, \(\Delta\), by replacing the first column by the right-hand sides of the equations.

Notice too the increase in calculation: in the two-equation case we had to evaluate three \(2\times 2\) determinants, whereas in the three-equation case we have to evaluate four \(3\times 3\) determinants. Hence Cramer’s rule is not really practicable for larger systems.

Engineering Example -- Stresses and strains on a section of material

Introduction

An important engineering problem is to determine the effect on materials of different types of loading. One way of measuring the effects is through the strain or fractional change in dimensions in the material which can be measured using a strain gauge.

Problem in words

In a homogeneous, isotropic and linearly elastic material, the strains (i.e. fractional displacements) on a section of the material, represented by \(\varepsilon_x, \ \varepsilon_y, \ \varepsilon_z\) for the \(x\)-,  \(y\)-, \(z\)-directions respectively, can be related to the stresses (i.e. force per unit area), \(\sigma_x, \ \sigma_y, \ \sigma_z\) by the following system of equations.

\[\begin{aligned} \varepsilon_x&=&\dfrac{1}{E}(\begin{array}{ccc}\sigma_x&-v\sigma_y&-v\sigma_z\end{array})\\ \\ \varepsilon_y&=&\dfrac{1}{E}(\begin{array}{ccc}-v\sigma_x&+\sigma_y&-v\sigma_z\end{array})\\ \\ \varepsilon_z&=&\dfrac{1}{E}(\begin{array}{ccc}-v\sigma_x&-v\sigma_y&+\sigma_z\end{array})\end{aligned}\]

where \(E\) is the modulus of elasticity (also called Young’s modulus) and \(v\) is Poisson’s ratio which relates the lateral strain to the axial strain.

Find expressions for the stresses \(\sigma_x, \ \sigma_y, \ \sigma_z,\) in terms of the strains \(\varepsilon_x,\ \varepsilon_y,\) and \(\varepsilon_z.\)

Mathematical statement of problem

The given system of equations can be written as a matrix equation:

\(\qquad \left(\begin{array}{c}\varepsilon_x\\ \varepsilon_y\\ \varepsilon_z\end{array}\right)=\dfrac{1}{E}\ \left(\begin{array}{rrr}1&-v&-v\\ -v&1&-v\\ -v&-v&1\end{array}\right)\ \left(\begin{array}{c}\sigma_x\\ \sigma_y\\ \sigma_z\end{array}\right)\)

We can write this equation as

\(\qquad \varepsilon=\dfrac{1}{E}{\pmb A}\pmb{\sigma}\)

where \(\varepsilon=\left(\begin{array}{c}\varepsilon_x\\ \varepsilon_y\\ \varepsilon_z\end{array}\right),\ {\pmb A}=\left(\begin{array}{rrr}1&-v&-v\\ -v&1&-v\\ -v&-v&1\end{array}\right)\) and \(\pmb{\sigma}=\left(\begin{array}{c}\sigma_x\\ \sigma_y\\ \sigma_z\end{array}\right)\)

This matrix equation must be solved to find the vector \(\pmb{\sigma}\) in terms of the vector \(\varepsilon\) and the inverse of the matrix \({\pmb A}\).

Mathematical analysis

\(\qquad \varepsilon=\dfrac{1}{E}{\pmb A}\pmb{\sigma}\)

Multiplying both sides of the expression by \(E\) we get

\(\qquad E\varepsilon={\pmb A}\pmb{\sigma}\)

Multiplying both sides by \({\pmb A}^{-1}\) we find that:

\(\qquad {\pmb A}^{-1}E\varepsilon={\pmb A}^{-1}{\pmb A}\pmb{\sigma}\)

But \({\pmb A}^{-1}{\pmb A} = {\bf I}\) so this becomes

\(\qquad \pmb{\sigma}=E{\pmb A}^{-1}\varepsilon\)

To find expressions for the stresses \(\sigma_x, \ \sigma_y, \ \sigma_z\), in terms of the strains \(\varepsilon_x,\ \varepsilon_y\) and \(\varepsilon_z\), we must find the inverse of the matrix \({\pmb A}\).

To find the inverse of \(\left(\begin{array}{rrr}1&-v&-v\\ -v&1&-v\\ -v&-v&1\end{array}\right)\) we first find the matrix of minors which is:

\(\qquad\left(\begin{array}{ccc}\left|\begin{array}{rr}1&-v\\-v&1\end{array}\right|&\left|\begin{array}{rr}-v&-v\\-v&1\end{array}\right|&\left|\begin{array}{rr}-v&1\\-v&-v\end{array}\right|\\ \\ \left|\begin{array}{rr}-v&-v\\ -v&1\end{array}\right|&\left|\begin{array}{rr}1&-v\\-v&1\end{array}\right|&\left|\begin{array}{rr}1&-v\\-v&-v\end{array}\right|\\ \\ \left|\begin{array}{rr}-v&-v\\ 1&-v\end{array}\right|&\left|\begin{array}{rr}1&-v\\ -v&-v\end{array}\right|&\left|\begin{array}{rr}1&-v\\-v&1\end{array}\right|\end{array}\right)=\left(\begin{array}{ccc}1-v^2&-v-v^2&v^2+v\\ -v-v^2&1-v^2&-v-v^2\\ v^2+v&-v-v^2&1-v^2\end{array}\right).\)

We then apply the pattern of signs:

\(\qquad \left(\begin{matrix} +&-&+\\ -&+&-\\ +&-&+ \end{matrix}\right)\)

to obtain the matrix of cofactors

\(\qquad \left(\begin{array}{ccc}1-v^2&v+v^2&v^2+v\\ v+v^2&1-v^2&v+v^2\\ v^2+v&v+v^2&1-v^2\end{array}\right).\)

To find the adjoint we take the transpose of the above, (which is the same as the original matrix since the matrix is symmetric)

\(\qquad \left(\begin{array}{ccc}1-v^2&v+v^2&v^2+v\\ v+v^2&1-v^2&v+v^2\\ v^2+v&v+v^2&1-v^2\end{array}\right).\)

The determinant of the original matrix is

\(\qquad 1\times (1-v^2)-v(v+v^2)-v(v^2+v)=1-3v^2-2v^3.\) Finally we divide the adjoint by the determinant to find the inverse, giving

\(\qquad \dfrac{1}{1-3v^2-2v^3}\left(\begin{array}{ccc}1-v^2&v+v^2&v+v^2\\ v+v^2&1-v^2&v+v^2\\ v+v^2&v+v^2&1-v^2\end{array}\right).\)

Now we found that \(\pmb{\sigma}=E{\pmb A}^{-1}\varepsilon\) so \(\left(\begin{array}{c}\sigma_x\\ \sigma_y\\ \sigma_z\end{array}\right)=\dfrac{E}{1-3v^2-2v^3}\left(\begin{array}{ccc}1-v^2&v+v^2&v+v^2\\ v+v^2&1-v^2&v+v^2\\ v+v^2&v+v^2&1-v^2\end{array}\right)\left(\begin{array}{c}\varepsilon_x\\ \varepsilon_y\\ \varepsilon_z\end{array}\right)\)

We can write this matrix equation as 3 equations relating the stresses \(\sigma_x,\ \sigma_y,\ \sigma_z,\) in terms of the strains \(\varepsilon_x,\ \varepsilon_y\) and \(\varepsilon_z\), by multiplying out this matrix expression, giving: \[\begin{aligned} \sigma_x&=&\dfrac{E}{1-3v^2-2v^3}\ \left((1-v^2)\varepsilon_x+(v+v^2)\varepsilon_y+(v+v^2)\varepsilon_z\right)\\ \\ \sigma_y&=&\dfrac{E}{1-3v^2-2v^3}\ \left((v+v^2)\varepsilon_x+(1-v^2)\varepsilon_y+(v+v^2)\varepsilon_z\right)\\ \\ \sigma_z&=&\dfrac{E}{1-3v^2-2v^3}\ \left((v+v^2)\varepsilon_x+(v+v^2)\varepsilon_y+(1-v^2)\varepsilon_z\right)\end{aligned}\]

Interpretation

Matrix manipulation has been used to transform three simultaneous equations relating strain to stress into simultaneous equations relating stress to strain in terms of the elastic constants. These would be useful for deducing the applied stress if the strains are known. The original equations enable calculation of strains if the applied stresses are known.

Exercise

Use Cramer's rule to find the solution of the system:

\[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] , \]
\(x=\)
\(y=\)
Feedback: Cramer's rule states that \(x = \frac{\Delta_{x}}{\Delta}\) where \(\Delta\) is the determinant of the matrix and \(\Delta_{x}\) is the determinant of the matrix with the x column replaced by the numbers on the right hand side of the equations and similarly \(y = \frac{\Delta_{y}}{\Delta}\). Therefore for the system, \[[value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[\Delta = \det[value]=[value],\] \[\Delta_{x} = \det[value]=[value],\] and \[\Delta_{y} = \det[value]=[value],\] where the notation \(\det A = |A|\) is the determinant of a matrix \(A\). Hence, \[x=\frac[value][value] = [value],\] and \[y=\frac[value][value] = [value].\]

Exercise

Use Cramer's rule to find the y-coordinate of the solution of the system:
\[[value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] . \]
y=
Feedback: Cramer's rule states that \(y = \frac{\Delta_{y}}{\Delta}\) where \(\Delta\) is the determinant of the matrix and \(\Delta_{y}\) is the determinant of the matrix with the y column replaced by the numbers on the right hand side of the equations. Therefore for the system \[[value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[ \Delta = \det[value]=[value],\] and \[\Delta_{y} = \det[value]=[value],\] where the notation \(\det A = |A|\) is the determinant of a matrix \(A.\) Hence, \[y=\frac{\Delta_{y}}{\Delta}=\frac[value][value] = [value].\]

Exercise

Use Cramer's rule to find the solution of the system:

\[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] , \]
\(x=\)
\(y=\)
\(z=\)
Feedback: Cramer's rule states that \(x = \frac{\Delta_{x}}{\Delta}\) where \(\Delta\) is the determinant of the matrix and \(\Delta_{x}\) is the determinant of the matrix with the x column replaced by the numbers on the right hand side of the equations and similarly \(y = \frac{\Delta_{y}}{\Delta}\) and \(z = \frac{\Delta_{z}}{\Delta}\). Therefore for the system, \[[value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[ \Delta = \det[value]=[value],\] \[\Delta_{x} = \det[value]=[value],\] \[\Delta_{y} = \det[value]=[value],\] and \[\Delta_{z} = \det[value]=[value],\] where the notation \(\det A = |A|\) is the determinant of a matrix \(A\). Hence, \[x=\frac[value][value] = [value],\] \[y=\frac[value][value] = [value],\] and \[z=\frac[value][value] = [value].\]

Use Cramer's rule to find the solution of the system:
\[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] , \]
\(x=\)
\(y=\)
Feedback: Cramer's rule states that \(x = \frac{\Delta_{x}}{\Delta}\) where \(\Delta\) is the determinant of the matrix and \(\Delta_{x}\) is the determinant of the matrix with the x column replaced by the numbers on the right hand side of the equations and similarly \(y = \frac{\Delta_{y}}{\Delta}\). Therefore for the system, \[[value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[\Delta = \det[value]=[value],\] \[\Delta_{x} = \det[value]=[value],\] and \[\Delta_{y} = \det[value]=[value],\] where the notation \(\det A = |A|\) is the determinant of a matrix \(A\). Hence, \[x=\frac[value][value] = [value],\] and \[y=\frac[value][value] = [value].\]

Use Cramer's rule to find the solution of the system:

\[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] , \]
\(x=\)
\(y=\)
\(z=\)
Feedback: Cramer's rule states that \(x = \frac{\Delta_{x}}{\Delta}\) where \(\Delta\) is the determinant of the matrix and \(\Delta_{x}\) is the determinant of the matrix with the x column replaced by the numbers on the right hand side of the equations and similarly \(y = \frac{\Delta_{y}}{\Delta}\) and \(z = \frac{\Delta_{z}}{\Delta}\). Therefore for the system, \[[value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[ [value]\ =\ [value] , \] \[ \Delta = \det[value]=[value],\] \[\Delta_{x} = \det[value]=[value],\] \[\Delta_{y} = \det[value]=[value],\] and \[\Delta_{z} = \det[value]=[value],\] where the notation \(\det A = |A|\) is the determinant of a matrix \(A\). Hence, \[x=\frac[value][value] = [value],\] \[y=\frac[value][value] = [value],\] and \[z=\frac[value][value] = [value].\]