PAGE 1

15.5 Directional Derivative and the Gradient

If \( z = f(x, y) \)

we know \( \frac{\partial f}{\partial x} = f_x \) is the rate of change of \( f \) with respect to \( x \) while \( y \) is constant

\( \frac{\partial f}{\partial y} = f_y \) same idea, but \( x \) is fixed and \( y \) varies.

There is a physical interpretation of \( f_x \) and \( f_y \)

Contour plot on x-y axes showing concentric level curves labeled with heights 1100 to 1400.
Level curves of height of a hill

Here, \( f_x \) tells us how fast the height changes if we walk in \( x \) direction (East)

\( f_y \) tells us how \( f \) changes if we go in \( y \) direction (North)

But what if we go in a direction such as North-East?

PAGE 2
A 3D topographical map of a mountain with horizontal slices projected onto a 2D plane as level curves.

level curves

each curve \( \rightarrow \) particular \( z \)

PAGE 3

The directional derivative tells us how \( f \) changes given a direction

Let \( \vec{u} = \langle a, b \rangle \) be a unit vector

then the rate of change of \( f(x, y) \) in the direction of \( \vec{u} \) is

\[ D_{\vec{u}} f(x, y) = \lim_{h \to 0} \frac{f(x + ah, y + bh) - f(x, y)}{h} \]

note if \( \vec{u} = \langle 1, 0 \rangle \) then \( D_{\vec{u}} f(x, y) = f_x \)

\( \vec{u} = \langle 0, 1 \rangle \) then \( D_{\vec{u}} f(x, y) = f_y \)

With some algebra, we can rewrite the formula as

\[ D_{\vec{u}} f(x, y) = \frac{\partial f}{\partial x}(x, y) a + \frac{\partial f}{\partial y}(x, y) b \]

\[ = f_x a + f_y b \]

where \( \vec{u} = \langle a, b \rangle \) is the unit vector specifying direction
PAGE 4

Example

\( f(x, y) = \cos(2x + 3y) \)

Find the rate of change of \( f(x, y) \) at \( (2, 1) \) in the direction toward the origin.

\( \vec{u} \) is very important

A 2D coordinate system showing a vector u pointing from the point (2,1) towards the origin (0,0).

from \( (2, 1) \) to origin \( \rightarrow \langle -2, -1 \rangle \)

\[ \vec{u} = \frac{\langle -2, -1 \rangle}{|\langle -2, -1 \rangle|} = \frac{\langle -2, -1 \rangle}{\sqrt{5}} = \left\langle \frac{-2}{\sqrt{5}}, \frac{-1}{\sqrt{5}} \right\rangle \]

\( D_{\vec{u}} f(x, y) = f_x(x, y) a + f_y(x, y) b \)

\( f_x = -2 \sin(2x + 3y) \)
\( f_x(2, 1) = -2 \sin(7) \)

\( f_y = -3 \sin(2x + 3y) \)
\( f_y(2, 1) = -3 \sin(7) \)

\[ D_{\vec{u}} f(2, 1) = -2 \sin(7) \cdot \frac{-2}{\sqrt{5}} - 3 \sin(7) \cdot \frac{-1}{\sqrt{5}} = \boxed{\frac{7}{\sqrt{5}} \sin(7)} \]

PAGE 5

back to \( D_{\vec{u}} f = f_x a + f_y b \)

note this is also \( D_{\vec{u}} f = \langle f_x, f_y \rangle \cdot \langle a, b \rangle \)

this vector contains rates of change

we call this vector the Gradient

\( \vec{u} \) : unit vector giving direction

gradient of \( f(x, y) \) :

\[ \nabla f(x, y) = \langle f_x(x, y), f_y(x, y) \rangle \]

\[ = \frac{\partial f}{\partial x}(x, y) \vec{i} + \frac{\partial f}{\partial y}(x, y) \vec{j} \]

"del"

\[ D_{\vec{u}} f = \nabla f \cdot \vec{u} \]

directional deriv: scalar projection onto \( \vec{u} \)

PAGE 6

Directional Derivatives and the Gradient Vector

What does its magnitude and direction mean?

