We still have some tasks from Day 15 to finish discussing in class.

Day 15 - Prep

Every time we compute a differential $df = f_xdx+ f_ydy$, we're following a pattern that shows up so often that it's given a name (linear combination). At some point you may take a linear algebra course where you'll focus quite a bit on linear combinations, and quickly adopt matrices to help speed up the process of writing linear combinations.

Linear Combination, Matrix Notation, Total Derivative

Given $n$ vectors $\vec v_1, \vec v_2,\cdots,\vec v_n$ and $n$ scalars $c_1, c_2, \cdots, c_n$ the linear combination of these vectors using these scalars is the sum $$\sum_{i=1}^n c_1 \vec v_i = c_1\vec v_1+c_2\vec v_2+\cdots+c_n\vec v_n.$$ Matrix notation and products were invented to organize linear combinations into a visually appealing compact form. We place each vector in the column of a matrix, and then place the corresponding scalars into a single column vector after the matrix. The linear combination above, in matrix form, becomes the matrix product $$c_1\vec v_1+c_2\vec v_2+\cdots+c_n\vec v_n = \begin{bmatrix} \begin{pmatrix}\\\vec v_1\\ \ \end{pmatrix} &\begin{pmatrix}\\\vec v_2\\ \ \end{pmatrix} &\cdots &\begin{pmatrix}\\\vec v_n\\ \ \end{pmatrix} \end{bmatrix} \begin{pmatrix}c_1\\c_2\\\vdots\\c_n\end{pmatrix}.$$

The derivative (or total derivative) of a function is a matrix whose columns are the partial derivatives of the function. The partial derivatives we insert into the columns of the matrix in the same order in which the variables are listed for the function. Some examples follow.

  • For the function $f(x)$, the derivative is $Df(x) = \begin{bmatrix}f_x\end{bmatrix} =\begin{bmatrix}\frac{df}{dx}\end{bmatrix}$, with differential $df = f_xdx$.
  • For the function $f(x,y)$, the derivative is $Df(x,y) = \begin{bmatrix}f_x&f_y\end{bmatrix}$, with differential $df = f_xdx+f_ydy$.
  • For the function $f(r,s,t)$, the derivative is $Df(r,s,t) = \begin{bmatrix}f_r&f_s&f_t\end{bmatrix}$, with differential $df = f_rdr+f_sds+f_tdt$.
  • For the function $\vec r(u,v)$, the derivative is $D\vec r(u,v) = \begin{bmatrix}\vec r_u&\vec r_v\end{bmatrix}$, with differential $d\vec r = \vec r_udu+\vec r_vdv$.

Task 15.1

Let's practice using the definitions above. For each function below, (a) compute and label all relevant partial derivatives. Then (b) write the differential $df$ as a linear combination of the partial derivatives. Then (c) write $df$ as a matrix product. Finish by (d) stating the total derivative $Df$ of the function.

  1. $f(x,y)=x^2y$ [Clearly label all 4 things you were asked to find, namely (a) all partials, (b) $df$ as a linear combination, (c) $df$ as a matrix product, and (d) the derivative $Df$.]
  2. $f(x,y)=x^2+2xy+3y^2$
  3. $f(x,y,z)=3xz-x^2y$

Task 15.2

The gradient of a function $f(x,y)$ is itself a function. When we compute the partial derivatives of the gradient, we obtain vectors instead of numbers. This task has you examine the differential, partials, and derivative of the gradient of a function. We'll soon see that the derivative of the gradient is precisely the key to classifying maximums and minimums of a function.

