(N/A) Consider a long thin wire $XY$ of uniform linear charge density $\lambda$.
Consider a point $A$ at a perpendicular distance $l$ from the mid-point $O$ of the wire.
Let $E$ be the electric field at point $A$ due to the wire $XY$.
Consider a small length element $dx$ on the wire section at a distance $x$ from $O$ (i.e.,$OZ = x$).
The charge on this element is $dq = \lambda dx$.
The electric field due to this element at point $A$ is:
$dE = \frac{1}{4 \pi \epsilon_{0}} \cdot \frac{\lambda dx}{(AZ)^{2}}$
Since $AZ = \sqrt{l^{2} + x^{2}}$,we have:
$dE = \frac{1}{4 \pi \epsilon_{0}} \cdot \frac{\lambda dx}{l^{2} + x^{2}}$
The electric field is resolved into two rectangular components. $dE \cos \theta$ is the perpendicular component and $dE \sin \theta$ is the parallel component. When the whole wire is considered,the parallel components $dE \sin \theta$ cancel out due to symmetry. Only the perpendicular component $dE \cos \theta$ contributes to the net electric field at point $A$.
Thus,the effective electric field $dE_{1}$ is:
$dE_{1} = dE \cos \theta = \frac{1}{4 \pi \epsilon_{0}} \cdot \frac{\lambda dx \cos \theta}{l^{2} + x^{2}} \dots (1)$
In $\Delta AZO$,$\tan \theta = \frac{x}{l} \Rightarrow x = l \tan \theta$. Differentiating,$dx = l \sec^{2} \theta d\theta \dots (2)$
Also,$l^{2} + x^{2} = l^{2} + l^{2} \tan^{2} \theta = l^{2} \sec^{2} \theta \dots (3)$
Substituting $(2)$ and $(3)$ into $(1)$:
$dE_{1} = \frac{1}{4 \pi \epsilon_{0}} \cdot \frac{\lambda (l \sec^{2} \theta d\theta) \cos \theta}{l^{2} \sec^{2} \theta} = \frac{\lambda}{4 \pi \epsilon_{0} l} \cos \theta d\theta$
For an infinitely long wire,$\theta$ ranges from $-\frac{\pi}{2}$ to $\frac{\pi}{2}$. Integrating:
$E = \int_{-\pi/2}^{\pi/2} \frac{\lambda}{4 \pi \epsilon_{0} l} \cos \theta d\theta = \frac{\lambda}{4 \pi \epsilon_{0} l} [\sin \theta]_{-\pi/2}^{\pi/2}$
$E = \frac{\lambda}{4 \pi \epsilon_{0} l} [1 - (-1)] = \frac{2\lambda}{4 \pi \epsilon_{0} l} = \frac{\lambda}{2 \pi \epsilon_{0} l}$