I am doing a simple line integral, but I am getting an inconsistency. I don't know what I am doing wrong.
$$ \int_{C} \vec{F}(\vec{x},\vec{y},\vec{z}).d\vec{l} = \int(\hat{z}).(dx\hat{x}+dy\hat{y}+dz\hat{z}) = z $$
When I try to do the same integral in spherical coordinates I get:
$$ \int_{C} \vec{F}(\vec{r},\vec{\theta},\vec{\phi}).d\vec{l} = \int[cos(\theta)\hat{r}-sin(\theta)\hat{\theta}].(dr\hat{r}+rd\hat{\theta}+rsin(\theta)d\phi\hat{\phi}) = rcos(\theta)+rcos(\theta)=2z \ne z $$