# Electric flux through a cube centered at the origin with a charge, $q$, centered at the origin

So the problem is a point charge is located at the origin of the coordinate system and a cube of side length 2a is centered at the origin and I am trying to find the electric field, and flux due to the point charge.

So far, I have said that the electric field, $$E = \frac{q(r_2-r_1)}{4πe_o|r_2-r_1|^3}$$ and attempted to convert from radial to cartesian coordinates. To do that, I replaced $$r_2 - r_1$$ in the equation with the cartesian coordinates $$$$. Firstly, would this step be correct? It seems as if I might be overlooking something, as I could use identities like x = $$r\sin(\theta)\cos(\phi)$$, but I can't figure out how to work it into the equation.

If it is correct, I should be able to get something like $$E(x,y,z) = \frac{q(x_2-x_1, y_2 - y_1, z_2 - z_1)}{4πe_o|x_2 - x_1, y_2 - y_1, z_2 - z_1|^3}$$, and since the point charge at the origin is at (0,0,0), simplifies down to $$E(x,y,z) = \frac{q(x_2, y_2, z_2)}{4πe_o|x_2^ , y_2 , z_2|^3} = \frac{q(x_2, y_2, z_2)}{4πe_o(x_2^2 + y_2^2 + z_2^2)^{3/2}}$$ But my main problem is that I don't know how I would integrate such an equation in order to get the flux through the surface.

Also, once I finally integrate this equation, should I get something that would be consistent with Gauss's law, so that the total flux is equal to $$Q_{enc}/e_0$$, or am I mistaken?

Edit: I believe that I can find the flux through one face using $$\iint\limits_ \, \mathrm{E} \cdotp {d}S$$. If I use the face along the y-axis, I can set $${d}S = \hat{y}dxdz$$ (would y be a unit vector in this case) and set $$y = a$$, ending with the integral $$4\int_0^{a} \int_0^{a} \frac{qa}{4πe_o(x^2 + a^2 + z^2)^{3/2}}$$.

• Just to be clear, is the charge located at the center of the cube or at the center of a face of the cube, or is it something else? Sep 6, 2020 at 18:46
• The charge would be located at the center of the cube, yes. Sep 6, 2020 at 18:51
• I don't know how I would integrate such an equation in order to get the flux through the surface. Edit the question to add the definition of flux as a surface integral of the field. Then explain what you don’t understand about the symbols in that integral. Sep 6, 2020 at 19:01
• Hint: You do one face at a time. You can do one, and then argue that the others have to be the same. Sep 6, 2020 at 19:03
• Were you told that you have to explicitly integrate to find the flux? You can’t just use Gauss’ Law? Sep 6, 2020 at 19:06

Also, once I finally integrate this equation, should I get something that would be consistent with Gauss's law, so that the total flux is equal to $$Q_{enc}/e_0$$, or am I mistaken?
No, you're not mistaken. If the charge is in fact located in the center of the cube, then by Gauss' law the net flux over the entire surface of the cube is $$Q_{enc}/e_0$$ and by symmetry the net flux through each face of the six faces of the cube is $$Q_{enc}/6e_0$$.
Only if you want to know the net flux over a limited surface of a face of the cube would you need to integrate. That's because the flux is $$\int E.dA$$ where $$E$$ and $$A$$ are vectors with the $$A$$ normal (perpendicular) to the surface. The flux is then maximum near the center of each face where $$E.dA$$ is maximum and minimum near the edges of each face where $$E.dA$$ is a minimum.
Put the point charge at the center of the xyz system. Then the $$r_1$$ in your expression for E is zero and the vector $$r_2$$ locates a segment of area on the surface of the cube (call it r). Given the symmetry of the cube you need only the flux though one quarter of one side (then multiply by 24). I would work with the xy plane at z = a. Then you need a double integral with x and y both going from 0 to a. The dot product of r with dA reduces to z(dx)(dy) so you will be integrating: $$\frac{k{qa}(dx)(dy)}{(x^2 + y^2 + a^2)^{3/2}}$$.