Two partial derivatives, one vector
At each point of a surface z = f(x, y) there are two partial derivatives: , the slope in the x direction, and , the slope in the y direction. Written side by side, in that order, they form a vector, the gradient of f: . The symbol is read “del”, and is read “grad f”.
For , and , so . At (3, 4) the gradient is (6, 8), and at (1, 0) it is (2, 0). There is a gradient vector at every point of the plane, and it lies in the plane: it has two components, not three.
The level curve of , dashed, and the gradient at (3, 4), drawn at a quarter of its length: (6, 8) shrunk to (1.5, 2). It points straight out from the origin, along the radius, so it crosses the circle at a right angle.
The steepest way up
Walk from (3, 4) in the direction of a unit vector u = (p, q). Over a short step, the height changes by about times the step in x plus times the step in y, so the slope in that direction is 6p + 8q. That is the dot product .
Difference quotients at (3, 4) agree. Heading east, u = (1, 0), the slope is 6. Heading north, u = (0, 1), it is 8. Along u = (0.6, 0.8), the direction of the gradient itself, it is 6 × 0.6 + 8 × 0.8 = 10. Heading the opposite way, it is −10.
By the dot product, , where is the angle between and u. The cosine is largest, 1, when . So the slope is greatest in the direction of : the gradient points in the direction of steepest ascent, and in the direction of steepest descent.
Du f = ∇f · u = |∇f| cos φ = 2.24 × 0.73 = 1.62: the slope in the direction u is the gradient's length scaled by the cosine of the angle between them
Turn u along the contour until Du f = 0
Contours of the bowl . At P = (1, 1) the gradient is (2x, y) = (2, 1), the gold arrow, with length , and the dashed line is the tangent to the contour through P. The chalk arrow u is a unit direction at 70°, 43° from the gradient, and the slope that way is . Turned onto the gradient the slope reads 2.24, and turned along the dashed tangent it reads 0.
Square to the level curves
Along a level curve the height does not change, so the slope in the direction of the curve is 0. Then for u along the curve, which means is perpendicular to the level curve.
At (3, 4) on the circle , the tangent to the circle runs along (−0.8, 0.6), and . On a contour map, the gradient crosses every contour at a right angle, heading toward the higher ones.
Length is steepness
In the direction of , and the slope is itself. So the length of the gradient is the steepest slope available at that point. For at (3, 4), , and no direction from (3, 4) climbs faster than 10 units of height per unit of distance.
Where the ground is steep the gradient is long, and where it is gentle the gradient is short. At the top of a hill, or the bottom of a bowl, both partial derivatives are 0 and : no direction is uphill.
A contour map of the dome , cut at heights 4, 8 and 12, so . At (0.22, 0.14), near the gentle top, the gradient is (−7.04, −4.48), with length 8.3. At (−0.3, −0.7), where the contours crowd, it is (9.6, 22.4), with length 24.4. Both arrows are drawn to the same scale and point toward the summit.
The usual mistakes
Swapping the components. The first component is always : for f = 3x + 5y, , not (5, 3).
Adding the partial derivatives into one number. For 3x + 5y, the gradient is the vector (3, 5), not 8.
Giving the unit vector as the steepest slope. The unit vector in the direction of gives only the direction; the slope that way is the length .
A hotplate
In the application below, the temperature of a hotplate is . At the probe’s position the gradient gives the direction in which the temperature rises fastest and the rate it rises at, and a robot that always follows the gradient traces a path found from it.
Worked example: A Probe on a Hotplate: the Direction of Fastest Warming, and the Path of a Robot That Always Takes It
Question A steel hotplate 12 centimeters by 8 centimeters is heated from below at its center. With the origin at the center, x centimeters along the long side and y centimeters along the short side, the temperature of the plate is T(x, y) = 100 − 0.5x2 − y2 degrees Celsius. A temperature probe rests at (4, 1). (a) Find the temperature at the probe, the gradient vector ∇ T there, the direction in which the temperature rises fastest, and that fastest rate. (b) A small robot carrying the probe always moves in the direction in which the temperature rises fastest. Find the equation of its path and the point it heads to.
1.(a) At the probe, T(4, 1) = 100 − 0.5 × 16 − 1 = 100 − 8 − 1 = 91°C.
(a) The isotherms are ellipses around the center of the plate; the probe at (4, 1) is on the 91°C isotherm. 2.The partial derivatives are ∂ T∂ x = −x and ∂ T∂ y = −2y, so ∇ T = (−x, −2y), which is (−4, −2) at the probe.
The gradient ∇ T = (−4, −2) points into the hotter part of the plate, at right angles to the isotherm through the probe. 3.The temperature rises fastest in the direction of the gradient, (−4, −2), which as a unit vector is 1√5(−2, −1). The fastest rate is the length of the gradient, √16 + 4 = √20 ≈ 4.47°C per centimeter.
Along the gradient the temperature rises at √20 ≈ 4.47°C per centimeter, faster than in any other direction. 4.(b) The path always points along ∇ T = (−x, −2y), so its gradient is dydx = −2y−x = 2yx. Separating the variables, dyy = 2 dxx, so ln y = 2ln x + c and y = Cx2 for a constant C.
(b) The robot's path has the direction of ∇ T at every point, so its gradient dydx is 2yx. 5.The path passes through (4, 1), so 1 = 16C and C = 116: the robot follows y = x216 toward (0, 0), the center of the plate, where the temperature is highest, 100°C. Check: at (4, 1) the path's gradient is 2 × 416 = 0.5, and the gradient vector (−4, −2) points along a line of gradient −2−4 = 0.5 too.
The robot follows y = x216 into the center of the plate, where the temperature is highest, 100°C.
Answer: (a) 91°C; ∇ T = (−4, −2); the temperature rises fastest in the direction 1√5(−2, −1), at √20 ≈ 4.47°C per centimeter; (b) y = x216, heading to the center (0, 0), where the plate is at 100°C
Common mistakes
- Heading straight for the center along the line y = x4. That line reaches the hottest point, but it is not the direction of fastest rise: at (4, 1) the gradient vector points along a line of gradient 0.5, not 0.25, because the temperature changes twice as fast across the short side of the plate.
- Stopping at the unit vector 1√5(−2, −1) and giving 1 as the fastest rate. The unit vector gives only the direction; the rate is the length of the gradient itself, √20.