# Partial Derivatives

## Definition of Partial Derivatives

Let $$f(x,y)$$ be a function with two variables. If we keep $$y$$ constant and differentiate $$f$$ (assuming $$f$$ is differentiable) with respect to the variable $$x$$, using the rules and formulas of differentiation, we obtain what is called the partial derivative of $$f$$ with respect to $$x$$ which is denoted by $\frac{\partial f}{\partial x} \; \text{or} \; f_x$ Similarly If we keep $$x$$ constant and differentiate $$f$$ (assuming $$f$$ is differentiable) with respect to the variable $$y$$, we obtain what is called the partial derivative of $$f$$ with respect to $$y$$ which is denoted by $\frac{\partial f}{\partial y} \; \text{or} \; f_y$ We might also use the limits to define partial derivatives of function $$f$$ as follows: $\frac{\partial f}{\partial x} = \lim_{h\to 0} \frac{f(x+h,y)-f(x,y)}{h}$ and $\frac{\partial f}{\partial y} = \lim_{k\to 0} \frac{f(x,y+k)-f(x,y)}{k}$

## Examples with Detailed Solutions

We now present several examples with detailed solution on how to calculate partial derivatives.

### Example 1

Find the partial derivatives $$f_x$$ and $$f_y$$ if $$f(x , y)$$ is given by $f(x,y) = x^2 y + 2 x + y$ Solution to Example 1:
Assume $$y$$ is constant and differentiate with respect to $$x$$ to obtain \begin{align*} f_x &= \frac{\partial f}{\partial x} = \frac{\partial}{\partial x}(x^2 y + 2 x + y ) \\ &= \frac{\partial}{\partial x}(x^2 y ) + \frac{\partial}{\partial x}(2 x) + \frac{\partial}{\partial x}( y ) = 2 xy + 2 + 0 = 2xy + 2 \end{align*} Assume $$x$$ is constant and differentiate with respect to $$y$$ to obtain \begin{align*} f_y &= \frac{\partial f}{\partial y} = \frac{\partial}{\partial y}(x^2 y + 2 x + y ) \\ &= \frac{\partial}{\partial y}(x^2 y ) + \frac{\partial}{\partial y}(2 x) + \frac{\partial}{\partial y}( y ) = x^2 + 0 + 1 = x^2 + 1 \end{align*}

### Example 2

Find the partial derivatives $$f_x$$ and $$f_y$$ if $$f(x , y)$$ is given by $f(x,y) = \sin(x y) + \cos x$ Solution to Example 2:
Differentiate with respect to $$x$$ assuming $$y$$ is constant \begin{align*} f_x &= \frac{\partial f}{\partial x} = \frac{\partial}{\partial x}(\sin(x y) + \cos x ) \\ &= \frac{\partial}{\partial x}(\sin(x y) ) + \frac{\partial}{\partial x}(\cos x) = y \cos(x y) -\sin(x) \end{align*} Differentiate with respect to $$y$$ assuming $$x$$ is constant \begin{align*} f_y &= \frac{\partial f}{\partial y} = \frac{\partial}{\partial y}(\sin(x y) + \cos x ) \\ &= \frac{\partial}{\partial y}(\sin(x y) ) + \frac{\partial}{\partial y}(\cos x) = x \cos(x y) - 0 = x \cos(x y) \end{align*}

### Example 3

Find $$f_x$$ and $$f_y$$ if $$f(x , y)$$ is given by $f(x,y) = x e^{x y}$ Solution to Example 3:
Differentiate with respect to $$x$$ assuming $$y$$ is constant using the product rule of differentiation. \begin{align*} f_x &= \frac{\partial f}{\partial x} = \frac{\partial}{\partial x}(x e^{x y}) \\ &= \frac{\partial}{\partial x}(x) e^{x y} + x \frac{\partial}{\partial x}(e^{x y}) = 1 \cdot e^{x y} + x \cdot y e^{x y} = (1+xy) e^{x y} \end{align*} Differentiate with respect to $$y$$ assuming $$x$$ is constant. \begin{align*} f_y &= \frac{\partial f}{\partial y} = \frac{\partial}{\partial y}(x e^{x y}) \\ &= x \frac{\partial}{\partial y}(e^{x y}) = x \cdot x e^{x y} = x^2 e^{x y} \end{align*}

### Example 4

Find $$f_x$$ and $$f_y$$ if $$f(x , y)$$ is given by $f(x,y) = \ln(x^2+2y)$ Solution to Example 4:
Differentiate with respect to $$x$$ to obtain \begin{align*} f_x &= \frac{\partial f}{\partial x} = \frac{\partial}{\partial x}(\ln(x^2+2y)) \\ &= \frac{\partial}{\partial x}(x^2+2y) \cdot \frac{1}{x^2+2y} = \frac{2x}{x^2+2y} \end{align*} Differentiate with respect to $$y$$ \begin{align*} f_y &= \frac{\partial f}{\partial y} = \frac{\partial}{\partial y}(\ln(x^2+2y)) \\ &= \frac{\partial}{\partial y}(x^2+2y) \cdot \frac{1}{x^2+2y} = \frac{2}{x^2+2y} \end{align*}

### Example 5

Find $$f_x(2 , 3)$$ and $$f_y(2 , 3)$$ if $$f(x , y)$$ is given by $f(x,y) = y x^2 + 2 y$ Solution to Example 5:
We first find the partial derivatives $$f_x$$ and $$f_y$$ $f_x(x,y) = 2x y$ $f_y(x,y) = x^2 + 2$ We now calculate $$f_x(2 , 3)$$ and $$f_y(2 , 3)$$ by substituting $$x$$ and $$y$$ by their given values $f_x(2,3) = 2 (2)(3) = 12$ $f_y(2,3) = 2^2 + 2 = 6$

## Exercises

Find partial derivatives $$f_x$$ and $$f_y$$ of the following functions
1. $$f(x , y) = x e^{x + y}$$
2. $$f(x , y) = \ln ( 2 x + y x)$$
3. $$f(x , y) = x \sin(x - y)$$

### Answers to the Above Exercises

1. $$f_x =(x + 1)e^{x + y} \quad$$ , $$\quad f_y = x e^{x + y}$$
2. $$f_x = 1 / x \quad$$ , $$\quad f_y = 1 / (y + 2)$$
3. $$f_x = x \cos (x - y) + \sin (x - y) \quad$$, $$\quad f_y = -x \cos (x - y)$$

## More References and Links to Partial Derivatives and Mtlivariable Functions

Partial Derivative Calculator
Tables of Formulas for Derivatives
Rules of Differentiation of Functions in Calculus
Multivariable Functions