This is a question from my textbook but I have trouble in tackling it:
Let $$\mathbf F = (x^2+y^2+2+z^2)\mathbf i + (e^{x^2} + y^2)\mathbf j + (3+x)\mathbf k$$
Let $a > 0$, and let $S$ be the part of the spherical surface $x^2 + y^2 + z^2 = 2az + 3a^2$ that is above the $xy$-plane. Find the flux of $F$ outward across $S$.
Well, the first idea that came into my mind is to use divergence theorem, so here is my steps:
$$\operatorname{div}\mathbf F = (2x+2y)$$
$$\int_0^{2\pi} \int_0^{\sqrt{3} a} \int_0^{\sqrt{4a^2-r^2} + a} 2r^2 (\sin \theta + \cos \theta) \,dz\, dr\, d\theta$$
but the part of $\int_0^{2pi} (\sin \theta+\cos \theta) d\theta$ would result in $0$. However, the answer is $9 \pi a^2$ according to the textbook.
Can anyone help me please?