I have an issue with integrating over the unit sphere in $\mathbb{H}$ (quaternions). The integral is :
$$\oint_{\mathbb{S}^2} \frac{1}{q} dq$$ with $$q\in \mathbb{H}, q=ia+jb+kc, (a,b,c) \in \mathbb{R}^3$$ yet we do not use the real numbers to have a 3-dimensional space.
So I used that property : if we have
$$ \begin{align*} \gamma \colon & [a;b] \to \mathbb{C}\\ &t \mapsto \gamma(t). \end{align*} $$ then $$\int_\gamma f(\zeta) d\zeta = \int_a^b f(\gamma(\xi)) \gamma'(\xi) d\xi$$
Note that I supposed that we can adapt this property to quaternions.
So, after changing this in a "normal" integral, I got :
$$\int_{-\pi / 2}^{\pi / 2} \int_{- \pi}^{\pi} \frac{i \cos^2(\theta) \cos(\phi)-j \cos^2(\theta)\sin(\phi)-k\cos(\theta)\sin(\theta)\cos^2(\phi)+k\cos(\theta)\sin(\theta)\sin^2(\phi) }{i\cos(\theta)\cos(\phi) + j\cos(\theta)\sin(\phi)+k\sin(\theta)} d\phi d\theta$$
with using the parametrization of unit sphere :
$$\mathbb{S}^2(\theta,\phi) : \left\{ \begin{align*} x(t) &= \cos(\theta)\cos(\phi) \\ y(t) &= \cos(\theta)\sin(\phi) \\ z(t) &= \sin(\theta) \end{align*} \right\} $$
and so
$$ \mathbb{S}^2(\theta,\phi)= \begin{align*} &i \cos(\theta)\cos(\phi) \\ + &j \cos(\theta)\sin(\phi) \\ + &k \sin(\theta) \end{align*} $$
yet we do not use the real numbers.
And the quaternion-adaptation for the property seen above :
$$\int_{-\pi / 2}^{\pi / 2} \int_{- \pi}^{\pi} \frac{(d \mathbb{S}^2(\theta,\phi)/d\theta)(d \mathbb{S}^2(\theta,\phi)/d\phi)}{\mathbb{S}^2(\theta,\phi)} d\phi d\theta$$
And there's the issue :
The result is divergent, however, we easily can see than $1/q$ has only one pole (or singularity) at $q=0$ yet $\mathbb{S}^2$ does not pass trought this point.
I certainly make a mistake but I am not able to determine which even if I strongly think that the mistake is about the quaternion-adaptation of the seen property.
Thanks you for helping.
I am posting this to get more information about the exact meaning of both $dq$ as well as the product in $\dfrac1q?dq$.
If this is to be a surface integral over the unit sphere, here's how it could go.
The surface of the unit sphere is, indeed, parametrized as $$ q(\theta,\phi)=\cos\theta\cos\phi \mathbf{i}+\cos\theta\sin\phi\mathbf{j}+\sin\theta\mathbf{k} $$ with $\phi\in[0,2\pi)$ growing from West to East and $\theta\in[-\pi/2,\pi/2]$ growing from South to North. I am following your parametrization. Usually the spherical coordinate $\theta\in[0,\pi]$ grows from North to South and measures the latitude difference from the North Pole as opposed to the difference from the Equator which is what your $\theta$ measures.
Anyway, we need the surface element $d\mathbf{S}$ on the unit sphere. It is gotten as the cross product of the derivatives $$ \frac{\partial q}{\partial\theta}=-\sin\theta\cos\phi\mathbf{i}-\sin\theta\sin\phi\mathbf{j}+\cos\theta\mathbf{k} $$ pointing North along a meridian, and $$ \frac{\partial q}{\partial\phi}=-\cos\theta\sin\phi\mathbf{i}+\cos\theta\cos\phi\mathbf{j} $$ pointing East along a latitude. More often than not we orient the surface of the sphres to have an outward pointing normal, so I calculate the cross product in the following order $$ \begin{aligned} d\mathbf{S}&=\frac{\partial q}{\partial\phi}\times \frac{\partial q}{\partial\theta}\,d\phi\,d\theta\\ &=\left(\cos^2\theta\cos\phi\mathbf{i}+\cos^2\theta\sin\phi\mathbf{j}+\cos\theta\sin\theta\mathbf{k}\right)\,d\phi\,d\theta\\ &=\cos\theta\, q\,d\phi\,d\theta. \end{aligned} $$ Therefore (sorry about being worried about non-commutativity of the product of quaternions – doesn't play a role here):
Of course, if we switch the orientation of the surface, then the signs in the two first bullets are swapped. Go figure?