Potential energy $U(\vec{r})$ of a conservative force field $\vec{F}$ is defined as a function whose variation between positions $\vec{r}_A$ and $\vec{r}_B$ is the opposite of the work done by the force field to move a pointlike body between the positions considered.
Gradient $U(\vec{r})$ is usually introduced as the vector field: $$ \vec{\nabla} U = \frac{\partial U}{\partial x}\hat u_x+\frac{\partial U}{\partial y}\hat u_y+\frac{\partial U}{\partial z}\hat u_z.$$
It is then shown that $\vec{F}=-\vec{\nabla} U$.
So it seems that to define the gradient, cartesian coordinates are necessary. But is this true? What happens if the potential energy is not expressed as a function of $x,y,z$?