Linear Algebra/Topic: Cramer's Rule

 Linear Algebra ← Laplace's Expansion Topic: Cramer's Rule Topic: Speed of Calculating Determinants →

We have introduced determinant functions algebraically by looking for a formula to decide whether a matrix is nonsingular. After that introduction we saw a geometric interpretation, that the determinant function gives the size of the box with sides formed by the columns of the matrix. This Topic makes a connection between the two views.

First, a linear system

${\displaystyle {\begin{array}{*{2}{rc}r}x_{1}&+&2x_{2}&=&6\\3x_{1}&+&x_{2}&=&8\end{array}}}$

is equivalent to a linear relationship among vectors.

${\displaystyle x_{1}\cdot {\begin{pmatrix}1\\3\end{pmatrix}}+x_{2}\cdot {\begin{pmatrix}2\\1\end{pmatrix}}={\begin{pmatrix}6\\8\end{pmatrix}}}$

The picture below shows a parallelogram with sides formed from ${\displaystyle {\binom {1}{3}}}$ and ${\displaystyle {\binom {2}{1}}}$ nested inside a parallelogram with sides formed from ${\displaystyle x_{1}{\binom {1}{3}}}$ and ${\displaystyle x_{2}{\binom {2}{1}}}$.

So even without determinants we can state the algebraic issue that opened this book, finding the solution of a linear system, in geometric terms: by what factors ${\displaystyle x_{1}}$ and ${\displaystyle x_{2}}$ must we dilate the vectors to expand the small parallegram to fill the larger one?

However, by employing the geometric significance of determinants we can get something that is not just a restatement, but also gives us a new insight and sometimes allows us to compute answers quickly. Compare the sizes of these shaded boxes.

The second is formed from ${\displaystyle x_{1}{\binom {1}{3}}}$ and ${\displaystyle {\binom {2}{1}}}$, and one of the properties of the size function— the determinant— is that its size is therefore ${\displaystyle x_{1}}$ times the size of the first box. Since the third box is formed from ${\displaystyle x_{1}{\binom {1}{3}}+x_{2}{\binom {2}{1}}={\binom {6}{8}}}$ and ${\displaystyle {\binom {2}{1}}}$, and the determinant is unchanged by adding ${\displaystyle x_{2}}$ times the second column to the first column, the size of the third box equals that of the second. We have this.

${\displaystyle {\begin{vmatrix}6&2\\8&1\end{vmatrix}}={\begin{vmatrix}x_{1}\cdot 1&2\\x_{1}\cdot 3&1\end{vmatrix}}=x_{1}\cdot {\begin{vmatrix}1&2\\3&1\end{vmatrix}}}$

Solving gives the value of one of the variables.

${\displaystyle x_{1}={\frac {\begin{vmatrix}6&2\\8&1\end{vmatrix}}{\begin{vmatrix}1&2\\3&1\end{vmatrix}}}={\frac {-10}{-5}}=2}$

The theorem that generalizes this example, Cramer's Rule, is: if ${\displaystyle \left|A\right|\neq 0}$ then the system ${\displaystyle A{\vec {x}}={\vec {b}}}$ has the unique solution ${\displaystyle x_{i}=\left|B_{i}\right|/\left|A\right|}$ where the matrix ${\displaystyle B_{i}}$ is formed from ${\displaystyle A}$ by replacing column ${\displaystyle i}$ with the vector ${\displaystyle {\vec {b}}}$. Problem 3 asks for a proof.

For instance, to solve this system for ${\displaystyle x_{2}}$

${\displaystyle {\begin{pmatrix}1&0&4\\2&1&-1\\1&0&1\end{pmatrix}}{\begin{pmatrix}x_{1}\\x_{2}\\x_{3}\end{pmatrix}}={\begin{pmatrix}2\\1\\-1\end{pmatrix}}}$

we do this computation.

${\displaystyle x_{2}={\frac {\begin{vmatrix}1&2&4\\2&1&-1\\1&-1&1\end{vmatrix}}{\begin{vmatrix}1&0&4\\2&1&-1\\1&0&1\end{vmatrix}}}={\frac {-18}{-3}}}$

Cramer's Rule allows us to solve many two equations/two unknowns systems by eye. It is also sometimes used for three equations/three unknowns systems. But computing large determinants takes a long time, so solving large systems by Cramer's Rule is not practical.

Exercises

Problem 1

Use Cramer's Rule to solve each for each of the variables.

1. ${\displaystyle {\begin{array}{*{2}{rc}r}x&-&y&=&4\\-x&+&2y&=&-7\end{array}}}$
2. ${\displaystyle {\begin{array}{*{2}{rc}r}-2x&+&y&=&-2\\x&-&2y&=&-2\end{array}}}$
Problem 2

Use Cramer's Rule to solve this system for ${\displaystyle z}$.

${\displaystyle {\begin{array}{*{4}{rc}r}2x&+&y&+&z&=&1\\3x&&&+&z&=&4\\x&-&y&-&z&=&2\end{array}}}$
Problem 3

Prove Cramer's Rule.

Problem 4

Suppose that a linear system has as many equations as unknowns, that all of its coefficients and constants are integers, and that its matrix of coefficients has determinant ${\displaystyle 1}$. Prove that the entries in the solution are all integers. (Remark. This is often used to invent linear systems for exercises. If an instructor makes the linear system with this property then the solution is not some disagreeable fraction.)

Problem 5

Use Cramer's Rule to give a formula for the solution of a two equations/two unknowns linear system.

Problem 6

Can Cramer's Rule tell the difference between a system with no solutions and one with infinitely many?

Problem 7

The first picture in this Topic (the one that doesn't use determinants) shows a unique solution case. Produce a similar picture for the case of infintely many solutions, and the case of no solutions.

 Linear Algebra ← Laplace's Expansion Topic: Cramer's Rule Topic: Speed of Calculating Determinants →