In definite integration, do I have to watch out for the behaviour of a function between the limits? 
Calculate -
$$\int^{1}_{-1}\frac{e^\frac{-1}{x}dx}{x^2(1+e^\frac{-2}{x})}$$

This is my approach-
Substitute $t=e^\frac{-1}{x}$
$$\therefore \int^{\frac{1}{e}}_{e}\frac{dt}{1+t^2}$$
which gives us $\frac{\pi}{2}- 2\arctan{e}$, but the answer given is $\pi- 2\arctan{e}$. I'm guessing that my wrong answer has something to do with the exponential term.

You can start from the substitution $\;y=-\dfrac1x.\;$ Then
$$I=\int\limits_{-\infty}^{-1}\dfrac{e^y\,\text dy}{e^{2y}+1}
+\int\limits_1^\infty\dfrac{e^y\,\text dy}{e^{2y}+1}
= \int\limits_1^\infty\dfrac{e^{-y}\,\text dy}{e^{-2y}+1} 
+ \int\limits_1^\infty\dfrac{e^y\,\text dy}{e^{2y}+1} 
= 2\int\limits_1^\infty\dfrac{e^y\,\text dy}{e^{2y}+1} $$
$$= 2\int\limits_e^\infty\dfrac{\text de^y}{1+e^{2y}}
=2\arctan e^y\bigg|_1^\infty =\pi-2\arctan e,$$
without doubts in the result.
