I've been trying to think of a potential to derive for the vector field
$$ \vec{F}(r,\theta,z) =-mg\sin(\theta) \hat{e}_{\theta} .$$
I'm assuming this is a force as in physics so the potential is assumed to respect $\vec{F}(r,\theta,z)= -\nabla\phi$. However, when I put the two equations on equal footing and begin to work on through the algebra/calculus it then appears as if I end up with my answer but certain integration constants come up with a result that would be a zero vector field with a constant potential field. Given that
$$ \nabla = \frac{\partial }{\partial r}\hat{e}_{r} + \frac{1}{r} \frac{\partial }{\partial \theta}\hat{e}_{\theta} + \frac{\partial }{\partial z}\hat{e}_{z} .$$
Then
$$ - \frac{\partial \phi}{\partial r} = 0 $$ $$ - \frac{1}{r} \frac{\partial \phi}{\partial \theta} = -mg\sin(\theta) $$ $$ - \frac{\partial \phi}{\partial z} = 0 .$$
From the middle equation above it follows that
$$ \phi = -mgr\cos(\theta) + h(r,z) . $$
So my answer is nearly there and if I insert it into the third, to figure out the integration constant, I get
$$ h_{z}(r,z) = 0 $$ $$ h(r,z) = c_{z} + g(r) .$$
The final integration constant is then found by inputting $ \phi = -mgr\cos(\theta) + c_{z} + g(r) $ into the first relation. This leads to
$$ -mg\cos(\theta) + g_{r}(r) = 0 $$ $$ g_{r}(r) = mg\cos(\theta) $$ $$ g(r) = mgr\cos(\theta) + c_{r}.$$
Which results in $\phi = c_{z} + c_{r}.$ This doesn't seem right as I was expecting a function of $\theta$ and got a constant function. Did I do something wrong or is what I seek impossible? Is the field not truly conservative?