# Partial Derivatives (and Partial Differential Equations)

• By David A. Smith, Founder & CEO, Direct Knowledge
• David Smith has a B.S. and M.S. in Mathematics and has enjoyed teaching calculus, linear algebra, and number theory at both Tarrant County College and the University of Texas at Arlington. David is the Founder and current CEO of Direct Knowledge.

## Partial Derivatives

For the partial differentiation of a function of two variables, $z=f(x,y)$, we find the partial derivative with respect to $x$ by regarding $y$ as a constant while differentiating the function with respect to $x.$ Similarly, the partial derivative with respect to $y$ is found by regarding $x$ as a constant while differentiating with respect to $y.$

## Definition of Partial Derivative

Definition. If $z=f(x,y)$ then the partial derivatives of $f$ with respect to $x$ and $y$ are the functions $f_x$ and $f_y$, respectively, defined by $$f_x(x,y)=\lim_{\Delta x\to 0}\frac{f(x+\Delta x,y)-f(x,y)}{\Delta x}$$ and $$f_y(x,y)=\lim_{\Delta y\to 0}\frac{f(x,y+\text{\Delta y})-f(x,y)}{\Delta y}.$$ The partial derivatives $f_x$ and $f_y$ are denoted by $$f_x=\frac{\partial f}{\partial x}=\frac{\partial z}{\partial x}=\frac{\partial }{\partial x}f(x,y)=D_x(f)$$ and $$f_y=\frac{\partial f}{\partial y}=\frac{\partial z}{\partial y}=\frac{\partial }{\partial y}f(x,y)=D_y(f).$$

The slopes of the lines tangent to the surface at $z=f(x,y)$ at $(a,b)$ when $y$ and $x$ are fixed are given by the partial derivatives of $f$ at $(a,b)$ with respect to $x$ and $y$, respectively.

Example. Find the partial derivatives of the function $$f(x,y)=x^3+x^2y^3-2y^2$$ at $P=(2,1).$

Solution. Holding $y$ constant and differentiating with respect to $x$, we get $$f_x(x,y)=3x^2+2x y^3$$ and so $$f_x(2,1) = 3\left(2^2\right) + 2(2) \left(1^3\right) = 16.$$ Holding $x$ constant and differentiating with respect to $y$, we get $$f_y(x,y)=3x^2y^2-4y$$ and so $f_y(2,1)=3(2)^2(1)^2-4(1)=8.$

Example. Find the partial derivatives of the function $f$ defined by $$f(x,y)=4-x^2-2y^2$$ at $P=(1,1).$ Explain graphical.

Solution. We have $$f_x(x,y)=-2x \quad \text{and} \quad f_y(x,y)=-4y,$$ and so $f_x(1,1)=-2$ and $f_y(1,1)=-4.$ The graph of $f$ is the paraboloid $$z=4-x^2-2y^2$$ and the vertical plane $y=1$ intersects it in the parabola $z=2-x^2,y=1.$ The slope of the tangent line to this parabola at the point $(1,1,1)$ is $f_x(1,1)=-2.$ Similarly the curve in which the plane $x=1$ intersects the paraboloid is the parabola $z=3-2y^2, x=1$ and the slope of the tangent line at $(1,1,1)$ is $f_y(1,1)=-4.$

Definition. If $f$ is a function of the variables $x_1,\ldots,x_n$, then the partial derivative of $f$ with respect to $x_k$ is the function $f_{x_k}$ defined by \begin{align*} f_{x_k}(x_1, \ldots, x_n) = \lim_{\Delta x_k\to 0}\frac{f\left(x_1,\ldots,x_k+\Delta x_k,x_{k+1},\ldots,x_n\right)-f\left(x_1,\ldots,x_n\right)}{\Delta x_k} \end{align*} provided this limits exists.

Example. Find the partial derivatives $f_x$ and $f_y$ given $$f(x,y)=\sin \left(\frac{x}{1+y}\right).$$

Solution. Using the chain rule for functions of one variable, we have $$f_x=\cos \left(\frac{x}{1+y}\right)\frac{\partial }{\partial x}\left(\frac{x}{1+y}\right)=\cos \left(\frac{x}{1+y}\right)\cdot \frac{1}{1+y}$$ and $$f_y=\cos \left(\frac{x}{1+y}\right)\frac{\partial }{\partial y}\left(\frac{x}{1+y}\right)=-\sin \left(\frac{x}{1+y}\right)\cdot \frac{x}{(1+y)^2}.$$

Example. Find the partial derivatives $\frac{\partial z}{\partial x}$ and $\frac{\partial z}{\partial y}$ if $z$ is defined implicitly as a function of $x$ and $y$ by the equation $$x^3+y^3+z^3+6x y z=1.$$

