Multivariable CalculusThe Chain Rule and the Gradient2 of 4
The Chain Rule and the Gradient · 2
Implicit Differentiation
When x and y are mixed together in an equation that we can't easily solve for y, we still need a fast way to find the slope dxdy.
1
A Shortcut for Implicit Differentiation
Suppose we want to find the slope dxdy of the curve
x3+x2y+y3=10
With single-variable calculus, differentiating term by term forces us to use the product rule and chain rule, attach dxdy to every y derivative, and do several steps of algebra to solve for dxdy. Partial derivatives let us write down the exact same answer in one step.
A Shortcut for Implicit Differentiation
Text solution
Differentiate in x with y held constantTreat y like a fixed number in F(x,y)=x3+x2y+y3 to find the numerator.
Fx=3x2+2xy
Differentiate in y with x held constantTreat x like a fixed number to find the denominator.
Fy=x2+3y2
Put Fx over Fy with a minus signDivide the x-derivative by the y-derivative and put a minus sign in front.
dxdy=−FyFx=−x2+3y23x2+2xy(Fy=0)
2
Why It Works: Staying on a Contour
That shortcut raises three immediate questions: why are we allowed to pretend y is constant when y changes with x, why is the fraction flipped with Fx on top and Fy on the bottom, and where does the minus sign come from?
To see why, let's look at a simpler curve, the circle x2+y2=25, and view it as a flat contour trail at height 25 on the 3D bowl F(x,y)=x2+y2.
Why It Works: Staying on a Contour
height change from xFxdx+height change from yFydy=0⟹dxdy=−FyFx(Fy=0)
A step stays on a level contour only along the tangent line, where the uphill change in one direction and the downhill change in the other cancel out.
3
Steepness Trade-Offs and Vertical Tangents
Let's also see why Fy belongs in the denominator geometrically, and what happens on the curve at points where Fy=0.
Steepness Trade-Offs and Vertical Tangents
Along a level trail on the bowl, the steeper direction takes a smaller step to cancel the other's height change, until one direction flattens out and the tangent line turns vertical.
4
Finding dy/dx with Partial Derivatives
Now let's find dxdy for an equation that has variable terms on both sides of the equals sign:
ycos(x)+x2y3=5x+8
Finding dy/dx with Partial Derivatives
ycos(x)+x2y3=5x+8
dxdy=?
Text solution
Move variable terms to one sideSubtract 5x so the left side is a single formula F(x,y) equal to a constant.
F(x,y)=ycos(x)+x2y3−5x=8
Differentiate in x with y held constantTreat every y like a fixed number to get the numerator Fx.
Fx=−ysin(x)+2xy3−5
Differentiate in y with x held constantTreat every x like a fixed number to get the denominator Fy.
Fy=cos(x)+3x2y2
Put Fx over Fy with a minus signPlace Fx on top, Fy on the bottom, and put a minus sign in front.
When an equation mixes three variables together, such as
x2z+yz3−2xy=10
it defines z implicitly as a function of x and y. Instead of a single slope, we want to find the partial derivatives ∂x∂z (how z changes when x changes with y held constant) and ∂y∂z (how z changes when y changes with x held constant).
At points where Fz=0 (with Fx or Fy nonzero), a small change in z doesn't change F at all because the surface goes vertical there.
Holding one variable steady slices the constant-temperature surface into a flat curve where the other two temperature changes cancel each other out, except where the surface goes vertical.
6
Finding ∂z/∂x and ∂z/∂y from the Total Change Balance
Let's use this balance to find both ∂x∂z and ∂y∂z for our three-variable equation
x2z+yz3−2xy=10
Finding ∂z/∂x and ∂z/∂y from the Total Change Balance
x2z+yz3−2xy=10
∂x∂z=−FzFx=?
∂y∂z=−FzFy=?
Text solution
Differentiate in x and in y for the numeratorsFrom F(x,y,z)=x2z+yz3−2xy, take the partial derivatives with respect to x and y.
Fx=2xz−2y,Fy=z3−2x
Differentiate in z for the shared denominatorFind Fz once, since both partial derivatives of z use it on the bottom.
Fz=x2+3yz2
Divide each numerator by Fz with a minus signPut Fx and Fy over the shared denominator Fz and put a minus sign in front of both fractions.
When variables are mixed together in an equation and you can't easily solve for the output variable, rewrite the equation with all variable terms on one side as F=c. (If the output variable is already solved for or takes one step to solve for, such as z=x2y−5x, differentiate directly instead of setting up F.)
Because staying on F=c means the total change is zero, the changes from the changing variables must cancel each other out. This always puts a minus sign in front and flips the variable positions between the derivative and the partial derivatives:
Two variables (F(x,y)=c)
From Fxdx+Fydy=0, the slope of the curve is
dxdy=−FyFx(Fy=0)
For x3+x2y+y3=10, this gives dxdy=−x2+3y23x2+2xy. Points on the curve where Fy=0 and Fx=0 have a vertical tangent line, like (5,0) on x2+y2=25 where Fy=2y=0.
Three variables (F(x,y,z)=c)
Start from the total change balance
Fxdx+Fydy+Fzdz=0
Cross out the variable held constant and solve for the fraction:
∂x∂z∂y∂z=−FzFx,=−FzFy(Fz=0)
For x2z+yz3−2xy=10, both share the denominator Fz=x2+3yz2, giving ∂x∂z=−x2+3yz22xz−2y and ∂y∂z=−x2+3yz2z3−2x. If a problem asks for a different output variable, such as ∂y∂x with z held fixed, crossing out Fzdz immediately shows ∂y∂x=−FxFy.
7
Practice
1
Find dxdy for x4−3x2y2+y3=12.
With all variable terms already on the left side, differentiate F(x,y)=x4−3x2y2+y3 treating y as a constant number for one part of the fraction, and x as a constant number for the other.
Find the partial derivatives Fx and Fy
FxFy=4x3−6xy2,=−6x2y+3y2
Form −FyFxWatch out for two common mistakes here: leaving off the front minus sign gives 3y2−6x2y4x3−6xy2, and putting Fy on top instead of Fx gives −4x3−6xy23y2−6x2y.
dxdy=−3y2−6x2y4x3−6xy2=3y2−6x2y6xy2−4x3
2
Find dxdy for xsin(y)+y2=4x−cos(x).
Are all the variable terms on the same side of the equals sign before you take Fx?
Move all variable terms to the left sideSubtracting 4x−cos(x) sets the equation equal to a constant. If you differentiate 4x while it is still on the right side without subtracting it first, its sign in Fx flips and gives the wrong numerator in −xcos(y)+2ysin(y)+4−sin(x).
F(x,y)=xsin(y)+y2−4x+cos(x)=0
Take the partial derivatives Fx and Fy and divide with a minus sign
Find all points on the curve x2+xy+y2=12 where the tangent line is vertical.
Which part of dxdy=−FyFx must equal zero for a vertical tangent, and how do you use the original curve equation to find the coordinates?
Set the denominator Fy=0With F(x,y)=x2+xy+y2, be careful not to set the numerator Fx=2x+y=0 instead, which finds the horizontal tangents at (−2,4) and (2,−4).
Fy=x+2y=0⟹x=−2y
Substitute x=−2y into the curve equation x2+xy+y2=12
(−2y)2+(−2y)y+y2⟹3y2⟹y=12=12=±2
Find the matching x-values from x=−2y (where Fx=2x+y=0)
(−4,2) and (4,−2)
4
Find ∂x∂z and ∂y∂z for x3z−2yz2+xy2=9.
Which variable's partial derivative goes in the denominator for both ∂x∂z and ∂y∂z?
Find Fx,Fy, and the shared denominator FzWhen differentiating with respect to z, remember that xy2 has no z in it and goes to 0 (keeping xy2 in Fz gives the wrong denominator x3−4yz+xy2).
FxFyFz=3x2z+y2,=2xy−2z2,=x3−4yz
Place Fx and Fy over Fz with a minus sign in front of each(Forgetting the front minus sign gives x3−4yz3x2z+y2 and x3−4yz2xy−2z2.)
∂x∂z∂y∂z=−x3−4yz3x2z+y2and=−x3−4yz2xy−2z2
5
Suppose x,y, and z satisfy xz2+y2z=2xy+4. Treating x as a function of y and z, find ∂y∂x (with z held constant) at the point (1,1,2).
Putting Fz on the bottom out of habit gives −FzFy=−52.
Move all variable terms to the left side first, then cross out the dz term in Fxdx+Fydy+Fzdz=0 to see which partial derivative belongs in the denominator of ∂y∂x.
Move 2xy to the left sideSubtract 2xy so that F(x,y,z)=xz2+y2z−2xy=4. (Leaving 2xy on the right side without subtracting it flips the signs of −2x and −2y in the partial derivatives and gives the wrong formula −z2+2y2yz+2x. At (1,1,2) it happens to give −1 too, but at most other points it doesn't.)
F(x,y,z)=xz2+y2z−2xy=4
Set dz=0 in the total change balance and solve for ∂y∂xBecause x is on top of ∂y∂x,Fx goes in the denominator. Putting Fz on the bottom out of habit gives −FzFy=−52, and flipping the fraction to −FyFx gives the reciprocal, which only gives the right value here because Fx=Fy=2 at (1,1,2).