Gauss’s law states that the flux of the electric field through any closed surface S is 1/∈ₒ times the total charge enclosed by S
Let the total flux through a sphere of radius r enclose a point charge q at its centre. Divide the sphere into a small area element as shown in the figure.

The flux through an area element ΔS is
\(\Delta \phi=E . \Delta S=\frac{q}{4 \pi \in_0 r^2} \hat{r} . \Delta S\)
Here, we have used Coulomb’s law for the electric field due to a single charge q.
The unit vector \(\hat{r}\) is along the radius vector from the centre to the area element. Because the normal to a sphere at every point is along the radius vector at that point, the area element ΔS and \(\hat{r}\) have the same direction. Therefore
\(\Delta \phi=\frac{q}{4 \pi \in_0 r^2} \Delta S\)
Because the magnitude of the unit vector is 1, the total flux through the sphere is obtained by adding the flux through all the different area elements.
\(\phi=\sum_{\text {all } \Delta S} \frac{q}{4 \pi \epsilon_0 r^2} \Delta S\)
Because each area element of the sphere is at the same distance r from the charge,
\(\phi=\frac{q}{4 \pi \in_0 r^2} \sum_{a l l \Delta S} \Delta S=\frac{q}{4 \pi \in_0 r^2} S\)
Now, S the total area of the sphere equals 4πr². Thus,
\(\pi=\frac{q}{4 \pi \epsilon_0 r^2} \times 4 \pi r^2=\frac{q}{\epsilon_0}\)
Hence, the above equation is a simple illustration of a general result of electrostatics called Gauss’s law