Travou nisso? Resolva com IA
Calculus · real student question

Compute the gradient and the directional derivative in the direction of the vector (0, -1) for the function f(x, y) = x^2 y + x e^(-xy).

Question

Compute the gradient and the directional derivative in the direction v=(0,−1)T\mathbf{v}=(0,-1)^{T} of

f(x,y)=x2y+xe−xy.f(x,y)=x^{2}y+x e^{-xy}.

Step-by-step solution

  1. Recall the rule and check the direction vector. For a unit vector v\mathbf v, the directional derivative is the dot product Dvf=∇f⋅vD_{\mathbf v}f=\nabla f\cdot \mathbf v. Here ∥(0,−1)∥=02+(−1)2=1\|(0,-1)\|=\sqrt{0^2+(-1)^2}=1, so v\mathbf v is already a unit vector and no normalisation is needed. Had it not been, we would have had to divide by its length first.

  2. Differentiate with respect to xx. The term x2yx^2y gives 2xy2xy. The term xe−xyxe^{-xy} needs the product rule together with the chain rule, since ∂xe−xy=−ye−xy\partial_x e^{-xy}=-y e^{-xy}:

    ∂∂x(xe−xy)=e−xy−xy e−xy.\frac{\partial}{\partial x}\left(xe^{-xy}\right)=e^{-xy}-xy\,e^{-xy}.

    So

    fx=2xy+(1−xy)e−xy.f_x=2xy+(1-xy)e^{-xy}.

  3. Differentiate with respect to yy. Now xx is a constant, so x2yx^2y gives x2x^2, and ∂ye−xy=−xe−xy\partial_y e^{-xy}=-x e^{-xy} makes the second term −x2e−xy-x^2 e^{-xy}:

    fy=x2−x2e−xy=x2(1−e−xy).f_y=x^{2}-x^{2}e^{-xy}=x^{2}\left(1-e^{-xy}\right).

  4. Assemble the gradient.

    ∇f(x,y)=(2xy+(1−xy)e−xyx2(1−e−xy)).\nabla f(x,y)=\begin{pmatrix}2xy+(1-xy)e^{-xy}\\[2pt] x^{2}\left(1-e^{-xy}\right)\end{pmatrix}.

  5. Dot with the direction. Because v=(0,−1)\mathbf v=(0,-1) kills the first component, only the yy-partial survives, with a sign flip:

    Dvf=∇f⋅(0,−1)=−fy=−x2(1−e−xy)=x2(e−xy−1).D_{\mathbf v}f=\nabla f\cdot(0,-1)=-f_y=-x^{2}\left(1-e^{-xy}\right)=x^{2}\left(e^{-xy}-1\right).

    That is exactly what the geometry says: moving in the −y-y direction is moving backwards along yy, so the rate of change is the negative of fyf_y.

  6. Spot-check numerically. At (x,y)=(1.3,0.7)(x,y)=(1.3,0.7) a central difference gives fx≈1.856227f_x\approx 1.856227 and fy≈1.009734f_y\approx 1.009734, matching the formulas, and Dvf≈−1.009734D_{\mathbf v}f\approx-1.009734. At (−2,1.5)(-2,1.5) the formula gives Dvf≈76.342D_{\mathbf v}f\approx 76.342, again matching the numerical derivative.

Answer

∇f=(2xy+(1−xy)e−xy, x2(1−e−xy)),D(0,−1)f=−x2(1−e−xy)\nabla f=\left(2xy+(1-xy)e^{-xy},\ x^{2}\left(1-e^{-xy}\right)\right),\qquad D_{(0,-1)}f=-x^{2}\left(1-e^{-xy}\right)

Need to solve a different problem like this? Open the solver →