← M408M Week 11: Partial Derivatives
M408M · Week 11 Stewart §14.3

Partial Derivatives

Outline

  1. 1Definition and computation
  2. 2Slopes of traces and tangent lines
  3. 3Implicit differentiation
  4. 4Second partial derivatives
  5. 5Exercises
§14.3 · Definition

Definition of $f_x$ and $f_y$

Let $z=f(x,y)$ be the height of the surface above the point $(x,y)$. Fix one variable; then $z$ is a function of the other variable, and we take its ordinary derivative.

$$f_x(a,b)=\lim_{h\to 0}\frac{f(a+h,b)-f(a,b)}{h}$$
$$f_y(a,b)=\lim_{h\to 0}\frac{f(a,b+h)-f(a,b)}{h}$$

Notation

$$f_x=\frac{\partial f}{\partial x}=\frac{\partial z}{\partial x}=z_x,\qquad f_y=\frac{\partial f}{\partial y}=\frac{\partial z}{\partial y}=z_y$$

Example: $z=f(x,y)=4-x^2-2y^2$ at $(1,1)$, where $z=1$

FixOne-variable functionDerivative at $1$
$y=1$$f(x,1)=2-x^2$$f_x(1,1)=-2$
$x=1$$f(1,y)=3-2y^2$$f_y(1,1)=-4$

§14.3 · Computation

Computing partial derivatives

To find $f_x$, treat $y$ as a constant and differentiate with respect to $x$. To find $f_y$, treat $x$ as a constant and differentiate with respect to $y$.

Example 1: $f(x,y)=x^3+x^2y^3-2y^2$ at $(2,1)$

$$f_x=3x^2+2xy^3,\qquad f_x(2,1)=12+4=16$$
$$f_y=3x^2y^2-4y,\qquad f_y(2,1)=12-4=8$$

In $f_x$, the term $-2y^2$ is a constant, so its derivative is $0$. In $f_y$, the term $x^3$ is a constant.

Example 2: chain rule, $f(x,y)=\sin\!\left(\dfrac{x}{1+y}\right)$

$$f_x=\cos\!\left(\frac{x}{1+y}\right)\cdot\frac{1}{1+y},\qquad f_y=-\cos\!\left(\frac{x}{1+y}\right)\cdot\frac{x}{(1+y)^2}$$

Example 3: three variables, $f(x,y,z)=e^{xy}\ln z$

Hold the other two variables constant.

$$f_x=ye^{xy}\ln z,\qquad f_y=xe^{xy}\ln z,\qquad f_z=\frac{e^{xy}}{z}$$
§14.3 · Geometric meaning

Partial derivatives are slopes of traces

Cut the surface $z=f(x,y)$ with a vertical plane through $P(a,b,c)$. The result is a curve through $P$.

PlaneTraceSlope of tangent at $P$
$y=b$$C_1$: $z=f(x,b)$$f_x(a,b)$
$x=a$$C_2$: $z=f(a,y)$$f_y(a,b)$

Reading the sign

$f_x>0$
The surface rises as $x$ increases with $y$ fixed.
$f_x<0$
The surface falls as $x$ increases with $y$ fixed.
$f_x=0$
The tangent line to $C_1$ is horizontal.

Example: $f(x,y)=4-x^2-2y^2$ at $P(1,1,1)$

$f_x(1,1)=-2$: walking in the $+x$ direction, the height falls $2$ units per unit of $x$.

$f_y(1,1)=-4$: walking in the $+y$ direction, the height falls $4$ units per unit of $y$.

Drag to rotate · double-click to reset

§14.3 · Tangent lines

Equations of the tangent lines

Vector form of a line: $\mathbf r(t)=\langle a,b,c\rangle+t\,\mathbf v$, the point $P(a,b,c)$ plus $t$ times a direction vector $\mathbf v$.

Tangent line $T_1$ to the trace in $y=b$

Direction $\mathbf v=\langle 1,0,f_x(a,b)\rangle$: $x$ goes up $1$, $y$ stays $b$, $z$ changes by $f_x(a,b)$.

$$\begin{aligned}\text{Point-slope:}&\quad y=b,\quad z-c=f_x(a,b)\,(x-a)\\\text{Vector:}&\quad \mathbf r(t)=\langle a,b,c\rangle+t\,\langle 1,0,f_x(a,b)\rangle\end{aligned}$$

Tangent line $T_2$ to the trace in $x=a$

