# Electric field due to a uniformly charged rod

1. Oct 28, 2009

### sprinks13

hi, here's the question:

a rod in the xy plane has it's ends at (0,0) and (L,0). It has a uniform charge per unit length (lambda). Find the electric field on the x-axis for 0 < x < L.

solution attempt:

dEx = dE
= kdQ/r^2

dQ = lambda*ds = (Q/L)*dx

now i took my r = (L - a - x) where x is the location of dx and a is the distance from L to the point that the field is being measured (note that 0 < a < L).

dEx = KQ/L (integral) dx/(L - a -x)^2

So my problem is my r. It's wrong, but Im not sure why or how to fix it.