# Problem integrating over a sphere.

1. Sep 13, 2015

### S. Moger

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

Compute $\int_S \vec{F} \cdot d\vec{S}$

$\vec{F} = (xz, yz, z^3/a)$

S: Sphere of radius $a$ centered at the origin.

2. Relevant equations

$x = a \sin(\theta) \cos(\varphi)$
$y = a \sin(\theta) \sin(\varphi)$
$z = a \cos(\theta)$

Phi : 0->2 pi, Theta : 0->pi/2 .

3. The attempt at a solution

$\vec{F} = a^2 \cos(\theta) \cdot \{ \sin(\theta) \cos(\varphi), \sin(\theta) \sin(\varphi), \cos(\theta)^2 \}$

$d\vec{S} = \frac{ \partial{\vec{r} }} {\partial{\theta} } \times \frac{ \partial{\vec{r}}}{\partial{\varphi}} d\theta d\varphi = a^2 \sin(\theta) \cdot \{ \sin(\theta) \cos(\varphi), \sin(\theta) \sin(\varphi), \cos(\theta) \}$

$\int_S \vec{F} \cdot d\vec{S}$ = $\int_\varphi d\varphi \int_\theta ... d\theta = 2 \pi a^4 \int_\theta ... d\theta = 9 \pi a^4 / 10$

While the correct answer is $\frac{4}{5} \pi a^4$ .

I'm relatively sure this isn't a book-keeping issue, I double checked the computations manually and with mathematica. Maybe I'm missing something (or maybe there's an easier way to "see" the answer).

2. Sep 13, 2015

### vela

Staff Emeritus
What's the integrand you came up with?

3. Sep 13, 2015

### Staff: Mentor

Stokes' theorem might lead to an easier integral (didn't test it).
This is still in cartesian coordinates? Then it shouldn't have that prefactor.

4. Sep 13, 2015

### S. Moger

I got this:
$\int_S \vec{F} \cdot d\vec{S}= a^4 \int \int \sin(\theta)^3 \cos(\theta) + \sin(\theta) \cos(\theta)^4 d\varphi d\theta$

The phi variable "disappears" ( = 1) because of the trigonometric identity, so I separate its integral from the expression involving theta.

The expression for the F-vector should be valid as it stands (in cartesian coordinates). I inserted the expressions for x y z in theta, phi and a, and extracted z.

5. Sep 13, 2015

### vela

Staff Emeritus
When you integrate the $\sin^3\theta \cos\theta$ term, it'll vanish because the integrand is odd around $\theta = \pi/2$. Is that what you found? The final answer pops out from the second integral.

6. Sep 13, 2015

### Staff: Mentor

Ah right, you have the z everywhere.

7. Sep 13, 2015

### S. Moger

If I integrate it from 0 to pi/2 I should get 1/4. (It's just $\frac{\sin^4{\theta}}{4}$, with theta=0 vanishing, if I'm not mistaken). But makes me think about the range (integration limits, not sure about the word for it). But if I spanned -pi/2 to pi/2 I would get zero in any case

8. Sep 13, 2015

### vela

Staff Emeritus
Oh, I didn't notice you had written down the wrong limits. $\theta$ does indeed go from 0 to $\pi$, not $\pi/2$.

9. Sep 13, 2015

### S. Moger

Yes, that's it! Thank you very much.