The function $f(x,y) = x^2+3xy+2y^2$ has the gradient $\vec \nabla f = (2x+3y,3x+4y)$. This is the vector field $$\vec F = (2x+3y,3x+4y).$$

  1. Find the differential $d\vec F$ and write it as the linear combination $$d\vec F = \begin{pmatrix}?\\?\end{pmatrix}dx+\begin{pmatrix}?\\?\end{pmatrix}dy.$$
  2. Rewrite the above differential as a matrix product, so fill in the blanks below. $$d\vec F = \begin{pmatrix}?&?\\?&?\end{pmatrix}\begin{pmatrix}?\\?\end{pmatrix}.$$
  3. Clearly label the two partial derivatives $\frac{\partial \vec F}{\partial x}$ and $\vec F_y$.
  4. State the total derivative $D\vec F(x,y)$ (it should be a 2 by 2 matrix). [Note: We also write the derivative of the gradient as $D^2f(x,y)$, or $D\vec\nabla f(x,y)$, and call the resulting matrix the Hessian of $f$. Some people use the notation $\vec \nabla ^2 f$ for the Hessian, though this notation also gets use for the Laplacian $\vec \nabla \cdot (\vec \nabla f)$, which is a very different quantity.]
  5. The function $f(x,y) = xy^2$ has gradient $\vec F = (y^2, 2xy)$. Repeat the above to obtain the differential of $\vec F$ (as a linear combination, and in matrix form), the partials of $\vec F$, and the derivative $D\vec F(x,y)$.

Task 15.3

Suppose a rover moves along the level curve of a function $f(x,y)$ following the path $\vec r(t)=(x,y)$. An example of such a scenario is shown below (note that lighter colors correspond to greater outputs of $f(x,y)$. )

