If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Multivariable calculus

### Course: Multivariable calculus>Unit 1

Lesson 2: Vectors and matrices

# Determinants

Learn about what the determinant represents, how to calculate it, and a connection it has to the cross product.
When we interpret matrices as movement, there is a sense in which some matrices stretch space out and others squeeze it in. This scaling factor has a name: the determinant.

## Determinant as a scaling factor

Let's go through a few examples to get a feel for how the determinant works. Here's a reminder of what the grid looks like before applying any matrices. The area of the little box starts as 1.
If a matrix stretches things out, then its determinant is greater than 1.
If a matrix doesn't stretch things out or squeeze them in, then its determinant is exactly 1. An example of this is a rotation.
If a matrix squeezes things in, then its determinant is less than 1.
Some matrices shrink space so much they actually flatten the entire grid on to a single line. This happens whenever a matrix maps the unit vectors start color #11accd, \imath, with, hat, on top, end color #11accd and start color #ca337c, \jmath, with, hat, on top, end color #ca337c to be multiples of each other, lying on the same line. These matrices have a determinant of 0.
Even though determinants represent scaling factors, they are not always positive numbers. The sign of the determinant has to do with the orientation of start color #11accd, \imath, with, hat, on top, end color #11accd and start color #ca337c, \jmath, with, hat, on top, end color #ca337c. If a matrix flips the orientation, then its determinant is negative. Notice how start color #11accd, \imath, with, hat, on top, end color #11accd is on the left of start color #ca337c, \jmath, with, hat, on top, end color #ca337c in the image below, when normally it is on the right of start color #ca337c, \jmath, with, hat, on top, end color #ca337c.
The same idea of scaling area extends to 3D matrices as well. The only difference is that in 3D we say the matrix scales volume rather than area. The unit square also becomes the unit cube, whose sides are the unit vectors start color #11accd, \imath, with, hat, on top, end color #11accd, start color #ca337c, \jmath, with, hat, on top, end color #ca337c, and start color #1fab54, k, with, hat, on top, end color #1fab54.
If you'd like, play around with determinants as scaling factors with this interactive demonstration. Notice how, whenever we flip the orientation of the unit vectors, we are forced to pass through a single moment in which the determinant is zero.
One last important note is that the determinant only makes sense for square matrices. That's because square matrices move vectors from n-dimensional space to n-dimensional space, so we can talk about volume changing. For nonsquare matrices, linear algebra has the concepts of null space and range, but they are not multivariable calculus topics. All the formulas in the next section require a matrix with the same number of rows as columns.

## How to calculate determinants

Now that we have a strong sense of what determinants represent, let's go over how we can find the determinant of a given matrix. We'll cover how to do this for 2, times, 2 and 3, times, 3 matrices.

### Calculating 2D determinants

There are two ways to write the determinant.
$\det\left( \left[ \begin{array}{cc} \blueD{a} & \maroonD{b} \\ \blueD{c} & \maroonD{d} \end{array} \right] \right) = \bigg| \begin{array}{cc} \blueD{a} & \maroonD{b} \\ \blueD{c} & \maroonD{d} \end{array} \bigg|$
The formula for the 2D determinant is a, d, minus, b, c. For example:
$\det\left( \left[ \begin{array}{cc} \blueD{1} & \maroonD{3} \\ \blueD{5} & \maroonD{4} \end{array} \right] \right) = 1 \cdot 4 - 3 \cdot 5 = -11$
Let's try a practice question.
Problem 1
$\det\left( \left[ \begin{array}{cc} \blueD{3} & \maroonD{-1} \\ \blueD{-2} & \maroonD{3} \end{array} \right] \right) =$

For more practice calculating 2D determinants, check out this exercise.

### Calculating 3D determinants

