# Directional Derivatives Examples 2

Recall from the Directional Derivatives page that for a two variable real-valued function $z = f(x, y)$, the directional derivative of $f$ at a point $(x, y) \in D(f)$ in the direction of the unit vector $\vec{u} = (a, b)$ is given by the formula:

(1)

For a three variable real-valued function $w = f(x, y, z)$, the directional derivative of $f$ at a point $(x, y, z) \in D(f)$ in the direction of the unit vector $\vec{u} = (a, b, c)$ is given by the formula:

(2)

We will now look at some examples of calculating directional derivatives. More examples can be found on the Directional Derivatives Examples 1 and Directional Derivatives Examples 3 pages.

## Example 1

**Find the directional derivative of $z = f(x, y) = e^x \sin y$ at $\left ( 0, \frac{\pi}{3} \right )$ in the direction of the vector $\vec{v} = (-6, 8)$.**

We first note that $\vec{v}$ is not a unit vector. Let’s find a unit vector that goes in the direction of $\vec{v}$. We have that $\| \vec{v} \| = \sqrt{(-6)^2 + (8)^2} = \sqrt{36+64} = 10$, and so $\vec{u} = \left ( \frac{-6}{10}, \frac{8}{10} \right ) = \left ( \frac{-3}{5}, \frac{4}{5} \right )$ is a unit vector in the direction of $\vec{v}$.

Now we compute the partial derivatives of $f$. We have that $\frac{\partial z}{\partial x} = e^x \sin y$ and $\frac{\partial z}{\partial y} = e^x \cos y$. Therefore:

(3)

## Example 2

**Find the directional derivative of $z = f(x, y) = x^4 – x^2y^3$ at $(2, 1)$ in the direction of the vector $\vec{v} = (1, 3)$.**

We first note that $\vec{v}$ is not a unit vector. Let’s find a unit vector that goes in the direction of $\vec{v}$. We have that $\| \vec{v} \| = \sqrt{(1)^2 + (3)^2} = \sqrt{10}$, and so $\vec{u} = \left (\frac{1}{\sqrt{10}}, \frac{3}{\sqrt{10}} \right )$ is a unit vector in the direction of $\vec{v}$.

Now we compute the partial derivatives of $f$. We have that $\frac{\partial z}{\partial x} = 4x^3 -2xy^3$ and $\frac{\partial z}{\partial y} = -3x^2y^2$. Therefore:

(4)

## Example 3

**Find the directional derivative of $w = f(x, y, z) = xe^y + ye^z + ze^x$ at $(0, 0, 0)$ in the direction of the vector $\vec{v} = (5, 1, -2)$.**

Once again, we note that $\vec{v}$ is not a unit vector, so let’s find a unit vector that goes in the direction of $\vec{v}$. We have that $\| \vec{v} \| = \sqrt{(5)^2 + (1)^2 + (-2)^2} = \sqrt{30}$. So $\vec{u} = \left ( \frac{5}{\sqrt{30}}, \frac{1}{\sqrt{30}}, \frac{-2}{\sqrt{30}} \right)$ is a unit vector in the direction of $\vec{v}$.

Now we compute the partial derivatives of $f$. We have that $\frac{\partial w}{\partial x} = e^y + ze^x$, $\frac{\partial w}{\partial y} = xe^y + e^z$, and $\frac{\partial w}{\partial z} = ye^z + e^x$. Therefore:

(5)