What is wrong with my evaluation of $\sqrt{\frac{2}{\pi}}\int_{-\infty}^{\infty} e^\frac{-z^2}{2}dz$? Evaluate $\sqrt{\frac{2}{\pi}}\int_{-\infty}^{\infty} e^\frac{-z^2}{2}dz$ ?

My approach : let $\color{navy}{\frac{z^2}{2} = t, z = \frac{dt}{\sqrt{2t}}}$ 
It reduces to form $\frac{1}{\sqrt{\pi}}\int_{-\infty}^{\infty}
 e^{-t}t^\frac{-1}{2}dt$. and it is related to Gamma function. $\Gamma(\frac{1}{2}) = \sqrt{\pi}$
But I am getting answer as $1$, whereas $2$ is right answer?

 A: Your variable substitution corresponds to a transformation that is not one-to-one on the interval of integration; e.g., $t = z^2/2$ implies that $$\lim_{z \to +\infty} \frac{z^2}{2} = \infty, \quad \lim_{z \to -\infty} \frac{z^2}{2} = \infty,$$ and it is not the case that you can now just say $t \in (-\infty, \infty)$:  for it is obvious that $t \ge 0$ if $z \in \mathbb R$.  So you must partition the interval of integration so that the desired substitution is one-to-one on the respective partitions.
A: Why not use the Gaussian Integral?

Let $-\frac {z^2}{2} =-x^2$. Then we have $z^2 =2x^2 \Rightarrow 2zdz =4xdx \Rightarrow dz =\frac {2x}{z} dx =\sqrt {2} dx $. Then our integral becomes, $$\sqrt {\frac {2}{\pi}}\int_{-\infty}^{\infty} e^{-\frac {z^2}{2}} dz = 2\sqrt {\frac {1}{\pi}} \int_{-\infty}^{\infty} e^{-x^2} dx = 2$$ 

Hope it helps.
A: Here's one way to do it
$$\sqrt{\frac{2}{\pi}}\int_{-\infty}^{\infty} e^\frac{-z^2}{2}\ \mathrm dz$$
First note that
$$t=\frac{z}{\sqrt 2}\Rightarrow\sqrt 2\ \mathrm dt=\mathrm dz$$
After substituting, we have
$$\frac{2}{\sqrt\pi}\int_{-\infty}^{\infty} e^{-t^2}\ \mathrm dt$$
Also note that
$$\int_{-\infty}^{\infty} e^{-t^2}\ \mathrm dt=\sqrt\pi$$
Therefore
$$\frac{2}{\sqrt\pi}\int_{-\infty}^{\infty} e^{-t^2}\ \mathrm dt=2$$
