<s>[INST] Evaulating the trigonometric integral $\int \frac{1}{(x^2+1)^2} \, dx$ Problem:
Evaluate the following integral:
\begin{eqnarray*}
\int \frac{1}{(x^2+1)^2} \, dx \\
\end{eqnarray*}
Answer:
To do this, I let $x = \tan u$. Now we have $dx = \sec^2 u du$.
\begin{eqnarray*} \int \frac{1}{(x^2+1)^2}  \, dx &=& \int \frac{\sec^2{u} \, du}{(\tan^2{u} + 1)^2} \\
\int \frac{1}{(x^2+1)^2}  \, dx &=& \int \frac{1}{\sec^2{u}} \, du
 = \int \cos^2{u} \, du \\
\int \frac{1}{(x^2+1)^2}  \, dx &=& \int \frac{\cos{(2u)} + 1}{2} \, du 
 = \frac{\sin(u)}{4} + \frac{u}{2} \\
\int \frac{1}{(x^2+1)^2}  \, dx &=& \frac{\sqrt{1 - \cos^2{u}}}{4} + \frac{u}{2} \\
\end{eqnarray*}
Now, I think I am right so far but I do not know have to get rid of the $u$ in
the $\cos^2(u)$ term. Please help.
Thanks
Bob  
 [/INST] Since you have $x=\tan u$, think of $u$ as an angle.  Then 
$$\tan u = \frac{x}{1}.$$
Draw a right triangle with legs $x$ and $1$ to demonstrate this fact (with $u$ as the angle opposite the $x$.)  The hypotenuse is $\sqrt{1+x^2}.$  Now you can evaluate any trig function of $u$ that you please.  E.g., 
$$\cos u = \frac{1}{\sqrt{1+x^2}}.$$
So to evaluate 
$$\sin 2u = 2\sin u \cos u  = 2\frac{x}{\sqrt{1+x^2}}\frac{1}{\sqrt{1+x^2}} = \frac{2x}{1+x^2}.$$
</s>