Evaluating $\int^1_0 \frac2{\sqrt{2-x^2}} dx$ $$\int^1_0 \frac2{\sqrt{2-x^2}} dx$$
using substitution $x=\sqrt 2 \sin \theta$
$$\int^{\pi/4}_0 \frac{2\cos \theta d\theta}{\sqrt{2-2\sin^2 \theta}} = \int^{\pi/4}_0 \frac{2\cos\theta d\theta}{\sqrt2 \cos\theta} = \int^{\pi/4}_0 \frac{2d\theta}{\sqrt2}  = \int^{\pi/4}_0 \frac{2\cdot\sqrt2 d\theta}{\sqrt2\cdot\sqrt2} = \int^{\pi/4}_0 \sqrt2d\theta = \sqrt2 \theta = \sqrt2 (\frac\pi4 - 0) = \sqrt2 \frac\pi4 $$
The problem is that the answer is $\frac\pi2$. Where did I make a mistake?
UPDATE: 
using substitution $x=\sqrt 2 \sin\theta \rightarrow dx=\sqrt2\cos\theta$
$$\int^{\pi/4}_0 \frac{2\sqrt2\cos\theta}{\sqrt{2-2\sin^2\theta}} = \int^{\pi/4}_0 \frac{2\sqrt2\cos\theta}{\sqrt2 cos\theta} = \int^{\pi/4}_0 \frac{2\sqrt2}{\sqrt2}  = \int^{\pi/4}_0 2 = 2 \theta = 2 (\frac\pi4 - 0) = \frac\pi2 $$

you should substitute $dx$ by $\sqrt{2}\cos t dt$
