You've learned about using matrices to represent and solve linear systems, either through **Gaussian elimination** or by finding the inverse of the coefficient matrix, if it exists.

Now we'll see how matrices can have aspects that can move you beyond just solving linear systems. The determinant concept is kind of odd at first.

You'll probably have to come back to it a few times to figure out just what's going on, but its usefulness should be obvious after reading through this section.

The determinant concept will also allow us to develop another method for solving linear systems. It's called **Cramer's rule**, and we'll go through a few examples in this section.

We'll begin with a 2-equations, 2-unknown (2-D) problem and look for some general (not dependent on the actual numbers) solutions. The system is:

$$ \begin{align} a_1 x + b_1 y = c_1 \\[5pt] a_2 x + b_2 y = c_2 \end{align}$$

where **a _{1}**,

$$ \left( \begin{matrix} a_1 & b_1 \\[5pt] a_2 & b_2 \end{matrix} \right) \left( \begin{matrix} x \\[5pt] y \end{matrix} \right) = \left( \begin{matrix} a_1 \\[5pt] b_1 \end{matrix} \right)$$

Now if we solve each equation for **y**, we get these two equations, each from one of the original linear equations:

$$y = \frac{c_1 - a_1 x}{b_1} \; \; \color{#E90F89}{\text{and}} \; \; y = \frac{c_2 - a_2 x}{b_2}$$

If each right-hand side is equal to **y**, then each must be equal to the other (**transitive property**):

$$\frac{c_1 - a_1 x}{b_1} = \frac{c_2 - a_2 x}{b_2}$$

Now cross multiply (or multiply both sides by **b _{1}b_{2}**):

$$b_2 c_1 - a_1 b_2 x = b_1 c_2 - b_1 a_2 x$$

Then group terms containing **x** on the left side:

$$a_1 b_2 x - b_1 a_2 x = b_2 c_1 - b_1 c_2$$

Pull the **x** out as a factor:

$$(a_1 b_2 - b_1 a_2) x = b_2 c_1 - b_1 c_2$$

And finally, by dividing by (**a _{1}b_{2} - b_{1}a_{2}**), we have an expression for

$$x = \frac{b_2 c_1 - b_1 c_2}{a_1 b_2 - a_2 b_1}$$

We could go through a similar process (and I suggest that you do) to get an expression for **y**:

$$y = \frac{a_1 c_2 - a_2 c_1}{a_1 b_2 - a_2 b_1}$$

Now the thing to notice about these two expressions is that the denominators (**a _{1}b_{2} - a_{2}b_{1}**) are the same and that the terms of the denominator all come from the coefficient matrix. Furthermore, if

So it turns out that this number **a _{1}b_{2} - a_{2}b_{1}** is quite important, important enough to get a name, the

**determinant** of a matrix is zero, then the linear system of equations it represents has no solution. In other words, the system of equations contains at least two equations that are **not linearly independent**.

The determinant of a 2×2 matrix is the difference of the products along its two diagonals. It looks like this:

In the top example, the linear system represented by the matrix is not linearly independent because one row can be formed by applying a linear operation on the other. For example, if the top row is multiplied by -1, the result would be the bottom row. There is really only one piece of information there to find two variables, so the system can't be solved, and this is indicated by the zero determinant.

The other two matrices *can* be solved because their determinants are not zero.

$$ \begin{align} \left| \begin{array}{cc} -1 & 1 \\[5pt] 1 & -1 \end{array} \right| &= (-1)(-1) - (1)(1) = 0 \\[8pt] \left| \begin{array}{cc} -2 & 3 \\[5pt] 1 & -1 \end{array} \right| &= (-2)(-1) - (1)(31) = -1 \\[8pt] \left| \begin{array}{cc} 1 & 2 \\[5pt] -1 & 5 \end{array} \right| &= (1)(4) - (-1)(2) = 7 \end{align}$$

**Pro tip**: The matrix determinant can be written in two ways:

$$\text{det} \left( \begin{array}{cc} a & b \\[4pt] c & d \end{array} \right) \; \; \color{#E90F89}{\text{OR}} \; \; \left| \begin{array}{cc} a & b \\[4pt] c & d \end{array} \right|$$

I'll use them both on this page; sometimes the second saves needed space. Just remember that when you see "absolute value" bars around a matrix, it means the determinant of that matrix.

Cramer's rule

With the idea of determinants of 2×2 matrices in hand, let's return to the expressions for **x** and **y** in our 2-equations, 2 unknowns system. They were:

$$ \begin{align} x &= \frac{b_2 c_1 - b_1 c_2}{a_1 b_2 - a_2 b_1} \\[8pt] y &= \frac{a_1 c_2 - a_2 c_1}{a_1 b_2 - a_2 b_1} \end{align}$$

We've already shown that the identical denominators are the determinant of the matrix of coefficients for this system. The numerators can be written as determinants of 2 × 2 matrices, too.

Those matrices consist of the coefficient matrix with the first column substituted with the result vector (**c _{1}, c_{2}**) for the

$$x = \frac{\left| \begin{array}{rr} \color{#E90F89}{c_1} & b_1 \\[3pt] \color{#E90F89}{c_2} & b_2 \end{array} \right|}{\left| \begin{array}{rr} a_1 & b_1 \\[3pt] a_2 & b_2 \end{array} \right|}, \; \; y = \frac{\left| \begin{array}{rr} a_1 & \color{#E90F89}{c_1} \\[3pt] a_2 & \color{#E90F89}{c_2} \end{array} \right|}{\left| \begin{array}{rr} a_1 & b_1 \\[3pt] a_2 & b_2 \end{array} \right|}$$

The **x** value is found by substituting the column vector of results into the first (x) row of the coefficient matrix, finding that determinant and then dividing by the determinant of the un-altered coefficient matrix. The **y** value is found by similarly substituting the result column vector into the second (y) column of the coefficient matrix.

For the matrix equation **Ax** = **b**, where **A** is an n×n square matrix of coefficients and **x** and **b** are n-dimensional column vectors, the components of **x** = (x_{1}, x_{2}, x_{3}, ... x_{n}) are given by

$$x_n = \frac{\text{det}(A_i)}{\text{det}(A)}$$

where **A _{i}** is the matrix

You might be saying to yourself, "Self, this is nice, but I can solve a two-equation — two unknown problem like these faster the old fashioned way." And you'd be right. In order to make Cramer's rule really useful, we'd like to apply it to very large systems of linear equations, ones with dimensions in the hundreds or thousands.

To do that, we'll need to figure out how to find determinants of larger matrices, because the multiplication of diagonals trick only works for 2 × 2 matrices.

Here is the formula for the determinant of any 3 × 3 matrix. It looks daunting, but don't worry, there's an easy way to do it that doesn't require memorization of a formula.

The way to remember this method is illustrated below. First, rewrite the first two columns of the matrix, (a, e, i) and (b, f, j), to the right of the matrix. Next, draw in the red diagonals as shown below:

The first three terms of the determinant are the products of the elements along all of these **afk + bgi + cej**. Then draw in the blue diagonals in the opposite direction (lower left to upper right), as shown. The next three terms are the products along those diagonals subtracted from the first part: **-ifc - jga - keb**. It's simple.

In this example, the determinant is zero, meaning that the system of 3 equations and 3 unknowns represented by this matrix can't be solved. Notice that the third row of the matrix is just the sum of the first two. It's a linear combination of the first two, so it's not linearly independent.

Here are two more examples, just so you can practice finding 3×3 determinants:

The latter two matrices represent solvable systems of equations – three equations and three unknowns – because they have non-zero determinants.

Cramer's rule extends nicely to 3×3 and larger square matrices. Let's use it to solve a 3 × 3 system:

Now the key to doing these problems by hand is to take your time and stay organized. First, we'll find the determinant of the coefficient matrix, which we'll call **A**. It will be the denominator in our expressions for **x**, **y** and **z**.

Now the determinants of the matrices substituted with the result vector (4, -2, 9) (

Now we just do the divisions and arrive at the solution:

$$(x, y, z) = (1, 2, 3)$$

Cramer's rule can be extended to larger matrices & systems of equations so long as we have n linearly independent equations to find n unknowns. It's also fairly easy to program to solve large systems by computer algorithm.

$$ \begin{align} x &= \frac{\text{det}(A_1)}{\text{det}(A)} = \frac{-21}{-21} = 1 \\[8pt] y &= \frac{\text{det}(A_2)}{\text{det}(A)} = \frac{-42}{-21} = 2 \\[8pt] z &= \frac{\text{det}(A_3)}{\text{det}(A)} = \frac{-63}{-21} = 3 \end{align}$$

We want to get to the point where we can solve for determinants of larger matrices, but first it's good to describe a few properties of determinants. They can be a big help.

1. | The determinant of a diagonal matrix is the product of the elements along the diagonal. |
This is pretty easy to see using a 3×3 or 2×2 matrix. For the 3×3, all of the other elements of the determinant expression except the first ( |

2. | The determinant of an upper-triangular or lower-triangular matrix is the product of the elements on the diagonal. |
I won't try to prove this for all matrices, but it's easy to see for a 3×3 matrix: The determinant is
= This property means that if we can manipulate a matrix into upper- or lower-triangular form, we can easily find its determinant, even for a large matrix. |

3. | The determinant of a block-diagonal matrix is the product of the determinants of the blocks. |
Recall that a block diagonal matrix is one that has elements only symmetrically distributed in square blocks along the diagonal. Here's one: The determinant of such a matrix is just the product of the determinants of the five blocks. In order from top to bottom they are 3×3, 2×2, 1×1, 1×1 and 3×3 blocks. |

4. | The determinant has the same absolute value, but switches sign when either two rows or two columns are swapped. |
(See below for some examples) |

Here are examples of the effect row and column swapping on the determinant of a 3 × 3 matrix. First we'll write out a generic (no numbers) determinant:

Now after swapping the top two rows, notice that the determinant has only changed sign:

And likewise for swapping two columns.

Note that if, in the first instance, we swapped any other two rows, the sign of the determinant would change again. The same is true for columns. We often want to swap columns or rows in order to make a matrix triangular or block diagonal, to make the determinant easier to calculate.

**xaktly.com** by Dr. Jeff Cruzan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. © 2016, Jeff Cruzan. All text and images on this website not specifically attributed to another source were created by me and I reserve all rights as to their use. Any opinions expressed on this website are entirely mine, and do not necessarily reflect the views of any of my employers. Please feel free to send any questions or comments to jeff.cruzan@verizon.net.