Direction $\mathbf v=\langle 0,1,f_y(a,b)\rangle$: $x$ stays $a$, $y$ goes up $1$, $z$ changes by $f_y(a,b)$.

$$\begin{aligned}\text{Point-slope:}&\quad x=a,\quad z-c=f_y(a,b)\,(y-b)\\\text{Vector:}&\quad \mathbf r(t)=\langle a,b,c\rangle+t\,\langle 0,1,f_y(a,b)\rangle\end{aligned}$$

Example: $f(x,y)=4-x^2-2y^2$ at $P(1,1,1)$

$T_1$, $f_x(1,1)=-2$$y=1,\ z-1=-2(x-1)$$\langle 1,1,1\rangle+t\langle 1,0,-2\rangle$
$T_2$, $f_y(1,1)=-4$$x=1,\ z-1=-4(y-1)$$\langle 1,1,1\rangle+t\langle 0,1,-4\rangle$

Left: drag to rotate · Right: the vertical plane, with the gap between line and curve

§14.3 · Implicit differentiation

Implicit differentiation

An equation in $x,y,z$ can define $z$ as a function $z(x,y)$ near a point, even when we cannot solve for $z$.

Method for $z_x$

  1. Differentiate both sides with respect to $x$. Treat $y$ as a constant and $z$ as a function of $x$.
  2. Solve for $z_x$ and evaluate at the point.

For $z_y$, differentiate with respect to $y$ and treat $x$ as a constant.

Example: $x^2+y^2+z^2=9$ at $P(1,2,2)$

$$\frac{\partial}{\partial x}:\ 2x+2z\,z_x=0\implies z_x=-\frac{x}{z}=-\frac12$$
$$\frac{\partial}{\partial y}:\ 2y+2z\,z_y=0\implies z_y=-\frac{y}{z}=-1$$

Check by solving for $z$

Near $P$, $z=\sqrt{9-x^2-y^2}$, so $z_x=\dfrac{-x}{\sqrt{9-x^2-y^2}}=-\dfrac{x}{z}$.

Drag to rotate · double-click to reset

§14.3 · Implicit differentiation

Terms containing $z$: chain rule and product rule

Every time $z$ is differentiated with respect to $x$, a factor $z_x$ appears.

Derivative with respect to $x$

Term$\partial/\partial x$Rule
$x^2$$2x$Power
$y^2$$0$Constant
$z^3$$3z^2\,z_x$Chain
$xz$$z+x\,z_x$Product
$xyz$$y(z+x\,z_x)$Product
Common errors. Writing $3z^2$ for the derivative of $z^3$ (missing $z_x$). Writing only $yz$ for the derivative of $xyz$ (missing $xy\,z_x$).

Example: $z^3+xyz+x^2=7$ near $P(2,1,1)$, since $1+2+4=7$

With respect to $x$:

$$3z^2z_x+y(z+x\,z_x)+2x=0$$
$$(3z^2+xy)\,z_x=-(yz+2x)\implies z_x=-\frac{yz+2x}{3z^2+xy}$$

With respect to $y$: the term $x^2$ is a constant.

$$3z^2z_y+x(z+y\,z_y)=0\implies z_y=-\frac{xz}{3z^2+xy}$$
$$z_x(2,1)=-\frac{1+4}{3+2}=-1,\qquad z_y(2,1)=-\frac{2}{3+2}=-\frac25$$
§14.3 · Higher derivatives

Second partial derivatives

$f_x$ and $f_y$ are functions of $x$ and $y$, so each has two partial derivatives of its own.

Notation

SymbolMeaning
$f_{xx}=\dfrac{\partial^2 f}{\partial x^2}$Differentiate in $x$, then in $x$
$f_{xy}=\dfrac{\partial^2 f}{\partial y\,\partial x}$Differentiate in $x$, then in $y$
$f_{yx}=\dfrac{\partial^2 f}{\partial x\,\partial y}$Differentiate in $y$, then in $x$
$f_{yy}=\dfrac{\partial^2 f}{\partial y^2}$Differentiate in $y$, then in $y$
Clairaut's Theorem. If $f_{xy}$ and $f_{yx}$ are continuous on a disk containing $(a,b)$, then $f_{xy}(a,b)=f_{yx}(a,b)$.

Meaning of $f_{xx}$: the rate of change of the slope of the trace in the $x$ direction. It gives the concavity of that trace.

Example: $f(x,y)=x^3+x^2y^3-2y^2$

