# 14.4 | Gradients and Directional Derivatives in the Plane

If $$f$$ is a function of two variables $$x$$ and $$y$$, then the gradient of $$f$$ is the vector $$\nabla f$$ defined by
\begin{aligned} \nabla f(x,y) & = \left \langle f_x(x,y), f_y(x,y) \right \rangle \\ & = \frac{\partial f}{\partial x} \mathbf{i} + \frac{\partial f}{\partial y} \mathbf{j} \end{aligned}
The directional derivative of $$f$$ at $$(x_0,y_0)$$ in the direction of a unit vector $$\mathbf{u}= \left \langle a, b \right \rangle$$ is

$$D_u f(x_0,y_0) = \lim_{h \rightarrow 0} \frac{f(x_0 + ha, y_0 + hb) – f(x_0, y_0)}{h}$$
\begin{aligned} D_u & f(x_0,y_0) \\ &= \lim_{h \rightarrow 0} \frac{f(x_0 + ha, y_0 + hb) – f(x_0, y_0)}{h} \end{aligned}

if this limit exists.

If $$f$$ is a differentiable function of $$x$$ and $$y$$, then $$f$$ has a directional derivative in the direction of any unit vector $$\mathbf{u} = \left \langle a,b \right \rangle$$ and
\begin{aligned} D_u f(x,y) & = f_x(x,y) a + f_y (x,y) b \\ & = \left \langle f_x(x,y), f_y(x,y) \right \rangle \cdot \left \langle a,b \right \rangle \end{aligned}
If $$\mathbf{u} = \left \langle a,b \right \rangle$$ makes an angle $$\theta$$ with the positive $$x$$-axis then

$$D_u f(x,y) = \left \langle f_x(x,y), f_y(x,y) \right \rangle \cdot \left \langle \cos \theta, \sin \theta \right \rangle$$
\begin{aligned} D_u & f(x,y) \\ &= \left \langle f_x(x,y), f_y(x,y) \right \rangle \cdot \left \langle \cos \theta, \sin \theta \right \rangle \end{aligned}
Suppose $$f$$ is a differentiable function of two or three variables. The maximum value of the directional derivative $$D_u f(\mathbf{x})$$ is $$\left| \nabla f(\mathbf{x})\right|$$ and it occurs when $$\mathbf{u}$$ has the same direction as the gradient vector $$\nabla f(\mathbf{x})$$.
An equation for the tangent plane to the surface $$z = f(x,y)$$ at $$(x_0, y_0, z_0)$$ is given by
$$\nabla F (x_0,y_0,z_0) \cdot \left \langle x-x_0, y-y_0, z-z_0 \right \rangle = 0$$
where $$F(x,y,z) = f(x,y) – z = 0$$.
Let $$f(x,y) = x^3 y^2 – y^4$$. Find the directional derivative of $$f$$ at $$(2,1)$$ in the of a vector $$\mathbf{u}$$ that makes an angle of $$\pi/6$$ with the positive $$x$$-axis.

\begin{aligned} D_u f(x,y) & = \left \langle f_x(x,y), f_y(x,y) \right \rangle \cdot \left \langle \cos \theta, \sin \theta \right \rangle \\ & = \left \langle 3x^2 y^2, 2x^3y – 4y^3 \right \rangle \cdot \left \langle \cos (\pi/6), \sin (\pi/6) \right \rangle \\ & = \left \langle 3x^2 y^2, 2x^3y – 4y^3 \right \rangle \cdot \left \langle \sqrt{3}/2, 1/2 \right \rangle \\ \end{aligned}
\begin{aligned} & D_u f(x,y) \\ & = \left \langle f_x(x,y), f_y(x,y) \right \rangle \cdot \left \langle \cos \theta, \sin \theta \right \rangle \\ & = \left \langle 3x^2 y^2, 2x^3y – 4y^3 \right \rangle \cdot \left \langle \cos (\pi/6), \sin (\pi/6) \right \rangle \\ & = \left \langle 3x^2 y^2, 2x^3y – 4y^3 \right \rangle \cdot \left \langle \sqrt{3}/2, 1/2 \right \rangle \\ \end{aligned}

So,
\begin{aligned} D_u f(2,1) & = \left \langle 12, 12 \right \rangle \cdot \left \langle \sqrt{3}/2, 1/2 \right \rangle \\ & = 6\sqrt{3} + 6 \end{aligned}

1. Let $$f(x,y) = 9 \cos x \sin y$$ and let $$S$$ be the surface $$z = f(x,y)$$. Find a unit vector $$\vec{u}$$ that is normal to the surface $$S$$ at the point $$(0, \pi/2, 9)$$.
2. What is an equation of the tangent plane to the surface $$S$$ at the point $$(0, \pi/2, 9)$$?

1. Let $$F(x,y,z) = 9 \cos x \sin y – z$$, then $$\nabla F = \langle -9 \sin x \sin y, 9 \cos x \cos y, -1 \rangle$$. A normal to the surface at $$(0, \pi/2, 9)$$ is given by $$\nabla F(0, \pi/2, 9) = \langle 0,0,1 \rangle$$, which is already unit.
2. An equation of the tangent plane to the surface $$S$$ at the point $$(0, \pi/2, 9)$$ is given by
$$\nabla F (0, \pi/2, 9) \cdot \left \langle x, y-\pi/2, z-9 \right \rangle = 0.$$
So, an equation for the tangent plane is $$z = 9$$.