This is Day 7 in Unit 2.

Brain Gains (Rapid Recall, Jivin' Generation)

  • Let $f(x,y)=ax+by$ and $\vec r(t) = (ct+d, et+f)$. Compute $\frac{df}{dt}$.

Solution

Two options:

  1. Substitute, so $f(\vec r(t)) = a(ct+d)+b(et+f)$, and then differentiate.
  2. Compute differentials, so $df=adx+bdy$, $dx=cdt$, and $dy=edt$, and then substitute.

Either way, we end up with $$\dfrac{df}{dt} = ac+be.$$ Symbolically, we have $$\frac{df}{dt} = \underbrace{a}_{f_x}\underbrace{c}_{\frac{dx}{dt}}+\underbrace{b}_{f_y}\underbrace{e}_{\frac{dy}{dt}} = f_x\frac{dx}{dt}+f_y\frac{dy}{dt}. $$ We call this the chain rule.

  • The hyperbola $x^2-y^2=5$ passes through the point $(3,2)$. Differentials tell us $2xdx-2ydy = 0$. Give an equation of the tangent line to this curve at $(3,2)$.

Solution

Let $(x,y)$ be a point on the tangent line.

  • The change in $x$ along the tangent line from $(3,2)$ to $(x,y)$ is $dx = x-3$.
  • The change in $y$ along the tangent line from $(3,2)$ to $(x,y)$ is $dy=y-2$.
  • Plugging $x=3$, $y=2$, $dx=x-3$ and $dy=y-2$ into the differential $2xdx-2ydy = 0$ gives the desired equation as $$2(\underbrace{3}_{x})\underbrace{ (x-3) }_{dx}-2(\underbrace{2}_{y})\underbrace{ (y-2) }_{dy} = 0.$$

Here are the computations, along with a plot, in Mathematica.

f[x_, y_] := x^2 - y^2

fx = D[f[x, y], x] /. {x -> 3, y -> 2};
fy = D[f[x, y], y] /. {x -> 3, y -> 2};
dx = x - 3;
dy = y - 2;
dz = 0;
tangentPlane = dz == fx dx + fy dy

xB = {x, -5, 5};
yB = {y, -5, 5};
p1 = ContourPlot[f[x, y] == 5, xB, yB]; p2 = 
 ContourPlot[Evaluate[tangentPlane], xB, yB, ContourStyle -> Red];
Show[p1, p2, Graphics[{PointSize[Large], Point[{3, 2}]}]]
  • Let $f(x,y)=2x^2+4y$, and $g(x,y)=2x+y$. Solve the system $\vec \nabla f = \lambda \vec \nabla g$ together with $g(x,y)=3$.

Solution

We have $\vec \nabla f = (4x,4)$ and $\vec \nabla g = (2,1)$. The equation $\vec \nabla f = \lambda \vec \nabla g$ means $$(4x,4) = \lambda(2,1) = (2\lambda,1\lambda).$$ This gives us the two equations $4x=2\lambda$ and $4 = \lambda$. The second equation tells us $\lambda=4$. The first equation tells us $x=2\lambda/4 = 2$. Substitution of $x=2$ into $2x+y=3$ tells us $y=-1$.

We can use Mathematica to complete all of the above, as well as provide a contour plot of $f$ along with the constraint $g=3$.

f[x_, y_] := 2 x^2 + 4 y
g[x_, y_] := 2 x + y
c = 3
gradf = D[f[x, y], {{x, y}}]
gradg = D[g[x, y], {{x, y}}]
Solve[{gradf == \[Lambda] gradg, g[x, y] == c}, {x, y, \[Lambda]}]

xB = {x, -3, 3}
yB = {y, -3, 3}
p1 = ContourPlot[f[x, y], xB, yB, Axes -> True, Frame -> None];
p2 = ContourPlot[g[x, y] == c, xB, yB, ContourStyle -> {Black, Thick}];
Show[p1, p2]
  • For the function $f(x,y) = 4x^2y+y^3$, compute $\ds\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial y}\right)$.

Solution

Since we know $\frac{\partial f}{\partial y} = 4x^2(1)+3y^2$, then we have $$\ds\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial y}\right) =\ds\frac{\partial}{\partial x}\left(4x^2(1)+3y^2\right) =8x. $$ We call the above the second partial derivative of f, first with respect to $y$, and then with respect to $x$. For this function $f(x,y)$, there are four total second partial derivatives of $f$, namely $$ f_{xx}=\ds\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial x}\right), \quad f_{xy}=\ds\frac{\partial}{\partial y}\left(\frac{\partial f}{\partial x}\right), \quad f_{yx}=\ds\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial y}\right), \quad f_{yy}=\ds\frac{\partial}{\partial y}\left(\frac{\partial f}{\partial y}\right). $$

  • For the function $f(x,y) = 4x^2y+y^3$, compute the four second partial derivatives $f_{xx}$, $f_{xy}$, $f_{yx}$, and $f_{yy}$, and then state the second derivative $D^2f(x,y)$.

