Trig Subsitution When There's No Square Root I would say I'm rather good at doing trig substitution when there is a square root, but when there isn't one, I'm lost.
I'm currently trying to solve the following question:
$$Ar \int_a^\infty \frac{dx}{(r^2+x^2)^{(3/2)}}$$
Anyway, so far, I have that:
$$x = r\tan \theta$$
$$dx = r\sec^2 \theta$$
$$\sqrt {(r^2+x^2)} = r\sec\theta$$
The triangle I based the above values on:

Given that $(r^2+x^2)^{(3/2)}$ can be rewritten as $ (\sqrt{r^2+x^2})^3$, I begin to solve.
Please pretend I have $\lim \limits_{b \to \infty}$ in front of every line please.
\begin{align}
&= Ar \int_a^b \frac{r\sec^2\theta}{(r\sec\theta)^3}d\theta \\
&= Ar \int_a^b \frac{r\sec^2\theta}{r^3\sec^6\theta}d\theta \\
&= \frac{A}{r} \int_a^b \frac{1}{\sec^4\theta}d\theta \\
&= \frac{A}{r} \int_a^b \cos^4\theta d\theta \\
&= \frac{A}{r} \int_a^b (\cos^2\theta)^2 d\theta \\
&= \frac{A}{r} \int_a^b \left[\ \frac12 1+\cos(2\theta))\ \right]^2d\theta \\
&= \frac{A}{4r} \int_a^b 1 + 2\cos(2\theta) + \cos^2(2\theta)\ d\theta \\
&= \frac{A}{4r} \int_a^b 1 + 2\cos(2\theta)\ d\theta \quad+\quad \frac{A}{4r} \int_a^b \cos^2(2\theta)\ d\theta
\end{align}
And from there it gets really messed up and I end up with a weird semi-final answer of $$\frac{A}{4r}[2\theta+\sin(2\theta)] + \frac{A}{32r} [4\theta+\sin(4\theta)]$$ which is wrong after I make substitutions.
I already know that the final answer is $\dfrac{A}{r}\left(1-\dfrac{a}{\sqrt{r^2+a^2}}\right)$, but I really want to understand this. 

Firstly you made an error in the first line of working
$$(r\sec{(\theta)})^3=r^3\sec^3{(\theta)}$$
Secondly, you need to change the range of integration after performing a substitution. If $\theta=\arctan{(\frac{x}{r})}$ then the limits should change as $x=a \implies \theta=\arctan{(\frac{a}{r})}$ also $x=\infty \implies \theta=\frac{\pi}2$.
