<s>[INST] Evaluating the $\int \frac{x+2}{x^2-4x+8}$ - a doubt I have to find the antiderivative of $f(x) = \dfrac{x+2}{x^2-4x+8}$ 
I rewrote it to the form $$ \dfrac{x-2}{x^2 -4x + 8} + \dfrac{1}{\frac{1}{4} (x-2)^2 +1}$$
The next step supposedly is $$F(x) = \dfrac{1}{2}\ln|x^2-4x+8| + 2 \arctan\left(\dfrac{1}{2}(x-2)\right) + c$$
But now there is a problem which I've always had: I don't know why the $\dfrac{1}{2}$ in front of the $\ln(x)$ is there, same for the $2$ and the $\dfrac{1}{2}$ for the $\arctan(x)$. For me simplifying the function to standard integrals is easy, however finding the right factors and such is hard. 
 [/INST] $\int$$\frac{1}{\frac{1}{4} (x-2)^2 +1}$=$4$$\int$$\frac{1}{(x-2)^2+4}$=$\frac{4}{2}$$\int$$\frac{2}{(x-2)^2+4}$=$\frac{4}{2}$$\tan^{-1}\frac{x-2}{2}$=...
You can simplify further. I have used the basics for differentiation of inverse trig functions.
</s>