Solution. To find $\frac{\partial z}{\partial x}$ we differentiate implicitly with respect to $x$, being careful to treat $y$ as a constant: $$3x^2+3z^2\frac{\partial z}{\partial x}+6y z+6x y\frac{\partial z}{\partial x}=0.$$ Solving this equation for $\frac{\partial z}{\partial x}$ we obtain $$\frac{\partial z}{\partial x}=-\frac{x^2+2y z}{z^2+2x y}.$$ Similarly, implicit differentiation with respect to $y$ gives
$$\frac{\partial z}{\partial y}=-\frac{y^2+2x z}{z^2+2xy}.$$

Example. Suppose the system $$\begin{cases} x u+y v-u v & = 0 \\ y u-x v+u v & = 0 \end{cases}$$ can be solved for $u$ and $v$ in terms of $x$ and $y,$ so that $u=u(x,y)$ and $v=v(x,y).$ Use implicit differentiation to find the partial derivatives $\frac{\partial u}{\partial x}$ and $\frac{\partial v}{\partial x}.$

Solution. We use implicit differentiation on $x u+y v-u v = 0$ to find $\frac{\partial u}{\partial x}.$ We have,
u+x\frac{\partial u}{\partial x}+y\frac{\partial v}{\partial x}-\frac{\partial u}{\partial x}v-\frac{\partial v}{\partial x}u=0 and so $$(x-v)\frac{\partial u}{\partial x}+(y-u)\frac{\partial v}{\partial x}=-u$$ Also, $$y\frac{\partial u}{\partial x}-x\frac{\partial v}{\partial x}-v+u\frac{\partial v}{\partial x}+v\frac{\partial u}{\partial x}=0$$ and so $$(y+v)\frac{\partial u}{\partial x}+(-x+u)\frac{\partial v}{\partial x}=v$$ So we can solve the system $$\begin{cases} (x-v)\frac{\partial u}{\partial x}+(y-u)\frac{\partial v}{\partial x} & =-u \\ (y+v)\frac{\partial u}{\partial x}+(-x+u)\frac{\partial v}{\partial x} & =v \end{cases}$$ to obtain $$\frac{\partial u}{\partial x}=\frac{u^2-u v-u x+v y}{x^2+y^2-u x-u y-v x+v y}$$ $$\frac{\partial v}{\partial x}=\frac{v^2-u v-u x+v y}{x^2+y^2-u x-u y-v x+v y}$$

## Second-Order Partial Derivatives

The partial derivative is a function, so it is possible to take the partial derivative of a partial derivative. This is very much like taking the second derivative of a function of one variable if we take two consecutive partial derivatives with respect to the same variable, and the resulting derivative is called the second-order partial derivative with respect to that variable. However, we can also take the partial derivative with respect to one variable and then take a second partial derivative with respect to a different variable, producing what is called a second-order partial derivative.

The higher-order partial derivatives for a function of two variables $f(x,y)$ are denoted as $$\frac{ \partial^2f}{\partial x^2}=\frac{\partial }{\partial x}\left(\frac{\partial f}{\partial x}\right)=\left(f_x\right)_x = f_{x x}$$ and $$\frac{ \partial^2f}{\partial y^2} = \frac{\partial }{\partial y}\left(\frac{\partial f}{\partial y}\right) = \left(f_y\right)_y = f_{y y}$$ and the mixed second partial derivatives are denoted as $$\frac{ \partial ^2f}{\partial x\partial y}=\frac{\partial }{\partial x}\left(\frac{\partial f}{\partial y}\right)=\left(f_y\right)_x=f_{y x}$$ and $$\frac{\partial ^2f}{\partial y\partial x}=\frac{\partial }{\partial y}\left(\frac{\partial f}{\partial x}\right) = \left(f_x\right)_y=f_{x y}.$$

Example. Find the second order partial derivatives of $$f(x,y)=x^3+x^2y^3-2y^2.$$

Solution. The first partial derivatives are $f_x(x,y)=3x^2+2x y^3$ and $f_y(x,y)=3x^2y^2-4y.$ Therefore the second derivatives are \begin{align} f_{x x}& =\frac{\partial }{\partial x}\left(3x^2+2x y^3 \right)=6x+2y^3 & f_{x y}& =\frac{\partial }{\partial y}\left(3x^2+2x y^3 \right)=6x y^2 \\ f_{y x}& =\frac{\partial }{\partial x}\left(3x^2y^2-4y \right)=6x y^2 & f_{y y}& =\frac{\partial }{\partial y}\left(3x^2y^2-4y\right)=6x^2y-4 \end{align}

