How to calculate $$\int _0^{\infty }\frac{1}{e^x+e^{-x}}\, dx\ ?$$
We understand what we need to do in terms of setting the upper bound (infinity) to b and then just integrating as normal. We tried to integrate e-x and ex as normal and our answer was that it was divergent to infinity...
...but when we look at the answer on the textbook (as well as on Symbolab and Wolfram Alpha), it gives a completely different and convergent answer (it converges to pi/4). They approach it by doing u-substitution and dealing with it in terms of arctangent. Why is this the correct way to approach it? It seems so unintuitive to do it this way. Are we missing a crucial piece of information?
hint
$$e^x+e^{-x}=2\cosh (x) $$
$$\cosh^2 (x )=1+\sinh^2 (x) $$
put $t=\sinh (x ) $ with $dt=\cosh (x)dx $.
You can take it.
you will find $$\frac {1}{2 }\int_0^{+\infty}\frac {dt}{1+t^2} $$
multiply by $e^x $ and put $u=e^x $. it is easier.
you will get $$\int_1^{+\infty}\frac {du}{1+u^2} $$