Electric field of infinite sheet I have a question regarding the electric field of an infinite sheet in the $x-y$-plane at $z=0$ with a constant sheet charge density $\sigma$. There are many ways to obtain the result $$\boldsymbol E=\frac{\sigma}{2\epsilon_0}\frac{z}{|z|}\boldsymbol{e_z}$$ but I can't seem to recreate this result using the divergence theorem and a cylindric volume. Maybe someone can point out an error in my thoughts: Let's assume first $\boldsymbol E=E(z)\boldsymbol{e_z}$. Then we put a cylindric volume $V$ into the sheet such that it gets cut in half and its symmetry axis is the $z$-axis. Furthermore I want this cylinder to have height $2z$ (so that the top is located at $z$ and the bottom is located at $-z$) and radius $R$. Now, by the divergence theorem we have $$\begin{equation}\int_V\text{div}\boldsymbol EdV=\int_{\partial V}\boldsymbol E\cdot\boldsymbol{dA}.\tag{1}\end{equation}$$ By the maxwell equation $\text{div}\boldsymbol E=\frac{\sigma}{\varepsilon_0}$ we easily see that the left-hand side of $(1)$ is equal to $$\frac{\sigma}{\epsilon_0}\int_VdV=\frac{\sigma}{\epsilon}V=\frac{\sigma}{\epsilon_0}\pi R^2\cdot 2z.$$ Now for the right-hand side we first need the surface elements: 


*

*$\boldsymbol{dA}=Rd\varphi dz\boldsymbol{e_\varphi}$ for the lateral surface,

*$\boldsymbol{dA}=zrdrd\varphi\boldsymbol{e_z}$ for the top and

*$\boldsymbol{dA}=-zrdrd\varphi(\boldsymbol{-e_z})$ for the bottom.


Maybe this is already where my error is since this now means that the lateral surface cancels ($\boldsymbol{e_\varphi}\perp\boldsymbol{e_z}$) and we have $$\int_{\partial V}\boldsymbol E\cdot\boldsymbol{dA}=2zE(z)\int_0^R\int_0^{2\pi}rd\varphi dr=2\pi R^2 E(z)z$$ So here I must have lost a factor of 2 and also I don't obtain the fact that the electric field changes the direction at $z=0$. Whereas my second problem can probably be fixed by just assuming $$\boldsymbol E(z)=\begin{cases}E(z)\boldsymbol{e_z},& z> 0\\ -E(z)\boldsymbol{e_z}, &z<0\end{cases},$$ I have no idea how to fix the first problem: Where did my $2$ go?
 A: Your mistake comes from a misunderstanding about the charge density. It is not uniformly distributed through the volume of the cylinder; rather, it is concentrated in an infinitesimally thin sheet; namely, the volumetric charge density (which is what Gauss's Law gives you) is $\rho=\sigma\delta(z)$. So your integral on the left-hand side of (1) should be
$$\frac{\rho}{\epsilon_0}\int dV = \frac{\sigma}{\epsilon_0}\int dA \int \delta(z) dz$$
Since, for any region of integration containing $0$, we have that $\int \delta(z) dz =1 $, therefore, this integral evaluates to
$$\frac{\sigma}{\epsilon_0}\pi R^2$$
which is the total charge enclosed by your Gaussian surface divided by $\epsilon_0$. Incidentally, this would have been completely obvious had you used the integral form of Gauss's Law instead of the differential form.
A: The issue is in your definition of density, turns out that the volume density of charge in your problem is
$$
\rho = \sigma\delta(z - 0)= \sigma \delta(z) \tag{1}
$$
That way Maxwell's equation becomes
$$
\require{cancel}
\int_{\partial V}{\rm d}^2{\bf S}\cdot {\bf E} = \int_V{\rm d}^3{\bf r}~\nabla \cdot {\bf E} = \int_V{\rm d}^3{\bf r} \frac{\rho}{\epsilon_0} = \frac{\sigma}{\epsilon_0} \int{\rm d}x{\rm dy}\cancelto{1}{\int{\rm d}z \delta(z)} = \frac{\sigma A}{\epsilon_0} \tag{2}
$$
where $A$ is the area of your cylinder $A = \pi R^2$. Now, on the l.h.s you are right, split the boundary into three pieces, the normal vector on the sides is perpendicular to the field and its contribution will vanish. Leading to
$$
\int_{\partial V}{\rm d}^2{\bf S}\cdot {\bf E} = 2E A \tag{3}
$$
Putting these two results together
$$
E = \frac{\sigma }{2\epsilon_0}
$$