$$f_x=3x^2+2xy^3,\qquad f_y=3x^2y^2-4y$$
$$f_{xx}=6x+2y^3,\qquad f_{yy}=6x^2y-4$$
$$f_{xy}=6xy^2,\qquad f_{yx}=6xy^2$$

The two mixed derivatives are equal, as Clairaut's Theorem says.

For $f(x,y)=4-x^2-2y^2$: $\;f_{xx}=-2<0$, so the trace in $y=b$ is concave down.

Exercises

Practice: partial derivatives and tangent lines

Exercise 1 · Partial derivatives

$$f(x,y)=x^2y^3+e^{2x-y}$$
  1. Find $f_x$ and $f_y$. Evaluate both at $(1,2)$.
  2. Optional Find $f_{xx}$, $f_{xy}$, $f_{yx}$ and $f_{yy}$. Evaluate each at $(1,2)$.

Exercise 2 · Implicit differentiation

The surface below defines $z$ implicitly as a function $z=z(x,y)$ near the point $P=(1,-1,2)$.

$$x^2y+y^2z+z^2x=5$$
  1. Use implicit differentiation to find formulas for $z_x$ and $z_y$. Evaluate both at $(x,y)=(1,-1)$.
  2. Find the tangent line at $P$ to the curve obtained by setting $y=-1$.
  3. Find the tangent line at $P$ to the curve obtained by setting $x=1$.
Solution · Exercise 1

Solution 1: $f(x,y)=x^2y^3+e^{2x-y}$

Use the chain rule on $e^{2x-y}$: multiply by the derivative of the exponent $2x-y$, which is $2$ in $x$ and $-1$ in $y$.

(a) First partial derivatives

$f_x$: treat $y$ as a constant.

$$\begin{aligned}f_x&=\frac{\partial}{\partial x}\big(x^2\big)\,y^3+e^{2x-y}\,\frac{\partial}{\partial x}(2x-y)\\&=2xy^3+2e^{2x-y}\end{aligned}$$

$f_y$: treat $x$ as a constant.

$$\begin{aligned}f_y&=x^2\,\frac{\partial}{\partial y}\big(y^3\big)+e^{2x-y}\,\frac{\partial}{\partial y}(2x-y)\\&=3x^2y^2-e^{2x-y}\end{aligned}$$

At $(1,2)$: $2x-y=0$, so $e^{2x-y}=1$.

$$f_x(1,2)=2(1)(2)^3+2(1)=18$$
$$f_y(1,2)=3(1)^2(2)^2-1=11$$

(b) Second partial derivatives Optional

Differentiate $f_x$ and $f_y$ from part (a). At $(1,2)$, again $e^{2x-y}=1$.

$$\begin{aligned}f_{xx}&=\frac{\partial}{\partial x}\big(2xy^3+2e^{2x-y}\big)=2y^3+4e^{2x-y}\\f_{xx}(1,2)&=16+4=20\end{aligned}$$
$$\begin{aligned}f_{xy}&=\frac{\partial}{\partial y}\big(2xy^3+2e^{2x-y}\big)=6xy^2-2e^{2x-y}\\f_{xy}(1,2)&=24-2=22\end{aligned}$$
$$\begin{aligned}f_{yx}&=\frac{\partial}{\partial x}\big(3x^2y^2-e^{2x-y}\big)=6xy^2-2e^{2x-y}\\f_{yx}(1,2)&=24-2=22\end{aligned}$$
$$\begin{aligned}f_{yy}&=\frac{\partial}{\partial y}\big(3x^2y^2-e^{2x-y}\big)=6x^2y+e^{2x-y}\\f_{yy}(1,2)&=12+1=13\end{aligned}$$

$f_{xy}=f_{yx}$, as Clairaut's Theorem says.

Solution · Exercise 2

Solution 2(a): $x^2y+y^2z+z^2x=5$ at $P(1,-1,2)$

$P$ is on the surface: $-1+2+4=5$. The right side $5$ is a constant, so its derivative is $0$.

Find $z_x$: $y$ is a constant, $z$ is a function of $x$

  1. Differentiate each term. $z^2x$ needs the product rule.
    $$x^2y\to 2xy,\quad y^2z\to y^2z_x,\quad z^2x\to 2xz\,z_x+z^2$$
  2. Add the terms.
    $$2xy+y^2z_x+2xz\,z_x+z^2=0$$
  3. Collect the $z_x$ terms.
    $$(y^2+2xz)\,z_x=-(2xy+z^2)$$
  4. Solve for $z_x$.
    $$z_x=-\frac{2xy+z^2}{y^2+2xz}$$
  5. Evaluate at $(1,-1,2)$.
    $$z_x(1,-1)=-\frac{2(1)(-1)+2^2}{(-1)^2+2(1)(2)}=-\frac25$$

