Take a long thin wire of uniform linear charge density λ.
Consider a point A at a perpendicular distance l from the mid-point O of the wire, as shown in the following figure.
Let E be the electric field at point A due to the wire, XY.
Consider a small length element dx on the wire section with OZ=x
Let q be the charge on this piece.
∴q=λdx
Electric field due to the piece,
dE=14π∈0λdx(AZ)2
However, AZ=√(l2+x2)
∴dE=λdx4π∈0(l2+x2)
The electric field is resolved into two rectangular components. dEcosθ is the perpendicular component and dEsinθ is the parallel component.
When the whole wire is considered, the component dEsinθ is cancelled.
Only the perpendicular component dEcosθ affects point A.
Hence, effective electric field at point A due to the element dx is dE1.
∴dE1=λdxcosθ4π∈0(x2+l2) ... (1)
In △AZO,
tanθ=xl
x=ltanθ ... (2)
On differentiating equation (2), we obtain
dx=lsec2(θ)dθ
dE1=λcos(θ)dθ4πεol
E1=∫π/2−π/2λcos(θ)dθ4πεol
Solving, E1=λ2πεol