A quantity that depends on several variables, each of which is itself changing, changes at a rate that no single partial derivative supplies.
The pressure of a gas depends on its temperature and its volume, and when a gas is heated in a cylinder with a moving piston both change at once. The temperature felt by a weather balloon depends on where the balloon is, and where it is depends on time. The previous lesson ended by noticing that most functions met in practice are compositions of this kind and that its total differential, , looks as if it wants to be divided by . This lesson proves that it can be, extends the result to inner functions of several variables, and uses it twice: to rewrite partial derivatives in polar coordinates, and to reduce the implicit differentiation of Calculus I to a single formula. It assumes partial derivatives and the definition of differentiability as the existence of a tangent plane whose error shrinks faster than the distance.
The rate along a path
Suppose , and the point moves along a path, so that and are differentiable functions of time. Then is an ordinary function of one variable, and the question is its derivative. Take to be differentiable at the point , and let time move from to . The inputs move by and by a similar , and the definition of differentiability says exactly how much moves:
with both partials evaluated at and with an error satisfying , where is the distance the point has moved. Dividing through by gives
As the first two quotients tend to and . The last term is the one to control, and the trick is to route it through the distance: . The factor equals , which tends to the finite speed . The factor tends to , because and are continuous and so . (When happens to be the point has not moved and is as well, so nothing is lost.) A bounded factor times one that vanishes vanishes, and the result is the chain rule along a path:
It is the total differential divided by , and the derivation is what licenses the division. Each term has a plain meaning: the rate at which would change if only were moving, plus the rate if only were moving. Near a point of differentiability those two contributions simply add, which is the additivity the tangent plane guarantees. With three inputs, as for the weather balloon's , the same argument gives three terms, one per input.
Differentiability is not a technicality here. Take with . It is continuous at the origin, since , and it vanishes on both axes, so . Along the path , the function equals , so at , while the formula would give . The two partials exist but no tangent plane does, and the chain rule needs the plane.
A gas that heats and expands
The ideal gas law gives the pressure of moles of gas as , with J/(mol K). When a piston lets a warming gas expand, temperature pushes the pressure up and volume pulls it down, and the chain rule says which wins.
Example. One mole of gas is at K in a volume of m³. It is being heated at K per second while the piston withdraws so that the volume grows by m³ per second. Is the pressure rising or falling, and how fast?
The partials of are and . At this state they are and , in pascals per kelvin and pascals per cubic metre. The chain rule gives
so the pressure, about kPa at this moment, is falling at about Pa per second. Heating alone would raise it by Pa each second, but the expansion lowers it by nearly five times as much. As a check, write the state as explicit functions of time, and , so that . The quotient rule at gives , the same number by a longer road.
The chain rule is the better road for two reasons. It never needed the formulas for and , only their rates at the instant, which is what an experiment usually measures. And it splits the answer into contributions that can be read separately, which the single quotient rule computation hides.
Now you. A beetle crosses a metal plate whose temperature is degrees Celsius, with and in metres. At time seconds it is at , . How fast is the temperature it feels changing at ?
Answer
At the beetle is at , where and . Its velocity is , . The chain rule gives , so the temperature it feels is rising at degrees per second: moving in cools it, but moving towards smaller warms it more.
Two independent variables
Often the intermediate variables depend on more than one thing. Suppose with and , so that is ultimately a function of and . The partial derivative holds fixed, and with fixed the point simply moves along a path parametrised by . The rule of the first section applies word for word, with in the role of time and ordinary derivatives replaced by partials:
and the same with in place of gives . Nothing new had to be proved.
The bookkeeping is easiest to hold as a tree of dependencies. Put at the top. It depends on and on , so two branches lead down from it. Each of and depends on and on , so two branches lead down from each of them, four in all. To find , follow every route from down to : there are two, one through and one through . Along each route multiply the derivatives on its branches, and add the routes. The same recipe handles any number of layers and variables. With depending on three intermediate variables that each depend on four independent ones, every partial of has three terms, one per route.
Take with and , at , where and . The top level gives and . The lower level gives , , and . Following the routes, and . Substituting first gives , and differentiating that directly at produces and again.
One warning about notation. The symbols and look like fractions that should cancel to , and they do not, because each carries a different variable held fixed: the first holds fixed, the second holds fixed. The product along one route is only part of the answer, and the other route supplies the rest. In one variable the tree has a single route, which is why the chain rule of Calculus I has a single product and fractions seem to cancel.
Polar coordinates
The most common change of variables in the plane is to polar coordinates, and . A function given as becomes a function of and , and its partials in the new variables follow from the tree with and renamed. The inner partials are , , and , so
The first is the rate of change of as the point moves straight out from the origin at unit speed. The second is the rate per radian as the point swings round a circle of radius ; since a radian of turn covers a distance , the rate per unit of distance along the circle is . A quick sanity check is , which is itself. Its partials are and , and the formulas give and , exactly what the derivatives of with respect to and should be.
Example. For , find and at the point , and check them by rewriting in polar form.
The point has , and . The Cartesian partials are and . Since and , the formulas give and . For the check, substitute to get . Then , and the product rule gives . Both agree.
The two descriptions measure the same steepness in different frames. The sum equals , because the radial and circular directions are perpendicular unit directions just as the and directions are, a fact the next lesson explains.
Now you. For , find and at the point , and check them against the polar form .
Answer
Here , , , and . So and . From the polar form, and , so and .
Implicit differentiation in one line
Calculus I found the slope of a curve such as by differentiating both sides with treated as an unknown function of , then solving for . The chain rule explains why that works and compresses it into a formula. Write the curve as , and suppose that near some point on it the curve is the graph of a differentiable function . Then for every nearby. The left side is a composition of exactly the kind this lesson handles: a path through the plane parametrised by itself, with . Its derivative is zero, because it is constantly zero, and the chain rule gives
wherever . For the circle, gives , which at is , perpendicular to the radius of slope as a tangent to a circle must be.
The argument assumed the curve is a graph near the point. The implicit function theorem, whose proof belongs to analysis, guarantees it: if has continuous partials and at a point of the curve, then near that point the curve is the graph of a differentiable function of . Where but , the roles swap, , and the tangent is vertical. Where both vanish, the formula says nothing, and the curve may do something other than pass smoothly through.
The same reasoning works one dimension up. A surface defines implicitly as a function of and , and holding fixed turns it into the case just done, so and wherever .
The folium of Descartes
The curve is the folium, or leaf, of Descartes. He proposed it in 1638 as a challenge to Pierre de Fermat, who had announced a method for finding tangents, and Fermat found them without difficulty. It has a loop in the first quadrant with its tip at , since , and two tails running off towards the line .
Example. Verify that lies on the folium , and find the slope of the curve there.
On the curve: , and . With , the partials are and , so
At the point, and , so the slope is . The Calculus I route, differentiating term by term to get and solving for , lands on the same expression after two more lines of algebra. The formula skips those lines.
At the tip the same expression gives , as the symmetry of the curve under swapping and demands. The loop has a vertical tangent where , that is where , and substituting into the curve locates it at , about . At the origin both and vanish, the formula reads , and the theorem's hypothesis fails for a visible reason: the curve crosses itself there, passing through twice, once tangent to each axis, so it has two tangents and is not the graph of any single function.
Now you. Check that lies on the curve , find the slope there, and write the tangent line.
Answer
The point gives . With , and , so . The tangent line is , that is .
Slopes in other directions
The chain rule came straight out of the tangent plane: divide the linear approximation by a small change in the underlying variable and let the error vanish. It gives the rate of change along any path, extends to any tree of dependencies by adding one product per route, converts partial derivatives between coordinate systems, and differentiates curves and surfaces defined implicitly.
Look again at what the ingredients measure. On a hill whose height is , is the slope for a walker heading due east and for one heading due north. Polar coordinates added , the slope for a walker heading straight away from the origin, but that direction too was chosen by a coordinate system. A walker setting off north east, or on any bearing at all, wants the slope in that direction, and no partial derivative supplies it.
The chain rule already holds the raw material. Walking in a straight line at unit speed is a path, and the rate of change along it depends only on , and the direction of travel. Turning that into the slope in every direction at once, finding which direction is steepest, and seeing why the pair , behaves like a vector are the work of the next lesson, on the gradient.