Why I cannot get the same answer if I do substitution with $x=a \cos\theta$ for $\int \sqrt{a^2-x^2}dx$ compared with substitution $x=a \sin\theta$? Why I cannot get the same answer if I do substitution with $x=a \cos\theta$ for $\int \sqrt{a^2-x^2}dx$ compared with substitution $x=a \sin\theta$?
$\int \sqrt{a^2-x^2}dx = \int \sqrt{a^2 - a^2 \cos^2 \theta} d\theta = \int a \sin\theta d\theta = \int a \sin\theta(-a \sin\theta)d\theta = -a^2 \int sin^2 \theta = -a^2[\frac{\theta}{2} - \frac{\sin(2\theta)}{4}]+C$
However, the correct answer seems to be $a^2(\frac{\theta}{2} + \frac{\sin(2\theta)}{4}) + C$

$I(x)$ integral done by two different methods yields $I_1(x), I_2(x)$. These two differ only  by a constant independent of $x$: $I_1(x)-I_2(x)=$Cosnstant, eventually.
In @lab Bhattacharjee 's answer above
$$I_2(x)=\frac{x}{2}\sqrt{a^2-x^2}-\frac{a^2}{2} \cos^{-1}(x/a)$$
and$$I_2(x)=\frac{x}{2}\sqrt{a^2-x^2}+\frac{a^2}{2} \sin^{-1}(x/a)$$
So $$I_1(x)-I_2(x)=\frac{a^2}{2}[-\cos^{-1}(x/a)-\sin^{-1}(x/a)]=-\frac{a^2\pi}{4}$$
