<s>[INST] Find the indefinite integral $\int\frac{dx}{(x^2+2x+5)^2}$ I need help with the indefinite integral 
\begin{align}
& \int\frac{dx}{(x^2+2x+5)^2} \\[10pt]
= {} & \int\frac{dx}{((x+1)^2+4)^2} = \int\frac{du}{(u^2+4)^2} & & x+1=u,\quad du=dx \\[10pt]
= {} & \frac{1}{16} \int\frac{du}{(\frac{u^2}{4}+1)^2} \\[10pt]
= {} &  \frac 1 8 \int \frac{ds}{(s^2+1)^2} = \text{?} & & \frac u 2 = s, \quad 2\,ds=du
\end{align}
or maybe there is an easier way ? 
Any ideas ? thanks !
 [/INST] it is $$x^2+2t+5=(x+1)^2+4$$ we Substitute $$x+1=t$$ then we have $$dx=dt$$
and $$\int\frac{1}{(t^2+4)^2}dt$$ and then we Substitute $$t=2\tan(s)$$ with $$dt=2\sec^2(s)ds$$ and we get $$(t^2+4)^2=16\sec^4(s)$$ and our integral is $$2\int \frac{\cos^2(s)}{16}ds$$ and in the last step note that $$\cos^2(s)=\frac{1}{2}\cos(2s)+\frac{1}{2}$$
</s>