Why can't I solve the integral $\int (1+x^2)^{-1}dx$ this way? Or at least, I've been told that this way is wrong, why is that?
$$\int (1+x^2)^{-1}dx=\frac i 2\int (x+i)^{-1}dx-\frac i 2 \int (x-i)^{-1}dx=\frac i 2 \left(\ln\left(\frac {x+i}{x-i}\right)\right)$$