# Triple Integration of charge density question

1. Mar 6, 2013

### CraigH

1. The problem statement, all variables and given/known data

a)Calculate the total charge a square capacitor plate would have with width x, height y, thickness z, and charge density f(x,y,z) = 1+x+y

b)Calculate the total charge a sphere would have with radius r, and charge density f(x,y,z)=x+y+z

Use the triple integration seen in gauss' theorem and show all working.

2. Relevant equations

$Q= \int\int\int\rho .dv$
$\rho = Charge Density$
$v=Volume$

3. The attempt at a solution

a)
$\int\int\int f(x,y,z) .dv$
$\int\int\int f(x,y,z) .dx.dy.dz$
$\int\int\int 1+x+y .dx.dy.dz$

$\int\int x + x^2 + yx .dy.dz$

$\int xy + (x^2)y + x(y^2) .dz$

$Charge = xyz +(x^2)yz + x(y^2)z$

//I think this one is correct?

b)
$\int\int\int x+y+z .dx.dy.dz$

//I get stuck here with this one because it is a sphere and not just a simple shape

Last edited: Mar 6, 2013
2. Mar 6, 2013

### CraigH

By the way the charge density function is completely arbitrary. I understand that charge would not spread itself out inside a capacitor plate like
charge density = f(x,y,z) = 1+x+y

3. Mar 6, 2013

### SteamKing

Staff Emeritus
A sphere is a pretty simple shape.

For calculating the charge on the sphere, I would suggest you convert to spherical coordinates before integrating.

4. Mar 6, 2013

### Mute

No, you have a slight mistake. You integrated the "x" to "1*x2". You made the same kind of mistake when integrating y. What is it supposed to be?

Also, you didn't include any limits on the integral, which could be important. You tell us that the plate has dimensions X by Y by Z (I'm using uppercase to distinguish from the coordinates x, y and z), but you don't tell us if the coordinates run from x = 0 to X, y = 0 to Y, z = 0 to Z or x = -X/2 to +X/2, y = -Y/2 to +Y/2, etc. It matters which it is, because your density is 1 + x + y, and can have negative charge on the conductor in the second set of limits I mentioned.

5. Mar 6, 2013

### CraigH

Thank you for answering. Ah yes the integral should be

Charge = (x)(y)(z) + 0.5(x^2)(y)(z) + 0.5(y^2)(x)(z)

And I can see now how the limits would be important. If (0,0,0) is the close bottom left of the plate, and (X,Y,Z) is the far top right of the plate these would be the limits. I can see that I also could have chose (0,0,0) as the centre of the plate.

So if I substitute in the limits after each integration I get:

$\int^{X}_{0}\int^{Y}_{0}\int^{Z}_{0} 1+x+y .dx.dy.dz$

$\int^{X}_{0}\int^{Y}_{0} [x + 0.5x^2 + yx]^{Z}_{0} .dy.dz$

$\int^{X}_{0}\int^{Y}_{0} (Z + 0.5Z^2 + yZ)-(0 + 0.5(0)^2 + y(0)) .dy.dz$ //The lower limit will always be zero so I wont include it from now

$\int^{X}_{0}[Zy + 0.5(Z^2)y + 0.5(y^2)Z]^{Y}_{0} .dz$

$\int^{X}_{0}(ZY + 0.5(Z^2)Y + 0.5(Y^2)Z) .dz$

$Charge = [ZYz + 0.5(Z^2)Yz + 0.5(Y^2)Zz]^{Y}_{0}$

$Charge = (ZYY + 0.5(Z^2)YY + 0.5(Y^2)ZY)$

$Charge = (ZY^2 + 0.5(Z^2)Y^2 + 0.5(Y^3)Z)$

This doesn't seem correct, the width of the plate (denoted by X) apparently doesn't affect the charge when it obviously should. Have I made another careless mistake or am I doing something wrong in the method?

Last edited: Mar 6, 2013
6. Mar 6, 2013

### CraigH

Okay, I see what I did wrong, the limits are in the wrong order. The upper limits should be Z, Y, X, from left to right. If I didn't do this though did I do the rest of the method correctly?

7. Mar 6, 2013

### CraigH

Thanks. I have attempted part b with the spherical coordinate system and it is much easier to understand. I'm just now waiting to check that I am doing the triple integrations with limits the correct way.

8. Mar 6, 2013

### Mute

It looks like your integrations are fine, you're just mixing up the limits, which seems to have caused you to get confused and lose your X somewhere. You're correct that all of X, Y and Z should appear in your solution. The order of integration doesn't matter, but you want to make sure that when you integrate with respect to x the upper limit should be x.

9. Mar 6, 2013

### CraigH

Thank you for helping, it is very much appreciated! I will definitely repay what I owe to this sites users once I have finished exams by answering other peoples questions, as this site has helped me quite a lot.
One more quick question though before I'm completely confident with this topic:

Can you always replace .dv with .dx.dy.dz?
like I did here
∫∫∫f(x,y,z).dv
∫∫∫f(x,y,z).dx.dy.dz

Or is this only for a cuboid shape?

If not, what would it be for other simple shapes?

10. Mar 6, 2013

### haruspex

Yes. dxdydz is the volume element in Cartesian coordinates. Even a sphere can be notionally thought of as composed of such elements because, in the limit as the elements tend to zero, the edge error tends to zero. When it is not a rectangular box, the awkward part is the ranges. The range of an inner integral will depend on the local value of a coordinate in an outer integral.
Other coordinate systems, spherical, cylindrical, ..., have other forms for the volume element. When converting from one to another you generally need to introduce a factor known as the Jacobian. E.g. the area element in polar is rdrdθ, the factor r being the Jacobian.