<s>[INST] Find a primitive of $x^2\sqrt{a^2 - x^2}$ I'm stuck on this problem for the last while now and any help would be appreciated. I need to find the indefinite integral of $$\int x^2\sqrt{a^2-x^2} dx$$ 
and show that it equals  $$\frac x8(2x^2-a^2)\sqrt{a^2-x^2}+{a^4\over 8}\arcsin{x\over a}+c$$
I've tried using the substitution $x=a\sin t$ and $x=a\sec t$  Both have looked promising but I just can't seem to finish it out. 
Thanks in advance for any help.
 [/INST] Putting $\displaystyle x=a\sin t,t=\arcsin\frac xa \implies -\frac\pi2\le t\le \frac\pi2$ as the principal value of inverse sine ratio lies $\displaystyle\left[-\frac\pi2,\frac\pi2\right]$
$\displaystyle\implies \cos t\ge0$
$\displaystyle\implies\sqrt{a^2-x^2}=\sqrt{a^2\cos^2t}=|a\cos t|=|a|\cos t$
$\displaystyle \int x^2\sqrt{a^2-x^2}dx=a^3|a|\int\sin^2t\cos^2tdt$
$$\text{Now as }\sin t\cos t=\frac{\sin2t}2, \sin^2t\cos^2t=\frac{\sin^22t}4$$
$$\text{Again as }\cos2u=\cos^2u-\sin^2u=1-2\sin^2u,\sin^22t=\frac{1-\cos4t}2$$
$$\int\sin^2t\cos^2tdt=\frac18\int(1-\cos4t)dt=\frac t8-\frac{\sin4t}{32}+C$$
Now as $\displaystyle x=a\sin t$ and $\sin4t=2\sin2t\cos2t=4\sin t\cos t\cos2t$
$\displaystyle\cos2t=1-2\sin^2t=1-2\left(\frac xa\right)^2=-\frac{2x^2-a^2}{a^2} $
As $\displaystyle\cos t\ge 0,\cos t=+\sqrt{1-\left(\frac xa\right)^2}=\frac{\sqrt{a^2-x^2}}{|a|}$
</s>