Skip to main content
\(\renewcommand{\chaptername}{Unit} \newcommand{\derivativehomeworklink}[1]{\href{http://db.tt/cSeKG8XO}{#1}} \newcommand{\chpname}{unit} \newcommand{\sageurlforcurvature}{http://bmw.byuimath.com/dokuwiki/doku.php?id=curvature_calculator} \newcommand{\uday}{ \LARGE Day \theunitday \normalsize \flushleft \stepcounter{unitday} } \newcommand{\sageworkurl}{http://bmw.byuimath.com/dokuwiki/doku.php?id=work_calculator} \newcommand{\sagefluxurl}{http://bmw.byuimath.com/dokuwiki/doku.php?id=flux_calculator} \newcommand{\sageworkfluxurl}{http://bmw.byuimath.com/dokuwiki/doku.php?id=both_flux_and_work} \newcommand{\sagelineintegral}{http://bmw.byuimath.com/dokuwiki/doku.php?id=line_integral_calculator} \newcommand{\sagephysicalpropertiestwod}{http://bmw.byuimath.com/dokuwiki/doku.php?id=physical_properties_in_2d} \newcommand{\sagephysicalpropertiesthreed}{http://bmw.byuimath.com/dokuwiki/doku.php?id=physical_properties_in_3d} \newcommand{\sageDoubleIntegralCheckerURL}{http://bmw.byuimath.com/dokuwiki/doku.php?id=double_integral_calculator} \newcommand{\myscale}{1} \newcommand{\ds}{\displaystyle} \newcommand{\dfdx}[1]{\frac{d#1}{dx}} \newcommand{\ddx}{\frac{d}{dx}} \newcommand{\ii}{\vec \imath} \newcommand{\jj}{\vec \jmath} \newcommand{\kk}{\vec k} \newcommand{\vv}{\mathbf{v}} \newcommand{\RR}{\mathbb{R}} \newcommand{\R}{ \mathbb{R}} \newcommand{\inv}{^{-1}} \newcommand{\im}{\text{im }} \newcommand{\colvec}[1]{\begin{bmatrix}#1\end{bmatrix} } \newcommand{\cl}[1]{ \begin{matrix} #1 \end{matrix} } \newcommand{\bm}[1]{ \begin{bmatrix} #1 \end{bmatrix} } \DeclareMathOperator{\rank}{rank} \DeclareMathOperator{\rref}{rref} \DeclareMathOperator{\vspan}{span} \DeclareMathOperator{\trace}{tr} \DeclareMathOperator{\proj}{proj} \DeclareMathOperator{\curl}{curl} \newcommand{\blank}[1]{[14pt]{\rule{#1}{1pt}}} \newcommand{\vp}{^{\,\prime}} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section10.1The Gradient

Objectives
  • compute directional derivatives and gradients

Recall from the previous unit that the derivative \(Df\) of a function \(f:\mathbb{R}^n\to\mathbb{R}\) (one output dimension) is called the gradient of \(f\text{,}\) and written \(\vec \nabla f\text{,}\) when we want to emphasize that the derivative is a vector field.

Exercise10.1.1

Consider three functions:

  • \(f(x,y)=9-x^2-y^2\)

  • \(g(x,y)=2x-y\)

  • \(h(x,y)=\sin x\cos y\)

You'll want a computer to help you construct the graphs, particularly \(h\text{.}\)

You could use Wolfram Alpha (use the links in the function chapter if you forgot how to graph).

(a)

Compute \(\vec \nabla f(x,y)\text{.}\) Then draw both \(\vec \nabla f\) and several level curves of \(f\) on the same axes.

See Sage. You can modify these commands to help in the plots below too.

Hint

If you need a reminder of how to draw level curves look back at Exercise 6.4.2

(b)

Compute \(\vec \nabla g(x,y)\text{.}\) Then draw both \(\vec \nabla g\) and several level curves of \(g\) on the same axes.

Hint

If you need a reminder of how to draw level curves look back at Exercise 6.4.2

(c)

Compute \(\vec \nabla h(x,y)\text{.}\) Then use the SageMath Cell above to plot the function and the gradient.

(d)

What relationships do you see between the gradient vector field and level curves?

Subsection10.1.1Relating Gradients Fields and Level Curves

The next few exercises will focus on explaining why the relationships you saw are always true.

Exercise10.1.2

Suppose \(\vec r(t)\) is a level curve of \(f(x,y)\text{.}\)

(a)

Suppose you know that at \(t=0\text{,}\) the value of \(f\) at \(\vec r(0)\) is 7. What is the value of \(f\) at \(\vec r(1)\text{?}\)

Hint

What does it mean to be on a level curve?

(b)

As you move along the level curve \(\vec r\text{,}\) how much does \(f\) change? What must \(\ds\frac{df}{dt}\) equal?

(c)

At points along the level curve \(\vec r\text{,}\) we have the composite function \(f(\vec r(t))\text{.}\) Compute the derivative \(\ds\frac{df}{dt}\) using the chain rule.

(d)

Use your work from the previous parts to explain why the gradient always meets the level curve at a 90\(^\circ\) angle.

We say that the gradient is normal to level curves (i.e., a gradient vector is orthogonal to the tangent vector of the curve).

In the derivative chapter, we extended differential notation from \(dy=f' dx\) to \(d\vec y = D\vec f d\vec x\text{.}\) The key idea is that a small change in the output variables is approximated by the product of the derivative and a small change in the input variables. As a quick refresher, if we have the function \(z=f(x,y)\text{,}\) then differential notation states that

\begin{equation*} dz = \begin{bmatrix}f_x\amp f_y \end{bmatrix} \begin{bmatrix}dx\\dy \end{bmatrix} . \end{equation*}
Review10.1.3
(a)

Compute a unit vector in the direction \(\vec{d}=\langle 1,3 \rangle\)

Solution

\(\hat{u}=\frac{\vec{d}}{|\vec{d}|}=\frac{\langle 1,3 \rangle}{\sqrt{1^2+3^2}}=\langle \frac{1}{\sqrt{10}}, \frac{3}{\sqrt{10}} \rangle\)

(b)

If you move 1 unit in the \(\vec{d}\) direction from \((x,y)=(0,1)\) what is the new point?

Solution

\((x,y)+\hat{u}=\langle \frac{1}{\sqrt{10}}, 1+\frac{3}{\sqrt{10}} \rangle\)

Exercise10.1.4

Suppose the temperature at a point in the plane is given by the function {\(T(x,y)=x^2-xy-y^2\)} degrees Fahrenheit. A particle is at \(P=(2,3)\text{.}\)

(a)

Use differentials to estimate the change in temperature if the particle moves 1 unit in the direction of \(\vec u=\left(3,4\right)\text{.}\)

(i)

Find the unit vector \(\hat{u}\text{.}\) If the particle moves 1 unit in the direction of \(\vec{u}\) what is \(dx\) and \(dy\text{?}\)

(ii)

Find \(D\vec{T}(x,y)\)

(iii)

Estimate the change using differential notation (set-up the exercise, then compute).

(b)

What is the actual change in temperature if the particle moves 1 unit in the direction of \(\vec u=\left(3,4\right)\text{?}\)

(i)

What is the particle's new position?

(ii)

What is the particle's new temperature?

(iii)

What is \(\Delta T\text{?}\)

(c)

Use differentials to estimate the change in temperature if the particle moves about .2 units in the direction of \(\vec u=\left(3,4\right)\text{.}\)

Hint

Use the previous parts as guides

We can define partial derivatives solely in terms of differential notation. We can define derivatives in any direction in terms of differential notation.

Exercise10.1.5

Suppose that \(z=f(x,y)\) is a differentiable function (so the derivative is the matrix \(\begin{bmatrix}f_x\amp f_y \end{bmatrix}\)). Remember to use differential notation in this exercise.

(a)

If \((dx,dy)=(1,0)\text{,}\) which means we've moved one unit in the \(x\) direction while holding \(y\) constant, what is \(dz\text{?}\)

(b)

If \((dx,dy)=(0,1)\text{,}\) which means we've moved one unit in the \(y\) direction while holding \(x\) constant, what is \(dz\text{?}\)

(c)

Consider the direction \(\vec u=(2,3)\text{.}\) Find a unit vector in the direction of \(\vec u\text{.}\) If we move one unit in the direction of \(\vec u\text{,}\) what is \(dz\text{?}\)

It's all right to leave your answer as a dot product.

Subsection10.1.2The Directional Derivative

Covered in this sub-section:

  • computing the directional derivative

Definition10.1.1

The directional derivative of \(f\) in the direction of the unit vector \(\vec u\) at a point \(P\) is defined to be

\begin{equation*} D_{\vec u} f(P) = Df(P) \hat u = \vec \nabla f \cdot \hat u. \end{equation*}

Here are the steps to compute the directional derivative:

  1. If \(\vec{d}\) is not a unit vector, compute \(\hat{u}=\frac{\vec{d}}{|\vec{d}|}\)

  2. Find \(Df=\vec{\nabla} f\)

  3. Evaluate \(\vec{\nabla} f\) at point \(P\)

  4. Find the dot product: \(\vec \nabla f \cdot \hat u\)

The partial derivative of \(f\) with respect to \(x\) is precisely the directional derivative of \(f\) in the \((1,0)\) direction.

Similarly, the partial derivative of \(f\) with respect to \(y\) is precisely the directional derivative of \(f\) in the \((0,1)\) direction. This definition extends to higher dimensions.

Note that in the definition above, we require the vector \(\vec u\) to be a unit vector. If you are asked to find a directional derivative in some direction, make sure you start by finding a unit vector in that direction. We want to deal with unit vectors because when we say something has a slope of \(m\) units, we want to say “The function `rises' \(m\) units if we `run' \(1\) unit.”

Exercise10.1.6

Consider the function \(f(x,y) = 9-x^2-y^2\text{.}\)

(a)

Draw several level curves of \(f\text{.}\)

(b)

At the point \(P=(2,1)\text{,}\) place a dot on your graph. Then draw a unit vector based at \(P\) that points in the direction \(\vec u=(3,4)\) [not to the point \((3,4)\text{,}\) but in the direction \(\vec u=(3,4)\)]. If you were to move in the direction \((3,4)\text{,}\) starting from the point \((2,1)\text{,}\) would the value of \(f\) increase or decrease?

(c)

Find the slope of \(f\) at \(P=(2,1)\) in the direction \(\vec u=(3,4)\) by finding the directional derivative. This should agree with your previous answer.

(d)

If you stand at \(Q=(-2,3)\) and move in the direction \(\vec v= (1,-1)\text{,}\) will \(f\) increase or decrease? Find the directional derivative of \(f\) in the direction \(\vec v=(1,-1)\) at the point \(Q=(-2,3)\text{.}\)

Exercise10.1.7

Recall that the dot product can be computed using \(\vec{v} \cdot \vec{u} = |\vec{v}||\vec{u}|\cos \theta\text{.}\) In this exercise, you'll explain why the gradient points in the direction of greatest increase.

(a)

Rewrite the dot product formula using the vectors/variables used to compute the directional derivative. (I.E. give an alternate formula for the directional derivative)

(b)

Why is the directional derivative of \(\vec f\) the largest when \(\vec u\) points in the exact same direction as \(\vec \nabla f\text{?}\)

Hint

What angle maximizes the cosine function?

(c)

When \(\vec u\) points in the same direction as \(\vec \nabla f\text{,}\) show that \(D_{\vec u}f = |\vec \nabla f|\text{.}\) In other words, explain why the length of the gradient is precisely the slope of \(f\) in the direction of greatest increase (the slope in the steepest direction).

Hint

What do you know about \(\vec{u}\) and \(\theta\text{?}\)

(d)

Which direction points in the direction of greatest decrease?

Exercise10.1.8

Suppose you are looking at a topographical map (see Wikipedia for an example). On this topographical map, each contour line represents 100 ft in elevation. You notice in one section of the map that the contour lines are really close together, and they start to form circles around a spot on the graph. You notice in another section of the map that the contour lines are spaced quite far apart. Let \(f(x,y)\) be the elevation of the land, so that the topographical map is just a contour plot of \(f\text{.}\)

(a)

Where is the slope of the terrain larger, in the section with closely packed contour lines, or the section with contour lines that are spread out. In which section will the gradient be a longer vector?

(b)

At the very top of a mountain, or the very bottom of a valley, will the gradient be a long vector or a small vector? How do you locate a peak in a topographical map?

(c)

If you're stuck, look at a contour plot of \(f(x,y) = (x+1)^3-3(x+1)^2-y^2+2\) in Sage. Then make your own example.

Create your own topographical map to illustrate the ideas above. Just make sure your map has a section with some contours that are closely packed together, and some that are far apart, as well as a contour that intersects itself. Then on your topographical map, please add a few gradient vectors, where you emphasize which ones are long, and which ones are short. Show us how to find a peak, as well as what the gradient vector would be at the peak.

The next few exercises have you practice using differentials, and then obtain tangent lines and planes to curves and surfaces using differentials.

Exercise10.1.9

The volume of a cylindrical can is \(V(r,h)=\pi r^2 h\text{.}\) Any manufacturing process has imperfections, and so building a cylindrical can with designed dimensions \((r,h)\) will result in a can with dimensions \((r+dr,h+dh)\text{.}\)

(a)

Compute both \(DV\) (the derivative of \(V\)) and \(dV\) (the differential of \(V\)).

(b)

If the can is tall and slender (\(h\) is big, \(r\) is small), which will cause a larger change in volume: an error in \(r\) or an error in \(h\text{?}\) Use \(dV\) to explain your answer.

(c)

If the can is short and wide (like a tuna can), which will cause a larger change in volume: an error in \(r\) or an error in \(h\text{?}\) Use \(dV\) to explain your answer.

Exercise10.1.10

Consider the function \(f(x,y)=x^2+y^2\text{.}\) Consider the level curve \(C\) given by \(f(x,y)=25\text{.}\) Our goal is to find an equation of the tangent line to \(C\) at \(P=(3,-4)\text{.}\)

(a)

Draw \(C\text{.}\)

(b)

Compute \(\vec \nabla f\) and add to your graph the vector \(\vec \nabla f(P)\text{.}\)

(c)

We know the point \(P=(3,-4)\) is on the tangent line. Let \(Q=(x,y)\) represent another point on the tangent line.

(i)

Add to your graph the point \(Q\) and the vector \(\vec {PQ} = (x-3,y+4)\text{.}\)

(ii)

Why does the dot product \(\vec \nabla f(P)\cdot\vec{PQ}\) equal zero?

(iii)

Compute this dot product and explain why this an equation of the tangent line?

(d)

What is a normal vector to the line?

The previous exercise had you give an equation of the tangent line to a level curve, by using differential notation. The next exercises asks you to repeat this idea and give an equation of a tangent plane to a level surface.

Exercise10.1.11

Consider the function \(f(x,y,z)=x^2+y^2+z^2\text{.}\) Consider the level surface \(S\) given by \(f(x,y,z)=9\text{.}\) Our goal is to find an equation of the tangent plane to \(S\) at \(P=(1,2,-2)\text{.}\)

(a)

Draw \(S\text{.}\)

(b)

Compute \(\vec \nabla f\text{.}\) Add to your graph the vector \(\vec \nabla f(P)\text{,}\) with its base at \(P\text{.}\)

(c)

We know the point \(P=(1,2,-2)\) is on the tangent plane. Let \(Q=(x,y,z)\) be any other point on the tangent plane. What is the component form of the vector \(\vec {PQ}\text{?}\)

(d)

Why are \(\vec \nabla f(P)\) and \(\vec{PQ}\) orthogonal? Use this fact to write an equation of the tangent plane.

(e)

What is a normal vector to the plane?

Exercise10.1.12

Use the process from Exercise 11 to find an equation of the tangent plane to the hyperboloid of one sheet \(1=x^2-y^2+z^2\) at the point \((-3,3,1)\text{.}\)

Also give an equation of the normal line (the line that sticks straight up out of the surface). FYI, the normal line is used in computer graphics to know how to shade an object.

Exercise10.1.13

The two surfaces \(x^2+y^2+z^2=14\) and \(3x+4y-z=-1\) intersect in a curve \(C\text{.}\) Draw both surfaces, and show us the curve \(C\text{.}\) Then, at the point \((2,-1,3)\text{,}\) find an equation of the tangent line to this curve.

Hint

The line is in both tangent planes, so it is orthogonal to both normal vectors. The cross product gets you a vector that is orthogonal to two vectors.

Subsection10.1.3Computational Practice

These are provided to help you achieve better skills in basic computational answers.

1
2
3
4
5
6
7
8