Compute $\lim_{n \to \infty}n\int_{0}^{1}\frac{\cos x}{1+e^{nx}},\ n\in\mathbb{N}$ Let 
$$
I_n = n\int_{0}^{1}\frac{\cos x}{1+e^{nx}}\,dx\,,\quad n\epsilon \mathbb N^*.
$$ Calculate $\lim_{n \to \infty}I_n$
 A: With $y={x}{n}$ you have:
$$I_n=\int_0^n \frac{\cos\frac{y}{n}}{1+e^y}\text{d}y=\int_0^{+\infty}g_n(y)\text{d}y, $$
with :
$$g_n:y\mapsto \left\{
    \begin{array}{ll}
        \frac{\cos\frac{y}{n}}{1+e^y} & \mbox{if } y\in[0,n] \\
        0 & \mbox{if }  y>n
    \end{array}
\right. $$
Since : $$g_n \underset{n\to +\infty}{\longrightarrow}\left( x\mapsto\frac{1}{1+e^x}\right),$$
and  $$\left|g_n(x)  \right|\le\frac{1}{1+e^x}, $$
with dominated convergence theorem :
$$I_n\underset{n\to +\infty}{\longrightarrow}\int_0^{+\infty}\frac{1}{1+e^x}\text{d}x=\log 2.$$
A: Integrating by parts,
$$
I_n=n\int_0^1\frac{\cos x}{1+e^{nx}}\,dx=-\int_0^1 \cos x\,\frac{d}{dx}\log(1+e^{-nx})\,dx
\\=\log2-\cos(1)\log(1+e^{-n})-\int_0^1\sin x\,\log(1+e^{-nx})\,dx\,.
$$
Now, 
$
\cos(1)\log(1+e^{-n})
$
tends to zero as $n\to\infty$ by continuity, while 
$$
\int_0^1\left|\sin x\,\log(1+e^{-nx})\right|dx\le\log2\int_0^1 |\sin x |\,dx=\log2[1-\cos(1)]\,,
$$
so the integral 
$$
\int_0^1 \sin x\,\log(1+e^{-nx})\,dx
$$ also tends to zero as $n\to\infty$ by the dominated convergence theorem and by continuity. Thus, 
$$
\lim_{n\to\infty}I_n=\log2\,.
$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[10px,#ffd]{\lim_{n \to \infty}\bracks{n\int_{0}^{1}{\cos\pars{x} \over 1 + \expo{nx}}\,\dd x}} =
\lim_{n \to \infty}\bracks{n\int_{0}^{1}{\dd x \over 1 + \expo{nx}} -
n\int_{0}^{1}{1 - \cos\pars{x} \over 1 + \expo{nx}}\,\dd x}
\\[5mm] = &\
\underbrace{\int_{0}^{\infty}{\dd x \over 1 + \expo{x}}}_{\ds{\ln\pars{2}}}\ -\
\lim_{n \to \infty}\bracks{n\int_{0}^{1}{2\sin^{2}\pars{x/2} \over 1 + \expo{nx}}\,\dd x}
\\[5mm] = &\
\ln\pars{2} -
2\lim_{n \to \infty}\int_{0}^{n}{\sin^{2}\pars{x/\bracks{2n}} \over 1 + \expo{x}}\,\dd x
\end{align}

Note that
  $\ds{0 < 2\int_{0}^{n}{\sin^{2}\pars{x/\bracks{2n}} \over 1 + \expo{x}}\,\dd x < {1 \over 2n^{2}}\int_{0}^{\infty}{x^{2} \over 1 + \expo{x}}\,\dd x\,\,\,\stackrel{\mrm{as}\ n\ \to\ \infty}{\to}\,\,\, {\LARGE 0}}$

Then,
$$
\bbox[10px,#ffd]{\lim_{n \to \infty}\bracks{n\int_{0}^{1}{\cos\pars{x} \over 1 + \expo{nx}}\,\dd x}} = \bbx{\ln\pars{2}} \approx 0.6931
$$
