8.05d - First and second partial derivatives

8.05d - First and second partial derivatives

Differentiate a function of two variables while holding one variable fixed. You will use both standard notations, calculate pure and mixed second derivatives, and show that a surface satisfies an identity involving its partial derivatives.

First partial derivatives

Can the same point on a surface have two different gradients? On z=x2+y2z=x^2+y^2, at (1,2,5)(1,2,5), the answer is yes: the section parallel to the xx-direction has gradient 22, while the section parallel to the yy-direction has gradient 44. A gradient needs a direction as well as a point.

You already know

Fixing y=by=b gives the section z=f(x,b)z=f(x,b); fixing x=ax=a gives z=f(a,y)z=f(a,y). Use the ordinary power, product and chain rules on a one-variable function.

To find the first gradient, treat yy as a constant and differentiate with respect to xx. To find the second, treat xx as a constant and differentiate with respect to yy. Thus xy2xy^2 has derivative y2y^2 with respect to xx, but 2xy2xy with respect to yy.

First partial derivatives

For z=f(x,y)z=f(x,y), the first partial derivatives are

fx=∂f∂x=∂z∂x,fy=∂f∂y=∂z∂y.f_x=\frac{\partial f}{\partial x}=\frac{\partial z}{\partial x}, \qquad f_y=\frac{\partial f}{\partial y}=\frac{\partial z}{\partial y}.

In fxf_x, hold yy fixed; in fyf_y, hold xx fixed. For example, if f=x2+y2f=x^2+y^2, then fx=2xf_x=2x and fy=2yf_y=2y.

The symbol ∂\partial distinguishes these derivatives from an ordinary derivative of a function of one independent variable. In particular, ∂y/∂x=0\partial y/\partial x=0 here because xx and yy are independent coordinates. It does not say that an arbitrary curve y=y(x)y=y(x) has zero derivative. This notation and the rule of holding the other variable constant are not in the formula booklet.

[DIAGRAM: asset_name: Two slopes at one surface point; asset_slug: h245_8_05_partial_slopes; caption: At the same point, the two coordinate sections have different tangent gradients.; description: Left plot has x and z axes and shows z=x squared+4 with its tangent z=2x+3 at (1,5), labelled y=2 and gradient 2. Right plot has y and z axes and shows z=1+y squared with tangent z=4y-3 at (2,5), labelled x=1 and gradient 4. Both marked points correspond to the surface point (1,2,5).]
At the same point, the two coordinate sections have different tangent gradients.

Worked example 1: powers with a constant coefficient

Question. For f(x,y)=x3y2+4x−y3f(x,y)=x^3y^2+4x-y^3, find fxf_x and fyf_y.

Plan. Differentiate once with respect to each variable, in separate calculations, changing which variable is held fixed.

fx=y2(3x2)+4−0y is constant=3x2y2+4fy=x3(2y)+0−3y2x is constant=2x3y−3y2\begin{aligned} f_x&=y^2(3x^2)+4-0 && y\text{ is constant}\\ &=3x^2y^2+4\\ f_y&=x^3(2y)+0-3y^2 && x\text{ is constant}\\ &=2x^3y-3y^2 \end{aligned}

Why this step? In fxf_x, the term −y3-y^3 is a constant, so it disappears. In fyf_y, 4x4x disappears instead.

Answer. fx=3x2y2+4f_x=3x^2y^2+4, fy=2x3y−3y2f_y=2x^3y-3y^2.

Check. On the section y=1y=1, f=x3+4x−1f=x^3+4x-1, whose derivative is 3x2+43x^2+4, agreeing with fx(x,1)f_x(x,1).

Worked example 2 changes only 4x4x to 4xy4xy. That term now contributes to both derivatives.

Worked example 2: a term containing both variables

Question. For g(x,y)=x3y2+4xy−y3g(x,y)=x^3y^2+4xy-y^3, find ∂g/∂x\partial g/\partial x and ∂g/∂y\partial g/\partial y.

Plan. Hold the other coordinate fixed in each calculation, including in the new product 4xy4xy.

∂g∂x=3x2y2+4ydifferentiate in x∂g∂y=2x3y+4x−3y2differentiate in y\begin{aligned} \frac{\partial g}{\partial x} &=3x^2y^2+4y && \text{differentiate in }x\\ \frac{\partial g}{\partial y} &=2x^3y+4x-3y^2 && \text{differentiate in }y \end{aligned}

Why this step? 4xy4xy is 4y4y times xx in the first calculation, but 4x4x times yy in the second.

Answer. gx=3x2y2+4yg_x=3x^2y^2+4y, gy=2x3y+4x−3y2g_y=2x^3y+4x-3y^2.

Check. At (1,2)(1,2), these give gx=20g_x=20 and gy=−4g_y=-4. The sections g(x,2)=4x3+8x−8g(x,2)=4x^3+8x-8 and g(1,y)=y2+4y−y3g(1,y)=y^2+4y-y^3 have exactly those gradients at x=1x=1 and y=2y=2.

