I'm trying to find the potential function for $F(x,y)=<x^2-y;x-y>$
So I started by integrating the first component: $$\int (x^2-y) dx = \frac {x^3}{3}-yx+h(y)$$ From that, I took a partial derivative with respect to $y$ and got: $$f_y=-x+h'(y)$$
So I'm now trying to find what $h(y)$ is, so I set the previous derivative equal to the y-derivative I got from $F(x,y)$: $$-x+h'(y) = x-y$$ But, here's the problem: solving for $h'(y)$ gives me $h'(y)=2x-y$ and if I integrate this I get an extra $x$ that ruins my whole thing: $$h(y)=\int (2x-y)dy = 2xy- \frac 1 2 y^2$$ If I try to plug this into my potential function I'd get $\frac {x^3}{3}-yx+2xy- \frac 1 2 y^2$ which doesn't work. However, if I could just get rid of the minus sign in the $f_y$ I found, everything would be better. But on what basis can I get rid of it? Is it possible? Or I'm just missing something in my whole process?