Skip to content
Math Analysis 2

Partial derivatives, gradient, differentiability and the tangent plane

Partial derivatives and the gradient, why they are not enough, differentiability and the tangent plane, directional derivative and steepest ascent, the chain rule and the Hessian.

In one variable the derivative tells how fast a function grows. In several variables the question becomes: how fast does it grow moving in a given direction? The answer leads to partial derivatives, the gradient, the tangent plane and differentiability, which is the right notion for saying that a function is “smooth”.

Partial derivatives

The partial derivative with respect to x is computed by holding y fixed and differentiating as in Analysis 1:

    \[ \frac{\partial f}{\partial x}(x_0, y_0) = \lim_{h\to 0}\frac{f(x_0 + h, y_0) - f(x_0, y_0)}{h} \]

Geometrically it is the slope of the curve obtained by cutting the graph with the plane y = y_0. Example: f(x, y) = x^2 y + \sin(xy) has f_x = 2xy + y\cos(xy) and f_y = x^2 + x\cos(xy).

The vector of partial derivatives is the gradient:

    \[ \nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}\right) \]

Partial derivatives are not enough

In one variable, differentiable implies continuous. In several variables it does not: the function \frac{xy}{x^2 + y^2}, extended by 0 at the origin, has both partial derivatives zero at (0, 0) (along the axes it is always 0), but it is not even continuous there. Partial derivatives look at only two directions, while the behaviour around a point depends on all of them.

Differentiability and the tangent plane

f is differentiable at \mathbf x_0 if it can be approximated by a linear function with an error that goes to zero faster than the distance:

    \[ f(\mathbf x_0 + \mathbf h) = f(\mathbf x_0) + \nabla f(\mathbf x_0)\cdot\mathbf h + o(\|\mathbf h\|) \]

Geometrically: near the point the graph cannot be told apart from a plane, the tangent plane

    \[ z = f(x_0, y_0) + f_x(x_0, y_0)(x - x_0) + f_y(x_0, y_0)(y - y_0) \]

Differentiable implies continuous and having every directional derivative. The practical test: if the partial derivatives exist and are continuous near the point, the function is differentiable (total differential theorem). All functions built from elementary operations are, where the derivatives are continuous.

Example. The tangent plane to z = x^2 + y^2 at (1, 2): f = 5, \nabla f = (2, 4), so z = 5 + 2(x - 1) + 4(y - 2).

Directional derivative

The derivative in the direction of the unit vector \mathbf v is

    \[ \frac{\partial f}{\partial\mathbf v}(\mathbf x_0) = \lim_{t\to 0}\frac{f(\mathbf x_0 + t\mathbf v) - f(\mathbf x_0)}{t} \]

and, if f is differentiable, the gradient formula holds:

    \[ \frac{\partial f}{\partial\mathbf v} = \nabla f\cdot\mathbf v = |\nabla f|\cos\theta \]

Proof and consequences

From the definition of differentiability with \mathbf h = t\mathbf v: f(\mathbf x_0 + t\mathbf v) - f(\mathbf x_0) = t\,\nabla f\cdot\mathbf v + o(t); dividing by t and taking the limit gives the formula. From the cosine three key facts follow:

  • the directional derivative is largest in the direction of the gradient (\theta = 0) and equals |\nabla f|: the gradient points in the direction of steepest ascent;
  • it is smallest, -|\nabla f|, in the opposite direction;
  • it is zero in directions perpendicular to the gradient.
Level curves of a function and gradient vectors perpendicular to them
Level curves of f = x^2 + 2y^2 and the gradient at a few points: it is always perpendicular to the level curve through the point and points towards increasing values. Where the curves are closer together the gradient is longer.

Along a level curve f is constant, so the derivative in the tangent direction is zero: the gradient is perpendicular to the level curves. That is why electric field lines \mathbf E = -\nabla V cross equipotential surfaces at right angles, and why water runs down the steepest slope, perpendicular to the contour lines.

The chain rule

If x = x(t) and y = y(t) describe a curve, the composite function g(t) = f(x(t), y(t)) has derivative

    \[ g'(t) = f_x\,x'(t) + f_y\,y'(t) = \nabla f\cdot\mathbf r'(t) \]

Example. The temperature on a plate is T(x, y) = 100 - x^2 - 2y^2 °C (with x, y in metres) and an ant moves along \mathbf r(t) = (t, t) metres, with t in seconds. At time t = 1, \nabla T = (-2, -4) and \mathbf r' = (1, 1): the ant feels the temperature drop by 6 °C per second.

More generally, for \mathbf F: \mathbb R^n\to\mathbb R^m the derivative is the Jacobian matrix, with the partial derivatives of each component along the rows, and the chain rule says that the Jacobian of a composition is the product of the Jacobians. It is the bridge between Analysis 2 and Geometry and Algebra: differentiating means approximating with a linear map.

Second derivatives

Differentiating again gives the second derivatives f_{xx}, f_{xy}, f_{yx}, f_{yy}, collected in the Hessian matrix. Schwarz’s theorem guarantees that, if the mixed second derivatives are continuous, the order does not matter: f_{xy} = f_{yx}, and the Hessian is symmetric. We will use it in the next lesson to classify maxima, minima and saddle points.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x