Yes, you are correct, we can use a trigonometric substitution...
$$u=a\tan(\theta)\,\therefore\,du=a\sec^2(\theta)\,d\theta$$
and we have:
$$\int\frac{a\sec^2(\theta)}{a^2\tan^2(\theta)+a^2} \,d\theta$$
$$\frac{1}{a}\int\frac{\sec^2(\theta)}{\tan^2(\theta)+1} \,d\theta$$
Now, by Pythagoras, we know:
$$\tan^2(\theta)+1=\sec^2(\theta)$$
and now we have:
$$\frac{1}{a}\int\,d\theta=\frac{1}{a}\theta+C$$
Next, we want to write $\theta$ in terms of $u$, and so we go back to:
$$u=a\tan(\theta)\,\therefore\,\theta=\tan^{-1}\left(\frac{u}{a} \right)$$
and so we may state:
$$\int\frac{du}{u^2+a^2}=\frac{1}{a}\tan^{-1}\left(\frac{u}{a} \right)+C$$
See if you can derive an equivalent formula using the cotangent function...