The general formula for the determinant of a 3, times, 3 matrix is a mouthful, so let's start by walking through a specific example. The top row is bolded because we'll go along it one entry at a time to find the determinant.
$\det\left( \left[ \begin{array}{ccc} \bold{\blueD{2}} & \bold{\maroonD{1}} & \bold\greenD{{2}} \\ \blueD{3} & \maroonD{3} & \greenD{1} \\ \blueD{1} & \maroonD{4} & \greenD{2} \end{array} \right] \right) = \; ???$
First, consider the start color #11accd, 2, end color #11accd in the top left of the matrix. Let's call this our "anchor number." Imagine we ignore all the other entries that are in the same row or column as our anchor number. The matrix would look like this:
$\left[ \begin{array}{ccc} \blueD{2} & & \\ & \maroonD{3} & \greenD{1} \\ & \maroonD{4} & \greenD{2} \end{array} \right]$
Now we take the 2D determinant of the submatrix we found.
$\det\left( \left[ \begin{array}{cc} \maroonD{3} & \greenD{1} \\ \maroonD{4} & \greenD{2} \end{array} \right] \right) = 3 \cdot 2 - 1 \cdot 4 = \goldD{2}$
Finally, we multiply the smaller determinant with the anchor number start color #11accd, 2, end color #11accd to get start color #11accd, 2, end color #11accd, dot, start color #e07d10, 2, end color #e07d10, equals, 4. This 4 is the first of three terms that we'll add to find the full 3D determinant.
$\det\left( \left[ \begin{array}{ccc} \blueD{2} & \maroonD{1} & \greenD{2} \\ \blueD{3} & \maroonD{3} & \greenD{1} \\ \blueD{1} & \maroonD{4} & \greenD{2} \end{array} \right] \right) = 4 \; + \; ??$
Let's do the next step. This time, our anchor number is start color #ca337c, 1, end color #ca337c.
$\left[ \begin{array}{ccc} & \maroonD{1} & \\ \blueD{3} & & \greenD{1} \\ \blueD{1} & & \greenD{2} \end{array} \right]$
We take the 2D determinant of our new submatrix to get 3, dot, 2, minus, 1, dot, 1, equals, start color #e07d10, 5, end color #e07d10. Now this is a bit odd, but we multiply the result by the negative of the anchor number to make our second term minus, start color #ca337c, 1, end color #ca337c, dot, start color #e07d10, 5, end color #e07d10, equals, minus, 5. In general, we alternate multiplying the small determinant by the anchor number and by the negative of the anchor number, like a checkerboard pattern:
$\left[ \begin{array}{ccc} \greenD{+} & \redD{-} & \greenD{+} \\ \redD{-} & \greenD{+} & \redD{-} \\ \greenD{+} & \redD{-} & \greenD{+} \end{array} \right]$
Now we have two out of three terms.
$\det\left( \left[ \begin{array}{ccc} \blueD{2} & \maroonD{1} & \greenD{2} \\ \blueD{3} & \maroonD{3} & \greenD{1} \\ \blueD{1} & \maroonD{4} & \greenD{2} \end{array} \right] \right) = 4 - 5 \; + \; ?$
For the final step, the anchor number is start color #1fab54, 2, end color #1fab54. According to the checkerboard pattern, we do not need to multiply by negative one at the end. Take a moment to try to imagine the submatrix we get this time. Its determinant is 3, dot, 4, minus, 3, dot, 1, equals, start color #e07d10, 9, end color #e07d10. We multiply this by the anchor number to get start color #1fab54, 2, end color #1fab54, dot, start color #e07d10, 9, end color #e07d10, equals, 18.
At last, we can add together all the terms we've found to see that the determinant is 4, minus, 5, plus, 18, equals, 17. Finding the determinant of a 3, times, 3 matrix is a lot of work! Good job following along.
Here's another example, done all at once. Try to imagine crossing out the entries in the row and column of each anchor number to see where its submatrix comes from.
\begin{aligned} \det\left( \left[ \begin{array}{ccc} \blueD{4} & \maroonD{1} & \greenD{3} \\ \blueD{0} & \maroonD{2} & \greenD{4} \\ \blueD{3} & \maroonD{2} & \greenD{1} \end{array} \right] \right) &= \blueD{4} \det \left( \left[ \begin{array}{cc} \maroonD{2} & \greenD{4} \\ \maroonD{2} & \greenD{1} \end{array} \right] \right) \\ \\ &- \maroonD{1} \det \left( \left[ \begin{array}{cc} \blueD{0} & \greenD{4} \\ \blueD{3} & \greenD{1} \end{array} \right] \right) \\ \\ &+ \greenD{3} \det \left( \left[ \begin{array}{cc} \blueD{0} & \maroonD{2} \\ \blueD{3} & \maroonD{2} \end{array} \right] \right) \\ \\ &= \blueD{4}(\goldD{-6}) - \maroonD{1}(\goldD{-12}) + \greenD{3}(\goldD{-6}) \\ \\ &= -30 \end{aligned}
If we apply the same procedure to a general 3, times, 3 matrix, we get a very long formula. What's most important to take away is the strategy we use to calculate the determinant, not the formula itself.
\begin{aligned} \det\left( \left[ \begin{array}{ccc} \blueD{a} & \maroonD{b} & \greenD{c} \\ \blueD{d} & \maroonD{e} & \greenD{f} \\ \blueD{g} & \maroonD{h} & \greenD{i} \end{array} \right] \right) &= \blueD{a} \det \left( \left[ \begin{array}{cc} \maroonD{e} & \greenD{f} \\ \maroonD{h} & \greenD{i} \end{array} \right] \right) \\ \\ &- \maroonD{b} \det \left( \left[ \begin{array}{cc} \blueD{d} & \greenD{f} \\ \blueD{g} & \greenD{i} \end{array} \right] \right) \\ \\ &+ \greenD{c} \det \left( \left[ \begin{array}{cc} \blueD{d} & \maroonD{e} \\ \blueD{g} & \maroonD{h} \end{array} \right] \right) \\ \\ &= aei - afh - bdi + bfg + cdh - ceg \end{aligned}
Let's do a practice problem.
Problem 2
$\det\left( \left[ \begin{array}{ccc} \blueD{1} & \maroonD{1} & \greenD{-2} \\ \blueD{-2} & \maroonD{0} & \greenD{2} \\ \blueD{4} & \maroonD{-3} & \greenD{3} \end{array} \right] \right) =$

