# Gauss's Law problem

[SOLVED] Gauss's Law problem

## Homework Statement

An infinite slab of charge parallel to the yz-plane has density p for -b < x < b, 0 otherwise. Find the electric field at all points.

## The Attempt at a Solution

I am able to do the electric field outside the slab. But I am off by a factor of 1/2 for the electric field inside. I made a Gaussian cylinder that starts at the axis to x. I'll call the area of the circular faces $A = \pi r^2$. Since there are two of these faces, net flux is $2EA$. The charge enclosed in the surface is $\rho A x$.

$$2 E A = \frac{\rho A x}{\epsilon_0} => E = \frac{\rho x}{2 \epsilon_0}$$

My book says the solution is just $\rho x / \epsilon_0$. So, I know the error probably came from saying the flux was 2EA. But, for the electric field outside the slab, I used 2EA for the flux, and since the charge enclosed in a cylinder running from -x to x, for |x| > b, was 2b, the factors of 2's cancel out. Here they don't. I can't figure out what I'm doing wrong.

I suppose I could just say the flux was one EA because the field at x = 0 is 0. But, for the next problem, I have to find the electric field for a slab whose density is $\rho(x) = \rho_0 e^{-|x/b|}$, and I still have that extra 1/2 factor in there, without the field at x = 0 being 0.

Last edited: