Question Reads :
\begin{align*} \text{Let }\ u(x,y) &= \pi y^2e^x + y+\pi/2 \\ f(x,y) &= x-cos(u(x,y)) \end{align*}
Deduce the gradient and Hessian of $u(x,y)$
Deduce the gradient and Hessian of $f(0,0)$ at .
The $u(x)$ part is easy enough. I got gradient =
$\nabla u= \left(\begin{matrix}\pi y^2e^x \\ 2\pi e^x y +1 \end{matrix}\right),\quad$
Hessian : $ \left(\begin{matrix}\pi y^2e^x & 2\pi e^x y \\ 2\pi e^x y & 2\pi e^x \end{matrix}\right),\quad$
...
So far so good, but here I'm not sure what the wisest option is.. I could probably find the derivatives of $x-\cos(\pi y^2e^x + y+\pi/2)$ using simple chain rule but I imagine the result will be a mess and the Hessian even worse. Is there a more clever way to do this?