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  

$$\int(1+\cos2u)du=u+\dfrac{\sin2u}2+C$$
$$\sin2u=\dfrac{2\tan u}{1+\tan^2u}=?$$
Another way: $$\int\dfrac{dx}{(x^2+1)^n}=\int\dfrac1{2x}\dfrac{2x}{(x^2+1)^n}dx$$
$$=\dfrac1{2x}\int\dfrac{2x}{(x^2+1)^n}dx-\int\left(\dfrac{d(1/2x)}{dx}\int\dfrac{2x}{(x^2+1)^n}dx\right)dx=?$$
