A given method for calculating $\int^1_{-1} \frac 1 {1+x^2} \, dx$ is
\begin{align} & \int^1_{-1} \frac 1 {1+x^2} \, dx=\int^1_{-1} \frac 1 {x^2(1+\frac 1 {x^2})} \, dx = -\int^1_{-1} \frac 1 {1+(\frac 1 x)^2} \,d(1/x) = \left.-\arctan\left(\frac 1 x\right)\right|_{x=-1}^1 \\[10pt] = {} & -\arctan(1) + \arctan(-1)=-\frac{\pi}{2}. \end{align}
This differs from the expected outcome $$\int^1_{-1} \frac 1 {1+x^{2}}dx= \arctan x \Big|_{x=-1}^1=\arctan(1)-\arctan(-1)=\frac \pi 2.$$
Is there something wrong with the first calculation? I noticed that $\frac{1}{1+x^{2}}-1=\frac{1}{1+(\frac{1}{x})^{2}}$, but I don't yet see how this can be of any help.