# Confusion about Spherical Coordinates Transformation

We have a function $$f(x,y,z) = \frac{e^{-x^2 -y^2 -z^2}}{\sqrt{x^2+y^2+z^2}}$$ and we want to integrate it over the whole $\mathbb{R}^3$. Then what i got is the following: $$\int_{\mathbb{R}^3}^ \! \frac{e^{-x^2 -y^2 -z^2}}{\sqrt{x^2+y^2+z^2}} \, \mathrm{d}x\mathrm{d}y\mathrm{d}z$$ $$=\int_0^{\infty} \! \!\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \! \int_0^{2\pi} \! \frac{e^{-r^2(cos^2\theta cos^2\phi +cos^2\theta sin^2\phi + sin^2\phi) }}{\sqrt{r^2(cos^2\theta cos^2\phi +cos^2\theta sin^2\phi + sin^2\phi)}}r^2cos\theta \, \mathrm{d}\phi\mathrm{d}\theta\mathrm{d}r,$$ my textbook says that the integral over the whole $\mathbb{R}^3$ is equal to $$\int_0^{\infty} \! \!\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \! \int_0^{2\pi} \! \frac{e^{-r^2}}{\sqrt{r^2}}r^2cos\theta \, \mathrm{d}\phi\mathrm{d}\theta\mathrm{d}r.$$ What i dont quite understand - did i go wrong or does $(cos^2\theta cos^2\phi +cos^2\theta sin^2\phi + sin^2\phi)$ somehow equal 1 here (the integration of the final integral is not necessary for the answer)?

$$\int_0^{\infty} \! \!\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \! \int_0^{2\pi} \! \frac{e^{-r^2(cos^2\theta cos^2\phi +cos^2\theta sin^2\phi + sin^2\color{red}\phi) }}{\sqrt{r^2(cos^2\theta cos^2\phi +cos^2\theta sin^2\phi + sin^2\color{red}\phi)}}r^2cos\theta \, \mathrm{d}\phi\mathrm{d}\theta\mathrm{d}r$$
The red bits should be $\theta$ and $$\forall \theta, \phi\in \mathbb R \left[\cos(\theta))^2 (\cos(\phi))^2 +(\cos(\theta))^2 (\sin(\phi))^2 + (\sin(\theta))^2=1\right].$$
Hint: $\cos^2 \theta \cos^2 \phi +\cos^2 \theta \sin^2 \phi = \cos^2 \theta (\cos^2 \phi + \sin^2 \phi)$.