# Quick electric field of a line segment integral question

1. May 22, 2012

### StephenD420

Question: Find the electric field a distance 'z' above the midpoint of a straight line segment of length 2L, which carries uniform charge λ

Solution: Let me work out the steps and show you where my problem is(I have avoided showing some of the steps).
The coordinate axis has been set up taking the midpoint of the wire as the origin. Magnitude of the electric field is given by:
E=1/4piϵ0∫2λz/(z^2+x^2)^3/2 dx

so the integral that I have a question on is
∫1/(z^2+x^2)^3/2 dx

Now I know you can use x=ztan(theta)
but why can I not do
u=z^2+x^2
du=2xdx
dx=du/2x
so
∫u^(-3/2) du/2x
=
-2/2x*u^(-1/2)
so the integral would be equal to
-1/(x*(z^2+x^2)^(1/2))

which, of course is not right, but why??

Thanks.
Stephen

2. May 22, 2012

### collinsmark

You're not quite done yet, if u substitution is to work. You still have an x in your expression, and you'll have to express it in terms of u, if you wish to proceed.
That's not quite right there. You've treated x as a constant number. But it's not a constant number. It's a function of u in this case. So you'll need to express that x in terms of u, before the integration.

And if that doesn't make the integral easier to evaluate than the original integral, you'll have to find some other way to proceed (perhaps such as your x = ztanθ idea).

3. May 22, 2012

### StephenD420

ahhh of course!

thanks.