To calculate the field at some point a distance d along the perpendicular bisector of a uniform line of charge of length L, we can simply break the line into tiny pieces, determine the field due to each piece, and then add all these fields **as vectors**. In other words, we'll integrate.

In general, the integral giving the field from a distribution of charge is:

E = ∫
dE = ∫
k dq / r^{2}

where the unit vector points from the charge distribution to the point where the field is being calculated, and reminds us that this is an integral of vectors.

When setting up the integral, take advantage of the symmetry. Consider two pieces of the line, one on the left and one on the right. When these pieces are the same distance from the center of the line the fields they set up are equal in magnitude. The horizontal components cancel, and the vertical components add. The net field has no horizontal component, so in the integral we just need to sum all the vertical components.

The charge Q is spread uniformly over the line, which has length L. There is therefore a constant charge per unit length l which is:

λ = Q/L

If a small piece of the line has a width dx, the charge on it is:

dq = λ dx

The field this piece sets up at the point is:

dE = k dq / r^{2}, where r^{2} = d^{2} + x^{2}

Therefore dE = k λ dx / (d^{2} + x^{2})

We just need the vertical component, so we multiply by

cos(θ) = d/r = d/(d^{2} + x^{2})^{1/2}

dE_{y} = k λ d dx / (d^{2} + x^{2})^{3/2}

Summing over the whole line gives:

E_{y} = ∫
dE_{y} = ∫
k λ d dx / (d^{2} + x^{2})^{3/2}

Pulling out the constants:

E = k λ d ∫ dx / (d^{2} + x^{2})^{3/2}

the limits on the integral run from x = -L/2 to x = L/2, although you could also do twice the integral from 0 to L/2.

This is a bit of a tricky integral, but looking up the result gives:

∫ dx / (d^{2} + x^{2})^{3/2} = x / [d^{2} (d^{2} + x^{2})^{1/2} ]

The integral becomes:

E_{y} = k λ x / [ d (d^{2} + x^{2})^{1/2} ]

Plugging in the limits ( x = -L/2 to L/2) gives:

E_{y} = k λ L / [ d (d^{2} + (L/2)^{2})^{1/2} ]

λ L = Q, so the field is:

E_{y} = k Q / [ d (d^{2} + (L/2)^{2})^{1/2} ]

Does the answer make any sense? One check is to plug in the extremes.

If L = 0 (i.e., we're back to a point charge) the field is:

E_{y} = kQ/d^{2}, which is certainly correct.

If L goes to infinity the result is actually:

E_{y} = 2 k λ / d.

That's an interesting result, and we'll verify it using another method (Gauss' Law).