I'm trying to solve the following integral $$I=\int_0^1\sqrt{x-x^2}dx$$ I know that this can be done without using a trigonometric substitution. (its the area of half a circle and is equal to $\pi/8$). My problem is when using a trig substitution my answer is $-\pi/8$ which does not make sense to me and I'm not sure what went wrong.
By completing the square I'll get $$x-x^2=-\left(x^2-x+\frac{1}{4}-\frac{1}{4}\right)=\frac{1}{4}-\left(x-\frac{1}{2}\right)^2$$
My substitution is $x-\frac{1}{2}=\frac{1}{2}\sin(\theta)$ so I'll have the following
\begin{align}I&=\int\sqrt{\frac{1}{4}-\left(\frac{1}{2}\sin(\theta)\right)^2}\frac{1}{2}\cos(\theta)d\theta\\&=\frac{1}{4}\int\cos^2(\theta)d\theta \\&=\frac{1}{4}\int\frac{1}{2}\left(1+\cos(2\theta)\right)d\theta\\ &=\frac{1}{8}(\theta+\sin(\theta)\cos(\theta))d\theta\\&=\frac{1}{8}\left(\arcsin(2x-1)+(2x-1)\sqrt{1-(2x-1)^2}\right)\end{align} Now if I plug in one and zero I get the following $$\frac{1}{8}\left(\arcsin(1)+0-(\arcsin(-1)+0)\right)=\frac{1}{8}\left(\frac{\pi}{2}-\frac{3\pi}{2}\right)=-\frac{\pi}{8}$$
Did I miss something?
$$I = \int_0^1 \sqrt{x-x^2} dx = \int_0^1 \sqrt{\frac{1}{4}-(x-\frac{1}{2})^2} dx$$ Let $u = x - \frac{1}{2}$, then $$I = \int_{-\frac{1}{2}}^{\frac{1}{2}} \sqrt{\frac{1}{4}-u^2} du$$ Now let $u = \frac{1}{2}\sin \theta$ then $du = \frac{1}{2}\cos \theta ~d\theta$. Note that: for $u = \frac{1}{2}$ we have $\theta = \frac{\pi}{2}$ and for $u = -\frac{1}{2}$ we have $\theta = -\frac{\pi}{2}$. Now we Substitute in the integral $$I = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \sqrt{\frac{1}{4}-\frac{1}{4}\sin^2\theta} .\frac{1}{2}\cos \theta ~d\theta = \frac{1}{4}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\cos^2 \theta ~d \theta = \frac{1}{8} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} 1 + \cos 2\theta ~d\theta = \frac{\pi}{8}.$$ Note that $\sqrt{\cos^2\theta} = \cos \theta$ sine we are working on the interval $[-\frac{\pi}{2},\frac{\pi}{2}]$ the cosine is positive on this interval.