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.

Main content


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 ı^ and ȷ^ 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 ı^ and ȷ^. If a matrix flips the orientation, then its determinant is negative. Notice how ı^ is on the left of ȷ^ in the image below, when normally it is on the right of ȷ^.
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 ı^, ȷ^, and k^.
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×2 and 3×3 matrices.

Calculating 2D determinants

There are two ways to write the determinant.
The formula for the 2D determinant is adbc. For example:
Let's try a practice question.
Problem 1
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

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

Calculating 3D determinants

The general formula for the determinant of a 3×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.
First, consider the 2 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:
Now we take the 2D determinant of the submatrix we found.
Finally, we multiply the smaller determinant with the anchor number 2 to get 22=4. This 4 is the first of three terms that we'll add to find the full 3D determinant.
Let's do the next step. This time, our anchor number is 1.
We take the 2D determinant of our new submatrix to get 3211=5. Now this is a bit odd, but we multiply the result by the negative of the anchor number to make our second term 15=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:
Now we have two out of three terms.
For the final step, the anchor number is 2. 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 3431=9. We multiply this by the anchor number to get 29=18.
At last, we can add together all the terms we've found to see that the determinant is 45+18=17. Finding the determinant of a 3×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.
If we apply the same procedure to a general 3×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.
Let's do a practice problem.
Problem 2
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

