Computing Partial Derivatives and Differentiating Composite Functions

The Basic Computation of Partial Derivatives

When computing a partial derivative, treat the other independent variables as constants and apply the rules of differentiation of a function of one variable. The basic differentiation formulas are exactly the same as for a function of one variable.

Common differentiation formulas

∂∂x(c)=0,∂∂x(xn)=nxn−1,∂∂x(ex)=ex\frac{\partial}{\partial x}(c) = 0, \quad \frac{\partial}{\partial x}(x^n) = nx^{n-1}, \quad \frac{\partial}{\partial x}(e^x) = e^x ∂∂x(ln⁡x)=1x,∂∂x(sin⁡x)=cos⁡x,∂∂x(cos⁡x)=−sin⁡x\frac{\partial}{\partial x}(\ln x) = \frac{1}{x}, \quad \frac{\partial}{\partial x}(\sin x) = \cos x, \quad \frac{\partial}{\partial x}(\cos x) = -\sin x

The Chain Rule for Composite Functions

Case 1: The intermediate variables are functions of one variable

Theorem1

Let z=f(u,v)z = f(u, v), u=u(t)u = u(t) and v=v(t)v = v(t). Then the derivative (the total derivative) of the composite function z=f(u(t),v(t))z = f(u(t), v(t)) with respect to tt is:

dzdt=∂z∂u⋅dudt+∂z∂v⋅dvdt\frac{dz}{dt} = \frac{\partial z}{\partial u} \cdot \frac{du}{dt} + \frac{\partial z}{\partial v} \cdot \frac{dv}{dt}

Case 2: The intermediate variables are functions of two variables

Theorem2

Let z=f(u,v)z = f(u, v), u=u(x,y)u = u(x, y) and v=v(x,y)v = v(x, y). Then the partial derivatives of the composite function z=f(u(x,y),v(x,y))z = f(u(x,y), v(x,y)) are:

∂z∂x=∂z∂u⋅∂u∂x+∂z∂v⋅∂v∂x\frac{\partial z}{\partial x} = \frac{\partial z}{\partial u} \cdot \frac{\partial u}{\partial x} + \frac{\partial z}{\partial v} \cdot \frac{\partial v}{\partial x}

∂z∂y=∂z∂u⋅∂u∂y+∂z∂v⋅∂v∂y\frac{\partial z}{\partial y} = \frac{\partial z}{\partial u} \cdot \frac{\partial u}{\partial y} + \frac{\partial z}{\partial v} \cdot \frac{\partial v}{\partial y}

Case 3: Special cases

  1. One intermediate variable: for z=f(u,x,y)z = f(u, x, y) and u=u(x,y)u = u(x, y), ∂z∂x=∂f∂u∂u∂x+∂f∂x,∂z∂y=∂f∂u∂u∂y+∂f∂y\frac{\partial z}{\partial x} = \frac{\partial f}{\partial u}\frac{\partial u}{\partial x} + \frac{\partial f}{\partial x}, \quad \frac{\partial z}{\partial y} = \frac{\partial f}{\partial u}\frac{\partial u}{\partial y} + \frac{\partial f}{\partial y} Note that ∂f∂x\frac{\partial f}{\partial x} is the partial derivative of ff with respect to xx with uu held constant, and is different from ∂z∂x\frac{\partial z}{\partial x}.

  2. The total derivative generalised: for z=f(u,v,w)z = f(u, v, w) and u=u(t),v=v(t),w=w(t)u=u(t), v=v(t), w=w(t), dzdt=∂z∂ududt+∂z∂vdvdt+∂z∂wdwdt\frac{dz}{dt} = \frac{\partial z}{\partial u}\frac{du}{dt} + \frac{\partial z}{\partial v}\frac{dv}{dt} + \frac{\partial z}{\partial w}\frac{dw}{dt}

Implicit Differentiation

The case of one equation

Theorem3

Suppose the function F(x,y,z)=0F(x, y, z) = 0 determines an implicit function z=z(x,y)z = z(x, y) and Fz≠0F_z \neq 0. Then

∂z∂x=−FxFz,∂z∂y=−FyFz\frac{\partial z}{\partial x} = -\frac{F_x}{F_z}, \quad \frac{\partial z}{\partial y} = -\frac{F_y}{F_z}

