Taylor series $\ln(1+e^x)$ about $x=0$ What's the best way to determine this up $x^3$ terms?
I thought it would be to take the series for $\ln(1+x)$ and the series for $e^x$ up to $x^3$ and sub the second series into the first. 
$$\ln(1+x) = x - \frac {x^2}{2} +\frac {x^3}{3} + \cdots$$
$$e^x = 1+ x + \frac {x^2}{2} +\frac {x^3}{6} + \cdots$$
This gave me $$\frac 5{6} + x + \frac {3x^2}{2} + \frac {2x^3}{3}$$ 
but this is not the answer in my book. help?
 A: A standard way to obtain the Taylor series about $0$ is
$$\sum_{k=0}^{\infty} \dfrac{f^{(k)}(0)}{k!}\cdot x^k$$
Since $f(x) = \log(1+e^x)$, we have
$$f(0) = \log(1+e^0) = \log(2)$$
$$f'(0) = \left.\dfrac{e^x}{1+e^x} \right \vert_{x=0} = \dfrac12$$
$$f''(0) = \left.\dfrac{e^x}{(1+e^x)^2} \right \vert_{x=0} = \dfrac14$$
$$f'''(0) = \left.\dfrac{e^x(1-e^x)}{(1+e^x)^3} \right \vert_{x=0} = 0$$
Hence, we have the Taylor series about $0$ to be
$$\log(2) + \dfrac{x}2 + \dfrac{x^2}8 + \mathcal{O}(x^4)$$
A: Your approach won't quite work because the argument of the logarithm in $\log(1+e^x)$ is not near $1$ at $x=0$ (it's near $2$ instead).  To fix this, note that
$$
\log(1+e^x)=\log 2 + \log\left(\frac{1}{2} + \frac{1}{2}e^x\right)=\log 2 + \log\left(1 + \frac{1}{2}x+\frac{1}{4}x^2 + \frac{1}{12}x^3+\ldots\right).
$$
Then use the Taylor series for the logarithm:
$$
\log 2 + \log\left(1 + \frac{1}{2}x+\frac{1}{4}x^2 + \frac{1}{12}x^3+\ldots\right)\\ = \log 2 + \left(\frac{1}{2}x+\frac{1}{4}x^2 + \frac{1}{12}x^3+\ldots\right) - \frac{1}{2}\left(\frac{1}{2}x+\frac{1}{4}x^2 +\ldots\right)^2 + \frac{1}{3}\left(\frac{1}{2}x + \ldots\right)^3 + \ldots \\
= \log 2 + \frac{1}{2}x + \left(\frac{1}{4}-\frac{1}{8}\right)x^2 + \left(\frac{1}{12}-\frac{1}{8}+\frac{1}{24}\right)x^3 + \ldots \\
= \log 2 + \frac{1}{2}x + \frac{1}{8}x^2 + O(x^4).
$$
A: Ok, we have to compute three Taylor coefficients. So, let us compute them all.
We may notice that:
$$\frac{d}{dx}\log(1+e^x)=\frac{1}{2}+\frac{1}{2}\tanh\frac{x}{2}\tag{1} $$
and since:
$$\cosh(x)=\prod_{n\geq 0}\left(1+\frac{4x^2}{(2n+1)^2\pi^2}\right) \tag{2}$$
by considering the logarithmic derivative we have:
$$\tanh(x/2) = \sum_{n\geq 0}\frac{4x}{(2n+1)^2\pi^2+x^2}\tag{3} $$
and by expanding every term in the RHS as a geometric series we get:
$$\tanh(x/2) = \sum_{n\geq 0}(-1)^n \frac{(4-4^{-n})\cdot\zeta(2n+2)}{\pi^{2n+2}} x^{2n+1} \tag{4}$$
so:

$$\log(1+e^x)=\log 2+\frac{x}{2}+\sum_{n\geq 0}(-1)^n \frac{(4-4^{-n})\cdot\zeta(2n+2)}{(2n+2)\,\pi^{2n+2}} x^{2n+2}\tag{5}$$

from which it follows that, in a nieghbourhood of the origin:
$$\log(1+e^x)=\log 2+\frac{x}{2}+\frac{x^2}{8}+o(x^3).\tag{6}$$