\[ D_{\vec{u}} f = \vec{\nabla} f \cdot \vec{u} \]

Recall: \( \vec{a} \cdot \vec{b} = |\vec{a}| |\vec{b}| \cos \theta \)

Diagram showing two vectors a and b with an angle theta between them.

Since \( \vec{u} \) is a unit vector, its magnitude is 1.

\[ D_{\vec{u}} f = |\vec{\nabla} f| |\vec{u}| \cos \theta \]\[ = |\vec{\nabla} f| \cos \theta \]

Since \( -1 \le \cos \theta \le 1 \), we have:

\[ -|\vec{\nabla} f| \le D_{\vec{u}} f \le |\vec{\nabla} f| \]

This means the magnitude of the gradient is the maximum directional derivative.

If \( \vec{u} \) is in the same direction as \( \vec{\nabla} f \), then \( \theta = 0 \) and \( \cos \theta = 1 \).

Two parallel vectors u and grad f pointing in the same direction.

So \( D_{\vec{u}} f = |\vec{\nabla} f| \) (max) \( \rightarrow \) \( \vec{u} \) is in the direction of maximum or greatest ascent.

If \( \vec{u} \) is opposite to \( \vec{\nabla} f \), then \( \vec{u} \) is the direction of greatest descent.

PAGE 7

Note: \( D_{\vec{u}} f = \vec{\nabla} f \cdot \vec{u} = 0 \) if \( \vec{\nabla} f \perp \vec{u} \) (if the gradient is orthogonal to \( \vec{u} \)).

Remember, a level curve is where \( z = f(x,y) = \text{constant} \).

So if \( \vec{u} \) is along a level curve (\( \vec{u} \parallel \) tangent of level curve), then \( D_{\vec{u}} f = 0 \).

Therefore, the gradient is orthogonal to a level curve.

Concentric level curves on a coordinate plane with gradient vectors perpendicular to them.
A single level curve with a tangent line and an orthogonal gradient vector.

We can use the gradient and \( D_{\vec{u}} f \) to find the slope of the level curve.

PAGE 8
A level curve z=z0 on a coordinate plane with a point (x0, y0) marked.

We can "parametrize" the level curve as:

\[ \vec{r}(t) = \langle x(t), y(t) \rangle \]

At the point \( (x_0, y_0) \):

\[ D_{\vec{u}} f(x_0, y_0) = \vec{\nabla} f(x_0, y_0) \cdot \vec{u} \]

If \( \vec{u} \) is along a level curve, then it's tangent to the level curve \( \vec{r}(t) \).

\[ \text{So, } \vec{u} = \frac{\vec{r}'(t)}{|\vec{r}'(t)|} = \frac{\langle \frac{dx}{dt}, \frac{dy}{dt} \rangle}{|\langle \frac{dx}{dt}, \frac{dy}{dt} \rangle|} \]

Along level curve, \( D_{\vec{u}} f = 0 \).

\[ \text{So, } \langle f_x, f_y \rangle \cdot \frac{\langle \frac{dx}{dt}, \frac{dy}{dt} \rangle}{|\langle \frac{dx}{dt}, \frac{dy}{dt} \rangle|} = 0 \rightarrow f_x \frac{dx}{dt} + f_y \frac{dy}{dt} = 0 \]
\[ \text{Then, } \frac{\frac{dy}{dt}}{\frac{dx}{dt}} = \frac{dy}{dx} = -\frac{f_x}{f_y} \]

This is the slope of a level curve.

PAGE 9

Example

\( f(x,y) = x e^y \)

Find the slope of level curve at \( x=1, y=2 \).

From last page,

\[ \frac{dy}{dx} = -\frac{f_x}{f_y} \]\[ = -\frac{e^y}{x e^y} = -\frac{1}{x} \]

At \( (1,2) \),

\[ \frac{dy}{dx} = -\frac{1}{1} = -1 \]
Graph of a level curve passing through (1,2) with a tangent line of slope -1.
PAGE 10

Please submit your reflections by using the CourseMIRROR App

If you are having a problem with CourseMIRROR, please send an email to coursemirror.development@gmail.com