# Directional Derivatives Examples 1

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 2 pages.

## Example 1

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

We first note that $\vec{v} = (1, 4)$ is not a unit vector, since $\| \vec{v} \| = \sqrt{1^2 + 4^2} = \sqrt{17} \neq 1$. Thus let $\vec{u} = \left ( \frac{1}{\sqrt{17}}, \frac{4}{\sqrt{17}} \right)$, which is a unit vector in the same direction as $\vec{v}$.

Now the partial derivatives of this function are $\frac{\partial z}{\partial x} = 2ex \cos y – \frac{2y^2}{x}$, and $\frac{\partial z}{\partial y} = -ex^2 \sin y – 4 \ln (x) y$. Therefore we have that:

(3)

## Example 2

**Find the directional derivative of $z = f(x, y) = \frac{x^2 – y^2}{x^2 + y^2}$ in the direction of the unit vector $\vec{u}$ whose angle $\theta = \frac{\pi}{3}$ with the positive $x$-axis when positioned at the origin.**

We note that the angle if $\vec{u} = (\cos \theta, \sin \theta)$ then $\| \vec{u} \| = \sqrt{\cos ^2 \theta + \sin ^2 \theta} = 1$. Therefore, $\vec{u} = \left ( \cos \frac{\pi}{3}, \sin \frac{\pi}{3} \right ) = \left ( \frac{1}{2}, \frac{\sqrt{3}}{2} \right )$ is the unit vector whose angle $\theta = \frac{\pi}{3}$ with the positive $x$-axis when positioned at the origin.

Now the partial derivatives of $f$ are $\frac{\partial z}{\partial x} = \frac{(x^2 + y^2)(2x) – (x^2 – y^2)(2x)}{(x^2 + y^2)^2}$ and $\frac{\partial z}{\partial y} = \frac{(x^2 + y^2)(-2y) – (x^2 – y^2)(2y)}{(x^2 + y^2)^2}$. Therefore we have that:

(4)

The answer above can be simplified drastically, but we will leave this to the reader.

## Example 3

**Let $w = f(x, y) = 2x^2y^4z$. Determine the rate of change of $w$ in the direction of the vector $\vec{u} = \left ( \frac{1}{\sqrt{14}}, \frac{2}{\sqrt{14}}, \frac{3}{\sqrt{14}} \right )$ at $(1, 2, 3) \in D(f)$.**

We first note that $\vec{u}$ is already a unit vector.

The partial derivatives of $f$ are $\frac{\partial w}{\partial x} = 4xy^4z$, $\frac{\partial w}{\partial y} = 8x^2y^3z$, and $\frac{\partial w}{\partial z} = 2x^2y^4$. Therefore we have that:

(5)

Inputting $(1, 2, 3)$ and we get that:

(6)