You learn to take partial derivatives and second-order derivatives of a multivariable function, to apply the chain rule with a tree diagram, and to find derivatives of implicit functions with the formula -F_x/F_y.
This week we carry the concept of the derivative over to multivariable functions. The idea is simple: hold all the other variables constant and take the derivative you know with respect to a single variable. This is called the partial derivative. On top of it we will build two important tools: the chain rule, which computes the derivative when variables depend on other variables, and the implicit differentiation formula, which gives the derivative of functions given by an equation. The exam almost always has a “find all second-order partials”, a chain rule and a related rates question.
Golden rules:
When computing fx, y behaves like a number. y2, siny, ey are all constant factors.
fxy means “first with respect to x, then with respect to y”. For continuous functions the order does not change the result (Clairaut).
In the chain rule, draw a tree: for every path from the dependent variable to the independent variable, multiply the derivatives, and add the paths.
In implicit differentiation, do not forget the minus sign at the start of the formula: dxdy=−FyFx.
Geometry. Cut the surface z=f(x,y) with the plane y=b. The slope of the resulting curve at the point (a,b) is fx(a,b). So fx measures how steeply the surface rises as you walk in the x direction. fy does the same in the y direction.
Example 1.f(x,y)=x3y2+4xy−y3.
fx=3x2y2+4y,fy=2x3y+4x−3y2.
At (1,2): fx=12+8=20, fy=4+4−12=−4. So at this point the surface rises quickly in the x direction and falls in the y direction.
Example 2 (the chain rule inside).f(x,y)=sin(xy2). fx=cos(xy2)⋅y2. Here y2 is the derivative of the inner function with respect to x. fy=cos(xy2)⋅2xy.
Example 3 (quotient).f(x,y)=x+yx. fx=(x+y)2(x+y)−x=(x+y)2y. fy=(x+y)20−x=−(x+y)2x.
It is the same with three variables: in f(x,y,z), for fz hold x and y constant.
PITFALL · constant factor or variable? For f=x2ey, fx=2xey. There is no need to apply the product rule; ey is constant with respect to x. On the other hand fy=x2ey, and here x2 is constant. Many people make mistakes in the exam by applying the product rule unnecessarily.
Second-order partial derivatives
You take the partial derivative of the partial derivative again. There are four:
A notation trap: in subscripts the order is left to right (fxy: first x), while in the ∂ notation it is read right to left.
Clairaut’s theorem. If fxy and fyx are continuous around a point, they are equal at that point. This holds for all the functions in the scope of this course, so you should get the same result whichever order you take the mixed derivative in. It is a free way to check your computation.
Example 4.f(x,y)=xexy.
f_x = e^(xy) + x·y·e^(xy) (product rule, x appears twice)f_xy = x·e^(xy) + [x·e^(xy) + x·y·x·e^(xy)] = 2x e^(xy) + x^2 y e^(xy)f_y = x·x·e^(xy) = x^2 e^(xy)f_yx = 2x e^(xy) + x^2·y·e^(xy) (the same, Clairaut ✓)at the point (1,0): f_xy = 2
Laplace’s equation. Functions that satisfy the equation uxx+uyy=0 are called harmonic; heat distribution and electric potential satisfy this equation. u=exsiny: uxx=exsiny, uyy=−exsiny, the sum is 0.
Tree diagram. Put z at the top, the intermediate variables (x, y) below it, and the independent variables (s, t) at the bottom. Each path from z to s is a term: multiply the derivatives along the path. Then add all the paths. This rule works for any number of variables.
z / \ x y / \ / \ s t s t∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s) ← two paths: z-x-s and z-y-s
Example 5.z=x2+y2, x=t2, y=2t. dtdz=2x⋅2t+2y⋅2. At t=1, x=1, y=2: 4+8=12. Check: z=t4+4t2, z′=4t3+8t=12 ✓.
Example 6 (three intermediate variables).w=xyz, x=u+v, y=u−v, z=uv. ∂u∂w=yz⋅1+xz⋅1+xy⋅v. At (u,v)=(2,1): x=3, y=1, z=2, the result is 2+6+3=11.
TIP · when do you plug in the values? First write the derivative expression in general. Then compute the values of x, y from the values of s, t. Plug everything in at once at the end. Forgetting to compute the values of the intermediate variables (plugging s in place of x) is the most common mistake.
Related rates
The physical face of the chain rule: several quantities change with time, and the rate of change of a composite quantity is asked. Write the formula, apply the chain rule with respect to t, plug in the given values. The derivative of a decreasing quantity is entered as negative.
Implicit differentiation
If the equation F(x,y)=0 defines y as a function of x, then from the chain rule
dxdy=−FyFx(Fy=0).
With three variables, if F(x,y,z)=0 defines z as a function of x,y, then
∂x∂z=−FzFx,∂y∂z=−FzFy.
Example 7.x3+y3=6xy at the point (3,3) (the folium of Descartes). F=x3+y3−6xy. Fx=3x2−6y=9, Fy=3y2−6x=9. dxdy=−1.
Why the minus? The derivative of the equality F(x,y(x))=0 with respect to x is Fx+Fydxdy=0. When you solve, the minus comes out.
Common mistakes
Wrong
Correct
Setting the terms with y to 0 in fx
y is a constant factor; only the summands that do not contain x become 0
yxy−1 for the derivative of xy with respect to y
xylnx
Taking the order the wrong way in fxy
First x, then y (it should come out the same anyway by Clairaut)
Skipping a path in the chain rule
Draw the tree, add all the paths
Plugging the values of s,t directly into zx
First compute x(s,t), y(s,t)
Forgetting the minus in implicit differentiation
−Fx/Fy
Taking a decreasing quantity as positive in related rates
Decreasing: the derivative is negative
Writing Fx/Fy for ∂z/∂x
Fz in the denominator
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
Question 1easy
Let f(x,y)=x3y2−4xy. Find fx(1,2).
Show answer
4
Hold y constant: fx=3x2y2−4y. At (1,2): 3⋅1⋅4−8=4.
Question 2easy
Let f(x,y)=exysiny. Find fy(0,π).
Show answer
−1
x is constant, product rule in y: fy=xexysiny+exycosy. At (0,π): 0+e0cosπ=−1.
Question 3easy
Let f(x,y)=ln(x2+y2). Find fx(1,1).
Show answer
1
fx=x2+y22x. At (1,1): 22=1.
Question 4medium
Let f(x,y)=x2y3+sin(xy). Find fxy(1,0).
Show answer
1
fx=2xy3+ycos(xy). Now with respect to y: fxy=6xy2+cos(xy)−xysin(xy). At (1,0): 0+1−0=1.
Question 5medium
Let f(x,y)=xy (x>0). Find fx(2,3) and fy(2,3).
Show answer
fx=12, fy=8ln2
With respect to x, y is a constant exponent, power rule: fx=yxy−1, at (2,3): 3⋅4=12. With respect to y, the base is constant, exponential rule: fy=xylnx, at (2,3): 8ln2≈5.545.
Question 6easy
Does u(x,y)=x2−y2+2xy satisfy Laplace's equation uxx+uyy=0?
Show answer
Yes
ux=2x+2y, uxx=2. uy=−2y+2x, uyy=−2.uxx+uyy=2−2=0. The function is harmonic.
Question 7medium
Let z=x2y with x=cost, y=sint. Find dtdz at t=π/4.
F(x,y)=x2+xy+y3−3. dxdy=−FyFx=−x+3y22x+y. At (1,1): −43.
Question 10hard
If xz+y2z3=2 defines z as a function of x and y, find ∂x∂z at (1,1,1).
Show answer
−1/4
F=xz+y2z3−2. ∂x∂z=−FzFx=−x+3y2z2z. At (1,1,1): −1+31=−41.
Question 11hard
The radius of a cylinder increases at 0.1 cm/s and its height decreases at 0.2 cm/s. How fast is the volume changing when r=5 cm and h=10 cm?
Show answer
5π≈15.71 cm3/s
V=πr2h. Chain rule: dtdV=Vrdtdr+Vhdtdh=2πrh⋅r′+πr2⋅h′.2π(5)(10)(0.1)+π(25)(−0.2)=10π−5π=5π. Positive: the volume is increasing.
Question 12medium
Let f(x,y)=xey+x2y3. Find fyx(1,1) and verify it equals fxy(1,1).
Show answer
e+6
fy=xey+3x2y2, then with respect to x: fyx=ey+6xy2. At (1,1): e+6. The other order: fx=ey+2xy3, fxy=ey+6xy2, the same. Clairaut's theorem: if the derivatives are continuous, the order does not matter.
Verification: All partial derivatives were checked with central differences, mixed derivatives with nested central differences, chain rule results against the direct numerical derivative of the composite function, and implicit derivatives against the difference quotient of z(x) solved with Newton's method in node (verify/MAT1052/09.mjs).
Review card
f_x: hold y CONSTANT, differentiate with respect to x. f_y: hold x constant
Notation: f_x = ∂f/∂x. f_xy = (f_x)_y (first x then y)
Clairaut: if the derivatives are continuous f_xy = f_yx
x^y: ∂/∂x = y x^(y-1), ∂/∂y = x^y ln x
Chain (1 parameter): dz/dt = z_x x'(t) + z_y y'(t)
Chain (2 parameters): ∂z/∂s = z_x x_s + z_y y_s
Tree: for EVERY path from z to t multiply the derivatives, add the paths
Implicit: F(x,y)=0 → dy/dx = -F_x/F_y
F(x,y,z)=0 → ∂z/∂x = -F_x/F_z, ∂z/∂y = -F_y/F_z (MINUS!)
Laplace: u_xx + u_yy = 0
Plug in the values last; first find the general derivative