Given the electric field in the region `vecE=2xhati`, find the net electric flux through the cube and the charge enclosed by it.
Since the electric field has only x component, for faces normal to x direction, the angle between E and ∆S is ±π/2. Therefore, the flux is separately zero for each face of the cube except the two shaded ones.
The magnitude of the electric field at the left face is EL = 0 (As x = 0 at the left face)
The magnitude of the electric field at the right face is ER = 2a (As x = a at the right face)
The corresponding fluxes are
`phi_R=vecE_R.DeltavecS=E_RDeltaScostheta=E_RDeltaS " "(.:theta=0^@)`
Net flux (ϕ) through the cube = ϕL+ϕR=0+ERa2=ERa2
We can use Gauss’s law to find the total charge q inside the cube.