## Connection to cross products

The formula for the cross product is not pretty, but there's a nice trick for deriving it on the fly. To find the cross product of a, with, vector, on top, equals, left parenthesis, start color #11accd, a, start subscript, 1, end subscript, end color #11accd, comma, start color #ca337c, a, start subscript, 2, end subscript, end color #ca337c, comma, start color #1fab54, a, start subscript, 3, end subscript, end color #1fab54, right parenthesis and b, with, vector, on top, equals, left parenthesis, start color #11accd, b, start subscript, 1, end subscript, end color #11accd, comma, start color #ca337c, b, start subscript, 2, end subscript, end color #ca337c, comma, start color #1fab54, b, start subscript, 3, end subscript, end color #1fab54, right parenthesis, just evaluate the following 3, times, 3 determinant, where the top row is the unit vectors start color #11accd, \imath, with, hat, on top, end color #11accd, start color #ca337c, \jmath, with, hat, on top, end color #ca337c, and start color #1fab54, k, with, hat, on top, end color #1fab54.
\begin{aligned} \det\left( \left[ \begin{array}{ccc} \blueD{\hat{\imath}} & \maroonD{\hat{\jmath}} & \greenD{\hat{k}} \\ \blueD{a_1} & \maroonD{a_2} & \greenD{a_3} \\ \blueD{b_1} & \maroonD{b_2} & \greenD{b_3} \end{array} \right] \right) &= \blueD{\hat{\imath}} \det \left( \left[ \begin{array}{cc} \maroonD{a_2} & \greenD{a_3} \\ \maroonD{b_2} & \greenD{b_3} \end{array} \right] \right) \\ \\ &- \maroonD{\hat{\jmath}} \det \left( \left[ \begin{array}{cc} \blueD{a_1} & \greenD{a_3} \\ \blueD{b_1} & \greenD{b_3} \end{array} \right] \right) \\ \\ &+ \greenD{\hat{k}} \det \left( \left[ \begin{array}{cc} \blueD{a_1} & \maroonD{a_2} \\ \blueD{b_1} & \maroonD{b_2} \end{array} \right] \right) \\ \\ &= \vec{a} \times \vec{b} \end{aligned}
Technically, the 3, times, 3 determinant above is not defined because it has vectors in the top row instead of numbers. But if we carry on evaluating it anyway, we arrive at the cross product of a, with, vector, on top and b, with, vector, on top. Many students find it easier to remember the formula for the cross product in terms of the determinant.

## What's next

The wide world of multivariable calculus is next! Congratulations on finishing up this series on vectors and matrices. Now we have all the concepts we need, and hopefully we've built an intuitive, visual understanding of each of them.

## Want to join the conversation?

• What's the origin or the +/- signs in the determinate formula? 