# Determining whether the non-integral form of Gauss' law applies

• B
• etotheipi
I've just been learning about Gauss' law which as far as I can tell states that the net electric flux through a surface equals the enclosed charge divided by the permittivity of free space, and is often expressed as the integral $$\int_S {\bf{E} \cdot d \bf{A}} = \frac{Q}{\epsilon_0}$$In some cases I've read it's fine to take the electric field out of the integral to obtain something like the following $$\sum{} EA = \frac{Q}{\epsilon_0}$$ where instead we can just add up the flux emanating from all of the relevant surfaces on a simple shape. An example would be adding the two contributions to flux at both ends of a cylinder through an infinite charged sheet.

My question is under what circumstances is this a "legal" move? It can't just be when we have a uniform electric field, since we can also apply this simplified version of Gauss' law to a spherical surface around point charge whose radius can be chosen to be whatever you want (i.e. $E \cdot 4 \pi r^{2} = \frac{Q}{\epsilon_0}$)

I came to the conclusion that this is only valid when the electric field is constant at all points on each area being considered, which made sense to me since then E would be constant with respect to the surface area elements in the integral and we can consequently take it out. Is this sort of the right way of thinking about it? Thanks