I'm trying to solve the following problem using the Gauss divergence theorem. I have to calculate the Flux through a sphere. The sphere is given as $$ x^2 +y^2+z^2==4 $$ where as the z is resticted from $$ \sqrt{3} \; to \; 2$$ I determined the divergence to $$ 4z $$ I first tried to use spherical coordinates which resolve to:
$$ \int _{\sqrt{3}}^2\int _0^{\pi /6}\int _0^{2\pi }4 *r*\text{Cos}[o]*r^2*\text{Sin}[o]dpdodr = \frac{7 \pi }{4} $$
To confirm this solution I tried to solve this problem using a regular volume integral. Which resolve to: $$ \int _{\sqrt{3}}^2\int _{-\sqrt{4-z^2}}^{\sqrt{4-z^2}}\int _{-\sqrt{4-y^2-z^2}}^{\sqrt{4-y^2-z^2}}(4 *z) dxdydz = \pi $$ I guess the error lies in my changed z variable. I replaced it with $$ r*\text{Cos}[o] $$ Could you guys please take a look into it? Thanks