Coulomb's law provides a way to obtain the electric field produced by a collection of charges. However, summing Coulomb's law over various continuous distributions of charge can be daunting and complicated. Instead of approaching things one point charge at a time, one can tackle the equivalent problem of determining the charge distribution in a region based on the electric field in that region. Naturally, the more charge in a region bounded by a box, the more electric field lines one would expect to pass through the box. Thus, one would expect some relationship between the regional charge distribution and the electric field.
In describing a region of a field, which assigns a magnitude and direction—in other words, a vector—to each point in space, it makes sense to draw an analogy with water currents. The electric field vectors that pass through a surface in space can be likened to the flow of water through a net. The greater the magnitude of the lines, or the more oriented the lines are against (perpendicular to) the surface, the greater the flow, or flux. This analogy forms the basis for the concept of electric flux.
A flux through a given surface can be "inward" or "outward" depending on which way counts as "in" or "out"—that is, flux has a definite orientation.
For a closed surface (a surface with no holes), the orientation of the surface is generally defined such that flux flowing from inside to outside counts as positive, outward flux, while flux from the outside to the inside counts as negative, inward flux. To remember this choice of orientation, we divide the closed surface into many small patches of surface and assign a vector to each small patch of surface that indicates the normal (perpendicular) to the surface. In addition, the magnitude of each is defined to be the area of the corresponding patch.
If the surface is partitioned into patches that are sufficiently small, then the electric field at all points on each patch essentially becomes constant. In that case, the electric flux through the patch is given by the dot product, which calculates the component of parallel to :
The total electric flux through the entire surface, meanwhile, is the sum over all patches:
As the become vanishingly small, as in the case of a continuous surface, the sum is replaced with a surface integral:
The "" in the limits of integration indicates that the integral is to be taken across the entire surface for all infinitesimal surface elements . Fortunately, the electric flux can often be computed without resorting to computing the integral explicitly.
Compute the electric flux across a spherical surface of radius that contains a charge at its center.
In this case, the electric field is the same at all points on the surface. Furthermore, the field is always perpendicular to the surface. Therefore, the perpendicular component of the electric field summed across the entire surface is simply the electric field at a distance from the charge multiplied by the area of the surface. Thus
Compute the electric flux across a cube of side length placed (a) perpendicular to and (b) with respect to a uniform electric field of magnitude as shown.
If the cube is placed parallel to the field, then the four faces parallel to the field have zero flux. Of the two faces with nonzero flux, one face contains flux ("inward" flux) while the other contains flux ("outward" flux). Therefore, the total flux is zero.
If the cube is placed with respect to the field, then two faces each contain flux . Similarly, the other two faces with nonzero flux contain . Therefore, the total flux is again zero.
In the example of the flux through a spherical surface, the flux was independent of the radius of the sphere. In that case, the total flux depended only on the charge contained inside the sphere. This makes sense intuitively; as the sphere grows larger, the sphere captures "more" electric field, but this always accompanies a concomitant decrease in field strength. The factors of growth and decay exactly cancel out.
The same, it turns out, holds for other surfaces as well. If the walls of a box containing a charge are expanded, the total flux through the box remains the same, as the increased number of field lines captured by the expanded walls is exactly canceled by a decrease in field strength farther from the walls.
But what if the box contains no charge? In the case of the cube, no matter how the cube was oriented, the total electric flux always came out to zero. Although the flux through some sides of the cube was positive (e.g., "outward" flux), it was always balanced exactly by negative flux through other sides of the cube (e.g., "inward" flux).
Based these two observations, one might conjecture that flux is always independent of the dimensions of the containing surface and depends only on the magnitude of the total charge enclosed. This forms the basis for Gauss' law, which holds that the total electric flux through a surface is proportional to the enclosed charge. Furthermore, on the basis of the example of the spherical surface, for which the total electric flux was , the constant of proportionality must be .
A more detailed discussion of Gauss' law can be found in the accompanying page.
A charge is split by one face of a cube. What is the total electric flux through the cube?
It is not easy to compute the electric flux directly using the definition. However, by Gauss' law, we know that a surface containing the entire charge must have total flux . Therefore, the cube, which contains half of the total flux from the charge, must contain electric flux .
 Young, H.D. University Physics. Thirteenth edition. Pearson, 2012.
 Griffiths, D.J. Introduction to Electrodynamics. Fourth edition. Pearson, 2014.
 Purcell, E.M. Electricity and Magnetism. Third edition. Cambridge University Press, 2013.