= Solution
The outward <area element> is $d\boldsymbol S=a^2\sin\theta\,d\theta\,d\phi\,\boldsymbol e_r$. Therefore
$$
\boxed{\int_S\boldsymbol B\cdot d\boldsymbol S=\int_0^{2\pi}\int_0^\pi\sin\theta\,d\theta\,d\phi=4\pi.}
$$
Split the sphere into the northern cap $0\leq\theta\leq\alpha$ and the southern cap $\alpha\leq\theta\leq\pi$. Their induced boundary orientations are $+C$ and $-C$, respectively. The <Stokes theorem> applies to $\boldsymbol A^{(+)}$ on the north and $\boldsymbol A^{(-)}$ on the south. Adding their fluxes gives $2\pi(1-\cos\alpha)+2\pi(1+\cos\alpha)=4\pi$, agreeing with direct integration.
There is no contradiction with the flux of a globally smooth <curl> through a closed surface: neither potential is regular on the entire sphere. On their overlap they differ by $2\boldsymbol e_\phi/(r\sin\theta)=2\nabla\phi$, a local <gauge transformation>. The longitude is not a globally single-valued scalar, so that difference can have nonzero circulation around $C$.
Back to article page