Partial Derivatives
Outline
- 1Definition and computation
- 2Slopes of traces and tangent lines
- 3Implicit differentiation
- 4Second partial derivatives
- 5Exercises
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.
Notation
Example: $z=f(x,y)=4-x^2-2y^2$ at $(1,1)$, where $z=1$
| Fix | One-variable function | Derivative 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$ |
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)$
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)$
Example 3: three variables, $f(x,y,z)=e^{xy}\ln z$
Hold the other two variables constant.
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$.
| Plane | Trace | Slope 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
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)$.
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)$.
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
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$
- Differentiate both sides with respect to $x$. Treat $y$ as a constant and $z$ as a function of $x$.
- 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)$
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
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 |
Example: $z^3+xyz+x^2=7$ near $P(2,1,1)$, since $1+2+4=7$
With respect to $x$:
With respect to $y$: the term $x^2$ is a constant.
Second partial derivatives
$f_x$ and $f_y$ are functions of $x$ and $y$, so each has two partial derivatives of its own.
Notation
| Symbol | Meaning |
|---|---|
| $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$ |
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$
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.
Practice: partial derivatives and tangent lines
Exercise 1 · Partial derivatives
- Find $f_x$ and $f_y$. Evaluate both at $(1,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)$.
- Use implicit differentiation to find formulas for $z_x$ and $z_y$. Evaluate both at $(x,y)=(1,-1)$.
- Find the tangent line at $P$ to the curve obtained by setting $y=-1$.
- Find the tangent line at $P$ to the curve obtained by setting $x=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.
$f_y$: treat $x$ as a constant.
At $(1,2)$: $2x-y=0$, so $e^{2x-y}=1$.
(b) Second partial derivatives Optional
Differentiate $f_x$ and $f_y$ from part (a). At $(1,2)$, again $e^{2x-y}=1$.
$f_{xy}=f_{yx}$, as Clairaut's Theorem says.
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$
- 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$$
- Add the terms.
$$2xy+y^2z_x+2xz\,z_x+z^2=0$$
- Collect the $z_x$ terms.
$$(y^2+2xz)\,z_x=-(2xy+z^2)$$
- Solve for $z_x$.
$$z_x=-\frac{2xy+z^2}{y^2+2xz}$$
- 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$
- 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$$
- Add the terms.
$$x^2+2yz+y^2z_y+2xz\,z_y=0$$
- Collect the $z_y$ terms.
$$(y^2+2xz)\,z_y=-(x^2+2yz)$$
- Solve for $z_y$.
$$z_y=-\frac{x^2+2yz}{y^2+2xz}$$
- Evaluate at $(1,-1,2)$.
$$z_y(1,-1)=-\frac{1^2+2(-1)(2)}{(-1)^2+2(1)(2)}=\frac35$$
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$
- Slope. $x$ varies, so the slope is $z_x(1,-1)=-\tfrac25$ and a direction is $\langle 1,0,-\tfrac25\rangle$.
- 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$
- Slope. $y$ varies, so the slope is $z_y(1,-1)=\tfrac35$ and a direction is $\langle 0,1,\tfrac35\rangle$.
- 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}$$
Drag to rotate · double-click to reset
Summary: key definitions and methods
A partial derivative is the derivative of $f$ in one variable with the other variables fixed.
| Concept | Definition / 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 differentiation | Differentiate 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 |