Convergence of the sequence $a_n=\int_0^1{nx^{n-1}\over 1+x}dx$ [duplicate]

We have $$ a_n=\int_0^1\frac{nx^{n-1}}{1+x}\,dx=\frac{x^n}{1+x}\Big|_0^1+\int_0^1\frac{x^n}{(1+x)^2}\,dx=\frac12+\int_0^1\frac{x^n}{(1+x)^2}\,dx \quad \forall n \ge 1. $$ Since $$ \int_0^1\frac{x^n}{(1+x)^2}\,dx\le \int_0^1x^n\,dx=\frac{1}{n+1} \quad \forall n\ge 1, $$ it follows that $$ \lim_n\int_0^1\frac{x^n}{(1+x)^2}\,dx=0. $$ Thus $\lim_na_n=\frac12$.


EDIT: I feel kind of stupid for not thinking of the easier ways in other posts, but I think this method is kind of cool.

I apologize in advance, this is a lot of math and few words.

$$\begin{align} \int_0^1\frac{nx^{n-1}}{1+x}\text dx&=\int_0^1nx^{n-1}\sum_{k=0}^\infty(-x)^k\text dx\\ &=\sum_{k=0}^\infty \int_0^1nx^{n-1+k}(-1)^k\text dx\\ &=\sum_{k=0}^\infty\frac{(-1)^kn}{n+k} \end{align}$$

Now, you want $$\begin{align}\lim_{n\to\infty}n\sum_{k=0}^\infty \frac{(-1)^k}{n+k}&=\lim_{n\to\infty}n\left(\sum_{k=0}^\infty \frac{1}{n+2k}-\frac{1}{n+2k+1}\right)\\ &=\lim_{n\to\infty}n\sum_{k=0}^\infty \frac1{(n+2k)^2+n+2k}\\ &=\lim_{n\to\infty}n\sum_{k=0}^\infty\frac{1}{(n+2k)^2}\tag 1\\ &=\lim_{n\to\infty}\frac1n\sum_{k=0}^\infty \frac{1}{(1+2\frac kn)^2}\\ &=\int_0^\infty \frac{1}{(1+2x)^2}\text dx\tag 2\\ &=\frac12\int_0^\infty \frac1{(1+x)^2}\text dx\\ &=\frac12\left.\left(-\frac1{x+1}\right)\right|_0^\infty\\ &=\frac12\end{align}$$

$(1)$ is obtained by realizing that $n+2k$ is negligible in comparison to $(n+2k)^2$ as $n$ approaches $\infty$

$(2)$ uses the well-known identity $$\lim_{n\to\infty}\frac1n\sum_{k=an}^{bn}f\left(\frac kn\right)=\int_a^bf(x)\text dx$$