User Name Remember Me? Password

 Electricity and Magnetism Electricity and Magnetism Physics Help Forum May 20th 2017, 11:46 AM #1 Senior Member   Join Date: Nov 2013 Location: New Zealand Posts: 550 Gauss's law using a cube I thought I would try and verify Gauss's law for a cube of sides length a, centred at the origin, just for fun. I didn't include the cross-product term in the surface integral as far as I can tell it equals unity anyway. The 3/2 power term comes from combining with the vector projection of the flux onto the area vector of the cube. The projection factor was as follows: I came up with this surface integral. Using wolfram alpha I got this to evaluate to: This is for one face of the cube so need to multiply that by 6 for each face. However Gauss's law is supposed to be independent of shape and here it seems dependent upon the size of the box!! I have a feeling I may be mixing up surface and volume integrals. Am I missing an obvious surface parameterization here? However surface integrals always seem to be double and if anything this should be simpler than a sphere (which I worked through previously). I should add that I evaluated this integral between 0 and a/2 and doubled the result rather than integrating between -a/2 and a/2 because the latter always evaluated to zero. The problem seems to be any integral of an even function evaluates to zero around equal and opposite upper and lower bounds. I know it shouldn't be zero so I did the former which probably means I set this problem up incorrectly but I can't quite see why. This is the answer I was expecting: Can anyone see any obvious mistakes I have made? Last edited by kiwiheretic; May 20th 2017 at 03:49 PM. Reason: Clean up last eqn   May 21st 2017, 05:24 AM   #2
Senior Member

Join Date: Aug 2010
Posts: 403
You say
 I should add that I evaluated this integral between 0 and a/2 and doubled the result rather than integrating between -a/2 and a/2
but the integral you show is from -1/a to 1/a. Where did that come from?

 The problem seems to be any integral of an even function evaluates to zero around equal and opposite upper and lower bounds.
No, it isn't. The integral of any odd function is even, F(-a)= F(a), so that F(a)- F(-a)= F(a)- F(a)= 0. Then integral of any even function is odd, F(-a)= -F(a), so that F(a)- F(-a)= F(a)+ F(a)= 2F(a).   May 21st 2017, 12:53 PM   #3
Senior Member

Join Date: Nov 2013
Location: New Zealand
Posts: 550
 Originally Posted by HallsofIvy You say but the integral you show is from -1/a to 1/a. Where did that come from?
The cube is centered at the origin with vertices at co-ordinates (1/a,1/a,1/a), (1/a,1/a,-1/a), (1/a,-1/a,1/a), (1/a,-1/a,-1/a), (-1/a,1/a,1/a), (-1/a,1/a,-1/a), (-1/a,-1/a,1/a), (-1/a,-1/a,-1/a).

I tried to cheat by calculating one face of the cube only thinking to multiply by 6 afterwards. (cube has 6 faces). I also tried to cheat by dividing a face into four quadrants, ie (x positive, y positive), (x, negative, y positive), (x positive, y negative) and (x negative, y negative). I chose to evaluate with 0 < x < 1/a and 0 < y < 1/a for both positive thinking to multiply the result by 4 as there are 4 quadrants. In other words using symmetry arguments where ever possible.

 No, it isn't. The integral of any odd function is even, F(-a)= F(a), so that F(a)- F(-a)= F(a)- F(a)= 0. Then integral of any even function is odd, F(-a)= -F(a), so that F(a)- F(-a)= F(a)+ F(a)= 2F(a).
Well, if we use an even function like y = x^2 as an example and evaluate it around -1 < x < 1 then I(Y(x)) = x^3/3 where I(Y(1)) - I(y(-1)) = 1/3 - - 1/3 = 2/3. Ohhh, oops. That's what happens when I try to do this too late at night to battle insomnia. ;-)

I tried again but leaving out the constant factor

for brevity.

Then integrating with respect to y

substituting x=1/a for the result and doubling it this time because when we substitute for x = -1/a we are same but for a sign but then we also subtract the two.

substituting in x = 1/a yields

and x = -1/a yields

yielding

which is where I think SymPy Live led me up the garden path by telling me it was zero.

Doing the same for y = 1/a

and y = -1/a

this time yielding

Ok, that's a lot better than what I had but we still get the total flux is dependent on the area of the sides of the cube and not just the charge inside according to what Gauss's law says so what am I missing here?

Last edited by kiwiheretic; May 21st 2017 at 02:02 PM.   May 21st 2017, 02:31 PM #4 Senior Member   Join Date: Nov 2013 Location: New Zealand Posts: 550 Ooops, my cube corners are wrong, should be (a/2,a/2,a/2), (a/2,a/2,-a/2),(a/2,-a/2,a/2),(a/2,-a/2,-a/2),(-a/2,a/2,a/2),(-a/2,a/2,-a/2),(-a/2,-a/2,a/2),(-a/2,-a/2,-a/2) Now when I substitute in integration limits -a/2 < x < a/2 and -a/2 < y < a/2 I get: and that "a" term cancels out with the factor in Ok, looks like I was half asleep when I was trying to do this last time. Looks like I solved it on my own (with some prompting from HallsofIvy). :-)   May 21st 2017, 02:33 PM #5 Senior Member   Join Date: Nov 2013 Location: New Zealand Posts: 550 I wonder what that "tan" expression represents in this case.  Tags cube, gauss, law Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Similar Physics Forum Discussions Thread Thread Starter Forum Replies Last Post dieselfuel Thermodynamics and Fluid Mechanics 1 Apr 23rd 2017 01:27 AM morrobay Thermodynamics and Fluid Mechanics 1 Nov 24th 2011 12:02 AM Mike_mara Advanced Electricity and Magnetism 1 Dec 9th 2010 02:02 AM maple_tree Electricity and Magnetism 1 May 2nd 2010 09:28 PM maple_tree Advanced Electricity and Magnetism 4 Mar 30th 2010 10:15 AM