Comparison test says that if bigger function is convergent then smaller one must be convergent.But here in this example it doesn't work and I want to know why?
$1/(e^x)$ is bigger or equal to $1/(e^x+1)$ ( between zero and infinite) Improper integral $\int_0^\infty \frac{1}{(e^x)} dx$ is convergent and it is $1$ however, improper integral $\int_0^\infty\frac{ 1}{ (e^x+1)}dx $ is divergent.
One has $$ 0<\frac1{e^x+1}<\frac1{e^x},\qquad x\ge0, $$ giving $$ 0<\int_0^\infty\frac1{e^x+1}\:dx<\int_0^\infty\frac1{e^x}\:dx=\lim_{M\to\infty}\left[-e^{-x} \right]_0^M=\color{red}{-0}+1<\infty $$ and one may observe that $$ \int_0^\infty\frac1{e^x+1}\:dx=\lim_{M\to\infty}\int_0^M\frac{e^{-x}}{1+e^{-x}}\:dx=\lim_{M\to\infty}\left[-\ln(1+e^{-x}) \right]_0^M=\color{red}{-0}+\ln 2. $$