Well I don't know the relevant mathematics so why not explain it all for people like me so we can understand?
I'll try to do it in laymans terms to an extent.
(1) is Gauss's Law for Gravitational pull. I'll go ahead and assume you trust that it is correct and Gauss was right.
Basically it says we take make a surface around said object. We divide this up into extremely tiny "bits". For each bit we designate a vector that is pointing outwards from this "bit" -
n that is a unit vector. We designate another vector for the pull that this tiny "bit" causes due to gravitation, lets call it
g. If we add up the first vector dotted with the second times the area of that bit for all of the bits we get -4*pi*G*m, where m is the mass inside said surface.
The object in this case is an infinite plane. The surface we'll use for this will be a cylinder.
Now, the edges of the cylinder won't matter for this since all the edges' n is perpendicular to the pull towards the mass. If you take the dot of two perpendicular vectors we get 0.
For the rest we have two vectors facing opposite directions. One of them is a unit vector. When we take the dot product of these we are left with the negative of the other - g. so
n.g=-g. So obviously we can go ahead and pull that out of the integral. This leaves us a (2). We are just left with dA. In this case this evals to (3) since we are dealing with the parallel two tops of the cylinder.
We use the surface density here and arrive at (4).
I was in a hurry here because I haven't left for dinner yet. We decided to go out so I had a bit longer, but not much. Let me know if I borked something up here and I'll fix the typo/mindfart later.