# Why is electric flux through a cube the same as electric flux through a spherical shell?

If a point charge $$q$$ is placed inside a cube (at the center), the electric flux comes out to be $$q/\varepsilon_0$$, which is same as that if the charge $$q$$ was placed at the center of a spherical shell.

The area vector for each infinitesimal area of the shell is parallel to the electric field vector, arising from the point charge, which makes the cosine of the dot product unity, which is understandable. But for the cube, the electric field vector is parallel to the area vector (of one face) at one point only, i.e., as we move away from centre of the face, the angle between area vector and electric field vector changes, i.e., they are no more parallel, still the flux remains the same?

To be precise, I guess, I am having some doubt about the angles between the electric field vector and the area vector for the cube.

• I've removed a number of comments that were attempting to answer the question and/or responses to them. Please keep in mind that comments should be used for suggesting improvements and requesting clarification on the question, not for answering. Commented May 10, 2020 at 21:57

Consider the flux through a tiny segment of a sphere. Since the electric field is parallel to the normal of the surface at all points, the flux is simply the electric field at that distance multiplied by the area of the element.

Now imagine tilting the top of the cone by an angle $$\theta$$ so that the corners still lie on the conical section, as seen below:

The area increases by a factor $$\frac{1}{\cos\theta}$$, however the electric field vector in the normal direction $$E_n$$ is decreased by a factor of $$\cos\theta$$. Therefore the flux through this surface is unchanged since flux is the product of the normal electric field component and the area.

Now imagine splitting the cube up into lots of these conical sections. Clearly the tilting of the top surfaces of these sections due to the fact it being a cube rather than a sphere does not affect the flux flowing through each area element. Therefore the total flux flowing through the cube is the same as a sphere.

Note that this was a simplified adaptation from a chapter of The Feynman Lectures on Physics which explains why the images do not quite match my explanations since I was just talking about the top surface of the conical section being tilted. Feynman explains the effect of the flux through a closed surface in a more complete way.

• I remember reading that the gauss law depends on the inverse square relation in the coulumb force. Had the coulumb force be proportional to say, 1/r^3, Gauss law wouldnt work. However, Your arguement doesnt account for this fact...Had the coulumb force be 1/r^3 I can still use your arguement and claim that the flux depends only on the enclosed charge. However, This is not the case. Commented May 29, 2020 at 7:25
• @satan29 No, my answer wouldn't apply if it were not an inverse square law. Conical surfaces closer to the corner of the cube are further from the center of the cube than surface elements at the middle of the faces, so even though the angle changes, this distance must be accounted for too. Since the conical top surface has spread out in proportion to $r^2$, but the electric field has decayed in proportion to $\frac{1}{r^2}$, this distance does does not affect the flux. Hence $\frac{1}{r^2}$ behaviour is necessary. See feynmanlectures.caltech.edu/II_05.html#Ch5-S8 for more detail. Commented May 29, 2020 at 13:34

Why does electric flux through a cube is same as that of electric flux through a spherical shell?

This is not only true for a cube or a sphere. The flux passing through any closed surface enclosing a net charge $$q$$ is $$q/\varepsilon_0$$. This is based on Gauss's law for electric charges.

When the field lines emerge from a point charge uniformly in all directions, the flux passing through any closed surface depends on the relative number of field lines which go into or out of the surface. For a charge inside the surface, the field lines either go out or come in depending upon the fact whether the charge is positive or negative respectively. For an external charge the net number of field lines which go in or come out of the surface is zero and hence it's flux contribution is zero.

So it doesn't matter whether it's a sphere or a cube (or even anything else), as long as a net charge of $$q$$ lies inside it, the total flux passing through the surface is $$q/\varepsilon_0$$. Also even if only one charge is present, it's not necessary for the charge to be at the geometric centre of the Gaussian surface.

• But if one approaches solving it by E.ds, then there will be problem for the cube, since there are angle variations. How it is explained? Commented May 10, 2020 at 10:05
• @Vivek: If you wish to proceed by integrating the dot product over the entire surface you must take the angle between the area vector of the small element and the field at that point into account. Yes the angle between the two vectors depends on where your area element lies. Commented May 10, 2020 at 10:09
• @Vivek, the beauty of Gauss's law is that, since the amount of flux is the same for all enclosed surfaces, you have the freedom to choose the closed surface that is easiest to integrate. For a point source of a field (your situation), the easiest closed surface to integrate is a sphere with the point charge located at the sphere's center. Commented May 10, 2020 at 16:26
• @Vivek: Mathematically, this is a consequence of the Divergence Theorem Commented May 10, 2020 at 19:52

