Electric field intensity due to uniformly charged wire of infinite length

Derivation of electric field intensity due to the uniformly charged wire of infinite length: Let us consider a uniformly-charged (positively charged) wire of infinite length having a constant linear charge density (that is, a charge per unit length) $\lambda$ coulomb/meter. Let P is a point at a distance $r$ from the wire at which electric field $\overrightarrow{E}$ has to find.

Let us draw a coaxial Gaussian cylindrical surface of length $l$ through point $P$. By symmetry, the magnitude $E$ of the electric field will be the same at all points on this surface and directed radially outward. Thus, Now take small area elements $dA_{1}$, $dA_{2}$ and $dA_{3}$ on the Gaussian surface as shown in figure below. Therefore, the total electric flux passing through area elements is:
$\phi_{E}= \oint \overrightarrow{E} \cdot \overrightarrow{dA_{1}} + \oint \overrightarrow{E} \cdot \overrightarrow{dA_{2}} + \oint\overrightarrow{E} \cdot \overrightarrow{dA_{3}}$

$\phi_{E}= \oint E\: dA_{1} cos\theta_{1} + \oint E\: dA_{2} cos\theta_{2} + \oint E\: dA_{3} cos\theta_{3}$

The angle between the area element $dA_{1}$, $dA_{2}$ and $dA_{3}$ with electric field are $\theta_{1}= 0^{\circ}$ , $\theta_{2}= 90^{\circ}$, and $\theta_{3}=90^{\circ}$ respectively. So electric flux

$\phi_{E}= \oint E\: dA_{1} cos0^{\circ} + \oint E\: dA_{2} cos90^{\circ} + \oint E\: dA_{3} cos90^{\circ}$

Here $cos \: 0^{\circ}=1$ and $cos \: 90^{\circ}=0$

Hence the above equation can be written as: $\phi_{E}= \oint E\:dA_{1}$

The total electric flux passing through the Gaussian surface is

$\phi_{E}= \oint{E\:dA_{1}}$

$\phi_{E}= E\:\oint{dA_{1}}$

$\phi_{E}= E\:\left(2\pi r l \right) \qquad \left\{\because \oint{dA_{1}} =2\pi r l \right\}$

$\phi_{E}= E\:\left(2\pi r l \right)$

But, By Gaussian's law, The total flux $\phi_{E}$ must be equal to $\frac{q}{\epsilon_{0}}$, where $q$ is the total charge enclosed with the Gaussian surface. so that

$\frac{q}{\epsilon_{0}}= E\:\left(2\pi r l \right)$

$E= \frac{q}{2\pi r l \epsilon_{0}}$

For linear charge distribution → $q=\lambda l$. So substitute this value in the above equation which can be written as

$E= \frac{\lambda l}{2\pi r l \epsilon_{0}}$

$E= \frac{\lambda}{2\pi\epsilon_{0} r }$

The vector form of the above equation :

$\overrightarrow{E}= \frac{\lambda}{2\pi\epsilon_{0} r }\widehat{r}$

Where $\widehat{r}$ is a unit vector in the direction of $r$. The direction of $\overrightarrow{E}$ is radially outwards(for positively charged wire).

Thus, the electric field ($E$) due to the linear charge is inversely proportional to the distance ($r$) from the linear charge and its direction is outward perpendicular to the linear charge.

Special Note: A charged cylindrical conductor behaves for external points as the whole charge is distributed along its axis.