# Gauss's Law understanding

In the case of a point charge $q$ at the origin, the flux of $\vec{E}$ through a sphere of radius r is, $$\oint \vec{E}\cdot d\vec{a} = \int \frac{1}{4 \pi \epsilon_0 }(\frac{q}{r^2}\hat{r})\cdot (r^2 \sin\theta d\theta d\phi \hat{r})=\frac{1}{\epsilon_0}q.$$ I want to know that, how the above equation has the value of $\frac{1}{\epsilon_0}q$?

-
The integral is pretty trivial... what do you get when you simplify the terms? – DilithiumMatrix May 29 '13 at 6:25

Notice that the factors of $r^2$ cancel, and $\hat r\cdot\hat r = 1$ so the integral expression you wrote down reduces to $$\frac{q}{4\pi\epsilon_0}\int \sin\theta \,d\theta \,d\phi$$ The bounds of integration are $0<\theta<\pi$ and $0<\phi<2\pi$ so we really need to compute $$\int_0^\pi \sin\theta\,d\theta\int_0^{2\pi}d\phi = 2(2\pi) = 4\pi$$ so the factors of $4\pi$ cancel and we are left with $q/\epsilon_0$ as desired.
Because $\hat{r}\cdot\hat{r}=1$, hence $\frac{q\hat{r}}{r^2}\cdot r^2\sin\theta d\theta d\phi\hat{r}=q\sin\theta d\theta d\phi$, and the integral of that over a sphere is $4\pi q$, giving the result.