In a region of space, the electric field is in the x-direction, proportional to x and given by , where is a positive constant. Consider an imaginary cubical volume of edge a, with its edges parallel to the axes of coordinates. The charge inside this cubical volume is
The field at the face ABCD
So, flux over the face ABCD
The negative sign arises as the field is directed into the cube
The field at the face
So, flux over the face EFGH
The flux over the other four faces is zero as the field is parallel to the surfaces
So, total flux over the cube here q is the total charge inside the cube