We have been asked to verify stokes theorem for a magnetic field.
We know Stokes theorem states, for any vector field $\vec{H}$: $$\int_S{(\nabla \times \vec{H}) \cdot \vec{dS}} = \oint_L{\vec{H} \cdot \vec{dL}}$$
The field is given in the cylindrical co-ordinate system by:
$$\vec{H} = (\frac{cos(\frac{ϕ}{2})}{2}, -\sin(\frac{ϕ}{2}), 0)$$
Naturally, $$\nabla \times \vec{H} = (0, 0, -\frac{3 \sin(\frac{ϕ}{2})}{4 \rho}) = \vec{J}$$
We were given the area $0<\rho<3 , 0<ϕ<2\pi, z = 2$
However, evaluating the 2 sides of stokes theorem over the surface and the perimeter, we get.
$$\int_0^{2\pi}\int_0^3{{\vec{J} \cdot (\rho d\rho dϕ\space \hat{az}})}=-9$$
and $$\int_0^{2\pi}{\vec{H} \cdot (\rho dϕ\space \hat{aϕ})} = -12$$
$\hat{aϕ}$ and $\hat{az}$ are unit vectors along $ϕ$ and $z$ respectively.
I can't figure out why the 2 sides of stokes theorem are not matching up.
For those not wanting to translate in and out of cylindrical coordinates, $\vec H$ corresponds to the $1$-form $\omega = \frac12\cos(\phi/2)dr - \sin(\phi/2)(r\,d\phi)$, and $d\omega = -\frac34\sin(\phi/2)dr\wedge d\phi$. If $D = \{r\le 3, z=2\}$, oriented upward, then \begin{align*}\int_{\partial D}\omega &= -3\int_0^{2\pi}\sin(\phi/2)d\phi = -3(4)=-12 \quad\text{and} \\ \int_D d\omega &= -\frac34\int_0^{2\pi}\int_0^3\sin(\pi/2)dr\,d\phi = -\frac34(12) = -9. \end{align*} So what gives?
In a word, Stokes's Theorem cannot be applied here. The force field in question must be continuously differentiable throughout the surface. Your $\vec H$ is not even continuous (or well-defined): Note that $\vec H(r,0,z)\ne\vec H(r,2\pi,z)$.