| The partial derivative | |
|---|---|
| The slope in direction u | |
| The tangent plane | |
| The second-derivative test, at a point where ∇f = 0 (D < 0: a saddle) |
Lesson
The theory — Partial Derivatives and the Gradient
A partial derivative of f(x, y) is the ordinary derivative in one variable with the other held fixed: fx is the slope of the surface walking in the x-direction, fy walking in the y-direction.
What each symbol means
∇f- the gradient, the vector (f_x, f_y)
θ- the heading, in degrees round from east
D- the discriminant f_xx f_yy − f_xy²
Where the formula comes from
- Hold one variable still. For fx, treat y as a constant and differentiate as usual; for fy, the other way round.
- The gradient. The two partials make a vector, ∇f. It points up the steepest slope, the coloured arrow on the map, and its length is that slope.
- Any other direction. The slope on a heading θ is the dot product of the gradient with the unit vector that way: the steepest slope times the cosine of the angle off it, and 0 along the contour.
- The tangent plane. Close to a point the surface is nearly a plane, with the two partials as its slopes. It is the two-variable form of the tangent line on the derivative page.
- Where both partials are 0. The point is critical, and the discriminant D decides: D > 0 with fxx > 0 is a minimum, D > 0 with fxx < 0 a maximum, D < 0 a saddle, and D = 0 says nothing.
Problems solved in full
-
First and second partial derivatives 4 steps
For f(x, y) = x³y² − 2xy + y³, find fx, fy and the three second partial derivatives at (1, 2), and check that the two mixed ones agree.
-
For fx treat y as a constant, and for fy treat x as one:
-
At (1, 2):
-
Differentiate again. The mixed partial can be taken in either order:
-
At (1, 2):
Answer
fx = 8, fy = 14, fxx = 24, fyy = 14 and fxy = fyx = 10. The two mixed partials agree wherever they are continuous, which is Schwarz's theorem, often credited to Clairaut; every polynomial qualifies.
-
-
The slope in a given direction, and the steepest one 4 steps
For f(x, y) = x²y + y³, find the rate of change at (2, 1) in the direction of the vector (3, 4), and the largest rate of change there, with its direction.
Show solution
-
The gradient first:
-
A direction has to be a unit vector, and (3, 4) has length 5:
-
The directional derivative is the dot product:
-
The largest rate is the length of the gradient, in the gradient's own direction:
Answer
8 in the direction of (3, 4); at most √65 = 8.062, on a heading of 60.3°. Forgetting to divide (3, 4) by its length gives 40, five times too much, and it is the commonest slip in this question.
-
-
The tangent plane, and an estimate from it 3 steps
Find the tangent plane to z = √(x² + y²) at (3, 4), and use it to estimate √(3.02² + 3.97²).
Show solution
-
At (3, 4) the height is 5, and the partials are x/√(x² + y²) and y/√(x² + y²):
-
The tangent plane uses the height and both slopes:
-
At (3.02, 3.97):
Answer
The tangent plane is z = 0.6x + 0.8y, and it gives 4.988 against a true 4.988116. Close to (3, 4) the surface is nearly flat, so the plane tracks it, as the tangent line tracked a curve on the derivative page.
-
-
Critical points and the second-derivative test 3 steps
Find and classify the critical points of f(x, y) = x³ + y³ − 3xy.
Show solution
-
Set both partial derivatives to 0:
-
The first gives y = x², and the second then gives x⁴ = x, so x = 0 or x = 1:
-
The second partials are fxx = 6x, fyy = 6y and fxy = −3. Test each point:
Answer
(0, 0) is a saddle and (1, 1) a local minimum, with f(1, 1) = −1. It is not the lowest point of the surface: along the line y = x, f = 2x³ − 3x², which falls without bound as x → −∞.
-
-
Steepness of a hillside rising 3 metres east and 4 metres north 6 steps
You are on a hillside where the ground rises 3 metres per 100 travelled due east, and 4 metres per 100 travelled due north. How steep is the hill, which way does it fall, and what heading must a road take to climb at half that gradient?
Show solution
-
Those two measurements are the partial derivatives. Keeping them as 3 and 4 per hundred reads more easily than 0.03 and 0.04, and changes nothing.
-
The steepest slope is the length of the gradient, which is neither the sum of the parts nor the larger of them. Three and four give five, and five is what a walker feels.
-
Its heading is atan2(4, 3), which is 53.1° round from east. Downhill is the opposite way, at 233.1°. Nothing was measured along either.
-
For a road at 2.5 per hundred, run the identity backwards. The slope on a heading θ away from that steepest heading is 5 cos θ, so cos θ = 2.5/5 and θ = 60°.
-
Sixty, not forty-five. A road at 45° would still be climbing at 3.54 per hundred, which is 71% of the steepest and nowhere near half of it.
-
The length comes from the same cosine. Gaining a fixed height at half the gradient means covering twice the ground for as long as the slope holds, and that factor of two is what the switchbacks on a mountain road are made of.
Answer
The hill is 5 m per 100 m, rising at a heading of 53.1° and falling at 233.1°, and a road holding 2.5 m per 100 m must run 60° off that steepest heading and travel twice as far. The tool answers the first half: point it any way you like and it gives the slope. The second half is the inverse question, and it is the one that a road engineer, a ramp accessibility standard and a ski piste grading all actually ask. Given the gradient I am allowed, what heading am I forced onto?
-
-
The heading with no slope, and how long it stays level 6 steps
At (1, 1) on 1.5x² + 2y² the panel puts the slope on a heading of 143.1° at 0.000. Work out what the ground does if you keep walking that way, and decide whether that heading is one you could follow to stay level.
Show solution
-
A quarter turn from the steepest heading of 53.1°. The two terms of the dot product come out −2.4 and +2.4, so the slope card reads 0.000.
-
Zero slope is a statement about the first derivative and nothing else. Take the second one along the same heading. It is the quadratic form built from the three second partials, with the same cosine and sine inside it.
-
On this surface f_xx is 3, f_yy is 4 and the mixed partial is 0, so the second derivative along the level heading is 3.36. Positive, so the ground curves upward.
-
The height along that line is therefore a parabola with its lowest point where you are standing. Half a unit out the ground has risen 0.42, from 3.5 to 3.92, and the slice panel draws exactly that curve.
-
Turn it into a property of the contour. The curve that really does hold height bends away from the tangent at the second derivative divided by the gradient: 0.672, which is a radius of 1.488.
-
The standard formula for the curvature of a level set gives the same number from the partials alone, with no heading anywhere in it. Two routes, one answer, and it is exactly 84/125.
Answer
No. That heading is level for an instant and then climbs. Walk half a unit along it and you have gained 0.42, where the first derivative predicted 0. The two zero-slope headings are tangents to the contour rather than the contour itself, and staying level means turning continuously, on a circle of radius 1.488 at this point. The panel gives you the tangent; the curvature says how far it is worth trusting.
-
Learning path