Directional derivative and gradient examples

Example 1

Let f(x,y) = x2y. (a) Find f(3, 2). (b) Find the derivative of f in the direction of (1,2) at the point (3,2).

Solution: (a) The gradient is just the vector of partial derivatives. The partial derivatives of f at the point (x,y) = (3, 2) are:

f x(x,y) = 2xy f y(x,y) = x2 f x(3, 2) = 12 f y(3, 2) = 9

Therefore, the gradient is

f(3, 2) = 12i + 9j = (12, 9).

(b) Let u = u1i + u2j be a unit vector. The directional derivative at (3,2) in the direction of u is

Duf(3, 2) = f(3, 2) u = (12i + 9j) (u1i + u2j) = 12u1 + 9u2.  (1)

To find the directional derivative in the direction of the vector (1,2), we need to find a unit vector in the direction of the vector (1,2). We simply divide by the magnitude of (1, 2).

u = (1, 2) (1, 2) = (1, 2) 12 + 22 = (1, 2) 5 = (15, 25).

Plugging this expression for u = (u1,u2) into equation (1) for the directional derivative, and we find that the directional derivative at the point (3, 2) in the direction of (1, 2) is

Duf(3, 2) = 12u1 + 9u2 = 12 5 + 18 5 = 30 5.

Example 2

For the f of Example 1, find the directional derivative of f at the point (3,2) in the direciton of (2, 1).

Solution: The unit vector in the direction of (2, 1) is

u = (2, 1) 5 = (25, 15).

Since we are still at the point (3,2), equation (1) is still valid. We plug in our new u to obtain

Duf(3, 2) = 12u1 + 9u2 = 24 5 + 9 5 = 33 5

Example 3

For the f of Example 1 at the point (3,2), (a) in which direction is the directional derivative maximal, (b) what is the directional derivative in that direction?

Solution: (a) The gradient points in the direction of the maximal directional derivative. The directional derivative is maximal in the direction of (12,9). (A unit vector in that direction is u = (12, 9)122 + 92 = (45, 35).)

(b) The magnitude of the gradient is this maximal directional derivative, which is ||(12, 9)|| = 122 + 92 = 15. Hence the directional derivative at the point (3,2) in the direction of (12,9) is 15.

We could double-check by calculating the result using equation (1) and the unit vector u = (45, 35). Then we find that

Duf(3, 2) = 12u1 + 9u2 = 48 5 + 27 15 = 75 5 = 15,

which agrees with our result.

Example 4

For the f of Example 1 at the point (3,2), (a) what is the directional derivative in the direction (-3,4) (which is perpendicular to f(3, 2)), and (b) what is the directional derivative in the direction (-4,-3) (which is opposite of the direction of f(3, 2))?

Solution: (a) The directional derivative must be zero. (b) The directional derivative must be ||f(3, 2)||, which is 15. (You can verify these by calculating the results directly using equation (1).)