Fallacy - where is the mistake? Could anyone help me to find the mistake in this fallacy? Because the actual result for $I$ is $\pi/2$
\begin{equation}
I = \int_{0}^{\pi} \cos^{2} x \; \textrm{d}x
\end{equation}
\begin{equation}
I = \int_{0}^{\pi} \cos x \cos x \; \textrm{d}x
\end{equation}
substitution:
\begin{equation}
\sin x = u
\end{equation}
\begin{equation}
\cos x \; \textrm{d}x = u
\end{equation}
\begin{equation}
\cos x = \cos (\arcsin x)
\end{equation}
and the limits:
\begin{align}
\begin{split}
x &= 0 \quad \Rightarrow \quad u=0 \\
x &= \pi \quad \Rightarrow \quad u=0
\end{split}
\end{align}
so
\begin{equation} 
I = \int_{0}^{0} \cos (\arcsin u) \textrm{d}u
\end{equation}
\begin{equation}
I=0
\end{equation}

if $\sin(x)=u$ we get $x=\arcsin(u)$ and $dx=\frac{1}{\sqrt{1-u^2}}du$ thus we get
$\int \cos(x)^2dx=\int 1-\sin(x)^2dx=\int \sqrt{1-u^2}du$
