Set \(x = a\sin\theta\text{.}\) Then, \(dx = a\cos\theta\text{.}\) Making our substitutions, we get
\begin{equation*}
\ds \int_0^a a^2\sin^2\theta \sqrt{a^2-a^2\sin\theta}\, (a\cos\theta)\, d\theta
\end{equation*}
After some simplification, we get
\begin{equation*}
\ds \int_0^a a^4\sin^2\theta\cos^2\theta\, d\theta
\end{equation*}
Using the double angle identity for sine, we have
\begin{equation*}
\ds \int_0^a a^4 \lrpar{\dfrac{1}{2}\sin 2\theta}^2\, d\theta = \dfrac{a^4}{4}\int \sin^2 2\theta\, d\theta
\end{equation*}
Now use a power reducing identity:
\begin{equation*}
\ds \dfrac{a^4}{4}\int_0^a \dfrac{1}{2} (1-\cos 4\theta)\, d\theta
\end{equation*}
More simplification gives
\begin{equation*}
\ds \dfrac{a^4}{8} \int_0^a 1-\cos 4\theta\, d\theta
\end{equation*}
Integrating and using double angle identities gives
\begin{equation*}
\dfrac{a^4}{8}\lrpar{\theta - \dfrac{1}{4}\sin 4\theta}\bigg \rvert_{x = 0}^{x = a}
\end{equation*}
After reduction, it becomes clear that the sine term is zero at the endpoints, so the integral becomes
\begin{equation*}
\dfrac{a^4}{8}\lrpar{\inv{\sin}\lrpar{\dfrac{x}{a}}}\bigg\rvert_0^a
\end{equation*}
Evaluating gives our answer.