<s>[INST] How do I evaluate $\int_{-1}^1\frac{dx}{(1+x^2)(e^x+1)}$? How do I evaluate:

$$\int_{-1}^1\frac{dx}{(1+x^2)(e^x+1)}$$

The answer given in the book is written below.
$$\int_{-1}^1\frac{dx}{(1+x^2)(e^{-x}+1)} \tag{1}$$
$$=\int_{-1}^1\frac{e^x}{(1+x^2)(e^x+1)}dx \tag{2}$$
On adding $(1)$ and $(2)$, we get:
$$\Rightarrow 2I=\int_{-1}^1\frac{e^x+1}{(1+x^2)(e^x+1)}dx \tag{3}$$
$$=\int_{-1}^1\frac{dx}{1+x^2} =2\int_{0}^1\frac{dx}{1+x^2} \tag{4}$$
$$\Rightarrow I=\int_{0}^1\frac{dx}{1+x^2}=[ \tan^{-1}x]\:_{0}^{1}\:=\:\frac{\pi}{4} \tag{5}$$
$(2): \int_{a}^{b}{f(x)dx}=\int_{a}^{b}{f(a+b-x)dx}$
$(4): \frac{1}{1+x^2} \text{ is an even function}$
I understood how to solve the integral, but I'm not able to understand how the original integral changed to the integral in $(1)$.
It might be something basic, most probably related to exponents but please tell because I'm a complete beginner in calculus.
 [/INST] Answer:
$I= \int\limits_{-1}^{1} \frac{dx}{(1+x^2)(e^x+1) } $=
We put $x=-y$
$I=\int\limits_{1}^{-1} - \frac{dy}{(1+y^2)(e^{-y}+1)} =\int\limits_{-1}^{1} \frac{e^{y}}{(1+y^2)(e^{y} +1)}  =
\int\limits_{-1}^{1}  \frac{e^{y}+1-1}{(1+y^2)(e^{y} +1)} $
$2I=\int\limits_{-1}^{1} \frac{1}{1+y^2 } $
$I=\frac{[arct(y) ]_{-1}^{1}}{2} =\frac{\pi}{4}$
</s>