<s>[INST] Evaluate $\int{\sqrt{a^2 - x^2}}dx$ I'm trying to solve the following integral, but seems these 2 methods led to different answers. I think one of the methods must be incorrect. But why doesn't one of them work?
Evaluate $\int{\sqrt{a^2 - x^2}}\ dx$
My friend evaluated this way:

First let $x=a\cos{\theta}$, so
   $a^2-x^2=a^2(1-\cos^2\theta)=a^2\sin^2{\theta}$ $$ \int{\sqrt{a^2 -
 x^2}}\ dx = -\int{a\sin{\theta}}\ d(a\cos{\theta}) =
 -\int{a^2\sin^2{\theta}}\ d\theta=-a^2\int{\frac{1-\cos{2\theta}}{2}}\ d\theta
 $$ $$ = -\frac{a^2}{2}\int(1-\cos{2\theta})\ d\theta =
 -\frac{a^2}{2}\left(\theta - \frac{\sin{2\theta}}{2}\right) $$ $$ = \frac{a^2}{2}\left(-\cos^{-1}{\frac{x}{a}}+\frac{{x}\sqrt{a^2-x^2}}{a^2}\right)
 $$

However I've done this way:

First let $x=a\sin{\theta}$, so
   $a^2-x^2=a^2(1-\sin^2\theta)=a^2\cos^2{\theta}$ $$ \int{\sqrt{a^2 -
 x^2}}\ dx = \int{a\cos{\theta}}\ d(a\sin{\theta}) =
 \int{a^2\cos^2{\theta}}\ d\theta=a^2\int{\frac{1+\cos{2\theta}}{2}}\ d\theta
 $$ $$ = \frac{a^2}{2}\int(1+\cos{2\theta})\ d\theta =
 \frac{a^2}{2}(\theta + \frac{\sin{2\theta}}{2}) $$ $$=
 \frac{a^2}{2}\left(\sin^{-1}{\frac{x}{a}}+\frac{{x}\sqrt{a^2-x^2}}{a^2}\right) $$

 [/INST] $\cos(\pi/2-x)=\sin(x)$ and vice versa. If you haven't seen this before, the geometric explanation is that the sine of one of the acute angles in a right triangle is the cosine of the other.
Therefore $-\cos^{-1}(x)$ and $\sin^{-1}(x)$ are the same up to a constant. Since indefinite integrals are only defined up to a constant (and the factor on the outside is a constant), your two solutions are consistent with each other.
</s>