Partial Derivatives and the Gradient
Partial derivatives extend the derivative to functions of several variables by changing one input at a time. The gradient collects those first partial derivatives into a vector. Together they describe slopes, tangent planes, directional derivatives, level curves, and local linear approximation for surfaces.
The main conceptual shift is that a multivariable function can change in many directions from the same point. A single derivative number is no longer enough. The gradient gives the direction of steepest increase and organizes all directional rates into one vector formula.
Definitions
For a function , the partial derivative with respect to is
and the partial derivative with respect to is
When computing , treat as constant. When computing , treat as constant.
The gradient is
For ,
The directional derivative of at a point in the unit direction is
A level curve of is a curve
A level surface of is
Key results
The gradient points in the direction of steepest increase. Since
and , the maximum directional derivative is , achieved when points in the gradient direction.
The gradient is perpendicular to level curves and level surfaces. If a path stays on a level curve , then
Differentiating gives
Thus the gradient is orthogonal to the tangent direction .
The tangent plane to at is
This is the multivariable version of linearization. The corresponding linear approximation is
For an implicit surface , the tangent plane at point has normal vector :
Second partial derivatives include , , , and . Under suitable continuity hypotheses,
This equality is called Clairaut's Theorem.
The chain rule for a path is
This is the same dot product structure that appears in directional derivatives.
Differentiability in several variables is stronger than the existence of partial derivatives. A function can have both and at a point and still fail to have a good tangent plane there. A common sufficient condition is that the first partial derivatives exist in a neighborhood of the point and are continuous at the point. Under that condition, the linear approximation really is the best first-order approximation.
The total differential records this approximation:
It estimates the output change caused by small input changes. In measurement problems, if and have small errors, the differential estimates the resulting error in .
For functions of three variables, the gradient normal property is especially important. If is a level surface, then is perpendicular to the tangent plane. This is why tangent planes to spheres, ellipsoids, and implicit surfaces are often found more cleanly with gradients than by solving for one variable.
The directional derivative formula also makes angle dependence explicit. Moving perpendicular to the gradient gives zero first-order change because the dot product is zero. Moving opposite the gradient gives the steepest decrease, with value .
Second partials describe bending. The Hessian matrix
is used in the multivariable second derivative test. Its determinant and signs determine whether the surface bends upward, downward, or like a saddle near a critical point.
Partial derivatives also have units. If is temperature in degrees Celsius and are measured in meters, then and are degrees Celsius per meter. A directional derivative has the same units and gives the rate of temperature change per meter in the chosen direction. This unit check is useful in physical fields such as temperature, pressure, elevation, and concentration.
The gradient can be zero at flat points. When , every directional derivative is zero because for every unit vector . This makes the point a candidate for a local extremum, but not a guarantee. A saddle point also has zero gradient, just as has zero derivative at a point that is not a one-variable extremum.
For level curves on a contour map, closely spaced contours indicate a large gradient magnitude because the function changes rapidly over a short distance. Widely spaced contours indicate a small gradient magnitude. The gradient direction crosses contour lines at right angles and points toward increasing labels.
Linear approximation is local. If moves too far from , curvature and higher-order terms can dominate. The tangent plane gives first-order behavior, and the Hessian describes the next-order correction.
Visual
| Object | Formula | Meaning |
|---|---|---|
| Partial derivative | , | change one variable at a time |
| Gradient | vector of first partials | |
| Directional derivative | rate in unit direction | |
| Tangent plane | best local linear surface | |
| Level curve normal | perpendicular to constant-value curve |
Worked example 1: gradient and directional derivative
Problem. Let
Find and the directional derivative at in the direction of .
Method.
- Compute partial derivatives:
- Evaluate at :
Thus
- Convert to a unit vector:
- Compute the directional derivative:
- Evaluate:
Checked answer. , and the directional derivative in the direction is . The maximum directional derivative at the point would be .
Worked example 2: tangent plane and linear approximation
Problem. Find the tangent plane to
at , and use it to approximate .
Method.
- Compute partial derivatives:
- Evaluate at :
- Write the tangent plane:
- For , the changes are
- Approximate:
- Simplify:
Checked answer. The tangent plane is , and .
A direct check gives
The linear approximation is close because is near . The tangent plane is not expected to remain accurate far from the base point.
The gradient at is , a unit vector pointing radially outward. This fits the geometry of : the steepest increase in distance from the origin is directly away from the origin.
In applications, the same computation estimates sensitivity. If and are measured values, the coefficients and tell how much each small input error contributes to the first-order output error. This is the multivariable version of using in one variable.
When using finite differences numerically, the same hold-one-variable-fixed interpretation applies. A central difference for changes in both directions while keeping fixed. Changing both variables at once estimates a directional derivative, not a partial derivative.
The notation should reflect that distinction. The symbol signals that other independent variables are held fixed, while along a path means every coordinate depending on may change. Many multivariable mistakes come from using a partial derivative when a total derivative along a curve is required in context.
Writing the dependency first prevents that error in solutions and explanations consistently enough.
It is a small notation habit with large payoff.
Code
def f(x, y):
return x*x*y + 3*y*y
def partial_x(f, x, y, h=1e-5):
return (f(x + h, y) - f(x - h, y)) / (2*h)
def partial_y(f, x, y, h=1e-5):
return (f(x, y + h) - f(x, y - h)) / (2*h)
print(partial_x(f, 2, 1), partial_y(f, 2, 1))
Common pitfalls
- Forgetting to use a unit vector for directional derivatives.
- Treating partial derivatives as if all variables change at once. One variable changes; the others are held constant.
- Assuming whenever a level curve has a horizontal tangent. The gradient is normal, not tangent.
- Writing a tangent plane without evaluating derivatives at the base point.
- Confusing a tangent plane to with a level-surface tangent plane for .
- Assuming mixed partials are equal without the needed continuity conditions.
Connections
- Derivatives and Rates: partial derivatives are one-variable derivatives in coordinate directions.
- Vectors and Geometry of Space: gradients are vectors and often normals.
- Extrema and Lagrange Multipliers: gradients and second partials classify multivariable extrema.
- Vector Calculus: grad is one of the central vector differential operators.