# Homework Help: Finding electric field of a hemisphere (without using Gauss' Law)

1. Sep 26, 2014

### ghostfolk

1. The problem statement, all variables and given/known data
A charge distribution is given by $\rho(r,\theta,phi)=\gamma r^3cos\theta,a<r,b,0\leq\theta\leq\pi/2$ and is zero everywhere else. The distance from the origin $r=\sqrt{x^2+y^2+z^2}$ and $\gamma$ is a constant. Write out the electric field P along the z-axis a distance z from the origin as an integral over the charge density. Be sure to include all the limits of integration. Simplify the expression and carry out the $\phi'$ integration, but leave the $r'$ and $\theta'$ integrations.

2. Relevant equations

$dE=kdq/r^2$
$\rho=Q/V$

3. The attempt at a solution
$dq=\rho dV=\rho2\pi(b-r)^2dr$
So then, $dE_z=k\frac{\gamma r^3cos\theta(b-r)^2dr}{(z-(b-r))^2}$

Is that the correct way to set up the integral? Any help is appreciated.

2. Sep 26, 2014

### vela

Staff Emeritus
Not quite. You have to integrate over all three coordinates, and you want to use the volume element $dV = r^2\sin\theta\,dr\,d\phi\,d\theta$. Also, you need to rethink what the distance between point P and the charge element is.

3. Sep 26, 2014

### Orodruin

Staff Emeritus
Here you need to be mindful of the fact that the electric field is a vector. You later write the z-component $dE_z$, how would its differential look like and what happens with the x and y components. Also be mindful of the fact that the r that appears here is the distance from the charge dq, not from the origin. This means you will have to find an expression for this in terms of the spherical coordinates.

I would here suggest not to make spherical slices, but use a differential in all three coordinates. This is mainly because the distance to any given point on the z axis is going to depend on $\theta$. (Also note that the problem formulation will let you keep an integral in $r$ and $\theta$.

4. Sep 26, 2014

### ghostfolk

Okay so if I would to put in terms of the equation $E=\int dq\frac{(r-r')}{|r-r'|^3}$,. then $r-r'=z-rcos\phi$ and $|r-r'|=z^2+r^2-acos\phi$?

5. Sep 26, 2014

### ghostfolk

Would you mind pointing me in the right direction?

6. Sep 26, 2014

### Orodruin

Staff Emeritus
For the distance, I would start by writing down an expression in cartesian coordinates and then make the coordinate transformation to spherical for the sources.

For the component in the z direction, I suggest you write down the expression for the full field on vector form and then take the z component. For the x and y components, can you think of any symmetries that might help you?

7. Sep 26, 2014

### ghostfolk

All right so then I got $z-(r-a)cos\phi$ as the distance from the origin and $(r-a)^2+z^2-2a(r-a)cos\phi$ as the distance from the charge element to the point P. Is this correct formulation of dq $dq=\rho2\pi (r-a)^2R^2drd\theta \phi$? Also, I thought that by symmetry, the x and y components cancel out.

8. Sep 26, 2014

### vela

Staff Emeritus
I'm not sure why $a$ is appearing in your expression for the distances. The distance between the infinitesimal charge element and point P should depend only on $z, r, \theta,$ and $\phi$ at most.

9. Sep 26, 2014

### ghostfolk

Well since there isn't charge when $r<a$, I thought I had to subtract a from r. So with that thought I did $r-r'=z-(r-a)cos\phi$ and $|r-r'|=(r-a)^2+z^2-2a(r-a)cos\phi$ and got $dq=\rho2\pi (r-a)^2R^2drd\theta \phi$.

10. Sep 26, 2014

### Orodruin

Staff Emeritus
Well, as vela said, we have not yet begun to consider the bounds to the region. The only important things are the coordinates. Try to do what I suggested with writing the position vector first as a function of the cartesian coordinates.

11. Sep 26, 2014

### ghostfolk

Do you mean writing $r-r'$ in terms of cartesian coordinates?

12. Sep 26, 2014

### vela

Staff Emeritus
It would help a lot to understand your posts if you would stop using $r$ to mean both the vector $\vec{r}$ and the spherical coordinate $r$.

You could also use the law of cosines to find $\| \vec{r}-\vec{r}' \|$, or just expand it out. If you haven't already, draw a sketch with $\vec{r}$ and $\vec{r}'$.

13. Sep 26, 2014

### vanhees71

It's all vectors! I'd work in Cartesian coordinates, parametrizing the half-shell in spherical coordinates. Then you have to evaluate
$$\vec{E}(\vec{x})=\frac{1}{4 \pi} \int_V \mathrm{d}^3 \vec{x}' \rho(\vec{x}') \frac{\vec{x}-\vec{x}'}{|\vec{x}-\vec{x}'|^3}.$$
It's always good to write down everything in a clear way, not abbreviating too much, because this usually confuses you in such problems!

14. Sep 26, 2014

### ghostfolk

Sorry about that. Here's my sketch of $\vec{r}$ and $\vec{r}'$.

So if I were to express then I can express the distance between those two vectors in cartesian coordinates as $\vec{r}-\vec{r}'=(0-x')\hat{i}+(0-y')\hat{j}+(z-z')\hat{k}$

