Integral over a sphere in spherical coordinates Suppose we have a function $f(x,y,z)$ where $(x,y,z) \in S$. With $S$ being unit sphere in $R^3$. Passing to spherical coordinates we may write $x=\sin{\theta} \cos \phi$ and $y=\sin{\theta} \sin \phi$ where $\theta$ is the angel of $(x,y,\sqrt{1-x^2-y^2})$ with the $Z$-axis, $\phi$ is the angel between its projection and $X$-axis. Why can't we write
$$\int_{S} f(x,y,z) d\sigma = \int_0^\pi \int_0^{2 \pi} f \left( x(\theta,\phi), y(\theta,\phi), \sqrt{1-x^2(\theta,\phi)-y^2(\theta,\phi)} \right) \ \sin{\theta} \cos{\theta} \ \ d\phi d\theta$$
The term $\sin{\theta} \cos{\theta}$ is the determinant of the $2 \times 2$ Jacobian matrix coming from the change of variables.  
 A: In Cartesian Coordinates, the surface integral
$$\int_S f\,dS=\iint_{C_{xy}}f(x,y,z=\sqrt{1-x^x-y^2})\,\frac{dxdy}{\cos \theta}$$
where the surface element $dS\to \frac{dxdy}{\cos \theta}$ and $C_{xy}$ is unit circle resulting from projecting the sphere on to the $x-y$ plane.  


ASIDE NOTE:
Note that the surface element "scale factor", $\cos \theta$, can be heuristically viewed as a simple projection of the surface element onto the $x-y$ plane - the "shadow" cast by the element.  
More rigorously, we can parameterize the upper hemi-sphere as $$\vec r=\hat x u+\hat y v+\hat z\sqrt{1-u^2-v^2}$$Then, a normal vector $\vec N$ to the surface is 
  $$\begin{align}
\vec N&=\frac{\partial \vec r}{\partial u}\times \frac{\partial \vec r}{\partial v}\\\\
&=\left(\hat x-\hat z \frac{u}{z}\right)\times \left(\hat y-\hat z\frac{v}{z}\right)\\\\
&=\hat x \frac{u}{z}+\hat y \frac{v}{z}+\hat z
\end{align}$$
Then, we have $$\begin{align}
dS&=\sqrt{1+\frac{u^2}{z^2}+\frac{v^2}{z^2}}\,du\,dv\\\\
&=\frac{du\,dv}{|z|}\\\\
&=\frac{du\,dv}{\cos \theta}
\end{align}$$


Now one can apply the use the Jacobian of the transformation given by $x=\sin \theta\cos \phi$ and $y=\sin \theta\sin \phi$ to obtain the result
$$\int_S f\,dS=\int_0^{2\pi}\int_0^{\pi}f(\sin \theta \cos \phi,\sin \theta \cos \phi,\cos \theta)\,\frac{\sin \theta \cos \theta}{\cos \theta} \,d\theta\,d\phi$$
