Electric field for non uniform line charge

Homework Statement

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... =(

Simon Bridge
Homework Helper
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:
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.

Simon Bridge
Homework Helper
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 ...

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

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.

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

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:
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:

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?!

gabbagabbahey
Homework Helper
Gold Member
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

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

gabbagabbahey
Homework Helper
Gold Member
Evaluating your integral, though, you get the same thing as the OP...
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}

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

gabbagabbahey
Homework Helper
Gold Member
So it's not just permitted to use the positive part of the x-axis and double the integral?
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:
vela
Staff Emeritus
$$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.