A charge Q is uniformly distributed over a rod of length l. Consider a hypothetical cube of edge l such that one end of the rod is kept at the centre of the cube and also rod intersects one of the faces of the cube perpendicularly. Then the electric flux through the entire surface of the cube is :
Here half part of the rod is inside the cube, so charge inside is Qin=Q/2
By Gauss's law, the flux through cube is ϕ=Qinϵ0=Q2ϵ0