MA 261 - Lesson 13: Directional Derivative & Gradient (Section 15.5)

Page 1

Page 1: Lesson title and announcements
Original handwritten page 1

Announcements:

Office Hours:


Page 2

Page 2: Review example of chain rule with multiple variables
Original handwritten page 2

Review Example: Chain Rule

Example: Apply the Chain Rule

Given \(f(x,y,z) = xy^2 + z^3\), where \(x = \cos u + t^3\), \(y = \sin t + u^3\), and \(z = t^2\), find \(\frac{\partial f}{\partial u}\) and \(\frac{\partial f}{\partial t}\).

Diagram Description: The page shows a dependency tree diagram illustrating how the function \(f\) depends on intermediate variables \(x\), \(y\), and \(z\), which in turn depend on the independent variables \(u\) and \(t\). The tree has \(f\) at the top, branching down to \(x\), \(y\), and \(z\), with each of these further branching to show their dependencies on \(u\) and \(t\).

Solution:

Using the multivariable chain rule:

\[\frac{\partial f}{\partial u} = \frac{\partial f}{\partial x} \cdot \frac{\partial x}{\partial u} + \frac{\partial f}{\partial y} \cdot \frac{\partial y}{\partial u} + \frac{\partial f}{\partial z} \cdot \frac{\partial z}{\partial u}\]

Computing the partial derivatives:

  • \(\frac{\partial f}{\partial x} = y^2\)
  • \(\frac{\partial f}{\partial y} = 2xy\)
  • \(\frac{\partial f}{\partial z} = 3z^2\)
  • \(\frac{\partial x}{\partial u} = -\sin u\)
  • \(\frac{\partial y}{\partial u} = 3u^2\)
  • \(\frac{\partial z}{\partial u} = 0\)

Therefore:

\[\frac{\partial f}{\partial u} = y^2(-\sin u) + 2xy \cdot 3u^2\]

Similarly, for \(\frac{\partial f}{\partial t}\):

\[\frac{\partial f}{\partial t} = \frac{\partial f}{\partial x} \cdot \frac{\partial x}{\partial t} + \frac{\partial f}{\partial y} \cdot \frac{\partial y}{\partial t} + \frac{\partial f}{\partial z} \cdot \frac{\partial z}{\partial t}\]

With:

  • \(\frac{\partial x}{\partial t} = 3t^2\)
  • \(\frac{\partial y}{\partial t} = \cos t\)
  • \(\frac{\partial z}{\partial t} = 2t\)

Therefore:

\[\frac{\partial f}{\partial t} = y^2 \cdot 3t^2 + 2xy \cdot \cos t + 3z^2 \cdot 2t\]

Page 3

Page 3: Recall of partial derivatives and their interpretation
Original handwritten page 3

Recall: Partial Derivatives

For a function \(z = f(x,y)\), we can visualize level curves \(f(x,y) = k\).

Graph Description: The page displays a contour plot showing level curves of a function in the \(xy\)-plane. The curves are labeled with values like \(z=0\), \(z=1\), \(z=5\), representing different heights on the surface. A point in the interior is marked, with arrows indicating the \(x\) and \(y\) directions.

Definition: The partial derivative with respect to \(x\) is:

\[f_x = \frac{\partial f}{\partial x} = \lim_{h \to 0} \frac{f(x+h, y) - f(x,y)}{h}\]

This represents how fast you are climbing the hill if you walk in the \(x\)-direction.

Definition: The partial derivative with respect to \(y\) is:

\[f_y = \frac{\partial f}{\partial y} = \lim_{h \to 0} \frac{f(x, y+h) - f(x,y)}{h}\]

This represents how fast you are climbing if you walk in the \(y\)-direction.


Page 4

Page 4: Introduction to directional derivatives
Original handwritten page 4

Directional Derivative for Two Variable Functions

Graph Description: The page shows the same contour plot as the previous page, with level curves labeled \(z=0\), \(z=1\), \(z=5\). At a point in the plot, there is an arrow labeled \(\vec{u}\) pointing in an arbitrary direction (not aligned with the \(x\) or \(y\) axes), illustrating a directional derivative in that direction.

For a function \(f(x,y)\), we have seen that partial derivatives tell us the rate of change in the coordinate directions. But what if we want to know the rate of change in an arbitrary direction?

Definition: Let \(\vec{u} = \langle u_1, u_2 \rangle\) be a unit vector. The directional derivative of \(f(x,y)\) in the direction of \(\vec{u}\) is:

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

This represents the rate of change of \(f(x,y)\) in the direction of \(\vec{u}\).

Algebra:

The directional derivative can be computed using the formula:

\[D_{\vec{u}} f = f_x u_1 + f_y u_2\]

Page 5

Page 5: Directional derivative for three variable functions
Original handwritten page 5

3 Variable Function

