TITLE: $\int_0^{\infty} \arctan{\left(\frac{n}{\cosh{(x)}}\right)} \mathop{dx}$
QUESTION [7 upvotes]: $$\int_0^{\infty} \arctan{\left(\frac{n}{\cosh{(x)}}\right)} \mathop{dx}$$
I think the integral evaluates to $$\frac{\pi}{2} \ln{\left(\sqrt{n^2+1}+n\right)}$$
but I dont know how really!  I think $n$ is any number but I dont know for sure!
The answer reminds me of $\int \frac{\pi}{2} \sec{x} \mathop{dx}$ and $n=\tan{x}$.
I got to $$\int_0^{\infty} \arctan{\left(\frac{e^{x} n}{e^{2x}+1}\right)} \mathop{dx}$$
$$\int_0^{\infty} \arctan{\left(\frac{n}{2}\frac{e^{x} +e^x}{e^{x}\cdot e^x+1}\right)} 
\mathop{dx}$$
Reminds me of $\tan{a-b}$ but the $n/2$ factor?

REPLY [4 votes]: If $|n| \le 1$, we can use the Maclaurin series for $\arctan x$.
$$ \begin{align}\int_{0}^{\infty} \arctan \left( \frac{n}{\cosh x}\right) \, \mathrm dx &= \int_{0}^{\infty} \sum_{k=0}^{\infty} \frac{(-1)^{k}}{2k+1} \left(\frac{n}{\cosh x} \right)^{2k+1} \mathrm dx \\ &= \sum_{k=0}^{\infty} \frac{(-1)^{k}n^{2k+1}}{2k+1} \int_{0}^{\infty} \frac{1}{\cosh^{2k+1}(x)} \, \mathrm dx \\ &\stackrel{(1)}=  \sum_{k=0}^{\infty} \frac{(-1)^{k}n^{2k+1}}{2k+1} \frac{\sqrt{\pi}}{2} \frac{\Gamma (k+1/2)}{\Gamma(k+1)} \\ &\stackrel{(2)}=  \sum_{k=0}^{\infty} \frac{(-1)^{k}n^{2k+1}}{2k+1} \frac{\sqrt{\pi}}{2} \frac{1}{\Gamma(k+1)} \frac{\Gamma(2k) \sqrt{\pi}}{2^{2k-1} \Gamma(k)} \frac{k}{k} \\ &= \frac{\pi}{2} \sum_{k=0}^{\infty}\frac{(-1)^{k} (2k)!}{2^{2k}(k!)^2} \frac{n^{2k+1}}{2k+1} \\&\stackrel{(3)}= \frac{\pi}{2} \operatorname{arsinh}(n) \end{align}$$

$(1)$ https://math.stackexchange.com/a/1379526/
$(2)$ https://mathworld.wolfram.com/LegendreDuplicationFormula.html
$(3)$ https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions#Series_expansions