Solution

We have $f_x = 8xy$ which gives

  • $f_{xx} = 8y$ and
  • $f_{xy} = 8x$.

We have $f_y = 4x^2(1)+3y^2$ which gives

  • $f_{yx} = 8x$ and
  • $f_{yy} = 6y$.

The second derivative is $$D^2f(x,y) = \begin{bmatrix}f_{xx}&f_{yx}\\f_{xy}&f_{yy}\end{bmatrix} = \begin{bmatrix}8y&8x\\8x&6y\end{bmatrix}.$$

With Mathematica, we have the following computation.

f[x_, y_] := 4 x^2 y + y^3
D[f[x, y], {{x, y}}, {{x, y}}]
% // MatrixForm
  • The eigenvalues of the matrix $\begin{bmatrix}a&b\\c&d\end{bmatrix}$ are the solutions to the equation $(a-\lambda)(d-\lambda)-bc=0$. Find the eigenvalues of the matrix $\begin{bmatrix}5&3\\2&4\end{bmatrix}$.

Solution

We have $$(5-\lambda)(4-\lambda)-(2)(3) = \lambda^2-9\lambda+20-6 = \lambda^2-9\lambda-14 = (\lambda - 7)(\lambda - 2).$$ This equals zero when $\lambda = 7 $ or $\lambda =2$.

Finding the eigenvalues of a 2 by 2 matrix will always result in solving a quadratic equation. Carefully chosen problems will factor nicely, but in general the eigenvalues will not be integers.

We can compute eigenvalues with Mathematica, as follows.

A = {{5, 3}, {2, 4}}
A // MatrixForm
Eigenvalues[A]

Group Problems

  1. Find the eigenvalues of the following matrices (take turns).
    • $\begin{bmatrix}2&4\\4&2\end{bmatrix}$, $\begin{bmatrix}2&3\\1&4\end{bmatrix}$, $\begin{bmatrix}1&6\\4&3\end{bmatrix}$, $\begin{bmatrix}3&2\\1&2\end{bmatrix}$.
    • Check: 6,-2; 5,1; 7,-3; 4,1
  2. A rover travels along the line $g(x,y)=2x+3y=6$. The surrounding terrain has elevation $f(x,y)=x^2+4y$. The rover reaches a local minimum along this path, and our job is to find the location of this minimum.
    • Compute $\vec \nabla f$ and $\vec \nabla g$.
    • Write the system of equations that results from $\vec \nabla f=\lambda\vec \nabla g$ together with $g(x,y) = 6$.
    • Solve the system above (you should get $x=4/3$ and $y=10/9$).
    • Use Mathematica to check your work and visualize the rover's path and how it relates to the elevation contours.
      f[x_, y_] := x^2 + 4 y
      g[x_, y_] := 2 x + 3 y
      c = 6
      gradf = D[f[x, y], {{x, y}}]
      gradg = D[g[x, y], {{x, y}}]
      Solve[{gradf == \[Lambda] gradg, g[x, y] == c}, {x, y, \[Lambda]}]
      
      xB = {x, -3, 3}
      yB = {y, -3, 3}
      p1 = ContourPlot[f[x, y], xB, yB, Axes -> True, Frame -> None];
      p2 = ContourPlot[g[x, y] == c, xB, yB, ContourStyle -> {Black, Thick}];
      Show[p1, p2]
      
  3. Consider the function $f(x,y)= 2x^2+3xy+4y^2-5x+2y$.
    • Find all critical points of $f$, so find when the first derivative equals zero. [Check: $(x,y) = (2,-1)$.]
    • Compute the second derivative $D^2f(x,y)$.
    • Determine the eigenvalues of the second derivative at the critical point. [Check: The eigenvalues are $\lambda = 6\pm\sqrt{13}$, so $\lambda \approx 9.6$ or $\lambda \approx 2.4$.]
    • Do we have a local max, local min, or saddle, at this critical point?
  4. 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 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)$. [Check: $0=8(x-1)+16(y-2)-6(z+3)$.]
    • Give an equation of the tangent plane to the level surface of $f$ that passes through $(a,b,c)$.


Today

« February 2023 »

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