Integration over $S^2$ in electrostatics I'm studying for a test in electrostatics and I'm always failing on putting up the correct integrals.
In one problem I have the surface of a sphere with radius $a$ and an opening angle of $2\theta$. There is a total charge $Q$ evenly distributed on the surface. I want to calculate the potential.
In order to calculate the potential I first have to calculate the surface charge distribution, $\sigma(r)$, and this is where I always fail. I've done like this:
$Q=\sigma A=\sigma 4\pi r^2$
Then I tried to convert this into spherical coordinates by changing $r$ into $r=a \sin\theta \cos\phi +a \sin\theta \sin\phi +a \cos\theta$
The correct integral should be 
$Q=\sigma a^2\int_0^\theta \sin \theta d\theta \int_0^{2\pi}\!d\phi$
Can someone explain how to put up integrals like these? 
 A: The induced metric on a sphere $S^2$ of radius $r$ is given by,
$$\mathrm{d}s^2 = g_{\mu\nu}\mathrm{d}x^\mu \mathrm{d}x^\nu = r^2\mathrm{d}\theta^2 + r^2 \sin^2 \theta \, \mathrm{d}\phi^2$$
We find $\sqrt{g}=r^2 \sin \theta$, and the surface area must be given by the integral,
$$A = \int_{S^2} \mathrm{d}^2 x \, \sqrt{g}= \int_{0}^{2\pi} \! \! \mathrm{d}\phi  \int_0^\pi \! \mathrm{d}\theta \, (r^2 \sin \theta)=4\pi r^2$$
If a net charge $Q$ is distributed evenly on the surface of a sphere, the charge density is,
$$\sigma = \frac{Q}{A} = \frac{Q}{4\pi r^2}$$
The integral provided in the question is also an integration over a sphere of radius $a$, but in more generality for any angle $\theta$; we chose $\theta=\pi$ to integrate over all of $S^2$. Otherwise, the integral is nothing more than that.

Addendum: Induced Metric
How did we find $g_{\mu\nu}$? The embedding of a sphere $S^2$ in $\mathbb{R}^3$ is given by,
$$X^\mu =\left(r\cos\theta\sin\phi, r\sin\theta\sin\phi, r\cos\phi\right)$$
The induced metric is given by the pullback of $\mathbb{R}^3$ onto the sphere,
$$g_{ab}=\frac{\partial X^\mu}{\partial \sigma^a} \frac{\partial X^\nu}{\partial \sigma^b}\delta_{\mu\nu} $$
as $\delta_{\mu\nu} = \mathrm{diag}(1,1,1)$  is the metric of $\mathbb{R}^3$. The embedding itself is a solution to,
$$x^2 +y^2 +z^2 = r^2$$
which is the standard equation of a sphere in $\mathbb{R}^3$ centered at the origin.
