# Finding the electric field of a NON uniform slab? [duplicate]

If we have an infinite slab that is not uniformly charged and is not a conductor, how can we find an expression for the electric field everywhere? Here's a picture

Things we know about the slab:

• The width is $2b$

• It is lying on the $yz$ plane (centered at the origin)

• the charge density varies as $\rho = \rho_0(x/b)^2$

where $\rho_{0}$ is constant.

I know that I have to use Gauss's law with a right Gaussian cylinder. This is what I have so far:

The closed integral

$$\int EdA = \frac{q_\text{enclosed}} {\epsilon_{0}} \, .$$

To solve for $q_\text{enclosed}$, I believe it would be $\int ρdV$.

From here, I can plug in $ρ_0(x/b)^2$ for $ρ$ and $dV$ is just the area of the circle (I'll call that $A$) multiplied by $dx$.

So the integral becomes (by pulling out all the constants) $ρ_0(1/b^2)A\int x^2dx$ and I am integrating from $-b$ to $b$. Evaluating these bounds in this integral gives me a final answer of $q$ enclosed of $\frac{2ρ_0Ab}{3}$.

## marked as duplicate by Kyle Kanos, ACuriousMind♦, John Rennie, Neuneck, WetSavannaAnimalAug 3 '15 at 12:41

There are a couple mistakes in your approach. $\rho A$ is not the enclosed charge. To get a charge from a charge density you need to multiply by volume not area, and since $\rho$ varies with $x$ you really need to integrate.

So say you take a Gaussian surface where one face is outside the slab and the other face is at $x=x_0$ (and the remaining faces don't contribute due to symmetry).

Then the enclosed charge is $$Q_{enc}=A\int^b_{x_0} \rho(x) dx.$$ If both faces are outside the material you would use $-b$ instead of $x_0$. You can calculate this integral since $\rho(x)$ has a simple form.

Then your second mistake is that $E\neq \rho/\epsilon_0$ in general. From the flux side of Gauss's law you'd get something like

$$\int E dA = E(x>b)A-E(x_0)A,$$

where by $E(x>b)$ I mean the value of $E$ outside the material at $x>b$.

From these steps you should be able to solve this.

• Yes you have the correct $q_{enc}$ (I misread initially). If you integrate from (-b/2) to (b/2) that will tell you all the charge enclosed between those points so that will be useful for finding the electric field at $x=\pm b/2$. Good luck – octonion Aug 2 '15 at 7:40