The net flux is the same, but this doesn’t mean the flux is uniform.

Think of a similar situation where you place a lightbulb inside a closed lampshade. The net flux is the total amount of light passing through the lampshade. This depends only on the amount of light produced by the lightbulb, not by the position of the lightbulb.

In other words, if you can take a 60W lightbulb and move it anywhere inside your (closed) lampshade, and this will not change the total amount of light that goes through the lampshade. Of course unless you place the light bulb exactly at the center of a spherical lampshade, the amount of light will be NOT be uniform on every surface of your lampshade, but that not the net flux, which is the sum total of light of all the light on the entire lampshade.

Note I didn’t discuss the shape of the lampshade or its size. The net flux is determined by the strength of the source, not by the surface through which the light passes.

• +1, good intuitive answer. Another similar example is a river - for some fixed upstream flow rate, it doesn't matter if the river later becomes narrow and deep or flat and wide, you'll have the same amount of water passing a point on the shore per unit time no matter what. So long as you're capturing everything that comes out of a source, the flux will only depend on the source itself, and not whatever shape you're putting that flux through. Commented May 11, 2020 at 16:30

As has already been pointed out the net flux across any closed surface is the same and only depends on the charge enclosed.

That does not necessarily mean the the flux over a given surface area will be the same as you have found out comparing the cube to the sphere. It decreases as you move away from the center of a face of the cube whereas it is constant over the entire surface of the sphere if the charge is in the center.

But the total flux is obtained by summing up (integrating) the flux over the entire surface. Consider that for a cube and sphere of the same volume, the surface area of the cube is greater than the surface area of the sphere. Integrating the flux over the two surfaces should yield the same value.

Hope this helps

If you doubt it, show:

$$F = 6\cdot 4\int_{x=0}^R\int_{y=0}^R\frac{\frac{R}{\sqrt{R^2+x^2+y^2}}}{x^2+y^2+R^2}dxdy = 4\pi$$

where the LHS is the flux through a cube with side $$2R$$ expressed as 6 times the integral over 1 face, and 1 face is 4 times the integral over one quarter-panel, and a quarter-panel extends from $$0$$ to $$R$$. The integrand is $$\cos{\theta}/r^2$$. The RHS is the flux of $$\hat r/r^2$$ through a sphere of any radius $$R$$.

$$F = 24 \int_{x=0}^R\int_{y=0}^R\frac R{(x^2+y^2+R^2)^{\frac 3 2}}dxdy$$

$$F = 24\int_{x=0}^R\big[\frac{Ry}{(x^2+R^2)\sqrt{x^2+y^2+R^2}}\big]^R_{y=0}dx$$

$$F = 24\int_{x=0}^R\frac{R^2}{(x^2+R^2)\sqrt{x^2+2R^2}}dx$$

$$F = 24\big[ \tan^{-1}(\frac x {\sqrt{2R^2+x^2}}) \big]_{x=0}^R$$

$$F = 24\tan^{-1}(R/\sqrt{3R^2})=24\tan^{-1}(\frac 1 {\sqrt 3}) = 24 \times \frac{\pi} 6 = 4\pi$$

Q.E.D.

From Gauss's law $$\int\vec{E}.d\vec{s}=\frac{q_{in}}{\epsilon_{0}}$$

So the flux through both of the surfaces would be same as the charge inside both of the surfaces is same.

If we approach the problem through integral, you mislooked the angle between area vector and electric field in the case of cube.

A good way to visualize the problem is to imagine first that the charge is enclosed by a sphere. Draw a small area on the surface of the sphere, ane draw lines from the charge through the small area. Those lines are the flux through the area. Now imagine a larger sphere concentric with the first one. The continued lines trace out an area of the same shape on the second sphere, and the same lines pass through that second area. Now deform the second sphere into a cube, but leave the lines alone. Imagine the area the lines will trace out on the cube. Even though the new area is tilted relative to the corresponding area on the sphere, and the new area is distorted, all the same lines pass through it. In other words, the flux through the (tilted & distorted) area is the same as it was through the corresponding area on the sphere. The mathematical operation is an expression of this fact.