I have to solve the equation $$f(x,y) = x^2e^{-y}$$ calculating the second partial derivatives for $x$ and $y$.
I had no problem for variable $y$, I did it and it is correct.
For the variable $x$ I have a lot of problem.It's not the first time that I had difficulties deriving an equation like this. I tried :
$$ fx(x,y)=2xe^{-y}$$ $$fxx(x,y)=2e^{-y}$$
also for $$fxy(x,y)$$ I had difficulties
Your book seems to assume that $y$ is a function of $x$, and not independent on $x$.
In this case when you derive you'll also have the terms with $y'(x)$.
But if you set $y'(x) =0$ (treating $y$ as a constant wrt to $x$) then you'll recover your result.