# Checking the divergence of a function

## Homework Statement

Check the divergence theorem using the vector function V = r^2 $\hat{r}$ + sin(θ) $\hat{θ}$ which is expressed in spherical coordinates. For the volume use a hemisphere of unit radius above the xy-plane (see figure below) (picture not shown, but I integrated r: 0 to 1, theta: 0 to pi/2, and phi 0 to 2pi)

## Homework Equations

∫(Div V) d$\tau$ = $\oint V da$
(Divergence Theorem)

## The Attempt at a Solution

I did the RHS first because it's simpler. given da = R^2 sin(θ) dθ dψ $\hat{r}$ and R = 1
$\oint V da$ → ∫sinθd from 0 to pi/2 * ∫dψ from 0 to 2pi, which is of course, 2pi.

I assume that because of it's simplicity, this side must absolutely be correct. Unfortunately, the LHS is much harder.

First I find Div V = 4r + 2cos(θ)/r, then I use d$\tau$ = r^2 * sinθ dr dθ dψ
to obtain ∫ ( 4r + 2cos(θ)/r ) * r^2 * sinθ dr dθ dψ.

Next I integrate with respect to r, 0 to 1, to get sinθ (cos+1) dθ dψ. This is where it gets weird.

I integrate theta from 0 to pi/2 but I get 3/2. Since phi is from 0 to 2pi, and there are 0 phi terms, the answer must be 3pi. But this does not equal the LHS, which must be correct!

I have been doing this for a couple of hours and I cannot think of a problem. Please help!

• 