We will assume that $a>0$ for the following.
We have
$$\int x^2\sqrt{a^2-x^2} \,dx.$$
Let
$$
\begin{align*}
x&=a\sin{t} \\
dx &= a\cos{t} \, dt \\
a^2-x^2&=a^2-a^2\sin{t}\\
&=a^2\left( 1-\sin^2{t} \right)\\
&=a^2\cos^2{t}.
\end{align*}
$$
We substitute and integrate,
$$
\begin{align*}
&\int a^2\sin^2t \cdot \sqrt{a^2\cos^2t}\,\cdot a \cos t \,dt \\
=&a^4\int\sin^2 t \cos^2 t \, dt \\
=&a^4 \int\left( \sin t \cdot \cos t \right)^2 \, dt \\
=&a^4 \int\left( \frac{1}{2}\sin(2t) \right)^2 \, dt \\
=&\frac{a^4}{4}\int \sin^2(2t)\, dt \\
=& \frac{a^4}{4} \int \frac{1-\cos(4t)}{2} \, dt \\
=& \frac{a^4}{8} \int \left(1-\cos(4t)\right) \, dt \\
=& \frac{a^4}{8} \left( t-\frac{1}{4}\sin(4t) \right)+c.
\end{align*}
$$
The back substitution will be simpler if we have single angled trig solutions, and so we can reduce,
$$
\begin{align*}
\sin(4t) &= 2\sin(2t)\cos(2t) \\
&=2\left( 2\sin t \cdot \cos t \left( \cos^2 t- \sin^2 t \right)\right) \\
&= 4\sin t \cos^3 t-4\sin^3 t \cos t.
\end{align*}
$$
Hence our integral is
$$\frac{a^4}{8}\left( t- \sin t \cos^3 t + \sin^3 t \cos t \right)+c.$$
For the back substitution, we have that
$$x=a\sin t,$$
and so
$$t=\sin^{-1}\left(\frac{x}{a}\right).$$
For the remaining part, we draw a right triangle with angle $t$, opposite side $x$, hypotenuse $a$, and it follows that the adjacent side will be $\sqrt{a^2-x^2}$.
We use the definition of $t$ and read straight from the right triangle to back substitute,
\begin{align*}
& \frac{a^4}{8}\left( t- \sin t \cos^3 t + \sin^3 t \cos t \right) +c \\
=& \frac{a^4}{8}\left( \sin^{-1}\left(\frac{x}{a}\right)-\left(\frac{x}{a}\right)\left( \frac{\sqrt{a^2-x^2}}{a} \right)^3 +\left( \frac{x}{a} \right)^3\frac{\sqrt{a^2-x^2}}{a} \right) +c \\
=&\frac{a^4}{8}\left( \sin^{-1}\left(\frac{x}{a}\right) -\left(\frac{x}{a}\right)\frac{\sqrt{a^2-x^2}}{a}\left( \frac{a^2-x^2}{a^2}-\frac{x^2}{a^2} \right) \right) +c \\
=& \frac{a^4}{8}\left( \sin^{-1}\left(\frac{x}{a}\right)-\frac{x\sqrt{a^2-x^2}}{a^2}\left( \frac{a^2-2x^2}{a^2} \right) \right) +c \\
=&\frac{x}{8}\left( 2x^2-a^2 \right)\sqrt{a^2-x^2}+\frac{a^4}{8}\sin^{-1}\left(\frac{x}{a}\right)+c.
\end{align*}
This is the desired form.