Answer
$-\displaystyle \frac{\tan\theta}{2}\sqrt{9-\tan^{2}\theta}+\frac{9}{2}\sin^{-1}(\frac{\tan\theta}{3})+C$
Work Step by Step
With $\left[\begin{array}{l}
u=\tan\theta\\
du=\sec^{2}\theta d\theta ,
\end{array}\right]$ the integral becomes $I=\displaystyle \int\frac{u^{2}}{\sqrt{3^{2}-u^{2}}}du$
Table of integrals:
$\color{blue}{34. \displaystyle \quad\int\frac{u^{2}du}{\sqrt{\mathrm{a}^{2}-u^{2}}}=-\frac{u}{2}\sqrt{a^{2}-u^{2}}+\frac{a^{2}}{2}\sin^{-1}\frac{u}{a}+C }$
$(\mathrm{a}=3)$
$I=-\displaystyle \frac{u}{2}\sqrt{9-u^{2}}+\frac{9}{2}\sin^{-1}(\frac{u}{3})+C$
... bring back $\theta$...
$=-\displaystyle \frac{\tan\theta}{2}\sqrt{9-\tan^{2}\theta}+\frac{9}{2}\sin^{-1}(\frac{\tan\theta}{3})+C$