Find $z_y$: $x$ is a constant, $z$ is a function of $y$

  1. Differentiate each term. $y^2z$ needs the product rule.
    $$x^2y\to x^2,\quad y^2z\to 2yz+y^2z_y,\quad z^2x\to 2xz\,z_y$$
  2. Add the terms.
    $$x^2+2yz+y^2z_y+2xz\,z_y=0$$
  3. Collect the $z_y$ terms.
    $$(y^2+2xz)\,z_y=-(x^2+2yz)$$
  4. Solve for $z_y$.
    $$z_y=-\frac{x^2+2yz}{y^2+2xz}$$
  5. Evaluate at $(1,-1,2)$.
    $$z_y(1,-1)=-\frac{1^2+2(-1)(2)}{(-1)^2+2(1)(2)}=\frac35$$
Solution · Exercise 2

Solution 2(b), (c): tangent lines at $P(1,-1,2)$

Each line uses the point $P$ and a slope from part (a). Vector form: $\mathbf r(t)=P+t\,(\text{direction})$.

(b) The curve in the plane $y=-1$

  1. Slope. $x$ varies, so the slope is $z_x(1,-1)=-\tfrac25$ and a direction is $\langle 1,0,-\tfrac25\rangle$.
  2. Equations, with $x=1$, $z=2$ from $P$:
    $$\begin{aligned}\text{Point-slope:}&\quad y=-1,\quad z-2=-\tfrac25(x-1)\\\text{Vector:}&\quad \mathbf r(t)=\langle 1,-1,2\rangle+t\,\langle 1,0,-\tfrac25\rangle\\&\quad\phantom{\mathbf r(t)}=\langle 1+t,\ -1,\ 2-\tfrac25t\rangle\end{aligned}$$

(c) The curve in the plane $x=1$

  1. Slope. $y$ varies, so the slope is $z_y(1,-1)=\tfrac35$ and a direction is $\langle 0,1,\tfrac35\rangle$.
  2. Equations, with $y=-1$, $z=2$ from $P$:
    $$\begin{aligned}\text{Point-slope:}&\quad x=1,\quad z-2=\tfrac35\big(y-(-1)\big)=\tfrac35(y+1)\\\text{Vector:}&\quad \mathbf r(t)=\langle 1,-1,2\rangle+t\,\langle 0,1,\tfrac35\rangle\\&\quad\phantom{\mathbf r(t)}=\langle 1,\ -1+t,\ 2+\tfrac35t\rangle\end{aligned}$$
Patch of the surface over $0.6\le x\le 1.4$, $\;-1.6\le y\le -0.4$.

Drag to rotate · double-click to reset

§14.3 · Summary

Summary: key definitions and methods

A partial derivative is the derivative of $f$ in one variable with the other variables fixed.

ConceptDefinition / Method
$f_x(a,b)$$\displaystyle\lim_{h\to 0}\frac{f(a+h,b)-f(a,b)}{h}$. To compute: treat $y$ as a constant and differentiate in $x$
Rate of change$f_x$ is the rate of change of $f$ with respect to $x$ when $y$ is fixed
Slope of a trace$f_x(a,b)$ is the slope at $P$ of the curve in the plane $y=b$; $f_y(a,b)$ is the slope at $P$ of the curve in the plane $x=a$
Tangent lines at $P(a,b,c)$Point-slope: $y=b,\ z-c=f_x(a,b)(x-a)$; $\;x=a,\ z-c=f_y(a,b)(y-b)$
Vector: $\mathbf r(t)=\langle a,b,c\rangle+t\langle 1,0,f_x(a,b)\rangle$; $\;\mathbf r(t)=\langle a,b,c\rangle+t\langle 0,1,f_y(a,b)\rangle$
Implicit differentiationDifferentiate the equation in $x$ with $y$ constant and $z=z(x,y)$; every derivative of $z$ gives a factor $z_x$. Solve for $z_x$. Repeat in $y$ for $z_y$
Second partial derivatives$f_{xx},f_{xy},f_{yx},f_{yy}$. Clairaut: $f_{xy}=f_{yx}$ when both are continuous