Constants can be negative powers of the other variable too. For z=x/y=xy−1z=x/y=xy^{-1}, where y≠0y\ne0, the same rule gives zx=1/yz_x=1/y and zy=−x/y2z_y=-x/y^2.

Watch out

Wrong: ∂(x2y3)/∂x=2x⋅3y2\partial(x^2y^3)/\partial x=2x\cdot3y^2. That differentiates both independent variables at once. Right: ∂(x2y3)/∂x=2xy3\partial(x^2y^3)/\partial x=2xy^3, with y3y^3 unchanged.

The next check changes the coefficient of the mixed term and asks for the gradients at a specified point.

Product and chain rules

A partial derivative uses the familiar differentiation rules, with the other variable acting as a constant throughout.

For example, in differentiating sin⁡(xy)\sin(xy) with respect to xx, the inner function xyxy has derivative yy, so the result is ycos⁡(xy)y\cos(xy). With respect to yy, the inner derivative is xx, giving xcos⁡(xy)x\cos(xy). The two chain-rule factors differ.

Chain rule for a function of two independent variables

If u=u(x,y)u=u(x,y) and FF is differentiable, then

∂∂xF(u)=F′(u)∂u∂x,∂∂yF(u)=F′(u)∂u∂y.\frac{\partial}{\partial x}F(u)=F'(u)\frac{\partial u}{\partial x}, \qquad \frac{\partial}{\partial y}F(u)=F'(u)\frac{\partial u}{\partial y}.

Hold the other independent variable fixed each time.
Not in the formula booklet: learn it.

For ln⁡(x+y)\ln(x+y), both inner derivatives are 11, so both first partial derivatives are 1/(x+y)1/(x+y), where x+y>0x+y>0. For exye^{xy}, the inner derivatives are yy and xx. Write the relevant inner derivative before simplifying.

Worked example 3: two chain rules

Question. For f(x,y)=exy+ln⁡(x+y)f(x,y)=e^{xy}+\ln(x+y), where x+y>0x+y>0, find fxf_x and fyf_y.

Plan. Apply the chain rule to each term, separately for each independent variable.

fx=exy y+1x+y⋅1∂(xy)/∂x=yfy=exy x+1x+y⋅1∂(xy)/∂y=x\begin{aligned} f_x&=e^{xy}\,y+\frac{1}{x+y}\cdot1 && \partial(xy)/\partial x=y\\ f_y&=e^{xy}\,x+\frac{1}{x+y}\cdot1 && \partial(xy)/\partial y=x \end{aligned}

Why this step? The outer derivative of the exponential stays the same, but the inner derivative changes with the coordinate.

Answer. fx=yexy+1/(x+y)f_x=ye^{xy}+1/(x+y), fy=xexy+1/(x+y)f_y=xe^{xy}+1/(x+y).

Check. On y=0y=0, the original section is 1+ln⁡x1+\ln x, whose derivative is 1/x1/x. The formula gives fx(x,0)=1/xf_x(x,0)=1/x too.

Worked example 4 adds just one factor, xx, in front of the exponential. The xx-derivative now needs a product rule, while the yy-derivative treats that factor as constant.

Worked example 4: product and chain together

Question. For g(x,y)=xexy+ln⁡(x+y)g(x,y)=xe^{xy}+\ln(x+y), where x+y>0x+y>0, find gxg_x and gyg_y.

Plan. Use a product rule in xx, then differentiate with respect to yy holding the leading xx fixed.

gx=1⋅exy+x(yexy)+1x+yproduct rule in x=(1+xy)exy+1x+ycollect exponential termsgy=x(xexy)+1x+yx is constant=x2exy+1x+y\begin{aligned} g_x&=1\cdot e^{xy}+x(ye^{xy})+\frac1{x+y} && \text{product rule in }x\\ &=(1+xy)e^{xy}+\frac1{x+y} && \text{collect exponential terms}\\ g_y&=x(xe^{xy})+\frac1{x+y} && x\text{ is constant}\\ &=x^2e^{xy}+\frac1{x+y} \end{aligned}

Why this step? In gxg_x, both factors xx and exye^{xy} depend on xx; differentiating only the second factor would lose the term exye^{xy}.

Answer. gx=(1+xy)exy+1/(x+y)g_x=(1+xy)e^{xy}+1/(x+y), gy=x2exy+1/(x+y)g_y=x^2e^{xy}+1/(x+y).

Check. On y=0y=0, g=x+ln⁡xg=x+\ln x, so gx(x,0)=1+1/xg_x(x,0)=1+1/x, agreeing with the formula.

The ordinary product rule is recalled knowledge; its partial-derivative version is not printed separately in the formula booklet.

Watch out

Wrong: ∂exy/∂x=exy\partial e^{xy}/\partial x=e^{xy}. Right: it is yexyye^{xy}. The missing factor is the derivative of the exponent with respect to the variable named in the denominator.

A power of the leading xx changes the product-rule term once more.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account