<s>[INST] Tricky integral $\int_{0}^{2}{\frac{\arctan x}{x^2+2x+2}}$ $$\int_{0}^{2}\frac{\arctan{x}}{x^2+2x+2}$$
The solution comes with the substitution $x=\frac{2-t}{1+2t}$. It works perfectly fine, but I wonder, how can I guess something like this?
 [/INST] Observe that \begin{align}\dfrac{2-t}{1+2\times t }\end{align}leads to think about the following formula, $ab>-1$:
\begin{align}\arctan\left(\frac{a-b}{1+ab}\right)=\arctan\left(a\right)-\arctan\left(b\right)\end{align}
If you perform the change of variable $x=\dfrac{2-t}{1+2\times t }$,
you get something like this:
\begin{align}I&=K\int_0^2\frac{\arctan\left(\frac{2-t}{1+2t}\right)}{x^2+2x+2}dx\\
&=K\int_0^2\frac{\arctan 2 }{x^2+2x+2}dx-K\times I
\end{align}
($K$, a real)
Therefore, if you are facing to, $a>0$, $P$ polynomial:
\begin{align}\int_0^a\frac{\arctan x}{P(x)}dx\end{align}
Try the change of variable $x=\dfrac{a-t}{1+a\times t }$
$\left(t=\dfrac{a-x}{1+a\times x }\right)$
Sometimes, the following formula is helpful.
Let $a>0,b>1$, perform the change of variable $y=\dfrac{1}{x}$,
\begin{align}J&=\int_{\frac{1}{b}}^b \dfrac{\arctan x}{x^2+ax+1}\,dx\\
&=\int_{\frac{1}{b}}^b \dfrac{\arctan\left(\frac{1}{x}\right)}{x^2+ax+1}\,dx\end{align}
Since, for $x>0$,
\begin{align}\arctan x+\arctan\left(\frac{1}{x}\right)=\dfrac{\pi}{2}\end{align}
Therefore,
\begin{align}J&=\dfrac{\pi}{4}\int_{\frac{1}{b}}^b \dfrac{1}{x^2+ax+1}\,dx\end{align}
</s>