# Math Insight

### Matrices and determinants for multivariable calculus

#### Matrices

A matrix is simply a rectangular array of numbers, such as \begin{align*} \left[ \begin{array}{rrr} 1 & -2 & 3\pi\\ 1.7 & 0 & -\frac{3}{2} \end{array} \right]. \end{align*} Sometimes we might write a matrix like \begin{align*} \left( \begin{array}{rrr} 1 & -2 & 3\pi\\ 1.7 & 0 & -\frac{3}{2} \end{array} \right), \end{align*} but it means the same thing. The above matrix is a $2 \times 3$ matrix because it has two rows and three columns. In general, we'll talk about $m \times n$ matrices, with $m$ rows and $n$ columns.

When studying linear algebra, you'll learn all about matrices. This page, though, covers just some basics that we need for multivariable calculus.

#### Determinants

Many of the main uses for matrices in multivariable calculus involve calculating something called the determinant. It's useful, for example, to calculate the cross product as well as a change of variables.

The determinant of a matrix is defined only for square matrices, i.e., $n \times n$ matrices with the same number of rows and columns. The determinant can be viewed as a function whose input is a square matrix and whose output is a number. The simplest square matrix is a $1 \times 1$ matrix, which isn't very interesting since it contains just a single number. The determinant of a $1 \times 1$ matrix is that number itself.

Moving up in complexity, the next square matrix is a $2 \times 2$ matrix, which we can write \begin{align*} \left[ \begin{array}{cc} a & b\\ c & d \end{array} \right]. \end{align*}

We calculate the determinant of this matrix as follows. We proceed along the first row, starting with the upper left component $a$. We multiply the component $a$ by the determinant of the “submatrix” formed by ignoring $a$'s row and column. In this case, this submatrix is the $1 \times 1$ matrix consisting of $d$, and its determinant is just $d$. So the first term of the determinant is $ad$.

Next, we proceed to the second component of the first row, which is the upper right component $b$. We multiply $b$ by the determinant of the submatrix formed by ignoring $b$'s row and column, which is $c$. So, the next term of the determinant is $bc$. The total determinant is simply the first term $ad$ minus the second term $bc$. We denote this as \begin{align*} \det \left(\left[ \begin{array}{cc} a & b\\ c & d \end{array} \right]\right) = ad-bc. \end{align*}

Okay, that was a lot of work for a simple fact. Most students don't have any trouble memorizing the determinant of a $2 \times 2$ matrix without such rigmarole. The reason for going through this process was to make calculating a $3 \times 3$ (and larger) determinant easy.

We calculate the determinant of a $3 \times 3$ matrix \begin{align*} \left[ \begin{array}{ccc} a & b & c\\ d & e & f\\ g & h & i \end{array} \right] \end{align*} in the exact same way. We proceed along the first row and multiply each component by the determinant of the submatrix formed by ignoring that component's row and column. Through this procedure we calculate three terms, one for $a$, one for $b$, and one for $c$. Each of these terms is added together, only with alternating signs (i.e., the first term minus the second term plus the third term).

We can now write down the determinant of a $3 \times 3$ matrix. \begin{align*} \det \left(\left[ \begin{array}{ccc} a & b & c\\ d & e & f\\ g & h & i \end{array} \right]\right) &= a \det \left(\left[ \begin{array}{cc} e & f\\ h & i \end{array} \right]\right) -b \det \left(\left[ \begin{array}{cc} d & f\\ g & i \end{array} \right]\right) +c \det \left(\left[ \begin{array}{cc} d & e\\ g & h \end{array} \right]\right)\\ &=a(ei-fh) - b(di-fg) + c(dh-eg)\\ &=aei +bfg + cdh -afh -bdi -ceg \end{align*}

Now, I guess you could memorize the final formula for a $3 \times 3$ determinant. But I'd rather use my brain's synaptic connections to do something more useful. In fact, I'm afraid if I tried to memorize it, I might forget something else important, like how to combine like terms in algebra.

The above procedure generalizes to larger determinants, but $3 \times 3$ determinants will be enough for multivariable calculus..

Remember: the determinant is a single number calculated from a matrix.

#### Alternative notation

We often write a $2 \times 2$ determinant as $\left| \begin{array}{cc} a & b\\ c & d \end{array}\right|$ or a $3 \times 3$ determinant as \begin{align*} \left| \begin{array}{ccc} a & b & c\\ d & e & f\\ g & h & i \end{array} \right|. \end{align*} This notation is easier to write than the original notation above, so we'll often use it.

However, note that in this case, the vertical lines do not mean absolute value. The determinant can be negative. In mathematics, we like to use the same symbols to mean different things, which is okay as long as it's clear from context. Since the absolute value of an array of numbers is meaningless, the notation is unambiguous.

Sometimes, we'll need the absolute value of a determinant. How can we denote this? We don't want to put another pair of vertical lines around the determinant when using this notation. (If we did, we'd end up with double vertical lines, which could be confused with something called the “norm” of a matrix—you'll learn about matrix norms in linear algebra.) So instead, when we have to write the absolute value of a determinant, we'll use the original notation, for example, \begin{align*} \left|\det \left(\left[ \begin{array}{cc} a & b\\ c & d \end{array} \right]\right) \right|. \end{align*}

You'll want to be able to denote the absolute value of the determinant accurately when calculating the area of a parallelogram or volume of a parallelepiped. Calculating such volumes are important for changing variables in double integrals and triple integrals.