This was a problem I encountered while solving my homework.
PROBLEM:The potential $\phi(x,y,z)$ at any point $P$ due to the charges $q_i, i=1,2,..,n$ with respective position vectors $\vec r_i, i=1,2,..,n$ is defined by the following formula: $$\phi=\sum_{m=1}^{n}\frac{q_i}{r_i}$$
Hence prove Gauss's Law: $\int \int_S \vec E\cdot d\vec S=4\pi Q$
where $S$ is the surface enclosing the charges, $Q$ is the total charge ($=\sum_{m=1}^{n}q_i$) and $\vec E$ is the electric field related to potential by $\vec E=-\nabla \phi$.
MY ATTEMPT: I assumed $\sigma$ to be the surface charge density and wrote
$$\phi=\int \frac{dq}{r} = \int \frac{\sigma}{r}dS$$
Now we know that $$\int \int\psi d\vec S=\int \int \int (\nabla\psi) dV =\int \int \int (\nabla (\frac{\sigma}{r})) dV = -\int \int \int (\frac{\sigma\cdot\vec r }{r^3}) dV$$ assuming $S$ encloses a volume $V$.
I don't know what to do next. Can anyone help with the proof?
If possible can you give a hint as to how I should calculate $\nabla \phi$?
You should consider using the divergence theorem.
$$\int E \cdot dS = \int \nabla \cdot E \, dV = -\int \nabla^2 \phi \, dV$$
You will need to know what $\nabla^2 \frac{1}{|\vec r - \vec r_i|}$ is. If you do not already know this (or have not already been told what it is), you might be able to reason out what the integral is regardless.
If not, you will have to be careful computing this Laplacian of a point charge potential. A naive computation using the derivative definition of $\nabla$ will tell you it's zero. Instead, consider using the limit definition of the divergence: for any vector field $F$:
$$\nabla \cdot F(\vec r) = \lim_{\epsilon \to 0} \frac{1}{4\pi \epsilon^3/3} \int_{\Omega} F(\vec r + \hat n \epsilon) \cdot \hat n \, \epsilon^2 \, d\Omega$$
In principle, the above integral can be carried out in any coordinate system, not the spherical angular coordinates used here, but this form should be convenient for this problem.