I'm trying to prove that the potential generated by a infinitesimally thin surface density with constant $\Sigma$ at $z = 0$ is equal to $$\Phi = 2 \pi G \Sigma |z|$$ using Poisson's equation $$\nabla^2 \Phi = 4 \pi G \rho$$ where $\rho$ is the volume density.
So given that the mass is distributed essentially all over the plane $z=0$ the next relation can be drawn $$\rho = \delta(z) \Sigma$$
Now replacing this in the Poisson equation we get $$\frac{\mathrm{d}^2\Phi}{\mathrm{d}z^2} = 4 \pi G \Sigma \delta(z)$$
By integrating over $z$, given the definition of the Dirac Delta we have $$\frac{\mathrm{d}\Phi}{\mathrm{d}z} = 4\pi G \Sigma - C$$ Now this is where I have my doubts about my proceedings. If I take the derivative with respect to $z$ of the last equality, the right hand side becomes zero, which is not consistent with the Poisson equation. What am I doing wrong here.
I know I can get the right answer easily using the Gauss theorem, but I need to solve it using this method.