Hi i was wondering if anyone could show me how to calculate the potential energy of the conservative force $$F=(-x,2yz,y^2)$$ i know that the correct answer is $U=\frac{1}{2}x^2-y^2z$ i know that $-\nabla U=F$ $\implies U=-\int_0^rF.dr$ so $$U=-\int_0^{(X,Y,Z)}-xdx-\int_0^{(X,Y,Z)}2yzdy-\int_0^{(X,Y,Z)}y^2dz$$ clearly then from this $$U=\frac{1}{2}x^2-y^2z-y^2z\ne \frac{1}{2}x^2-y^2z$$ i dont understand how i'm going wrong if someone could tell me that would be great, Thanks.
New approach $$U(\vec{r})=-\int_0^\vec{r}\vec{F}(\vec{r}').d\vec{r'}$$ so let $\vec{r'}=\vec{r}\lambda$ $\implies d\vec{r'}=d\lambda\vec{r}$ so $$U(\vec{r})=-\int_0^1F_x(\vec{r}\lambda)xd\lambda-\int_0^1F_y(\vec{r}\lambda)yd\lambda-\int_0^1F_z(\vec{r}\lambda)zd\lambda$$ $$=-\int_0^1-x^2\lambda d\lambda-\int_0^12\lambda ^2zy^2d\lambda-\int_0^1y^2\lambda^2d\lambda$$ $$=\frac{1}{2}x^2-\frac{2}{3}y^2z-\frac{1}{3}y^2z$$$$=\frac{1}{2}x^2-y^2z$$
$\nabla U = \frac {\partial U}{\partial x} ,\frac {\partial U}{\partial y}, \frac {\partial U}{\partial z}$
$U = \int \frac {\partial U}{\partial x} dx = \int \frac{\partial U}{\partial y} dy = \int \frac {\partial U}{\partial z} dz$
$\int \frac {\partial U}{\partial x} dx = \int x\ dx = \frac 12 x^2 + f(y,z)$
Noitce I have an arbitrary function instead of a constant.
$\int \frac {\partial U}{\partial y} dy = \int -2yz\ dy = -y^2z + g(x,z)$
$ \frac 12 x^2 + f(y,z)= -y^2z + g(x,z)$
gives us some idea what these mystery fuctions must be.
$\frac 12 x^2 - y^2z + h(z)$
$\int \frac {\partial U}{\partial z} dz = \int -y^2\ dz = -y^2z + k(x,y) = \frac 12x^2 - y^2z + h(z)\\ y^2z - \frac 12 x^2$