Theorem. (Mixed Second-Order Partial Derivatives) If the function $f(x,y)$ has mixed second-order partial derivatives $f_{x y}$ and $f_{y x}$, that are continuous on an open disk containing $(a,b)$, then $$f_{y x}(a,b)=f_{x y}(a,b).$$

Proof. For small values of $h$ with $h\neq 0$, consider the difference $$\Delta (h)=[f(a+h,b+h)-f(a+h,b)]-[f(a,b+h)-f(a,b)].$$ Notice that if we let $$g(x)=f(x,b+h)-f(x,b),$$ then $$\Delta (h)=g(a+h)-g(a).$$ By the Mean Value Theorem, there is a number $c$ between $a$ and $a+h$ such that $$g(a+h)-g(a)=g'(c)h=h\left[f_x(c,b+h)-f_x(c,b)\right].$$ Applying the Mean Value Theorem \index{mean value theorem} again, this time to $f_x$ we get a number $d$ between $b$ and $b+h$ such that $$f_x(c,b+h)-f_x(c,b)=f_{x y}(c,d)h.$$
Combining these equations, we obtain $\Delta (h)=h^2f_{x y}(c,d).$ If $h\to 0$, then $(c,d)\to (a,b)$, so the continuity of $f_{x y}$ at $(a,b)$ gives $$\lim_{h\to 0}\frac{\Delta (h)}{h^2}=\lim_{(c,d)\to (a,b)}f_{x y}(c,d)=f_{x y}(a,b).$$ Similarly, by writing $$\Delta (h)=[f(a+h,b+h)-f(a,b+h)]-[f(a+h,b)-f(a,b)]$$ and using the Mean Value Theorem twice and the continuity of $f_{y x}$ at $(a,b)$, we obtain $$\lim_{h\to 0}\frac{\Delta (h)}{h^2}=f_{y x}(a,b).$$ It follows that $f_{x y}(a,b)=f_{y x}(a,b)$ as desired.

Example. Use implicit differentiation to find $\frac{ \partial ^2z}{\partial x\partial y}$ given $z^2+\sin x=\tan y.$

Solution. We use implicit differentiation with respect to $y$ first to find $\frac{\partial z}{\partial y}$ as follows, $$2z \frac{\partial z}{\partial y}+0=\sec ^2y$$ (recall $\frac{d}{du}(\tan u)=\sec ^2 u$) and so $$\frac{\partial z}{\partial y}=\frac{\sec ^2y}{2z }$$ Now to find $\frac{ \partial ^2z}{\partial x\partial y}$ we use implicit differentiation with respect to $x$ but first we write $$\frac{\partial z}{\partial y}=\left(\sec ^2y\right)(2z)^{-1}$$ Then, $$\label{imdeq} \frac{ \partial ^2z}{\partial x\partial y}=\left(\sec ^2y\right)(-2z)^{-2}\frac{\partial z}{\partial x}$$ so in order to find $\frac{ \partial ^2z}{\partial x\partial y}$ we now need to find $\frac{\partial z}{\partial x}.$ We find, $$2z\frac{\partial z}{\partial x}+\cos x=0$$ and solving for $\frac{\partial z}{\partial x}$ we find, $$\frac{\partial z}{\partial x}=-\frac{\cos x}{2 z}.$$ Now substituting back into \eqref{imdeq}, we find $$\frac{ \partial ^2z}{\partial x\partial y}=\left(\sec ^2y\right)\left(-2z^{-2}\right)\left(-\frac{\cos x}{2 z}\right).$$ Therefore, after simplifying $$\frac{ \partial ^2z}{\partial x\partial y}=\frac{\cos x \sec ^2y}{4z^3}$$

Example. Use implicit differentiation to find $\frac{ \partial ^2z}{\partial x\partial y}$ given $$\frac{1}{x}+\frac{1}{y}+\frac{1}{z}=3.$$

Solution. Using implicit differentiation with respect to $y$ we find $-y^{-2}-z^{-2}z_y=0$ and solving for $z_y$ yields $$z_y=\frac{y^{-2}}{-z^{-2}}=-\frac{z^2}{y^2}.$$ Using implicit differentiation with respect to $x$ we find, $$\label{imdou} z_{y x}=\frac{-1}{y^2} 2 z \\ z_x$$ and so we need to find $z_x$ in order to finish with $z_{y x}.$ So using implicit differentiation with respect to $x$ we find, $-x^{-2}-z^{-2} z_x =0$ and solving for $z_x,$ yields $$z_x=-\frac{z^2}{x^2}$$ which is easily seen from the symmetry of the given equation. Now then we substitute into \eqref{imdou} and find $$z_{y x}=\frac{-1}{y^2}2 z \left(-\frac{z^2}{x^2}\right)=\frac{2z^3}{x^2y^2}$$ as desired.

