# Non-uniform electric field flux through a cube

1. Jun 14, 2016

### WrongMan

1. The problem statement, all variables and given/known data
A cube side lenght a=2 has one vertice at the origin of the referencial.
an electric field is present described as follows:
E(x,y,z)= (2xz) i + (x+2) j + (y(z^2-3) k
Find the flux through the cube
My cube's front face is at (0 to 2, 0, 0 to 2)

2. Relevant equations
flux=∫E.dA

3. The attempt at a solution
My first thought here is, for the face of the cube situated in x=2, the flux in the y and z directions is 0, so i only consider the "i" part of the field (same for the opposing face) so
E= 4i bring e out of the integral and calculate (same for opposing face but since x=0 its 0). Correct?

What about for the face at y=0?there can only be field in the y direction, but the field there deppends only of the x position, how do i integrate?
i dont know how to do ∫(x-2)dA i imagine i have to integrate from 0 to 2 but how do i do it? do i say dA is (x*z) dx? and do ∫(x-2)(x*2) dx ?

2. Jun 14, 2016

### haruspex

What happened to the z in 2xz?

3. Jun 14, 2016

### WrongMan

oh i missed it lol :/

then i have the same problem as i have with the "y part" i get a field dependant on a position for the integral.
E=4z î

so flux = ∫4zdA <=> = ∫4z(2*z)dz ?

4. Jun 14, 2016

### haruspex

I don't see how you turned dA into 2zdz. This is for a surface normal to the x axis, so what should dA look like?

5. Jun 14, 2016

### WrongMan

should be along (parallel) the x axis. right?
the dA i was trying to relate dA to the change in z idk :/ im lost with this integral...

6. Jun 14, 2016

### haruspex

You can construct a small area dA perpendicular to the x axis as having sides dy and dz. write that as an equation.

7. Jun 14, 2016

### WrongMan

∫4z dzdy?
makes sense as k^*j^ =î i think

8. Jun 14, 2016

### haruspex

Right. But you need to get two details right: the integration bounds and the sign.
In principle, dA is a vector, and you take the dot product with the field vector. Since you already chose to keep only the component of the field normal to the face, you have the magnitude of the dot product, but the sign needs to be right too.
The thing to remember is that the dA vector should be taken as pointing out of the volume always, so it will be opposite for two opposite sides of the cube.

9. Jun 14, 2016

### WrongMan

oh yeah about the signs i know i have to be carefull to "where dA is pointing"
so is this a double integral?
do i integrate in respect to z and in respect to y? getting y2z2 ?

10. Jun 14, 2016

Would recommend the OP employ Gauss's law to evaluate the flux: $\int E \cdot dA=\int \nabla \cdot E \ d \tau$. It should give an identical result and be much simpler to compute... editing... I worked the calculation by both methods and got identical answers. The volume integral method was quicker. And editing some more...The dot product $E \cdot dA$ helps to simplify the flux calculations for the 6 faces, because it isolates a single component in each case. Both methods are quite workable. To answer your question in post #9-is this a double integral? The answer is each of the integrals of the flux over each face is a double integral, but they are readily evaluated with simple limits for each case. As double integrals go, these are relatively simple ones. Incidentally, the integral $\int \vec{E} \cdot d \vec{A}$ is sometimes written as $\int \vec{E} \cdot \hat{n}dA$ where $\hat{n}$ is an outward pointing unit vector. $\hat{n}$ for each of the six faces of the cube is quite simple. Perhaps this last part will be helpful.

Last edited: Jun 14, 2016
11. Jun 18, 2016

Now that you (the OP) have had some practice with double integrals in another section, you might find this calculation a little easier. Ignore my first part of post #10. That's a more advanced technique that can be used to check the answer. You might find the second part of my post #10 helpful. Once you take the dot product of the vectors (the outward pointing unit vector $\hat{n}$ perpendicular to the face of the cube and the $E$ field ,i.e $E \cdot \hat{n}$), the double integrals are simple ones here.

12. Jun 23, 2016

### WrongMan

Ok so i went back to this today.
So for the front face (x fixed at 2) i got:
∫4zdA = ∫4zdzdy and so i used a double integral from 0 to 2 to calculate and got 16 as an answer.
E^n should be ["(2xz) i + (x+2) j + (y(z^2-3) k" . (1i+0j+0k)]; which would give me only 2xz i, then since x is constant at 2, its 4z hence the integral above.
And just repeat for all faces, using care for the angle dA makes with E so that i dont get the signals wrong, them sum up the opposite faces (or sum up all the faces?)

13. Jun 23, 2016

You need to sum each of the faces. (all 6 faces). A couple of things to note: Three of the faces have one variable equal to zero. (e.g. x, y, or z.) The other 3 faces have one variable equal to 2. One other important item, $\hat{n}$ is the outward pointing unit vector, i.e. outward from the cube. For the bottom face in the x-y plane, (at z=0), this is $\hat{n}=-k$. For the top face, where you are integrating dxdy at z=2, this is $\hat{n}=+k$. Glad to see you returned to this calculation. I think you should find it much easier the second time around. I'd be happy to check the answers that you get. Your 16 is correct for the x=2 face. (Presumably you integrated the "z dz" and got $(1/2)z^2$, (and you integrated the 1dy and got y)).

Last edited: Jun 23, 2016
14. Jun 23, 2016

### WrongMan

yup thats what i did.
So for the face opposing this one (x=0) the field (along x) is 0 so the flux is 0.
Note: to avoid having negative axis values i moved the cube so it stands in the positive octant.

For the front face on y=2; field along y is (x+2) and since it does not depend on the y position the front face will "counter" the back face summing to 0 (values 12 and -12)
for the z-constant faces:
the one on top
∫∫y dydx = y2/2 from 0 to 2 => ∫2dx again from 0 to 2 =>4
on the bottom:
∫∫-3y dydx => -12 but since dA is pointing down (-k) this is 12
So the z "contribution" is +16 the y contribution is 0 and the x contribution is 16 so the total flux is 32 Nm2C-1 (these are the correct units here right? if the faces have sides 2m and the field is in SI )

15. Jun 23, 2016