## Directional Derivatives Part 2: Dot Products and Arbitrary Directions.

### May 17, 2010

Last time, we talked about the gradient. Let’s remind ourselves of what this means: for an arbitrary function (let’s say, of two variables) we have the associated vector field .

Now, we need to introduce the** dot product**. While the dot product of two things is relatively easy to calculate, it’s a bit tricky to figure out what it "means" to take the dot product of two vectors. Let’s define this first:

where is the length of the vector (given as its magnitude, calculated in the standard way: the square root of the sum of the square of its components!) and is the angle between the two vectors. Let’s note here that *the dot product takes two vectors and spits out a scalar*.

But what does the dot product *mean*? Let’s look at this picture, stolen from wikipedia shamelessly. Notice that the scalar projection of the vector A onto the vector B has length ; that is, it’s how long A is when we "project" it down onto B. To obtain the dot product, we take this projection length and multiply it by the length of B. Kind of a strange idea, no? Why would we do such a thing?

Nonetheless, this is not a study of the dot product, and to do so would move us farther away from our original topic! But using the dot product, we can define the directional derivative this way.

Let’s look at a specific function before we consider the directional derivative.

This pretty function is . (By the by, I made this in Mathematica, which is a pretty sweet program to make pictures!) Now, let’s pick a point and take the partial derivatives.

So, we’ve done that. One of those red arrows points directly in the x-direction, and the other points in the y-direction.

Now, let’s pretend we want our derivative in some other direction. Say we want it in the direction of that purple arrow in the picture. This is between the two partial derivatives. Now, wait a momentâ€¦! The two magnitudes "project" onto our new direction and contribute to some of the magnitude of the derivative in that direction! This sounds like dot product material right there.

Our first order of business is to make this easier for ourselves: instead of using the full vector for the direction we want to derive in, let’s make it into a unit vector. This is usually pretty easy: just divide by its magnitude. *Now we can suppose that the vector of the direction we want to derive in is a unit vector.* Let’s call this vector in honor of its unit-ness.

Let’s get right down into the meat of this thing: the way to find the magnitude of the derivative in the direction of , we need only find

and in order to understand this formula, we need only think of what each part means: this formula gives us "how much the partial in the x-direction acts in the direction? how much of the partial in the y-direction acts in the direction?" and this allows us to judge the magnitude of the derivative. After we have the magnitude, all we need is the direction — but, wait! We already know the direction: it’s just ! So, the directional derivative is just

which is pretty nice looking. Notice that the left hand side says : this is a nice way to write "derivative in the direction of at the point (x,y)" compactly. Now, all this theory is nice and all, but let’s do an example or two.

**Examples:**

- Let’s let like in that pretty picture above. First, . So, that’s nice. Now, let’s take the directional derivative at the point with . Notice that this is a unit vector! Now that we have all of this, we find that . Therefore, the vector for the directional derivative in the direction of is equal to .
- Let’s let . Let’s find the directional derivative in the direction of at the point (1,1). Then , and so . Cool. Now, the vector is not a unit vector, so we must divide by the magnitude, which happens to be 5. The unit vector is . So, the magnitude of the directional derivative is , and so the full directional derivative is: .

**Exercises:**

Let .

- Find the directional derivative at the point (1,2) in the direction of .
- Is there anywhere on this function that the directional derivative in all direction will be 0? What happens at this point on the surface?

Now consider the function .

- Find the directional derivative at the point (-1,1) in the direction of .
- Is there anywhere on this function that the directional derivative in all direction will be 0? What happens at this point on the surface? Why is this different from the previous problem?

By the way, the first surface above has a minimum point at the point where its directional derivatives are all zero, but this surface has neither a maximum nor a minimum at the point where its directional derivatives are all zero. When the directional derivatives are all zero but the surface has neither a maximum nor a minimum, we call the point a *saddle point*. Looking at the graph, you can probably guess why! In the next post, we’ll talk about when a point is a maximum, minimum, or a saddle point using cool generalizations of the standard two-variable derivative tests.