## Verifying Partial Differential Equations

Example. Verify that the function $u(x,t)=\sin (x-a t)$ is a solution of the wave equation $$\frac{ \partial ^2u}{ \partial t^2}=a^2\frac{ \partial^2u}{\partial x^2}.$$ where $a$ is a constant.

Solution. We find that $u_x=\cos (x-a t)$, $u_{x x}=-\sin (x-a t)$, $u_t=-a \cos (x-a t)$, and $u_{t t}=-a^2\sin (x-a t)=a^2u_{x x}.$ We verify as follows:
$$u_{t t} =-a^2\sin (x-a t) =a^2u_{x x}.$$

Example. Verify that the function $u(x,y)=e^x \sin y$ is a solution of Laplace‘s equation $$\frac{\partial ^2u}{\partial x^2}+\frac{\partial ^2u}{\partial y^2}=0.$$

Solution. We find that $u_x=e^x \sin y$, $u_{x x}=e^x \sin y$, $u_y=e^x \cos y$, and $u_{y y}=-e^x \sin y.$ We verify as follows $$u_{x x}+u_{y y}=e^x \sin y-e^x \sin y=0.$$

Example. Verify that the functions $$u(x,y)=\ln \left(x^2+y^2\right) \quad \text{and} \quad v(x,y)=2\tan ^{-1}\left(\frac{y}{x}\right)$$ satisfy the Cauchy-Riemann equations $$\frac{\partial u}{\partial x}=\frac{\partial v}{\partial y} \qquad \text{and} \qquad \frac{\partial u}{\partial y}=-\frac{\partial v}{\partial x}.$$

Solution. We find that $$\frac{\partial u}{\partial x}=\frac{2x}{x^2+y^2}=\frac{\partial v}{\partial y}$$ and $$\frac{\partial u}{\partial y}=\frac{2y}{x^2+y^2}=-\left(-\frac{2y}{x^2+y^2}\right)=-\frac{\partial v}{\partial y}.$$

Example. Verify that the function $$u=1\left/\sqrt{x^2+y^2+z^2}\right.$$ is a solution of the three-dimensional Laplace equation $u_{x x}+u_{y y}+u_{z z}=0.$

Solution. We compute \begin{array}{llll} u_x=-\frac{x}{\left(x^2+y^2+z^2\right)^{3/2}} & \qquad u_{x x}=\frac{2 x^2-y^2-z^2}{\left(x^2+y^2+z^2\right)^{5/2}} \\ u_y=-\frac{y}{\left(x^2+y^2+z^2\right)^{3/2}} & \qquad u_{y y}=-\frac{x^2-2 y^2+z^2}{\left(x^2+y^2+z^2\right)^{5/2}} \\ u_z=-\frac{z}{\left(x^2+y^2+z^2\right)^{3/2}}
\end{array} We verify as follows $$\frac{2 x^2-y^2-z^2}{\left(x^2+y^2+z^2\right)^{5/2}}-\left[\frac{x^2-2 y^2+z^2}{\left(x^2+y^2+z^2\right)^{5/2}}\right]-\left[\frac{x^2+y^2-2 z^2}{\left(x^2+y^2+z^2\right)^{5/2}}\right]=0.$$

Example. Show that the function $z=x e^y+y e^x$ is a solution of the partial differential equation $$z_{x x x}+z_{y y y}=x z_{x y y}+y z_{x x y}.$$

Solution. The needed partial derivatives are $$\begin{array}{lllll} z_x=e^y+e^x y && z_{y y}=e^y x && z_{y y y}=e^y x \\ z_y=e^x+e^y x && z_{x y}=e^x+e^y && z_{x y y}=e^y\ z_{x x}=e^x y && z_{x x x}=e^x y && z_{x x y}=e^x. \end{array}$$ We verify as follows
z_{x x x}+z_{y y y}=e^x y+e^y x =x\left(e^y\right)+y\left(e^x\right)=x z_{x y y}+y z_{x x y} as desired.

## Exercises on Partial Derivatives

Exercise. Find $f_{x z}+f_{y z}$ given $f(x,y,z)=16e^{-\left(x^2+y^2+z^2\right)}.$

Exercise. Find $\frac{\partial x}{\partial y}$ when $x^2 y^2=2z^2.$

Exercise. Let $f(x,y,z)=x \cos y z.$ Find $f_{xyz}.$

Exercise. Find $z_y$ if $y^2 z^2+x \sin y z =3.$

