Gauss's law :The law relates the flux through any closed surface and the net charge enclosed with in the surface. The law states that the total flux of the electric field \\\\(E\\\\) over any closed surface is equal to \\\\(\\dfrac { 1 }{ { \\varepsilon }_{ 0 } }\\\\) times the net charge enclosed by the surface.\\\\(\\phi =\\dfrac { q }{ { \\varepsilon }_{ 0 } }\\\\)This closed imaginary surface is called Gaussian surface. Gauss's law tells us that the flux of \\\\(E\\\\) through a closed surface \\\\(S\\\\) depends only on the value of net charge inside the surface and not on the location of the charges. Charges outside the surface will not contribute to flux.Electric field due to an infinitely long straight uniformly charged wire :Consider an uniformly charged wire of infinite length having a constant linear charge density \\\\(\\lambda\\\\) (Charge per unit length). Let \\\\(P\\\\) be a point at a distance \\\\(r\\\\) from the wire and \\\\(E\\\\) be the electric field at the point \\\\(P\\\\). A cylinder of length \\\\(l\\\\), radius \\\\(r\\\\), closed at each end by plane caps normal to the axis is chosen as Gaussian surface. Consider a very small area \\\\(ds\\\\) on the Gaussian surface. By symmetry, the magnitude of the electric field will be the same at all points on the curved surface of the cylinder and directed radially outward. \\\\(\\vec { E }\\\\) and \\\\(\\vec { ds }\\\\) are along the same direction.The electric flux \\\\(\\left( \\phi \\right)\\\\) through curved surface \\\\(=\\displaystyle\\oint { Eds\\cos { \ heta } }\\\\)\\\\(\\phi =\\displaystyle\\oint { Eds }\\\\) \\\\( \\left[ \\because \ heta =0;\\cos { \ heta } =1 \\right]\\\\) \\\\(=E\\left( 2r\\pi l \\right)\\\\) [The surface area of the curved part is ] since \\\\(\\vec { E }\\\\) and \\\\(\\vec { ds }\\\\) are right angles \\\\(2\\pi rl\\\\) to each other, the electric flux through the plane caps \\\\(=0\\\\).\\\\(\ herefore\\\\) Total flux through the Gaussian surface, \\\\(\\phi =E\\left( 2\\pi rl \\right)\\\\). The net charge enclosed by Gaussian surface is, \\\\(q=\\lambda l\\\\)\\\\(\ herefore\\\\) By Gauss's law,\\\\( =E\\left( 2\\pi rl \\right) \\dfrac { \\lambda l }{ { \\varepsilon }_{ 0 } }\\\\) or \\\\( E=\\dfrac { \\lambda }{ 2\\pi { \\varepsilon }_{ 0 }r }\\\\)The direction of electric field \\\\(E\\\\) is radially outward, if line charge is positive and inward, if the line charge is negative.