Verify the divergence theorem for the vector function $\vec{F}=x\hat{i}-y^2\hat{j}+z^2\hat{k}$ over the region bounded by $x^2+y^2=4,z=0,z=4$
First, using Divergence Theorem, $$div\vec{F}=(1-2y+2z)$$ So, $$\int_{0}^{2}\int_{0}^{4}\int_{0}^{\sqrt{4-x^2}}(1-2y+2z)dydzdx$$ $$=20\pi-{\frac{64}{3}}$$
Next, let $$f=x^2+y^2-4$$ Then,$$grad{f}=2x\hat{i}+2y\hat{j}$$ and its modulus is $4$
So, my unit normal is $$\hat{n}=\frac{gradf}{4}= \frac{x}{2}\hat{i}+\frac{x}{2}\hat{j}$$ Projecting onto $XZ$ plane, $$dS=\frac{dxdz}{\hat{n}\cdot\hat{j}}=\frac{2dxdz}{y}$$
So, $$\int\int\vec{F}\cdot\hat{n}dS$$ $$=\int_{0}^{4}\int_{0}^{2}\frac{x^2-y^3}{2}\frac{2dxdz}{y}$$ Substituting $y=\sqrt{4-x^2}$ and integrating, I get $$4\pi-{\frac{64}{3}}$$
[I omitted showing the full calculations here because I find it hard to type in Latex. If it is an error in my calculations, I'd be happy to redo and show the detailed work. ]
My two answers are not matching. Which one is correct? Am I putting any limit of integration wrong? Or do I know some formula wrong? Any help would be greatly appreciated.