 If z is a function of two variables, then the directional derivative along a unit vector a v is going to be given by and corresponds to the rate of change of our function in the direction of v. We can express this conveniently as the dot product of the vector whose components are the partials with respect to x and y and the vector corresponding to our unit vector. What if we have a function of three variables, g of x, y, and z? Through a similar analysis, we obtain the following. If v is a unit vector, the rate of change of a function in the direction of v is our directional derivative and it's the dot product of the vector whose components are the partials with respect to x, y, and z with our unit vector. And in fact, this generalizes two functions of four, five, six, or more variables. Additionally, the direction of greatest increase of our function will go in the direction of this vector consisting of those partial derivatives. So for example, if we have a function of three variables, we can ask how rapidly g is increasing in a particular direction. Again, since our directional derivative is like the slope and it depends on how far we go, we want to find a unit vector. So we need a unit vector in the same direction as three, four, twelve, so we find the magnitude. And we'll scale by one-thirteenth to get a unit vector. So the directional derivative will be the dot product of the vector whose components are the partial derivatives with the unit vector. We know what the unit vector is. We just need to find those partial derivatives. So we'll find the partial of g with respect to x, with respect to y, and with respect to z. Substituting those in, we find the directional derivative is, and our directional derivative does depend on where we are, so we actually need to know the coordinates. So we know that x is equal to two, y is equal to one, c is equal to negative four, so we can substitute those in and find our directional derivative. For example, suppose we wanted to find the direction of greatest increase. So remember that the direction of greatest increase will be the vector consisting of the partial derivatives. So let's say if my function w equals x cubed minus sine xy plus z squared, so we can find the partial derivatives. Now the actual value of this directional derivative depends on x, y, and z. Fortunately we know what those are. If x equals five, y equals zero, z equals three, then these partial derivatives have values. And so w will be increasing most rapidly in the direction of the vector 75, negative five, negative six. Let's think about this a little more. If going in the direction of the unit vector a, b, c gives the greatest possible value of dvf, then we know that the directional derivative will be greater than any other directional derivative for any other unit vector a prime, b prime, c prime. But if I multiply everything through by negative one, this changes the direction of our inequality, which means that if we go in the opposite direction, our directional derivative will be less than the directional derivative of any other direction. And so if a, b, c corresponds to the direction of greatest increase of our function, then negative a, negative b, negative c corresponds to the direction of greatest decrease. And this may be important. For example, suppose a temperature at any point in a room is given by some function, a particle is at some point five, three, one. And let's find its temperature and in what direction should the particle move to decrease the temperature most rapidly? So our function gives the temperature at any point x, y, z, and we know the x, y, z coordinates, so we can compute the temperature. 440 degrees, we're essentially talking about a room on fire. Now if I want to find the direction of greatest increase, I want to find the directional derivative, so we'll find those partial derivatives. So we'll find our partial with respect to x at the point five, three, one. Our partial with respect to y at five, three, one. Our partial with respect to c. And so this gives us the direction of greatest increase. But since we actually want to look for the direction of greatest decrease, we should move in the opposite direction.