Exercise. Let $z=f(x,y)$ be a differentiable function where $x$ and $y$ are both differentiable functions of $s, t$, and $v.$ Find $z_v$

Exercise. The function $z=f(x,y)$ is implicitly defined by the equation
$xy^2-x^2e^z+yz^2=0.$ What is $\frac {\partial z}{\partial x}$?

Exercise. Find the first and second order partial derivatives.

$(1) \quad f(x,y)=(x^2-2x y+y)^5$

$(2) \quad f(x,y)=\ln (\sin x y).$

$(3) \quad f(x,y)=(x+x y+y)^3$

$(4) \quad f(x,y)=\ln (2x+3y).$

$(5) \quad f(x,y)=(x+x y+10y)^{-2}-x y^2$

$(6) \quad f(x,y)=\ln (2x+3y).$

$(7) \quad f(x,y)=\left(\sin \sqrt{x}\right)\ln y^2$

$(8) \quad f(x,y)=\tan \left(\sqrt{x}\ln y^2\right)$

$(9) \quad f(x,y)=x^2e^{x+y}\cos y.$

$(10) \quad f(x,y)=\cos ^{-1}(x y).$

$(11) \quad f(x,y,z)=\frac{x+y^2}{z}.$

$(12) \quad f(x,y,z)=\sin (x y+z).$

Exercise. Determine the partial derivatives $\frac{ \partial z}{\partial x}$ and $\frac{ \partial z}{\partial y}$ by differentiating implicitly.

$(1) \quad 3 x^2y+y^3z-z^2=1$

$(2) \quad \ln (x y+y z+x z)=5$

Exercise. Compute the slope of the tangent line to the graph of the function $f(x,y)=x^2 \sin (x+y)$ at the point $\left(\frac{\pi }{2},\frac{\pi }{2},0\right)$ in the direction of the $x z$-plane and of the $y z$-plane.

Exercise. Determine the partial derivatives $f_x$ and $f_y$ given $$f(x,y)=\int _x^y\left(t^2+2t+1\right)dt.$$

Exercise. Show that the function $f(x,y)=\ln \left(x^2+y^2\right)$ is harmonic on the $x y$-plane with the point $(0,0)$ removed.

Exercise. Show that the mixed partial derivatives are identical.

$(1) \quad f(x,y)=\cos x y^2$

$(2) \quad f(x,y)=\left(\sin ^2x\right)(\sin y)$

Exercise. Let $f$ be the function defined by $$f(x,y,z)=x^2+y^2-2 x y \cos z.$$ Determine $f_{x z y}-f_{y z z}.$

Exercise. Determine $f_x, f_y,$ and $f_z.$

$(1) \quad f(x,y,z)=\ln \left(x+y^2+z^3\right)$

$(2) \quad f(x,y,z)=\frac{x y+y z}{x z}$

Exercise. Assume $z=f(x,y),$ determine $\frac{\partial f}{\partial x}$ and
$\frac{\partial f}{\partial y}$ by differentiating implicitly.

$(1) \quad x^3-x y^2+y z^2-z^3=0$

$(2) \quad \sqrt{x}+y^2+\sin x z=2.$

Exercise. Show that $f_x(0,0)=0$ but $f_y(0,0)$ does not exist, given the following function. $$f(x,y)= \begin{cases} \left(x^2+y\right)\sin \left(\frac{1}{x^2+y^2}\right) & \text{if} (x,y)\neq (0,0) \\ 0 & \text{if} (x,y)=(0,0). \end{cases}$$

Exercise. The partial differential equation $$\frac{ \partial ^2z}{\partial t^2}=c^2\frac{ \partial ^2z}{\partial x^2}.$$ is often called the heat equation. Determine whether the function satisfies the heat equation.

$(1) \quad z=e^{-t}\left(\sin \frac{x}{c}+\cos \frac{x}{c}\right)$

$(2) \quad z=\sin (3 c t) \sin (3 x)$

$(3) \quad z=\sin (5 c t) \cos (5x)$

$(4) \quad z=\tan (5 c t) \cot (5x)$

Exercise. The Cauchy-Riemann equations are $$\frac{\partial u}{\partial x}=\frac{\partial v}{\partial y} \quad \text{and} \quad \frac{\partial u}{\partial y}=-\frac{\partial v}{\partial x}$$ where $u$ and $v$ are functions of $x$ and $y.$ Determine which pair of functions $u$ and $v$ satisfies the Cauchy-Riemann equations.

$(1) \quad u=e^{-x}\cos y, v=e^{-x}\sin y$

$(2) \quad u=x^2+y^2, v=2 x y$