15. Sep 26, 2014

### Orodruin

Staff Emeritus
Precisely. Now, what is the length of that vector and what is the unit vector which is pointing in the same direction? After that it might be a good idea to express $x', y'$, and $z'$ in spherical coordinates.

16. Sep 26, 2014

### Orodruin

Staff Emeritus
Addendum: Just one thing I noticed that I think too important to go in an edit of the post I just made. Based on your drawing, you seem to measure the angles from the inner radius of the spherical shell. The problem is not symmetric around this point and I suggest you use the centre of the half-shell for the origin also for the spherical coordinates. This may be the reason you end up with $a$s in your expression where you should not.

17. Sep 26, 2014

### ghostfolk

So then the $|\vec{r}-\vec{r}'|=\sqrt{(-x')^2+(-y')^2+(z-z')^2}$ and to get the unit vector I would need to perform $\frac{(\vec{r}-\vec{r}')}{|\vec{r}-\vec{r}'|}$
How would measuring from the center remove $a$s. Since there is no charge for $r<a$, wouldn't there need to be something along the lines $r-a$?

18. Sep 26, 2014

### Orodruin

Staff Emeritus
How you define your coordinates is not about where there is charge or not, it is about finding a coordinate system where your expressions simplify as much as possible. Measuring $r'$ from the centre of the cavity is going to make your integration boundaries much simpler and show the symmetry of the problem in more detail, for example the integral in $r'$ will go from $a$ to $b$ - this is where your constraints should preferably enter, not in the definition of the coordinates. In addition, I am 100% certain that these are the coordinates the problem constructor had in mind when (s)he wrote down the charge distribution. (Note that the charge distribution starts at $r > a$, which means that there is a distance $a$ around the origin of the spherical coordinates where there should be no charge, i.e., the cavity.)

Correct.

19. Sep 26, 2014

### ghostfolk

Oh Okay, that makes sense to me now. Is it right to assume that under symmetry the $x$s and $y$s will cancel? Leaving $E=k\int dq\frac{(z-z')\hat{k}}{\sqrt{(z-z')^2}}$

20. Sep 26, 2014

### Orodruin

Staff Emeritus
The x and y components are going to cancel due to symmetry, this does not mean the x and y from the distance function will cancel out so you will need to keep them. I suggest you follow every step of making the change of variables if you are unsure.

21. Sep 26, 2014

### ghostfolk

Okay. So $z'=rcos\theta$ and $x'=rsin\theta cos\phi,y'=rsin\theta\sin\phi$. Then $x'^2+y'^2=r^2sin^2\theta$ resulting in $E=k\int\frac{dq (z−rcos\theta)\hat{k}}{\sqrt{r^2sin^2\theta+(z−rcos\theta)^2}}$

22. Sep 27, 2014

### Orodruin

Staff Emeritus
Yes, that looks more reasonable, but you are missing some powers of $\vec r - \vec r'$ in the denominator.