Definition: For a function \(f(x,y,z)\), let \(\vec{u} = \langle u_1, u_2, u_3 \rangle\) be a unit vector. The directional derivative in the direction of \(\vec{u}\) is:

\[D_{\vec{u}} f = f_x u_1 + f_y u_2 + f_z u_3\]

Page 6

Page 6: Example problem finding directional derivative
Original handwritten page 6
Example 1: Directional Derivative

Given \(f(x,y) = \sin(x^3 + 7y)\), find the directional derivative at \((0, \frac{\pi}{4})\) in the direction of \(\langle 2, 5 \rangle\).

Solution:

Step 1: Find the unit vector

First, we need to convert \(\langle 2, 5 \rangle\) to a unit vector:

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

So \(u_1 = \frac{2}{\sqrt{29}}\) and \(u_2 = \frac{5}{\sqrt{29}}\).

Step 2: Compute the partial derivatives
\[f_x = 3x^2 \cos(x^3 + 7y)\] \[f_y = 7 \cos(x^3 + 7y)\]
Step 3: Apply the directional derivative formula
\[D_{\vec{u}} f = f_x u_1 + f_y u_2 = 3x^2 \cos(x^3 + 7y) \cdot \frac{2}{\sqrt{29}} + 7 \cos(x^3 + 7y) \cdot \frac{5}{\sqrt{29}}\]

Evaluating at \((0, \frac{\pi}{4})\):

\[D_{\vec{u}} f\left(0, \frac{\pi}{4}\right) = \frac{-35}{\sqrt{29}}\]

Page 7

Page 7: Another example of directional derivative
Original handwritten page 7
Example 2: Directional Derivative

Given \(f(x,y) = x^2y + xy^2\), find the directional derivative at \((1,2)\) in the direction of \(\langle -1, -1 \rangle\).

Solution:

Step 1: Find the unit vector
\[\vec{u} = \frac{\langle -1, -1 \rangle}{|\langle -1, -1 \rangle|} = \frac{\langle -1, -1 \rangle}{\sqrt{2}} = \left\langle \frac{-1}{\sqrt{2}}, \frac{-1}{\sqrt{2}} \right\rangle\]
Step 2: Compute the partial derivatives
\[f_x = 2xy + y^2\] \[f_y = x^2 + 2xy\]
Step 3: Apply the directional derivative formula
\[D_{\vec{u}} f = f_x u_1 + f_y u_2 = (2xy + y^2)\left(\frac{-1}{\sqrt{2}}\right) + (x^2 + 2xy)\left(\frac{-1}{\sqrt{2}}\right)\]

Evaluating at \((1,2)\):

\[D_{\vec{u}} f(1,2) = (10)\left(\frac{-1}{\sqrt{2}}\right) + (5)\left(\frac{-1}{\sqrt{2}}\right) = \frac{-15}{\sqrt{2}}\]

Page 8

Page 8: Visualization of directional derivatives on level curves
Original handwritten page 8

Graph Description: The page shows a contour plot with several level curves labeled \(k=5\), \(k=6\), and \(k=7\). At a point \(C(1,2)\) on one of the curves, there are two vectors drawn: one labeled \(\langle 1, 1 \rangle\) pointing upward and to the right, and another labeled \(\langle -1, -1 \rangle\) pointing downward and to the left (in the opposite direction). The curve \(k=7\) is at the top of the diagram.

This visualization shows how the directional derivative varies depending on the direction of travel. Moving in the direction of \(\langle -1, -1 \rangle\) from point \((1,2)\) results in a negative rate of change (descending), while moving in the opposite direction \(\langle 1, 1 \rangle\) would result in a positive rate of change (ascending).


Page 9

Page 9: Introduction to gradient vector
Original handwritten page 9

Gradient Vector

Definition: For a function \(f(x,y)\), the gradient of \(f\) is the vector:

\[\nabla f = \langle f_x, f_y \rangle\]

The symbol \(\nabla\) is read as "nabla" or "del".

Definition: Similarly, for \(f(x,y,z)\), the gradient is:

\[\nabla f = \langle f_x, f_y, f_z \rangle\]

Directional Derivative using Gradient:

Let \(\vec{u} = \langle u_1, u_2 \rangle\) be a unit vector. Then:

\[D_{\vec{u}} f = f_x u_1 + f_y u_2 = \nabla f \cdot \vec{u}\]

This shows that the directional derivative equals the dot product of the gradient with the unit direction vector.


Page 10

Page 10: Question about maximizing directional derivative
Original handwritten page 10

Maximizing the Directional Derivative

Question: Given \(f(x,y) = x^2y + xy^2\) at \((1,2)\), can we find the direction \(\vec{u}\) such that \(D_{\vec{u}} f(1,2)\) is maximum?

Diagram Description: The page shows two parallel vectors: \(\vec{u}\) and \(\nabla f\), illustrating that when these vectors are parallel, the directional derivative is maximized. Below this are vectors \(\vec{u}\) and \(-\nabla f\) pointing in opposite directions, illustrating the minimum case.

