# Homework Help: Electric field for non uniform line charge

1. Aug 13, 2012

### Lily@pie

1. The problem statement, all variables and given/known data

Find the Electric field at distance z above the mid point of a length L straight line segment, carrying a non-uniform line charge $\lambda = \frac{1}{C} |x|$ where C is a constant

2. The attempt at a solution

I note that the horizontal component cancels out.

Hence

E= 2* $\frac{1}{4\pi\epsilon_{0}}$$\frac{\lambda z}{(z^{2}+x^{2})^{3/2}}$ dx
substitute the equation for $\lambda$ and Integrated from x=0 to 1/2 L

I got the solution as $\vec{E} = \frac{1}{4\pi\epsilon_{0}}\frac{2}{C} (1+\frac{z}{\sqrt{\frac{1}{4} L^{2} + z^{2}}})$

However, I wanted to check my answer as I know that the line will be like a point charge when z>>L. With the equation I obtain, E becomes a constant value when z>>L.... Which does not make sense... I can't find where did I do wrong too... =(

2. Aug 13, 2012

### Simon Bridge

Did you remember to cancel out the horizontal components in your equation?
[edit - yep, seems you did ... I would have changed variables earlier than you]

A couple of niggles:
Your first equation is infinitesimal on the RHS but complete on the LHS .. shouldn't the LHS by $\vec{dE}$?
Both equations are for vectors, yet you failed to add in the direction on the RHS of either.

Looking at the charge distribution - it's zero at the origin and getting bigger with x. At a distance they would appear as separate localized charges either side of the origin ... if the charge distribution were x/C instead of |x|/C then that would be a dipole field.

However:
Looking at that last integration - I think you should recheck your substitution:

I'm guessing you did x=z.tanθ, so dz=z.sec2θdθ ?
In which case, don't you get a z3 in the numerator to cancel with the z3 common factor from the denominator?

Last edited: Aug 13, 2012
3. Aug 13, 2012

### Lily@pie

Oh, my bad... the $d\vec{E}$ is a typo and it is in the vertical direction

I am pretty sure the integration is correct.

Initially the z3 in the numerator does cancel off, but the integration gives out another z in the equation.

Hence, I end up getting the same solution.

4. Aug 14, 2012

### Simon Bridge

hmmm ... I get $\int \sin(\theta)d\theta = c-\cos(\theta)$ and limits 0 to arctan(L/2z) ?

I see where you recover the z, it's from the ID: $$\cos(\arctan(a)) = \frac{1}{\sqrt{1+a^2}}$$

The difference between you and me is a minus sign.

$$\vec{E} = \frac{1}{4\pi\epsilon_0}\frac{2}{C}\left [ 1 - \frac{1}{\sqrt{1+(\frac{L}{2z})^2}}\right ]\vec{k}$$

for z >> L, E → 0 ...

5. Aug 18, 2012

### Lily@pie

Oh!!! I have solved it again and I did a mistake on the integration. So sorry and thank you!!! =D

6. Aug 18, 2012

### schaefera

Why should E approach 0 as you reach infinite distances? Wouldn't it approach a point charge of the line charge's total charge-- because it varies as the absolute value it isn't simply two equal and opposite charges.

7. Aug 18, 2012

### Lily@pie

Oh ya... I didn't notice that.

I thought that it didn't make sense cz as z>>L, E should be approximately a point charge as you said. But I couldn't find anything wrong with the calculation.

Will it be possible to help?? Thanks

8. Aug 19, 2012

### schaefera

