Bounding the integral of $\ln(1+e^{-x})$ from $0$ to $n$ using given double inequality Let $f(x) := \ln(1+e^{-x})$ and
$$u_n := \sum_{k=1}^n \frac{(-1)^{k-1}}{k^2}.$$
Given that for $x>0$ 
$$ \tag{1} \sum_{k=1}^n \frac{(-1)^{k-1}}{k}e^{-kx} - \frac{e^{-(n+1)x}}{n+1} \le f(x) \le \sum_{k=1}^n \frac{(-1)^{k-1}}{k}e^{-kx} + \frac{e^{-(n+1)x}}{n+1} $$
it is asked to prove that 
$$u_n - \dfrac{1}{(n+1)^2} \le \int_0^n f(x) dx \le u_n + \frac{1}{(n+1)^2}$$
I tried to integrate the first double-inequality  form $0$ to $n$ but I get extra terms of unknown sign. For the left side for instance I get 
$$ \tag{2} \left( u_n - \dfrac{1}{(n+1)^2} \right) + \left(\dfrac{e^{-(n+1)n}}{(n+1)^2} - 
\displaystyle\sum_{k=1}^n \dfrac{(-1)^{k-1}}{k^2} e^{-nk} \right) \le \displaystyle\int_0^n f(x) dx $$
I tried to prove that the second term is positive (sufficient condition) but in vain.
thanks for any advice.
 A: For the right part: integrate from $0$ to $n$ the inequality you've been given:
$$
\begin{split} \int_0^n f(x)dx &\le \int_0^n \left( \displaystyle\sum_{k=1}^n \dfrac{(-1)^{k-1}}{k}e^{-kx} + \dfrac{e^{-(n+1)x}}{n+1} \right)dx \\
& = \sum_{k=1}^n \dfrac{(-1)^{k-1}}{k} \int_0^n e^{-kx}dx + \dfrac{1}{n+1} \int_0^n e^{-(n+1)x}dx \\
& = \sum_{k=1}^n \dfrac{(-1)^{k-1}}{k^2} \left[1-e^{-nk} \right] + \dfrac{1}{(n+1)^2}[1-e^{-(n+1)n}] \\
& \le \sum_{k=1}^n \dfrac{(-1)^{k-1}}{k^2} + \dfrac{1}{(n+1)^2} \\
& = u_n + \dfrac{1}{(n+1)^2}
\end{split}$$
I've not tried the left part but I suppose it should be done similarly
A: It is possible to give a closed formula for the integral. We have
\begin{align}
\int_0^n \ln(1+e^{-x}) dx = \int_{-n}^0 \ln(1+e^x) dx = -\left. \mathrm{Li}_2(-e^{x}) \right|_{x=-n}^0 &= \mathrm{Li}_2(-e^{-n}) - \mathrm{Li}_2(-1) \\& = \mathrm{Li}_2(-e^{-n}) + \frac{\pi^2}{12},
\end{align}
since it is well-known that $$\mathrm{Li}_2(-1) = -\eta(2) = - \zeta(2)/2 =- \pi^2/12,$$ where $\eta$ denotes the Dirichlet eta function. Now, one can easily do some numerical checks: Looking at
$$E(n):=  \mathrm{Li}_2(-e^{-n}) + \frac{\pi^2}{12} - \Big( u_n - \frac{1}{(n+1)^2} \Big)$$
one get that $E(1) < 0$ and $E(3) < 0$. Thus, at least for $n=1$ and $n=3$ the inequality is wrong.

Conjecture: For $n>3$ the inequality $$\int_0^n \ln(1+e^{-x}) \, dx \geq u_n - \frac{1}{(n+1)^2}$$ seems to be true.

However, the Taylor-type inequality (1) is not suitable for the verification of this conjecture. If we define
$$a_n:= \sum_{k=1}^n \frac{(−1)^{k}}{k^2} e^{-nk},$$
then one has the alternating series estimate
$$|a_n - \mathrm{Li}_2(-e^{-n})| \leq \frac{e^{-n(n+1)}}{(n+1)^2}.$$
Additionally, one has
$$\mathrm{Li}_2(-e^{-n}) = - \int_0^{e^{-n}} \frac{\ln(1+t)}{t} dt.$$
Because of $|t - \ln(1+t)| \leq |t|/2$ for $|t| \leq 1/2$, we see that
$$-e^{-n} \leq \mathrm{Li}_2(-e^{-n}) \leq - \frac{e^{-n}}{2}$$
for all $n \in \mathbb{N}$. Thus, we may conclude that
$$ \frac{e^{-n(n+1)}}{(n+1)^2} - \sum_{k=1}^n \frac{(-1)^{k-1}}{k^2} e^{-nk} =\frac{e^{-n(n+1)}}{(n+1)^2} +a_n \leq 2 \frac{e^{-n(n+1)}}{(n+1)^2} -\frac{e^{-n}}{2} \leq - \frac{(1-e^{-2})}{2} e^{-n}.$$
This shows that the second term in (2) is always negative!

Let us prove that $\int_0^n \ln(1+e^{-x}) \, dx \geq u_n - (n+1)^{-2}$  for all $n>3$.

Starting with the formula
$$\int_0^n \ln(1+e^{-x}) \, dx = \mathrm{Li}_2(-e^{-n}) + \frac{\pi^2}{12} = \mathrm{Li}_2(-e^{-n}) + u_n + \sum_{k=n+1}^\infty \frac{(-1)^{k-1}}{k^2}$$
we have to show that
$$\mathrm{Li}_2(-e^{-n})+ \sum_{k=n+1}^\infty \frac{(-1)^{k-1}}{k^2} \geq - \frac{1}{(n+1)^2}$$
for $n>3$. If $n$ is even, then the sum is positive and $\mathrm{Li}_2(-e^{-n}) \geq - e^{-n}$, as we have already seen in the previous step. Since $e^{-n} \geq - (n+1)^2$, if $n>3$, the inequality follows. If $n$ is odd, then
$$\mathrm{Li}_2(-e^{-n})+ \sum_{k=n+1}^\infty \frac{(-1)^{k-1}}{k^2} = - \frac{1}{(n+1)^2} + \mathrm{Li}_2(-e^{-n}) + \sum_{k=n+2}^\infty \frac{(-1)^{k-1}}{k^2}$$
and hence we need to verify that 
$$\mathrm{Li}_2(-e^{-n}) + \sum_{k=n+2}^\infty \frac{(-1)^{k-1}}{k^2} \geq 0.$$
Here we may use the estimate
$$\sum_{k=n+2}^\infty \frac{(-1)^{k-1}}{k^2} \ge \frac{1}{(n+2)^2} - \frac{1}{(n+3)^2}$$
and note that
$$\mathrm{Li}_2(-e^{-n}) + \frac{1}{(n+2)^2} - \frac{1}{(n+4)^2} \geq - e^{-n} + \frac{1}{(n+2)^2} - \frac{1}{(n+3)^2} \geq 0$$
holds for $n \geq 6$. One case here is missing, namely $n=5$. Here one need to use the more precise estimate
$$\sum_{k=n+2}^\infty \frac{(-1)^{k-1}}{k^2} \ge \frac{1}{(n+2)^2} - \frac{1}{(n+3)^2} + \frac{1}{(n+4)^2} - \frac{1}{(n+5)^2}.$$

All in all, we conclude that $E(1)<0$, $E(2)>0$, $E(3)<0$ and $E(n)>0$ for $n>3$. Thus, the left-hand side of the inequality is valid with two exception, namely if $n=1$ or $n=3$.

