# Flux Integral in spherical coordinates

I need to know if my solution and answer to this problem is correct.

The problem is to calculate the flux through the unit sphere centered in origin from the vector field $\vec{A}$

The vector field: $\vec{A}=\frac{1}{r^2}\hat{e}_{r}$

The surface: $S = Unit \space sphere \space centered \space at \space origin$

The flux through the surface $S$ is given by: $\int_{S}\vec{A}\space\cdot\space d\vec{S}$

$$d\vec{S}=r^2\sin\theta \,d\theta d\phi\hat{e}_{r}$$

$$\int_{S}\vec{A}\space\cdot\space d\vec{S}=\int_{s}(\frac{1}{r^2}\hat{e}_{r})\cdot(r^2\sin\theta \,d\theta d\phi\hat{e}_{r})=\int_{S}\sin\theta \space d\theta d\phi=\int_{0}^{2\pi}\int_{0}^{\pi}\sin\theta \ d\theta d\phi=4\pi$$

We know from gauss' law that $$\int E.ds = \frac {Q_{in}}{\epsilon_0}$$
Lets apply this, for a point charge at origin where $$E=\frac {Q_{in}}{4\pi \epsilon_0 r^2} e_r$$
So in your problem you are essentially doing the same thing where $$\frac {Q_{in}}{4\pi \epsilon_0}$$ is taken to the other side of the Gauss's equation