# Electric potential due to an infinite polarized sheet

I have an infinite plane (no thickness) with a uniform dipole density $\mathbf p = p \mathbf n$, with $\mathbf n$ being the normal to the plane. So the surface charge density is $\sigma = \mathbf p \bullet \mathbf n = p$. Then, if we consider an infinitesimal surface element $\mathrm dS$, it has a charge of $p \mathrm dS$.

Consider a point $M$ floating in space $z$ units above the plane. I want to express the position of a point on the plane via the angles $\theta, \varphi$ seen by $M$. Basically, from this picture:

We can see that the $x$ and $y$ coordinates of a point on the plane are: \begin{align*} x &= r \cos\varphi = z \tan\theta \cos\varphi\\ x &= r \sin\varphi = z \tan\theta \sin\varphi\\ \end{align*}

with $\theta \in [0,\pi/2]$ and $\varphi \in [0,2\pi]$.

Also, the distance from a point on the plane to $M$ is $|z| \sec\theta$.

Then, via magic/Jacobian determinant, we find out that: $$\mathrm dS = z^2 \tan \theta \sec^2 \theta \mathrm d\theta \mathrm d\phi$$

Then the electric potential is:

\begin{align*} \phi(M) &= \frac{1}{4\pi\epsilon_0} \int_0^{\tfrac{\pi}{2}}\int_0^{2\pi} \frac{p z^2 \tan\theta \sec^2 \theta}{|z| \sec\theta} \mathrm d \theta \mathrm d\varphi\\ &= \frac{|z|p}{2 \epsilon_0} \int_0^{\tfrac{\pi}{2}} \tan\theta \sec\theta \mathrm d \theta\\ &=\pm \infty \end{align*}

EDIT: I figured the problem! To express the potential as that integral, you are implicitly assuming the potential is zero at infinity. But the potential isn't zero at infinity if we have charges or dipoles at infinity. After realizing this, I managed to get the thing to work. The potential is $\phi = \frac{|z|p}{2\epsilon_0}$.