Point out my mistake in $\int_{0}^{2} \frac{dx}{x^2-2x+2}$ Given the integral $$F=\int_{0}^{2} \frac{dx}{x^2-2x+2}. ~~~(1)$$
Usually, one will do it as $$F=\tan^{-1}(x-1)|_{0}^{2}=\pi/2$$
We are asked to paractice $\sqrt{(x-1)^2}=|x-1|.$ So, if we do it, we get
$$F=\tan^{-1}|x-1|_{0}^{2}=0.$$ Can someone point out my mistake, here.
 A: $\int_{0}^{2} \frac{dx}{(x-1)^{2} + 1} = \int_{0}^{2} \frac{dx}{|x-1|^{2} + 1} dx$
This is true.
But, is not true that $F(x) = \text{tan}^{-1}(|x-1|)$ is a primitive of the function $\frac{1}{|x-1|^{2}+1}$
Well, if we derivate it, $F'(x) = \frac{1}{|x-1|^{2}+1}$ $\cdot \frac{d}{dx}(|x-1|) = \frac{1}{|x-1|^{2}+1} \cdot \frac{x-1}{|x-1|} \not= \frac{1}{|x-1|^{2} + 1}$
A: Though unneccessary, ideally the right way is $$I=\int_{0}^{2} \frac{dx}{(x-1)^2+1}=\int_{0}^{2} \frac{dx}{|x-1|^2+1}=\int_{0}^{1} \frac{dx}{(1-x)^2+1}+\int_{1}^{2} \frac{dx}{(x-1)^2+1}$$ $$I=-\tan^{-1}(1-x)|_{0}^{1}+\tan^{-1}(x-1)|_{1}^{2}=\pi/2.$$
The point is to break the integral about $x=1$ as you have brought $|1-x|$ in the calculation.
A: Hint for definite integral with $\boxed{X=ax^2+bx+c; \space \Delta=4ac-b^2}$:
$$\int\frac{dx}{X}=\cases{\frac{2}{\sqrt{\Delta}}\arctan\frac{2ax+b}{\sqrt{\Delta}}, \space\space \space \space\space\space\space\space (\text{for } \Delta>0),\\-\frac{2}{\sqrt{-\Delta}}\operatorname{Artanh} \frac{2ax+b}{\sqrt{-\Delta}} \space \space \space (\text{for } \Delta<0).}$$
