Show that $\int_{0}^{1}\ln{(1+e^t)}dt\approx\frac{1}{4}+\ln{2}.$ a) Let $$f(x)=\int_0^x\ln{(1+e^t)}dt.$$
Find the McLaurin expansion of the second order, with the remainder term on Lagrangian form.
b) Show that $$\int_{0}^{1}\ln{(1+e^t)}dt\approx\frac{1}{4}+\ln{2},$$
with an error less than $1/8.$

The first sub-problem was easy, just differentiate three times and plug in to the McLaurin formula. I got that $$f(x)=\ln{2}\cdot x +\frac{1}{4}x^2+\frac{e^{\theta x}}{6(1+e^{\theta x})^2}x^3.$$
Using this to show b), I have that 
$$\int_{0}^{1}\ln{(1+e^t)}dt\approx\left[\ln{2}\cdot x +\frac{1}{4}x^2+\frac{e^{\theta x}}{6(1+e^{\theta x})^2}x^3\right]_0^1=\ln{2+\frac{1}{4}}+\frac{e^{\theta}}{6(1+e^{\theta})^2}.$$
Here, the difference between what is supposed to be shown and what I have is the last term $e^{\theta}/6(1+e^{\theta})^2.$ This error will attain max value when $\theta=1.$ So I have that 
$$\frac{e}{6(1+e)^2}<\frac{e}{6\cdot 8}<\frac{1}{8}.$$
Thus, when using a second order McLaurin expansion, the error can never be greater than $1/8$. 
Questions:


*

*Is this solution correct?

*Any detail to change in order to improve the mathematical stringency?

*In my second equation line, I write that the integral is $\approx$, is this correct or should I use plain $=$?

 A: We have $f(0) = 0$ by definition and $f'(x) = \ln(1+e^x)$ by the FTOC. Therefore
$$ f(x) = f(0) + f'(0)x + f''(0)\frac{x^2}{2} + O(x^3) = x \ln 2 + \frac{x^2}{4} + O(x^3) $$
The definite integral is given by $$ f(1) \approx \ln 2 + \frac14$$
For the error term we have
$$ \left|f(x) - x\ln 2 - \frac{x^2}{4} \right| \le M\frac{x^3}{3!} $$
where $M$ is an upper bound for $|f'''(x)|$ where
$$ f'''(x) = \frac{e^x}{(1+e^x)^2} $$
This is a decreasing function in $[0,1]$ (you can check for yourself). Therefore $f'''(x) \le f'''(0) = \dfrac{1}{4}$ and
$$ \left|f(1) -\ln 2 - \frac{1}{4} \right| \le \frac{1}{24} $$
A: Let $g(x) = \log (1+e^x)$ Then $g(0) = \log 2, g'(0) = {1 \over 2}$ and
$g''(x) = {e^x \over (e^x+1)^2}$ and $|g''(x)| \le {1 \over 4}$ for all $x$.
Hence $|g(x)-(\log 2 + {1 \over 2} x)| \le {1 \over 4} {1 \over 2!} x^2$.
Since $\int_0^1 {1 \over 4} {1 \over 2!} x^2 dx = {1 \over 4!}$, we have
$|f(x) - ((\log 2) x - {1 \over 4} x^2)|\le {1 \over 24} $.
A: An alternative approach for b):
$$\begin{eqnarray*} \int_{0}^{1}\log(1+e^t)\,dt &=& \int_{0}^{1}\frac{t}{2}+\log(2)+\log\left(\cosh\frac{t}{2}\right)\,dt\\&=& \frac{1}{4}+\log(2)+\int_{0}^{1}\log\cosh\frac{t}{2}\,dt\end{eqnarray*}$$
the last integral is clearly positive, but due to Jensen's inequality
$$\int_{0}^{1}\log\cosh\frac{t}{2}\,dt \leq\log\left(2\sinh\frac{1}{2}\right)<\color{red}{\frac{1}{24}}.$$
