asymptotic expansion of $\ln(\cosh(x))$ I am currently looking into some C++ code which approximates the function in the title as follows 
$$\ln\cosh(x))\approx x- \ln(2); \qquad x \geq 12$$
The approximation is plausible to me, since plotting the difference between the function results in an  $error < 10^{-3}$. However how does one arrive at such an approximation? The usual way of calculating the Taylor expansion at $x_0=12$ does not result in such a nice expression for me. 
 A: Start from the definition: $$\cosh(x)=\frac{e^x+e^{-x}}2$$
For large $x$, you have $e^x>>e^{-x}$, so $\cosh x\approx\frac{e^x} 2$. Now take the log, and you get your answer.
A: Recall that 
$$
\cosh x = \frac{e^{x} + e^{-x}}{2}
$$
And that for $\color{blue}{x \gg 0}$ the term $e^{-x}$ is very small, so that
$$
\cosh x = \frac{e^{x} + e^{-x}}{2} \approx  \frac{e^{x} + 0}{2} ~~~\mbox{for}~~ \color{blue}{x \gg 0}
$$
Or equivalently
$$
\ln \cosh x \approx x - \ln 2 ~~~\mbox{for}~~ \color{blue}{x \gg 0}
$$
Probably the author of the code decided that 12 was a large number to ignore the contribution from $e^{-x}$, which actually is $e^{-12} \approx 10^{-5}$
A: To complement the previous answers with an estimate of the error:
\begin{align}
\log(\cosh x)-(x-\log2)&=\log\frac{e^x+e^{-x}}2-\log\frac{e^x}2\\
&=\log(1+e^{-2x})\\
&\le e^{-2x}
\end{align}
for $x>0$.
A: Here is a useful approximation if we expand in both $x$ and $z=e^{-x}$.
\begin{align*}
\log(\cosh(x))&=\log(e^x+e^{-x})-\log(2)\\
&=x-\log(2)+\log(e^x+e^{-x})-x\\
&=x-\log(2)+\log(z+z^{-1})+\log(z)\\
&=x-\log(2)+\log(1+z^2)\\
&=x-\log(2)+\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n}{z^{2n}}\\
&=x-\log(2)+\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n}e^{-2xn}
\end{align*}
This came up in Cardy Scaling and Renormalization in Statistical Physics, problem 3.3, where $\log(2\cosh(K))$ is a free energy density and you care only about its non-analytic parts in the infinite sum.
