← All skill guides

Gradient: Step-by-Step Guide

The gradient of a scalar function f is the vector of its partial derivatives. It points in the direction of greatest increase of f at each point, and its magnitude equals the maximum rate of change. It is also normal to the level curves (or surfaces) of f.

Math Racer skill guide · Calculus 3 · College

How to solve it, step by step

  1. Identify the variables. Determine whether f is a function of two, three, or more variables. The gradient has one component per variable.
    \[f(x,y),\; f(x,y,z),\; f(x_1,\dots,x_n)\]
  2. Compute each partial derivative. For each variable, hold the others constant and differentiate.
    \[f_x,\; f_y,\; f_z,\;\dots\]
  3. Assemble the gradient vector. Write the partials as the components of a vector.
    \[\nabla f = \langle f_x,\, f_y,\, f_z \rangle\]
  4. Evaluate at a point if asked. Substitute the coordinates of the point into each component.
    \[\nabla f(P) = \langle f_x(P),\, f_y(P),\, f_z(P) \rangle\]
  5. Interpret geometrically. The gradient points in the direction of steepest ascent and is perpendicular to the level set through P.
    \[\nabla f(P) \perp \{f = f(P)\}\]

Worked example

Find the gradient of f(x, y) = x^2 + 3xy at the point (1, 2).

Step 1: f is a function of two variables, so the gradient has two components.

Step 2: Compute partials. f_x = 2x + 3y. f_y = 3x.

Step 3: Write the gradient: grad f = (2x + 3y, 3x).

Step 4: Evaluate at (1, 2): grad f(1, 2) = (2(1) + 3(2), 3(1)) = (8, 3).

Step 5: The gradient is (8, 3), pointing in the direction of steepest ascent at (1, 2). The maximum rate of increase is sqrt(64 + 9) = sqrt(73) ~ 8.54.

Verification: Both components are positive, consistent with f increasing in both x and y near (1, 2).

Tips and common mistakes

  • The gradient is a vector; the partials are scalars.
  • Number of components equals number of variables.
  • grad f points in the direction of fastest increase; -grad f points in the direction of fastest decrease.
  • |grad f| is the maximum rate of change in any direction.
  • grad f is perpendicular to the level curve f = c at every point.
  • Use the gradient to set up the equation of the tangent plane to a level surface: grad F dot (r - r0) = 0.
  • If grad f(P) = 0, then P is a critical point - candidate for max, min, or saddle.
  • For composite functions, use the multivariable chain rule rather than expanding.

Practice in Explorer · More skill guides