Integral of $\ln(\cosh x)$? $$\int \ln(\cosh x) dx$$
Tried for some time, couldn't get anywhere.
This IS an elementary function, isn't it?
Thanks in advance.
 A: $$\ln(\cosh(x))=\ln\left(\frac{e^x+e^{-x}}2\right)=x-\ln(2)+\ln(1+e^{-2x})= x-\ln(2)+\sum_{k=1}^\infty(-1)^{k+1}\frac{e^{-2kx}}k.$$
You can integrate term-wise and get a rapidly converging series (for positive $x$), which is asymptotic to the parabola $\dfrac{x^2}2-\ln(2)\,x+C$.
A: The integral $\int \log(\cosh(x))\,dx$ cannot be expressed in terms of elementary functions.  To see this, we enforce the substitution $x=\log(u)$ to obtain
$$\begin{align}
\int \log(\cosh(x))\,dx&=\int \frac{\log(1+u^2)-\log(u)}{u}\,du-\log(2)x \\\\
&=\int \frac{\log(1+u^2)}{u}\,du -\frac12 x^2-\log(2)x \tag 1
\end{align}$$
Next, we let $u=\sqrt{v}$ in the integral on the right-hand side of $(1)$ to reveal
$$\begin{align}
\int \log(\cosh(x))\,dx&=\int \frac{\log(1+v)}{2v}\,dv -\frac12 x^2-\log(2)x \\\\
&=\bbox[5px,border:2px solid #C0A000]{-\frac12\text{Li}_2(-e^{2x})-\frac12x^2-\log(2)x+C}\tag 2
\end{align}$$
which expresses the primitive in terms of the dilogarithm function, a special function given by $\text{Li}_2(x)=-\int_0^x \frac{\log(1-t)}{t}\,dt$.