Hmmm... when I try to calculate the potential and from there find the E-field, I get V=2*(sqrrt(z^2+(L/2)^2) - z)/c... and then -dV/dz=E gives the same answer. (I was using cgs units, but just imagine I had a 1/(4pie_0) and they're the same).

Could someone else help with this? It's bothering me now.

Of course, the rod carries a total charge of L^2/(4C), so we know that it should approximate a point charge of this amount in the z>>L limit.

Last edited: Aug 19, 2012
9. Aug 19, 2012

### schaefera

And for the record, I didn't do the same substitution-- I did u=x^2+z^2, du=2xdx, but I still go the same solution, so something weird is going on here.

Last edited: Aug 19, 2012
10. Aug 19, 2012

### schaefera

dEz=dq/r^2 * cos(t)= zdq/r^3= (z*x/c) / r^3 dx, but z=rcos(t), x=rsin(t), so
dEz= sin(t)cos(t)^2 dt, evaluated from 0 to arctan(L/2z).

When I integrate this, I get some weird cubic function (= (1/3)(1- 8z^3/(L^2+4z^2)^(3/2))... and this still gives 0 as z>>L. Why is this so different, though?!

11. Aug 19, 2012

### gabbagabbahey

The reason you're getting the wrong answer, is because you are calculating the wrong integral. For a linear charge distribution $\lambda(\mathbf{r})$, you have

$$\mathbf{E}(\mathbf{r})=\frac{1}{4 \pi \epsilon_0} \int d \mathbf{r}' \frac{\lambda ( \mathbf{r}' )}{|\mathbf{r}-\mathbf{r}'|^3}( \mathbf{r}-\mathbf{r}' )$$

Here, your field point is on the $z$-axis, so $\mathbf{r} = z \mathbf{e}_z$ and your charge distribution $\lambda ( \mathbf{r}' ) = \frac{1}{C} |x'|$ is along the $x$-axis from $-\frac{L}{2}$ to $\frac{L}{2}$, so $\mathbf{r}'=x' \mathbf{e}_x$ and your integral becomes

$$\mathbf{E}(z) = \frac{1}{4 \pi \epsilon_0} \int_{-\frac{L}{2}}^{\frac{L}{2}} dx' \frac{\frac{1}{C}|x'|}{ ( z^2 + (x')^2 )^{ \frac{3}{2} }}(z \mathbf{e}_z -x' \mathbf{e}_x ) = \frac{z \mathbf{e}_z}{2 \pi \epsilon_0 C} \int_{0}^{\frac{L}{2}} dx' \frac{x'}{ ( z^2 + (x')^2 )^{ \frac{3}{2} }}$$

In other words, you missed an $x$ in your integrand. Notice that the units of your electric field were off by a length factor

12. Aug 19, 2012

### schaefera

Evaluating your integral, though, you get the same thing as the OP... and it doesn't approximate a point charge at long distances.

13. Aug 19, 2012

### gabbagabbahey

I guess we just need to be a little more careful with the integral then (specifically, the absolute value part). Using integration by parts,

\begin{aligned} \int_{-a}^{a} \frac{|x|}{(x^2+z^2)^{\frac{3}{2}}}dx &= \left. \frac{x|x|}{z^2(x^2+z^2)^{\frac{1}{2}}} \right|_{-a}^{a} - \int_{-a}^{a} \frac{x \newcommand{\sgn}{\mathop{\mathrm{sgn}}} \sgn x}{z^2(x^2+z^2)^{ \frac{1}{2} } } dx \\ &= \left. \frac{x|x|}{z^2(x^2+z^2)^{\frac{1}{2}}} \right|_{-a}^{a} - \frac{2}{z^2} \int_{0}^{a} \frac{x}{(x^2+z^2)^{ \frac{1}{2} } } dx \end{aligned}

14. Aug 19, 2012

### schaefera

So it's not just permitted to use the positive part of the x-axis and double the integral?

15. Aug 19, 2012

### gabbagabbahey

When you do that, you are essentially double counting the contribution at $x=0$, which for this integral is finite and non-zero (due to the branch point singularity there). Integration by parts as described in my previous post "fixes" this problem in the sense that it produces the correct result (which we know is correct on physical grounds), but is not rigorous.

Edit: Nevermind, the branch point of $|x|$ at $x=0$ does not affect the integral. To see the expected behaviour for large $z$, see vela's post below.

Last edited: Aug 19, 2012
16. Aug 19, 2012

### vela

Staff Emeritus
I got the same result Simon did. When z→∞, E goes to 0 as well, which is the same as for a point charge. What you want to look at, however, is the behavior when z>>L. If you expand the factor in the square brackets, you get
$$1-\frac{1}{\sqrt{1+\left(\frac{L}{2z}\right)^2}} \cong 1 - \left[1-\frac{1}{2}\left(\frac{L}{2z}\right)^2\right] = \frac{1}{2}\left(\frac{L}{2z}\right)^2.$$ The leading term ends up being
$$\frac{1}{4\pi\epsilon_0} \frac{L^2}{4C}\frac{1}{z^2}$$ which is what you expected.