# Gauss's Law with non-uniform E-field

flyingpig
Actually a better question would be, why wouldn't it be different?

Mentor
When inside the charged sphere, as r changes so does the total charge contained within r. But once you are outside of the sphere, the total charge remains fixed.

flyingpig
Why? Shouldn't it get weaker?

flyingpig
Someone come back

Mentor
Why? Shouldn't it get weaker?
Shouldn't what get weaker? (If you're responding to my last post, realize that I was talking about charge not field strength.)

flyingpig
Shouldn't what get weaker? (If you're responding to my last post, realize that I was talking about charge not field strength.)

Well the density is non-uniform

$$\rho = \frac{Q}{V}$$

Volume can't really change so

$$\rho\; \alpha \;Q$$

so as radius goes up, density goes down and since they are proportional, charge drops?

Mentor
Well the density is non-uniform

$$\rho = \frac{Q}{V}$$

Volume can't really change so

$$\rho\; \alpha \;Q$$

so as radius goes up, density goes down and since they are proportional, charge drops?
I have no idea what you're talking about.

Within the sphere, obviously the total charge within your Gaussian sphere increases with radius; Outside the sphere, there's no additional charge so the total charge remains fixed.

flyingpig
$$Q_{en} = \int \rho dV$$

I am going to take a while shot at this one. Since we are looking at r > R, that means we only care about the field r > R

I think it would be

$$Q_{en} = \int_{R}^{r} \rho dV$$

But r > R not greater or EQUAL to. In other words, even though our Gaussian surface encloses the whole surface, it only cares about outside of r > R

Mentor
I think it would be

$$Q_{en} = \int_{R}^{r} \rho dV$$
No. The relevant charge is everything contained within the Gaussian surface. Since the charge only extends to R, we have (for a Gaussian surface with r > R):

$$Q_{en} = \int_{0}^{R} \rho dV$$

flyingpig
But $$Q_{en} = \int_{0}^{R} \rho dV$$ is for a Gaussian surface that has radius R.

WOuld it be...

$$Q_{en} = \int_{0}^{R} \rho dV + \int_{R}^{r} \rho dV$$

That includes inside and outside!?

EDIT: wait, that's no different from my first integral then...

EDIT2: nvm, you are right. My other integral encloses no charge because from R to r, it is just space. I keep thinking my integral is summing field, not charge.

flyingpig
wait would the integral change if the density was uniform?

flyingpig
Actually I should show you the final answer first to repay your time you put into helping me

$$2\pi l\int_{0}^{R} re^{ar} dr = 2\pi l \frac{e^{aR} (aR - 1) + 1}{a^2}$$

$$\oint \vec{E} \cdot d\vec{A} = 2\pi l \frac{e^{aR} (aR - 1) + 1}{\epsilon_0 a^2}$$

$$\vec{E} = \frac{e^{aR} (aR - 1) + 1}{\epsilon_0ra^2} \hat{r}$$