<s>[INST] How to calculate the limit $\lim\limits_{n\to\infty} \int\limits_0^1 \frac{n(2nx^{n-1}-(1+x))}{2(1+x)}\,dx$? How to calculate the limit $\lim\limits_{n\to\infty}\displaystyle\int_0^1\dfrac{n(2nx^{n-1}-(1+x))}{2(1+x)} dx$?
I have to calculate the limit when solving

Find $a,b$ for $\displaystyle\int_0^1 \dfrac{x^{n-1}}{x+1} dx=\dfrac{a}{n}+\dfrac{b}{n^2}+o(\dfrac{1}{n^2}) (n\to\infty)$

First I calculated that
$\lim\limits_{n\to\infty} \displaystyle\int_0^1 \dfrac{nx^{n-1}}{x+1} dx=\dfrac{1}{2}$, thus $a=\dfrac{1}{2}$, then 
$2b=\lim\limits_{n\to\infty}\displaystyle\int_0^1\dfrac{n(2nx^{n-1}-(1+x))}{2(1+x)} dx$. 
However, I cannot find a good way to calculate it. 
 [/INST] \begin{align*}
2b &= \lim_n n \int_0^1 \frac{nx^{n-1}} {x+1} \mathrm dx - \frac n 2 \\
&= \lim_n n \int_0^1 \frac {\mathrm d (x^n)} {x+1} - \frac n2\\
&= \lim_n n \left. \frac {x^n} {1+x}\right|_0^1 + n \int_0^1 \frac {x^n \mathrm dx} {(1+x)^2} - \frac n 2\\
&= \lim_n \frac n {n+1} \cdot \left.\frac {x^{n+1}}{(x+1)^2}\right|_0^1 + \frac {2n}{n+1}\int_0^1 \frac {x^{n+1}}{(x+1)^3} \mathrm d x\\
&= \frac 14 + 2\lim_n \int_0^1 \frac {x^{n+1} \mathrm dx} {(x+1)^3}\\
&= \frac 14,
\end{align*}
where
$$
0 \gets \frac 18 \int_0^1 x^{n+1} \mathrm dx \leqslant \int_0^1 \frac {x^{n+1} \mathrm dx} {(1+x)^3} \leqslant \int_0^1 x^{n+1} \mathrm d x \to 0. 
$$
UPDATE
The limit you gave at the very first is actually $b$, not $2b$. 
</s>