Find the limit of $(\int_{ 0}^{ 1} \frac {(1+x+...+x^{n})^2}{1+x+...+x^{n+1}}dx - \ln (n))$ I need to find $\lim_{n \rightarrow \infty} \left[\int_{ 0}^{ 1} \frac {(1+x+...+x^{n})^2}{1+x+...+x^{n+1}}dx - \ln (n)\right]$ and my idea is that after using some simplification the integral is equal to $\int_{0}^{1} \frac{x^{2(n+1)}-2x^{(n+1)}+1}{(x-1)(x^{(n+2)}-1)}dx$ which, because $x$ is smaller than 1, is bigger than $\int_{0}^{1} 1+x+...+x^{n+1}dx$, which gives $1+\frac{1}{2}+\frac{1}{3}+...+\frac{1}{n+1}$, a sum converging to $\ln(n)$, so I suppose the initial integral converges to $0$
 A: Write $f_n(x) = 1 + x + \cdots + x^n$. Denoting the expression inside the limit by $a_n$, we find that
$$ a_n = \int_{0}^{1} \frac{f_n(x)^2}{f_n(x) + x^{n+1}} \, \mathrm{d}x - \log n. $$
We first examine the expression where $\log n$ is replaced by $\int_{0}^{1} f_n(x) \mathrm{d}x$. Then
$$ \left| \int_{0}^{1} \frac{f_n(x)^2}{f_n(x) + x^{n+1}} \, \mathrm{d}x - \int_{0}^{1} f_n(x) \mathrm{d}x \right|
= \left| - \int_{0}^{1} \frac{x^{n+1} f_n(x)}{f_n(x) + x^{n+1}} \, \mathrm{d}x \right|
\leq \int_{0}^{1} x^{n+1} \, \mathrm{d}x = \frac{1}{n+2}. $$
Together with $\int_{0}^{1} f_n(x) \mathrm{d}x = \sum_{k=1}^{n+1} \frac{1}{k}$ and $\gamma := \lim_{n\to\infty} \left( \sum_{k=1}^{n} \frac{1}{k} - \log n \right) \approx 0.5772\cdots$, we have
$$ a_n = \int_{0}^{1} f_n(x) \mathrm{d}x - \log n + \mathcal{O}(n^{-1}) = \gamma + \mathcal{O}(n^{-1}), $$
which converges to $\gamma$ as $n\to\infty$.
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{\int_{0}^{1}
{\pars{1 + x + \cdots + x^{n}}^{\, 2} \over
1 + x + \cdots + x^{n + 1}}\,\dd x - \ln\pars{n}}}
\\[5mm] = &\
\lim_{n \to \infty}\bracks{\int_{0}^{1}
{\pars{\sum_{k = 0}^{n + 1}x^{k} - x^{n +1}}^{\, 2} \over
\sum_{k = 0}^{n + 1}x^{k}}\,\dd x - \ln\pars{n}}
\\[5mm] = &\
\lim_{n \to \infty}\bracks{\int_{0}^{1}
\sum_{k = 0}^{n + 1}x^{k}\,\dd x - 2\int_{0}^{1}x^{n +1}\,\dd x +
\int_{0}^{1}{x^{2n + 2} \over \sum_{k = 0}^{n + 1}x^{k}}\,\dd x - \ln\pars{n}}
\\[5mm] = &\
\lim_{n \to \infty}\bracks{H_{n + 2} - {2 \over n + 2} +
\int_{0}^{1}{x^{2n + 2} \over \sum_{k = 0}^{n + 1}x^{k}}\,\dd x - \ln\pars{n}}
\\[2mm] &\ \pars{~H_{z}\ \mbox{is the}\ Harmonic\ Number~}
\\[5mm] = &\
\lim_{n \to \infty}\bracks{H_{n} +
{1 \over \pars{n + 1}\pars{n + 2}} +
\int_{0}^{1}{x^{2n + 2} \over \sum_{k = 0}^{n + 1}x^{k}}\,\dd x - \ln\pars{n}}
\\[5mm] = &\
\gamma +
\lim_{n \to \infty}\int_{0}^{1}{x^{2n + 2} \over
\sum_{k = 0}^{n + 1}x^{k}}\,\dd x.\quad
\pars{~\mbox{Note that}\
\gamma = \lim_{n \to \infty}\bracks{H_{n} - \ln\pars{n}}~}
\label{1}\tag{1}
\end{align}

$\ds{\gamma}$ is the Euler-Mascheroni Constant. Note that

\begin{align}
&\bbox[10px,#ffd]{\int_{0}^{1}{x^{2n + 2} \over
\sum_{k = 0}^{n + 1}x^{k}}\,\dd x} =
\int_{0}^{1}{x^{2n + 2} - x^{2n + 3} \over
1 - x^{n + 2}}\,\dd x =
{1 \over n + 2}\int_{0}^{1}
{x^{\pars{n + 1}/\pars{n + 2}} - x \over 1 - x}\,\dd x
\\[5mm] = &\
{1 \over n + 2}\bracks{\int_{0}^{1}\dd x -
\int_{0}^{1}{1 - x^{\pars{n + 1}/\pars{n + 2}} \over 1 - x}\,\dd x}
\\[5mm] = &\
{1 - H_{\pars{n +1}/\pars{n + 2}} \over n + 2}
\,\,\,\stackrel{\mrm{as}\ n\ \to\ \infty}{\to}\,\,\,
\color{red}{\large 0}
\end{align}

\eqref{1} becomes

$$
\bbx{\bbox[10px,#ffd]{\lim_{n \to \infty}\bracks{\int_{0}^{1}
{\pars{1 + x + \cdots + x^{n}}^{\, 2} \over
1 + x + \cdots + x^{n + 1}}\,\dd x - \ln\pars{n}}} = \gamma}
$$
