Derivatives and level-set geometry
Partial derivatives, gradients, level-set normals and tangent planes for functions of several variables.
This page sets up first-order calculus for functions of several variables, where a change in the input has a direction as well as a size. Partial derivatives measure change along the coordinate directions and the gradient collects them into one vector.
The gradient also gives geometry: it is normal to every level set, meaning perpendicular to all its tangent directions. That fact leads to the tangent plane, the first local model of a surface.
Functions, graphs and level sets
Function of several variables
A function of several variables is a map
where and is the domain of allowed inputs.
When , the graph of is the surface in . A function of three variables has a graph in , which is harder to visualise, but the coordinate and vector formulas remain the same.
An explicit graph solves for one coordinate. An implicit description instead keeps all coordinates in one equation; this is the setting for level-set normals.
Level set
For , with and , the level set of at level is
For example, the graph is the level set and the unit sphere is the level set . The function defining the level set need not be the same function whose graph we are studying.
Level sets also appear in exact differential equations: the solution curves of an exact equation with potential are the level curves , so the geometry below applies to them.
Partial derivatives and the gradient
Partial derivative
For with , at an interior point , the partial derivative with respect to is the one-variable derivative obtained by varying and holding every other coordinate fixed:
when the limit exists.
The ordinary sum, product, quotient and chain rules still apply. Treat every variable other than the one being differentiated as a constant. For two variables we write and .
Gradient
For with , at points where all first partial derivatives exist, the gradient is the vector-valued function
When is differentiable, the gradient has a second interpretation. For a unit direction , the rate of change along the line is
The Cauchy–Schwarz inequality gives . When the gradient is non-zero, the maximum directional derivative is attained by taking in the gradient direction (and the most negative rate in the opposite direction). Thus points in the direction of steepest increase and its length is that maximum directional rate.
The linear map that gives first-order change is the total derivative (or derivative map). At a differentiable point it is represented by the gradient:
Differentiability means this one linear map approximates change in every direction. The coordinate partial derivatives alone do not establish that, so they do not guarantee the directional-derivative formula above.
Computing a gradient
Let
Holding the other variables fixed gives
Therefore
At a specified point this vector also predicts directional change. For example,
so a small displacement from changes to first order by . This is the same linear term used later in the tangent-plane approximation.
[routine]
- [1]:Gradient
Second derivatives describe how the first-order rates change. The order of mixed differentiation can be exchanged when the relevant mixed partials are continuous, but domain restrictions must still be recorded.
First and second partial derivatives
Consider
Treating the other coordinate as constant gives
Differentiate with respect to and with respect to :
The two mixed partials agree, as Clairaut's theorem guarantees because they are continuous everywhere. The other second partials are and .
[routine]
Domain restrictions are part of the derivative
For
the domain requires and . The first partial derivatives are
and the second partial derivatives are
[routine]
Gradients and level-set geometry
Suppose is a differentiable curve that stays in a level set. The value of the defining function does not change along the curve, so differentiating that constant value forces the gradient to be orthogonal to the curve's tangent.
Gradient normal to a level set
Let be on an open neighbourhood of and let
If and , then is normal to at .
The non-zero-gradient condition makes the level set regular at the point. When the gradient vanishes, the level set may have a corner, crossing or other singular behaviour for which no single gradient direction gives a normal.
- [1]:Gradient
- [2]:Level set
- [3]:Lagrange multipliers
- [4]:The closest point on a plane
- [5]:Constrained extrema
- [6]:Proof
- 5 more
Let be a differentiable curve in with . Since has the constant value along the curve,
The chain rule gives
Thus the gradient is perpendicular to every tangent vector supplied by a curve in the level set. It is therefore a normal vector at .
The normal to the unit circle
The unit circle is the level set
Its gradient is
At
a normal vector is
Any non-zero scalar multiple is also normal, so the radius gives the same direction.
[routine]
An explicit graph can be treated as a level surface by moving everything to one side:
The resulting normal is . Equivalently, parametrising the graph by gives tangent vectors
whose cross product is the same normal vector.
Tangent plane to a graph
If is differentiable at and , then the tangent plane to at is
The point-normal form uses the normal . The formula is also the first-order Taylor approximation, so the geometric tangent plane and the analytic linear model are the same object.
The graph is the level surface . Its gradient at the base point is
The point-normal equation is therefore
Solving for and using gives the stated equation.
Tangent plane to an implicit surface
Consider
Set
Then
The point lies on the surface because . At this point,
The parallel vector is a simpler normal. Hence the tangent plane through is
or
[exam]
The next page reads the tangent-plane model as a first-order Taylor polynomial and adds higher-degree terms. The quadratic part, built from the Hessian, later classifies stationary points.