Analysis:

We have:

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

where \(\theta\) is the angle between \(\vec{u}\) and \(\nabla f\).

Since \(|\vec{u}| = 1\) (unit vector), we have:

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

Maximum: \(\cos \theta\) is maximum when \(\cos \theta = 1\), which occurs when \(\theta = 0\). This means \(\vec{u}\) and \(\nabla f\) are parallel.

Therefore, the directional derivative is maximum when \(\vec{u}\) points in the direction of \(\nabla f\).

Minimum: \(\cos \theta\) is minimum when \(\cos \theta = -1\), which occurs when \(\theta = \pi\). This means \(\vec{u}\) and \(\nabla f\) are in opposite directions.

Therefore, the directional derivative is minimum when \(\vec{u}\) points in the direction of \(-\nabla f\).


Page 11

Page 11: Properties of gradient and example application
Original handwritten page 11

Properties of the Gradient

Theorem: Given \(f(x,y)\):

Example: Maximum and Minimum Rates of Change

For \(f(x,y) = x^2y + xy^2\) at \((1,2)\):

Solution:

First, compute the gradient:

\[\nabla f = \langle 2xy + y^2, x^2 + 2xy \rangle\]

At \((1,2)\):

\[\nabla f(1,2) = \langle 10, 5 \rangle\]

Maximum rate of increase: \(f(x,y)\) increases the fastest in the direction of \(\langle 10, 5 \rangle\).

Maximum rate of decrease: \(f(x,y)\) decreases the fastest in the direction of \(-\langle 10, 5 \rangle = \langle -10, -5 \rangle\).


Page 12

Page 12: Gradient is perpendicular to level curves
Original handwritten page 12

Gradient is Perpendicular to Level Curves

Theorem: The gradient \(\nabla f\) is perpendicular to the level curves at each point.

Proof:

Suppose \(\vec{r}(t) = \langle x(t), y(t) \rangle\) represents a level curve \(f(x,y) = k\).

Then \(\vec{r}'(t) = \langle x'(t), y'(t) \rangle\) is a tangent vector to the curve.

Since \(\vec{r}(t)\) satisfies \(f(x,y) = k\), we have \(f(x(t), y(t)) = k\) for all \(t\).

Differentiating both sides with respect to \(t\):

\[\frac{d}{dt}[f(x(t), y(t))] = \frac{d}{dt}[k]\] \[f_x \frac{dx}{dt} + f_y \frac{dy}{dt} = 0\] \[\nabla f \cdot \vec{r}'(t) = 0\]

This shows that \(\nabla f\) is perpendicular to the tangent vector \(\vec{r}'(t)\), meaning the gradient is perpendicular to the level curve.

Diagram Description: The page shows a level curve \(f=k\) in blue. At a point on the curve, the gradient vector \(\nabla f\) is drawn in red, pointing perpendicular to the curve. The tangent vector to the curve is also shown, demonstrating that it is orthogonal to the gradient.


Page 13

Page 13: Geometric interpretation of tangent and gradient directions
Original handwritten page 13

Geometric Interpretation

Diagram Description: The page shows several parallel level curves labeled \(k=0\), \(k=1\), \(k=3\). At a point \(x(t)\) on one of the curves, there are three vectors drawn: the tangent vector to the level curve (in black), the gradient vector \(\nabla f\) (in red) pointing perpendicular to the curve, and another vector in purple showing a different direction.

Key Insight: Going in the tangent direction (along the level curve), you are stuck on the same level curve. The directional derivative in this direction is zero.

Key Insight: Going in the gradient direction, you jump between level curves the fastest. This is the direction of steepest ascent.


Page 14

Page 14: Example finding slope of tangent line to level curve
Original handwritten page 14
Example: Find the Slope of the Tangent Line to a Level Curve

Given \(f(x,y) = x^2y^3\), find the slope of the tangent line to the level curve at \((-1, 1)\).

The tangent line is perpendicular to \(\nabla f\).

Solution:

First, compute the gradient:

\[\nabla f = \langle 2xy^3, 3x^2y^2 \rangle\]

At \((-1, 1)\):

\[\nabla f(-1,1) = \langle -2, 3 \rangle\]

The tangent vector to the level curve is perpendicular to \(\langle -2, 3 \rangle\).

A vector perpendicular to \(\langle -2, 3 \rangle\) is \(\langle 3, 2 \rangle\).

Therefore, the slope of the tangent line is:

\[\text{slope} = \frac{2}{3}\]

Diagram Description: The page includes a coordinate system showing a level curve passing through the point \((-1,1)\). The gradient vector \(\langle -2, 3 \rangle\) is drawn perpendicular to the curve, and the tangent vector \(\langle 3, 2 \rangle\) is drawn along the curve. A dashed line with slope \(\frac{2}{3}\) represents the tangent line to the level curve.