Similarly, when F(x,y)=0F(x,y)=0 determines y=y(x)y=y(x), dydx=−FxFy\frac{dy}{dx} = -\frac{F_x}{F_y} (with Fy≠0F_y \neq 0).

How It Is Derived

Differentiate the equation F(x,y,z(x,y))=0F(x, y, z(x,y)) = 0 with respect to xx on both sides:

Fx+Fz⋅∂z∂x=0⇒∂z∂x=−FxFzF_x + F_z \cdot \frac{\partial z}{\partial x} = 0 \Rightarrow \frac{\partial z}{\partial x} = -\frac{F_x}{F_z}

Worked Examples

Example 1: Differentiating a Composite Function

Let z=eusin⁡vz = e^u \sin v, u=xyu = xy and v=x+yv = x + y. Find ∂z∂x\frac{\partial z}{\partial x} and ∂z∂y\frac{\partial z}{\partial y}.

a composite functionthe chain rulepartial derivatives

Approach:

The intermediate variables uu and vv both depend on xx and yy, so when applying the chain rule you have to compute both branches and add them.

Steps:

  1. ∂z∂u=eusin⁡v\frac{\partial z}{\partial u} = e^u \sin v and ∂z∂v=eucos⁡v\frac{\partial z}{\partial v} = e^u \cos v
  2. ∂u∂x=y\frac{\partial u}{\partial x} = y, ∂u∂y=x\frac{\partial u}{\partial y} = x, ∂v∂x=1\frac{\partial v}{\partial x} = 1 and ∂v∂y=1\frac{\partial v}{\partial y} = 1
  3. ∂z∂x=eusin⁡v⋅y+eucos⁡v⋅1=exy[ysin⁡(x+y)+cos⁡(x+y)]\frac{\partial z}{\partial x} = e^u \sin v \cdot y + e^u \cos v \cdot 1 = e^{xy}[y\sin(x+y) + \cos(x+y)]
  4. ∂z∂y=eusin⁡v⋅x+eucos⁡v⋅1=exy[xsin⁡(x+y)+cos⁡(x+y)]\frac{\partial z}{\partial y} = e^u \sin v \cdot x + e^u \cos v \cdot 1 = e^{xy}[x\sin(x+y) + \cos(x+y)]

Answer: ∂z∂x=exy[ysin⁡(x+y)+cos⁡(x+y)]\frac{\partial z}{\partial x} = e^{xy}[y\sin(x+y)+\cos(x+y)] and ∂z∂y=exy[xsin⁡(x+y)+cos⁡(x+y)]\frac{\partial z}{\partial y} = e^{xy}[x\sin(x+y)+\cos(x+y)]

Example 2: The Total Derivative

Let z=arctan⁡(xy)z = \arctan(xy) and y=exy = e^x. Find dzdx\frac{dz}{dx}.

the total derivativea composite functionthe chain rule

Approach:

yy depends on xx and zz depends on yy, so this is the chained case of the chain rule.

Steps:

Method 1: the total derivative formula

  1. ∂z∂x=y1+x2y2\frac{\partial z}{\partial x} = \frac{y}{1+x^2y^2}, ∂z∂y=x1+x2y2\frac{\partial z}{\partial y} = \frac{x}{1+x^2y^2} and dydx=ex\frac{dy}{dx} = e^x
  2. dzdx=∂z∂x+∂z∂ydydx=y1+x2y2+x1+x2y2⋅ex=ex+xex1+x2e2x=ex(1+x)1+x2e2x\frac{dz}{dx} = \frac{\partial z}{\partial x} + \frac{\partial z}{\partial y}\frac{dy}{dx} = \frac{y}{1+x^2y^2} + \frac{x}{1+x^2y^2} \cdot e^x = \frac{e^x + xe^x}{1+x^2e^{2x}} = \frac{e^x(1+x)}{1+x^2e^{2x}}

