Why is $n\int_{0}^{1}f(x)x^{n}dx = n \int_{0}^{1}\left(f(x)-f(1)\right)x^{n}dx + \frac{n}{n+1}f(1)$? I am trying to understand this line in my notes but do not know how this jump is made. Let $f$ be a continuous function on $[0,1]$.  Why is
$$n\int_{0}^{1}f(x)x^{n}dx = n \int_{0}^{1}\left(f(x)-f(1)\right)x^{n}dx + \frac{n}{n+1}f(1)$$

One may observe that
$$
\begin{align}
n\int_{0}^{1}f(x)x^{n}dx &= n \int_{0}^{1}\left(f(x)-f(1)+f(1)\right)x^{n}dx
\\\\&=n \int_{0}^{1}\left(f(x)-f(1)\right)x^{n}dx+n \int_{0}^{1}f(1)x^{n}dx
\\\\&=n \int_{0}^{1}\left(f(x)-f(1)\right)x^{n}dx+f(1) \cdot n \int_{0}^{1}x^{n}dx
\\\\&=n \int_{0}^{1}\left(f(x)-f(1)\right)x^{n}dx+f(1) \cdot n  \cdot \frac1{n+1}.
\end{align}
$$
