How to find the gradient vector and the direction of steepest increase

Once we know the partial derivatives of a function, we can put them together into one vector called the gradient. The gradient tells us which way the function increases fastest and how quickly it increases in that direction. Let’s find both for a function of two variables.

Put the partial derivatives in coordinate order

For f(x,y), differentiate with respect to x while holding y constant, then differentiate with respect to y while holding x constant. The gradient puts the two partial derivatives in that order.

∇f(x,y)=⟨fx(x,y),fy(x,y)⟩

For a function of three variables, include the third partial derivative as well, so the components follow the order x, y, z. To find the gradient at a particular point, substitute its coordinates into each component.

Find the gradient at a point

Let f(x,y)=x3+2x2y+4y2. We’ll find the gradient at (1,1).

fx=3x2+4xyfy=2x2+8y∇f(1,1)=⟨7,10⟩

Find the fastest rate and its direction

For a differentiable function, the directional derivative in a unit direction is the dot product of the gradient and that unit vector. This dot product is largest when the unit vector points in the same direction as the gradient. The maximum rate is the gradient’s magnitude.

‖∇f(1,1)‖=72+102=149

For the unit direction of steepest increase, divide the gradient by its magnitude. At a point where the gradient is zero, every directional derivative is zero.

⟨7149,10149⟩

Use product and quotient rules for gradients

We can apply the ordinary derivative rules to each partial derivative. For the quotient, use points where g≠0.

∇(fg)=f∇g+g∇f∇(fg)=g∇f-f∇gg2

For example, let f=3x2y and g=x3+2x2y+x. Start with the two gradients.

∇f=⟨6xy,3x2⟩∇g=⟨3x2+4xy+1,2x2⟩

We can simplify before we differentiate. Factor x out of g and cancel one factor of x from the fraction on the original domain g≠0. Set q=x2+2xy+1, so f/g=3xy/q. Applying the quotient rule component by component gives

∂∂x(fg)=3y(1-x2)q2∂∂y(fg)=3x(x2+1)q2

These are the two components of the quotient’s gradient. The original domain still requires both x≠0 and q≠0.