Method 2: substituting directly z=arctan⁡(xex)z = \arctan(xe^x), so dzdx=(xex)′1+(xex)2=ex+xex1+x2e2x\frac{dz}{dx} = \frac{(xe^x)'}{1+(xe^x)^2} = \frac{e^x + xe^x}{1+x^2e^{2x}}

Answer: dzdx=ex(1+x)1+x2e2x\frac{dz}{dx} = \frac{e^x(1+x)}{1+x^2e^{2x}}

Example 3: Implicit Differentiation

Suppose x2+y2+z2=4zx^2 + y^2 + z^2 = 4z determines z=z(x,y)z = z(x,y). Find ∂z∂x\frac{\partial z}{\partial x} and ∂z∂y\frac{\partial z}{\partial y}.

an implicit functionimplicit differentiationpartial derivatives

Approach:

Treat zz as a function of xx and yy, differentiate the original equation on both sides, and then solve for the partial derivatives.

Steps:

  1. Put F(x,y,z)=x2+y2+z2−4zF(x,y,z) = x^2 + y^2 + z^2 - 4z
  2. Fx=2xF_x = 2x, Fy=2yF_y = 2y and Fz=2z−4F_z = 2z - 4
  3. ∂z∂x=−FxFz=−2x2z−4=x2−z\frac{\partial z}{\partial x} = -\frac{F_x}{F_z} = -\frac{2x}{2z-4} = \frac{x}{2-z}
  4. ∂z∂y=−FyFz=−2y2z−4=y2−z\frac{\partial z}{\partial y} = -\frac{F_y}{F_z} = -\frac{2y}{2z-4} = \frac{y}{2-z}

Answer: ∂z∂x=x2−z\frac{\partial z}{\partial x} = \frac{x}{2-z} and ∂z∂y=y2−z\frac{\partial z}{\partial y} = \frac{y}{2-z}


Exercises

Exercise 1

Let z=u2ln⁡vz = u^2 \ln v, u=xyu = \frac{x}{y} and v=3x−2yv = 3x - 2y. Find ∂z∂x\frac{\partial z}{\partial x}.

a composite functionthe chain rulepartial derivatives

Approach:

It is still the chain rule with two intermediate variables; note that both branches contribute a derivative.

Steps:

  1. ∂z∂u=2uln⁡v\frac{\partial z}{\partial u} = 2u\ln v and ∂z∂v=u2v\frac{\partial z}{\partial v} = \frac{u^2}{v}
  2. ∂u∂x=1y\frac{\partial u}{\partial x} = \frac{1}{y} and ∂v∂x=3\frac{\partial v}{\partial x} = 3
  3. ∂z∂x=2uln⁡v⋅1y+u2v⋅3=2xy2ln⁡(3x−2y)+3x2y2(3x−2y)\frac{\partial z}{\partial x} = 2u\ln v \cdot \frac{1}{y} + \frac{u^2}{v} \cdot 3 = \frac{2x}{y^2}\ln(3x-2y) + \frac{3x^2}{y^2(3x-2y)}

Answer: ∂z∂x=2xy2ln⁡(3x−2y)+3x2y2(3x−2y)\frac{\partial z}{\partial x} = \frac{2x}{y^2}\ln(3x-2y) + \frac{3x^2}{y^2(3x-2y)}

Exercise 2

Suppose ez−xyz=0e^z - xyz = 0 determines z=z(x,y)z = z(x,y). Find ∂z∂x\frac{\partial z}{\partial x}.

an implicit functionimplicit differentiation

Approach:

After the implicit differentiation, it is cleaner to simplify the result into a form involving zz.

Steps:

  1. Put F(x,y,z)=ez−xyzF(x,y,z) = e^z - xyz
  2. Fx=−yzF_x = -yz and Fz=ez−xyF_z = e^z - xy
  3. ∂z∂x=−FxFz=yzez−xy=yzxyz−xy=zx(z−1)\frac{\partial z}{\partial x} = -\frac{F_x}{F_z} = \frac{yz}{e^z - xy} = \frac{yz}{xyz - xy} = \frac{z}{x(z-1)} (using ez=xyze^z = xyz)

Answer: ∂z∂x=yzez−xy=zx(z−1)\frac{\partial z}{\partial x} = \frac{yz}{e^z-xy} = \frac{z}{x(z-1)}


Summary

Symbols Used in This Article

SymbolTypePronunciation/ExplanationMeaning in This Article
dzdt\frac{dz}{dt}Total derivativetotal derivativeThe derivative of a composite function with respect to a single independent variable
Fx,Fy,FzF_x, F_y, F_zPartial derivativespartial derivativesThe partial derivatives of the equation of the implicit function
u,v,wu, v, wIntermediate variableintermediate variablesThe intermediate variables of a composite function

Found an issue with this content?

Tell us what could be improved.