To find the gravitational potential in an infinite slab of incompressible self-gravitating fluid, start by applying the Poisson equation and using Gauss's law for the gravitational field. The gravitational flux through a closed surface relates to the total mass inside, leading to the potential being derived from the gravitational field. Inside the slab, the potential is quadratic, while outside it is linear. Consideration of pressure and boundary conditions is essential, as they affect the dynamics of the fluid. The final expressions for the potential are V = (1/2)G rho (z)^2 for |z|<a and V = G rho a (|z| - (1/2)a) for |z|>a.