# simple deriving of a function - preparing for hesse-matrix

$f(x,y) = 2x^2-2xy^2+y^2$

I want to prepare this function for a hesse-matrix. But I'm stuck at deriving.

I get $\frac{\partial f^2}{\partial^2 x} = 4$

$\frac{\partial f^2}{\partial y^2} = 4x + 4$

$\frac{\partial f^2}{\partial x \partial y} = 4x - 4y + 2y$

which is obviously wrong. but I can't tell why.

• You have somehow lost that the first and last terms of $f$ don't contain both variables, hence their mixed derivative vanishes, leaving only the mixed derivative of $-2xy^2$ to stay. Jul 9, 2013 at 19:18
• If I understood right, I end up with $4y$ for the last term? Jul 9, 2013 at 19:21
• Wrong sign. It's $-4y$. Jul 9, 2013 at 19:22

When $f=2x^2-2xy^2+y^2$ so $$f_x=4x-2y^2\to f_{xx}=4, ~~f_{xy}=-4y\\ f_y=-4xy+2y\to f_{yy}=-4x+2\\$$ This means that $$D=f_{xx}f_{yy}-f^2_{xy}=4\times(-4x+2)-(-4y)^2$$
• Thanks for your detailed answer! I think my professor has a fault in their exercises. since they end up with the hesse matrix $\begin{pmatrix} 4-4y & -4y \\ -4y & -4x+2 \end{pmatrix}$ which should be wrong with $f_{xx} = 4$ Jul 9, 2013 at 19:27