To learn more about calculating 3D determinants, check out this video.

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=(a1,a2,a3) and b=(b1,b2,b3), just evaluate the following 3×3 determinant, where the top row is the unit vectors ı^, ȷ^, and k^.
Technically, the 3×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 and b. 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?

  • blobby green style avatar for user millo.amit
    What's the origin or the +/- signs in the determinate formula?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • primosaur seed style avatar for user H Martone
      Here is what khan academy said:

      "Just like for the 2D case, we can carefully analyze a diagram of the unit cube after it's stretched by a matrix to find its final volume. That volume is the 3D determinant of the matrix, perhaps multiplied by -1 depending on orientation. As for determinants in n dimensions, there unfortunately isn't a satisfying explanation for why the formula works until we have a foundation in linear algebra.
      Luckily, all that's important to understand for multivariable calculus is that determinants scale area. Knowing the underlying machinery of why that's true can come later."

      I haven't taken linear algebra yet but when I do, I'll definetly let you know!
      (10 votes)
  • blobby green style avatar for user ab.dahal85
    idk if this is supposed to be simple but in the 3d matrix i dont understand why

    i is +ve and j is -ve and again k is +ve (to be more specific while finding discriminant why is there negative where does it come from ? )
    (2 votes)
    Default Khan Academy avatar avatar for user
    • male robot donald style avatar for user Venkata
      For this particular course, you can just take it as a rule. But, if you take up Linear Algebra, you'll see where the negative comes from. I'll explain it though.

      So, there are two quantities which can be found in a matrix: minors and cofactors. Minors exist for each element of the matrix, and are defined as the determinant of the matrix you get when you ignore the row and column of the element in question. For example, if my matrix is as follows:

      1 2 3
      4 5 6
      7 8 9

      If I need the minor of the first element, I ignore the elements in the row and column of that element. So, on removing them, I get:

      5 6
      8 9

      This leaves me with a "mini matrix", if you will. The determinant of this is the minor of the first element. See that this is exactly what you're doing when you find a cross product, but there's more.

      What you're actually doing during a cross product is finding the cofactors. The cofactor of an element (symbolized as A) has a formula:

      A = (-1)^(i+j) (M_(i,j))

      Here, i and j are the row and column number. So, for the first element of our matrix, i = j = 1. For the second element in the first row, i = 1 and j = 2, and so on. M_(i,j) is just the minor of the element in the ith row and jth column.

      Now, if I want the cofactor of the first element, I'll find the minor M_(1,1). But, here's the interesting part. See what happens to (-1)^(i+j). This becomes (-1)^(1+1) = (-1)^(2) = 1. So, the cofactor is positive (assuming M is positive)

      Now, see the second element. Here, i = 1 and j = 2. So, A = (-1)^(1+2) * (M_(1,2)). This gives us (-1)^(3) * (M) = -M. And this is where the negative comes from!

      You'll need to take a linear algebra course to truly understand these concepts, but this is the gist of it.
      (3 votes)
  • piceratops seedling style avatar for user Chris2Mac
    In the last bit, "Connection to Cross Products" shows that the Determinant can be used to conceptualize the Cross Product the term -1(^j) appears. When I expand a cross b into it's vector representation:
    there is no -1 term in the second value (a3b1-a1b3). Where did -1 go?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • male robot donald style avatar for user Venkata
      The -1 is built into the j component. So, on expanding, you, by default, put a negative sign before the j component. It doesn't come from the a3b1 - a1b3 itself.

      As for why this is the case, you'll learn it in Linear Algebra. What we're doing while finding the cross product is actually finding the cofactors of the first row. The cofactor of an element of a matrix is given by (-1)^(i+j)(M_(i,j)). Looks nasty, but let me break it down.

      i and j represent the row and column number of the element. So, for the first element in the first row and column, i and j would be 1. M_(i,j) represents the minor of the element in the ith row and jth column, which isn't really required to understand the sign aspect. So, I'll not delve into it.

      So, see how the signs work. For the first element, the cofactor will be (-1)^(1+1)(M_(1,1)) which is (-1)^(2)(M_(1,1)) which is (M_(1,1)). See that the first cofactor (which is also the x component) is positive.

      Now, for the second element (first row, second column), i will be 1 but j will be 2. So, the cofactor (which is the y component) will be (-1)^(1+2)(M_(1,2)). This ends up giving (-1)(M_(1,2)). See that this is negative. The y component itself is what M_(1,2) is, so the negative sign will be there regardless of what the minor is (I also realised that you wrote the y component as a3b1 - a1b3. It should be a1b3 - a3b1. So, transforming a3b1 - a1b3, we get -(a1b3 - a3b1), and you get the negative sign)

      I'll leave finding the third element and confirming it is positive to you, but here's where the negative sign comes from, and the error you made which made it so that you didn't get the negative sign.
      (4 votes)
  • starky seedling style avatar for user Disko
    I've never seen this method for determinants! This makes it a million times easier in my!
    (2 votes)
    Default Khan Academy avatar avatar for user
  • boggle blue style avatar for user Adam Dallas
    Who else just wrote a Python script to calculate the determinant of a 3x3 matrix? I already tried mentally calculating it from previous lessons. It was honestly the hardest thing I've done as of late. I kinda just gave up 😅
    (2 votes)
    Default Khan Academy avatar avatar for user
  • spunky sam red style avatar for user Arjun Roy
    Could the "anchor number" method work on any row? For example, could I use the numbers in the second row (3, 3, and 1) as anchor numbers and solve for the determinant that way?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user Gunin
      Yeah you can use any row to calculate the determinant the reason being that mathematically the determinant is defined as: The sum of the products of elements of any row with the co-factors of corresponding elements.

      But usually we calculate it using the first row for convenience.

      Well if you want to understand this definition in a better sense, well here you go 😉:

      Explanation: Now, before understanding the concept of co-factor, let me explain you the concept of minor: Over here, Khan Academy has talked about a sub matrix, formed after the elimination of rows and columns, the determinant of that sub matrix is called the minor.

      Now, coming to cofactor: ((-1)^(i + j)) × Minor
      i is the row, j is the column
      It looks a bit complex if I type it this way but it's simple 😅

      You might wonder where the -ve and +ve signs come up, well it is the cofactor; we multiply the minor with -1 raised to the power of the sum of the row and column of that element.
      (2 votes)
  • blobby green style avatar for user Ty Gaeta
    Wow, the cross formula is now much easier!
    (1 vote)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user helenwanghome
    I found this Lesson's learnings in Visualizing matrices and understanding determinants are very effective, especially the simulations. They seems to be very basic. Is there any reason why they are not included in the Linear Algebra course?
    (1 vote)
    Default Khan Academy avatar avatar for user