How to integrate $\frac{x^2}{x^2+9}$? I know you can use division to get $1-\frac{p}{x^2+9}$ and then use the result for arctan, but I was trying to do this using substitution and nothing seems to work? Is there a substitution that could be used for this?

If one chooses not to write $\frac{x^2}{x^2+9}=1-\frac{9}{x^2+9}$, then one can make still directly substitute $x=3 \tan y$ with $dx=3 \sec^2y \,dy$.  Thus, we have
$$\begin{align}
\int \frac{x^2}{x^2+9}dx&=\int\frac{9\tan^2y}{9\tan^2y+9}3\sec^2y\,dy\\\\
&=3\int \tan^2y\,dy\\\\
&=3(\tan y-y)+C\\\\
&=x-3\arctan (x/3)+C
\end{align}$$
