Chain Rule

Chain rule over a curve

Suppose is a real-valued function on the plane, and is a parametric curve. There is a recipe to compute the derivative of the composite function :

Example

Particle moving through temperature gradient

Problem: A particle traverses a parametric curve in the plane given by . The ambient temperature is a function of distance from the -axis: . How fast is the temperature changing at ? Solution: We compute and , while . Then:

Derivation of chain rule over a curve

Let’s suppose that some small change produces a change and via the parametrization . By differentiability of , we have:

Divide both sides by , and take the limit as . Notice that and because implies . It follows that we have:

So the sum of products in this chain rule comes from the linear approximation formula, which in turn comes from the tangency of the trace curves.

Chain rule over several parameters

The chain rule over a curve can be used to derive a more general chain rule for the case when the input variables are functions of several parameters. The formulas can be remembered as “sum of all products” (considering all products that make sense).

Suppose is a function, and suppose and are both functions of and . We can “consider” itself to be a function of and via the composition. Then:

These formulas may be derived immediately from the formula for the chain rule over a curve by considering the trace curves: let remain fixed for the first equation, and let remain fixed for the second equation.

Exercise 10A-01

Chain rule, several parameters

Let and , , and .

  • (a) Generalize the chain rule above to the case of 3 variables and compute the partials and .
  • (b) Write out in terms of and and compute the same partials directly.

Example

Polar partials and chain rule

Problem: Suppose is a real-valued function of points in the plane. Let and be the standard polar coordinates on the plane.

  • (a) Write in terms of and and and .
  • (b) Suppose . Find at .

Solution: (a) First compute and . Then:

(b) Compute , . So and .

Exercise 10A-02

Polar partials

Write in terms of and and and .

It is easy to generalize the chain rule to an arbitrary number of variables and parameters. Formally, the rule is:

where is a function of many variables, and each is a function of many parameters.

To remember the formula, it sometimes helps to draw a tree. The summation has one term for each path from the output variable down to the relevant input variable:

Exercise 10A-03

Chain rule: 3 variables, 3 parameters

Find at the point given that:

Directional derivative

The partial derivative gives the rate of change of with respect to the variable .

Think of as a coordinate that moves the input to the function along a line . The partial gives the rate of change of with respect to this coordinate.

We can move along other lines, at other speeds. Let be any vector in the -plane. Consider the line that starts at and moves along using the parameter . We can take the derivative of with respect to , and the result is called the derivative of with respect to the vector . Here is the defining formula:

where we write for the components of .

Observe that the directional derivatives and with respect to the unit vectors are identical with the partial derivatives and . (Plug in into the limit formula above, for example.)

Exercise 10A-04

Linearities of directional derivative

  • (a) Show that .
  • (b) Show that .

Lengthening the direction vector

Notice that the derivative of with respect to a vector is twice the derivative of with respect to . This is because the line is the same line as but traversed twice as quickly.

Calculating directional derivatives We can use the two partial derivatives and to calculate for vectors other than coordinate basis vectors and . Recall . Use the chain rule instead of the limit definition to compute:

Example

Derivative with respect to a vector

Problem: Find the derivative of at the point with respect to the vector . Solution: The partials at are given by and . So we calculate .

Unit vectors?

Many authors treat directional derivatives as if they only make sense with respect to unit vectors: . If you are interested in the analogue of partial derivative for other directions, you will want to take unit vectors. It may be reasonable to reserve the word ‘directional’ for this case, but it is certainly beneficial to allow the notation to extend to vectors that do not have unit length.

Example

Directional derivative

Problem: Find the ‘directional’ derivative of at the point in the direction of the vector . Solution: The key phrase “in the direction of” suggests that we need the unit vector in the direction of . The norm of is , so we want . By the linearity rule with , we can just multiply the previous result by , obtaining .

Exercise 10A-05

Directional derivative

Suppose . Find the rate of change of at the point in the direction of the vector .

Vector fields

A real-valued function may be called a scalar field. The word ‘field’ indicates a mathematical structure that assigns a concrete object of a certain fixed type to every point in space. A function may be interpreted as assigning a scalar value, the output , to each point in space.

A vector field assigns a vector value to each point of space. The data of a vector field can be conveyed as a collection of coordinate functions, where each coordinate function takes a point in space as input:

(In 3D, the vector field has 3 coordinate functions.) We can also represent the same data as:

Vector fields in 3D are harder to visualize: Vector fields are often used to represent a fluid flow (the vector gives flow velocity) or a force field (vector gives force). Both types of data require the assignment of a vector to each point in space.

Gradient

Given a function , a natural vector field may be formed using its partial derivative functions. This is called the gradient of , and is called the potential function of this vector field:

In 3D, the gradient of has components .

Recall that the partial is large when increases steeply in the direction, and it is large and negative when increases steeply in the direction. These facts generalize with the combined components: points in the direction of steepest increase of . This can be understood by recalculating the formula for :

Gradient and directional derivative

If we consider unit vectors pointing in various directions, we see that the greatest value of occurs when aligns with . This means that points in the direction in which is largest, i.e. the direction of steepest incline.

Exercise 10B-01

Compute gradient

For each of the following functions, compute the gradient:

  • (a)
  • (b)
  • (c) .
Exercise 10B-02

Derivative using gradient

Let . Find at the point , where , by first computing the gradient and evaluating a dot product.

The level curves of a function are the sets of points satisfying for various . The gradient vector is perpendicular to the level curves:

Proposition: Gradient level curves

The level curves to are perpendicular to the gradient vector.

Proof: Let parametrize the level curve , so for all . Then:

so .

This result can be generalized to surfaces. The level surfaces of a function are given by . Any curve in such a level surface satisfies , and therefore . This means the tangent plane to a level surface has normal vector given by at any given point.

Example

Tangent plane to a hyperboloid

Problem: Find the tangent plane at to the one-sheeted hyperboloid given by .

Solution: Consider the function , so the hyperboloid is the level curve . The normal vector is then given by the gradient . At this takes the value . The tangent plane is perpendicular to this vector and passes through :

Exercise 10B-03

Direction with given slope

You are hiking on a mountain with altitude in meters given by the function:

You are at the point . Which two directions could you head (as an angle from the -axis) in order to ascend at a 20% grade?

If you follow the gradient vectors, you will go up or down a path of steepest ascent. This is also the path that crosses levels curves most quickly.

Problems due 29 Oct 2023, 9:00pm

Problem 10-01

Chain rule over a curve and directional derivative

Let . Let parametrize a particle traversing a circle which passes through the origin heading north. Notice that it is a unit-speed parametrization.

  • (a) Find the derivative for when the particle is at the origin.
  • (b) Find the tangent vector to at and call it . Write a parametric equation of the line through at with velocity vector . Evaluate the derivative at .
  • (c) Compute at the origin.
Problem 10-02

Chain rule: spherical to Cartesian partials

Write the partials , , in terms of Cartesian coordinates and partials. Here , , are the spherical coordinate functions.

Problem 10-03

Chain rule: implicit partial differentiation

The set of points satisfying is a hyperboloid of one sheet. Near the point , let us consider this equation to determine as a function of and .

  • (a) Take the partial derivative of both sides of the equation with respect to . (Take to be constant, and to be a function, so both sides are functions of and .) Now solve for .
  • (b) Solve the equation for in terms of and and find the partial derivative directly.
  • (c) Make a formal rule that generalizes the above calculation: Let be an equation that is taken to determine as a function of and . Write a formula for in terms of partials of . Indicate where you use the chain rule!
Problem 10-04

Write up and submit: A-01, A-02, A-04, A-05; B-01, B-03, B-04.