Label the dots $A$ and $B$ (it doesn't matter which you label $A$ or $B$). Our goal is to prove that the gradient of $f$ is normal to level curves.

  1. At each dot in the picture on the right, draw a vector that represents a possible option for $\ds\frac{d\vec r}{dt} = \left(\frac{dx}{dt},\frac{dy}{dt}\right)$.
  2. Suppose $\vec r(0)=A$ and $\vec r(1)=B$. If we know that $f(\vec r(0)) = 7$, then what is $f(\vec r(1))$? Explain.
  3. As the rover moves along $\vec r(t)$, how much does $f$ change? Use this to give a value for $\ds\frac{df}{dt}$?
  4. Explain why $\vec \nabla f$ and $\ds\frac{d\vec r}{dt}$ are orthogonal at any point along the level curve. (Hint: Add $dt$ to the denominators of the the differential $df = f_xdx+f_ydy$ , and then write the differential as a dot product. Since we are on a level curve, we know the value of $\ds\frac{df}{dt}$.)
  5. At point $A$, draw a vector that points in the same direction as $\vec \nabla f(A)$. Use your work above to explain why the gradient of $f$ must be normal to the level curve.

Task 15.4

The last problem for prep each day will point to relevant problems from OpenStax. Spend 30 minutes working on problems from the sections below.

  • Return to any of the previous day's OpenStax problems to locate extra practice.

Day 17 - Prep

Task 17.1

We'll focus this task on making sure we understand how differentials can help us approximate changes in a function.

A forest ranger needs to estimate the height of a tree. The ranger stands 50 feet from the base of tree and measures the angle of elevation to the top of the tree to be about 60$^\circ$.

  1. If this angle of 60$^\circ$ is correct, then what is the height of the tree? Explain in general why the height of the tree is $h(\theta) = 50 \tan \theta$.
  2. Compute the differential $dh$ in terms of $\theta$ and $d\theta$.
  3. The ranger's angle measurement is mostly likely off by some amount. If the error in the ranger's measurement could be as much as $d\theta = 5^\circ$ (so $\frac{5\pi}{180}$ radians), then use differentials to estimate how large the error in the height could be (so compute $dh$). If your answer here is quite large (much larger than the height of the tree), then look back at your work and see if using radians instead of degrees makes a difference. Why does it? Feel free to ask in class.
  4. Compute the height if the angle were exactly 65 instead of 60. What's the actual difference between these two heights?

The US mint creates coins that are roughly a cylindrical shape, with volume $V = \pi r^2h$. Unfortunately, not every coin is exactly the same size, and small errors in $r$ (given by $dr$) and small errors in $h$ (given by $dh$), affect the amount of material needed to mint these coins.

  1. Compute $dV$ to give an approximate for the change in volume given by the errors $dr$ and $dh$.
  2. The radius of a coin is much larger than the height. Will an error in the radius, or an error in the height, cause a larger change in volume? Explain using your differentials.
  3. A soda can company has a cylindrical shape that instead has a large $h$ with small $r$. Will an error in the radius, or an error in the height, cause a larger change in volume in this situation.

Task 17.2

Suppose that our rover is located at point $P=(x,y)$ on a hill whose elevation is given by $z=f(x,y)$. The rover will be moving in the direction parallel to $\vec u$.

  1. Explain why the slope of the hill at $P$ in the direction $\vec u = (dx,dy)$ is given by $$\frac{dz}{\sqrt{(dx)^2+(dy)^2}}.$$
  2. Prove that this slope can be written, using gradients, as $$\vec \nabla f(P) \cdot \frac{\vec u}{|\vec u|}.$$
  3. Use the above fact to compute the slope of a hill given by $f(x,y) = x^2+3xy$ at $P=(2,-1)$ in the direction $\vec u = (3,4)$. (We call this the directional derivative of $f$ at $P$ in the direction $\vec u$, written $D_{\vec u}f(P)$.

The directional derivative of $f$ in the direction of the vector $\vec u$ at a point $P$ is defined to be $$D_{\vec u} f(P)=\vec \nabla f \cdot \frac{\vec u}{|\vec u|}.$$ We can simplify the above to just $f(P)=\vec \nabla f \cdot \hat u$ if $\hat u$ is a unit vector. We dot the gradient of $f$ with a unit vector in the direction of $\vec u$.

  1. Show that the partial derivative of $f$ with respect to $x$ is precisely the directional derivative of $f$ in the $(1,0)$ direction.
  2. Show that the partial derivative of $f$ with respect to $y$ is precisely the directional derivative of $f$ in the $(0,1)$ direction.

Please watch this short 2 part video that discusses the gradient a bit more, and how you can connect the gradient to the slope in various directions.

Task 17.3

Suppose our rover is located at a point $P$ on a hill whose elevation is given by $z=f(x,y)$. Recall that the directional derivative of $\vec f$ at $P$ in the direction $\vec u$ is the dot product $D_{\vec u} f(P)=\vec \nabla f(P)\cdot \frac{\vec u}{|\vec u|}.$ Also recall that we can compute dot products using the law of cosines $\vec \nabla f(P)\cdot \vec u= |\vec \nabla f(P)| |\vec u|\cos\theta,$ where $\theta$ is the angle between $\vec \nabla f(P)$ and $\vec u$.

  1. Give a formula for the angle $\theta$ between the two vectors $\vec \nabla f$ and $\vec u$?
  2. Given a direction $\vec u$, the directional derivative will give the slope of $f$ at $P$ in the direction $\vec u$. We want to know which direction we should be pick to obtain the largest slope (directional derivative). Explain why the angle between $\vec u$ and $\vec \nabla f(P)$ must be 0, in order to obtain the largest slope.
  3. State a vector $\vec u$ that yields the largest directional derivative.
  4. When $\vec u$ is parallel to $\vec \nabla f(P)$, show that $D_{\vec u}f(P) = |\vec \nabla f(P)|$. 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).
  5. Which direction points in the direction of greatest decrease? What is the slope in that direction?
  6. In your own words, summarize what facts this task helped you learn about the gradient.

Task 17.4

The last problem for prep each day will point to relevant problems from OpenStax. Spend 30 minutes working on problems from the sections below.

  • Return to any of the previous day's OpenStax problems to locate extra practice.

Day 17 - In class

Brain Gains (Rapid Recall, Jivin' Generation)

  • Below are several vector field plots. Associated with each vector field plot are two numbers, called eigenvalues (which we will soon learn to compute). What patterns do you see between the vector field plots and the eigenvalues.

Expand to see the plots.

  • Let $A(r,h) = 2rh+\frac{1}{2}\pi r^2$. This function gives the area of a region in the plane of a rectangle with side lengths $2r$ and $h$, attached to a semicircle of radius $r$. The radius is supposed to be $r=4$ with $h=3$. Use differentials to estimate the change in area $dA$ that would result from a change in $r$ of $dr = 0.1$ and change in $h$ of $dh = 0.5$.
  • Let $f(x,y) = 3xy+\frac{1}{2}x^2$ represent the elevation of a rover near some point on Mars (with (0,0) corresponding to the landing spot). The rover is currently at $(4,3)$. What is the slope of the terrain at the rover's location in the $(1,5)$ direction (so slightly east of north). In other words, compute the directional derivative of $f$ at point $(4,3)$ in the direction $(1,5)$, written as $D_{ (1,5) }f(4,3)$.
  • The image below shows a contour plot of a function $f$. Add $\vec \nabla f$ to several points on the plot. Add at least two vectors, one where the gradient should be long, and another where the gradient should be short.

Expand to see the plot.

Group Problems

  1. Let $g(x,y) =xy^3$.
    • State $g_x$ and $\dfrac{\partial g}{\partial y}$. Then state $\vec \nabla g$.
    • The formula for the directional derivative of $f$ at $P$ in the direction $\vec u$ is $D_{\vec u}f(P) = \vec \nabla f(P)\cdot \dfrac{\vec u}{|\vec u|}$. For this function $g$, verify that the directional derivative of $g$ at $(x,y)$ in the direction $(1,0)$ is indeed $g_x$.
    • Find the directional derivative (slope) of $g$ at $P=(3,1)$ in the direction $(-3,2)$.
    • Find the directional derivative of $g$ at $P=(3,1)$ in the direction $(2,-5)$.
  2. Consider the elevation function $f(x,y)=e^x\sin y$ and the path $\vec r(t) = (t^2,t^3)$.
    • Compute $f(\vec r(t))$ and then compute $\frac{df}{dt}$.
    • Find $df$ in terms of $x$, $y$, $dx$, and $dy$. Then find $dx$ and $dy$ in terms of $t$ and $dt$.
    • Use substitution to state $df$ in terms of $dt$ and divide by $dt$ to obtain $\frac{df}{dt}$. [You should have the same answer as the first part.]
    • In your solution for $\frac{df}{dt}$, label each of $f_x$, $f_y$, $\frac{dx}{dt}$ and $\frac{dy}{dt}$ to verify that $$\frac{df}{dt} = f_x\frac{dx}{dt}+f_y\frac{dy}{dt}.$$
  3. Consider the function $f(x,y,z) = 4x^2+4y^2+z^2$. We'll be analyzing the surface at the point $P=(1/2,0,\sqrt{3})$.
    • Compute $f(1/2,0,\sqrt{3})$.
    • Draw the level surface that passes through $(1/2,0,\sqrt{3})$. So draw the ellipsoid $4=4x^2+4y^2+z^2$, which we can rewrite at $1=x^2+y^2+\frac{z^2}{4}$.
    • Compute the gradient $\vec\nabla f(x,y,z)$, and then give $\vec\nabla f(P)$.
    • Compute the differential $df$, and then the differential at $P$. [Check: For the latter, $df = 4dx+0dy+2\sqrt{3}dz$]
    • For a level surface, the output remains constant (so $df=0$). If we let $(x,y,z)$ be a point on the surface really close to $P$, then we have $dx=x-1/2$, $dy=y-0$ and $dz = z-?$. Plug this information into the differential at $P$ to obtain an equation of the tangent plane to the surface.
    • Give an equation of the tangent plane to the level surface of $f$ that passes through $(1,2,-3)$.
    • Give an equation of the tangent plane to the level surface of $f$ that passes through $(a,b,c)$.
  4. Consider the function $f(x,y)=2-|x|$.
    • Construct a 2D contour plot. Label your contours with their corresponding height.
    • Construct a 3D surface plot.
    • Construct both the above with software.

Day 18 - Prep

Task 18.1

In first semester calculus, differential notation is $dy=f' dx$. At $x=c$, the tangent line passes through the point $P=(c,f(c))$. If $Q=(x,y)$ is any other point on the line, then the vector $\vec {PQ} = (x-c,y-f(c))$ tells us that when $dx=x-c$ we have $dy=y-f(c)$. Substitution give us an equation for the tangent line tangent line as $$\underbrace{y-f(c)}_{dy}={f'(c)}\underbrace{(x-c)}_{dx}.$$ This equation tells us that a change in the output ($y-f(c)$) equals the derivative times a change in the input ($x-c$). In this task, we'll repeat this process to obtain an equation of a tangent plane to a function $f(x,y)$, where differential notation gives $$dz = \frac{\partial f}{\partial x}dx+\frac{\partial f}{\partial y}dy.$$

Consider the function $z=f(x,y)=9-x^2-y^2$. We'll be finding an equation of the tangent plane to $f$ at $(x,y)=(2,1)$. Here is surface plot along with the tangent plane at $(2,1,f(2,1))$, together with a contour plot.

  1. Compute the partial derivatives $f_x$ and $f_y$, and the differential $dz$. At the point $(x,y) = (2,1)$, evaluate the partial derivatives and the function $z=f(x,y)$.
  2. One point on the tangent plane to the surface at $(2,1)$ is the point $P=(2,1,f(2,1))$. Let $Q=(x,y,z)$ be another point on this plane. Use the vector $\vec{PQ}$ to obtain $dz$ when $dx = x-2$ and $dy = y-1$.
  3. We'd like an equation of the tangent plane to $f(x,y)$ when $x=2$ and $y=1$. Differential notation tells us that $$\underbrace{z-?}_{dz}=(-4)\underbrace{(x-?)}_{dx}+(?)\underbrace{(y-?)}_{dy}.$$ Fill in the blanks to get an equation of the tangent plane.
  4. Rewrite the equation you got in the form $A(x-a)+B(y-b)+C(z-c)=0$ and state a normal vector to the plane.
  5. The level curve of $f$ that passes through $(2,1)$ has no change in height, so $dz=0$. Use this fact to give an equation of the tangent line to this level curve at $(2,1)$.

Now let $z=f(x,y)=x^2+4xy+y^2$. At the point $P=(x,y)=(3,-1)$, we'll give an equation of the tangent plane to the surface and an equation of the tangent line to the level curve of $f$ that passes through this point.

  1. Give an equation of the tangent plane at $P=(x,y)=(3,-1)$. [Hint: Find $f_x$, $f_y$, $dx$, $dy$, and then $dz$, all at $(x,y)=(3,-1)$. Then substitute, as done above.]
  2. The level curve of $f$ that passes through $P$ is a curve in the plane. Give an equation of the tangent line to this curve at $P$. [Hint: Since we're on a level curve, what does $dz$ equal? The equation is almost identical to the previous part, with one minor change based on what $dz$ equals.]

The tangent plane and tangent line you just found are shown below.

Task 18.2

A rover moves on a hill where elevation is given by $z=f(x,y)=9-x^2-y^2$. The rover's path is parametrized by $\vec r(t)=(2\cos t, 3\sin t)$.

  1. At time $t=0$, what is the rover's position $\vec r(0)$, and what is the elevation $f(\vec r(0))$ at that position? Then find the positions and elevations at $t=\pi/2$, $t=\pi$, and $t=3\pi/2$ as well.
  2. In the plane, draw the rover's path for $t\in [0,2\pi]$. Then, on the same 2D graph, include a contour plot of the elevation function $f$. Include the level curves that pass through the points in part 1. Along each level curve drawn, state the elevation of the curve. [If you end up with an ellipse and several concentric circles, then you've done this right.]
  3. As the rover follows its elliptical path, the elevation is rising and falling. At which $t$ does the elevation reach a maximum? A minimum? Explain, using your graph.
  4. As the rover moves past the point at $t=\pi/4$, is the elevation increasing or decreasing? In other words, is $\dfrac{df}{dt}$ positive or negative? Use your graph to explain.

Notice above that we wanted $\frac{df}{dt}$, the rate of change of elevation with respect to time, even though the function $f(x,y)$ does not explicitly have $t$ as an input. The proper notation would be $\frac{d(f\circ r)}{dt}$, but this is so cumbersome that it's generally avoided. The notation $\frac{df}{dt}$ requires the reader to infer from context that $x$ and $y$ depend on $t$.

  1. At the point $\vec r(t)$, we'd like a formula for the elevation $f(\vec r(t))$. What is the elevation of the rover at any time $t$? [In $f(x,y)$, replace $x$ and $y$ with what they are in terms of $t$.]
  2. Compute $df/dt$ (the derivative as you did in first-semester calculus).

Let's repeat the above, but first compute differentials before substitution. For reference, we let $f(x,y)=9-x^2-y^2$ and $(x,y)=\vec r(t)=(2\cos t, 3\sin t)$.

  1. Compute the differential $df$ in terms of $x$, $y$, $dx$, and $dy$.
  2. Compute $dx$ and $dy$ in terms of $t$ and $dt$.
  3. Use substitution to write $df$ in terms of $t$ and $dt$. Then divide by $dt$ to obtain $\frac{df}{dt}$. Did you get the same answer as the previous part?
  4. Use your work above to state both $\vec\nabla f(x,y)$ and $\frac{d\vec r}{dt}$. Show that $\frac{df}{dt} = \vec\nabla f(x,y)\cdot \frac{d\vec r}{dt}$.

Task 18.3

A second-order partial derivative of $f$ is a partial derivative of one of the partial derivatives of $f$. The second-order partial of $f$ with respect to $x$ and then $y$ is the quantity $\frac{\partial}{\partial y}\left[\frac{\partial f}{\partial x}\right]$, so we first compute the partial of $f$ with respect to $x$, and then compute the partial of the result with respect to $y$. Alternate notations exist, for example the same second-order partial above we can write as $$\frac{\partial}{\partial y}\left[\frac{\partial f}{\partial x}\right]=\left(f_{x}\right)_y=f_{xy}=\ds\frac{\partial}{\partial y}\frac{\partial}{\partial x}f = \frac{\partial}{\partial y}\frac{\partial f}{\partial x} = \frac{\partial^2 f}{\partial y \partial x}.$$ The subscript notation $f_{xy}$ is easiest to write. Sometimes we'll use subscript notation to mean something other than a partial derivative (like the $x$ or $y$ component of a vector), at which point we use the fractional partial derivative notation to avoid confusion.

Consider the functions $f(x,y,z) = xy^2z^3$ and $g(x,y)=x\cos(xy)$.

  1. First compute $\vec \nabla f$. Then compute $f_{xy}$ and $\frac{\partial^2 f}{\partial z\partial y}$. Explain how you got these. End by computing the entire second derivative $D\vec\nabla f(x,y,z)$ (it is a 3 by 3 matrix with all 9 second partials placed inside).
  2. Compute $g_x$ and then $g_{xy}$. Then compute $g_y$ followed by $g_{yx}$.
  3. Now let $f(x,y)=3xy^3+e^{x}.$ Compute the four second partials $$\ds \frac{\partial^2 f}{ \partial x^2},\quad \ds\frac{\partial^2 f}{\partial y \partial x},\quad \ds\frac{\partial^2 f}{\partial y^2}, \quad \text{ and }\ds\frac{\partial^2 f}{\partial x \partial y}.$$
  4. For $f(x,y)=x^2\sin(y)+y^3$, compute both $f_{xy}$ and $f_{yx}$.
  5. Make a conjecture about a relationship between $f_{xy}$ and $f_{yx}$. Then use your conjecture to quickly compute $f_{xy}$ if $$f(x,y)=3xy^2+\tan^{2}(\cos(x)) (x^{49}+x)^{1000}.$$

Task 18.4

The last problem for prep each day will point to relevant problems from OpenStax. Spend 30 minutes working on problems from the sections below.

  • Return to any of the previous day's OpenStax problems to locate extra practice.


Today

« October 2022 »

Sun

Mon

Tue

Wed

Thu

Fri

Sat

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31