# Electric flux in a non-uniform field

A cube is placed in a non-uniform field, where the field is decreasing from left to right. So in this case, when you calculate flux on the left and right side of cube (of side $A$) using $E\cdot A$, the flux is not going to cancel as $E$ will be different for left and right surfaces.

So in this case, a closed surface placed in a field will not have zero net flux. Where am I making mistake? If I use the concept of line $f$ forces that net flux becomes zero as whatever line of force is coming in has to go out.

• what do you mean by E. A? I find this question unclear, maybe a picture may help. Dec 20, 2016 at 2:13
• meant dot product of Electric field and Area Dec 20, 2016 at 2:15
• You did not make a mistake. If the fluxes do not cancel out, then you will have a net flux. This is how it's supposed to work. Dec 20, 2016 at 2:33
• But net flux for a closed surface placed in a field is always zero. if charge enclosed is zero, Gauss's law says flux has to be zero. In this case, cube is placed in a field. there is no charge enclosed by the cube so flux has to be zero. Dec 20, 2016 at 2:40
• When you placed the cube in the field, what did you do with the charge that was occupying the space where the cube will be? Unless you leave it where it is, the field will change. Dec 20, 2016 at 2:42

Imagine that your cube is just to the right of a point charge. The field lines from that charge are not parallel, they diverge. So some of them exit the cube through the top, bottom, front, and back faces. The total flux entering the left face is equal to the sum of the fluxes leaving through the other 5 faces.

Or perhaps you are thinking of field lines that are parallel, but decreasing in magnitude from left to right, say $E(r) = \hat{x}*(\textrm{some decreasing function of x})$. What your argument shows is that this is not a physically allowed field; it is not a solution of Maxwell's equations for a charge-free region of space.

The mistake you are making is that you are ignoring the fact that in a weaker field the electric field lines have a greater separation.
So it is certainly true that the electric flux into the shaded left hand face of the cube is greater than the electric flux out of the shaded right hand side of the cube.

However note that some of the electric field lines will emerge from other faces of the cube with the result that the total electric flux into the cube will be the same as that out of the cube.

There are two important points you should know if the so-called electric field is non-uniform and a Gaussain surface is placed in that field and the result is a net flux through that surface:

1). There exists a net charge inside the Gaussian surface causing that field and giving a net flux.

2). If you think the charge does not exist inside the Gaussian surface and still you have a net electric flux through the Gaussian surface than the existence of the field you are talking about is impossible as it will violate Maxwell´s equation and also in very simple terms it is not a 1/r^2 decreasing E-field.

It is important to note the charges that lie outside the Gaussian surface don´t contribute to any electric flux because of 1/r^2 nature of E-field.

Hope it helps!