Integrating $1/x$ on unit sphere (quaternions) 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.
 A: I am posting this to get more information about the exact meaning of both $dq$ as well as the product in $\dfrac1q?dq$.

There is some ambiguity about the nature of this integral. Your sources should make clear what $dq$ really means here, and that should resolve the ambiguity. I give somewhat plausible interpretations, but cannot be certain :-(

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):


*

*If the product in $\dfrac1q\,dq$ is a product of quaternions, then $$ \frac{1}q\,dq=\cos\theta\,d\phi\,d\theta, $$ and integrating this over the parameter range gives $4\pi$ = the surface area as the answer.

*Normally the surface integral of a vector field is about the dot product of the vector field to be integrated and the surface element $d\mathbf{S}$. This would give the result of the preceding bullet, but with a minus sign as the vector field $1/q=-q$ (see reuns's comment), and therefore the dot product (in $\Bbb{R}^3$) is $\dfrac1q\cdot q=(-q)\cdot q=-1$.

*If the product in $\dfrac1q\,dq$ is the cross product of vectors, then it vanishes as does the integral. On second thought this interpretation feels strange. Leaving it here only because it was in the first edition of my answer.

*But, if $dq$ is to mean a scalar valued measure on the sphere, and the integral is to be vector-valued (or what amounts to the same, quaternion-valued), then we are to calculate the integral
$$\int_{S^2}\frac1{q(\theta,\phi)}\cos\theta\,d\theta\,d\phi,$$ which is obviously the zero quaternion. This feels a more natural answer to me. In the spirit of reuns's comment we are in a sense calculating the average of $1/q$ over the sphere, and this can only be zero!


Of course, if we switch the orientation of the surface, then the signs in the two first bullets are swapped. Go figure?
