I think there is some mistake in the steps shown below. My objection is while integrating the function $f(x)$ we cannot directly put $1$ although the series when integrated has been substituted by $1$ directly. Kindly help me understand.
$\displaystyle\int_0^1f(x)dx=\displaystyle\int_0^1\frac{x}{1-x}dx=\displaystyle\int_0^1x+x^2+x^3+\ldots\infty dx$
$=\left.\frac{x^2}{2}+\frac{x^3}{3}+\frac{x^4}{4}+\ldots\infty\right\vert_0^1$
$=\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\ldots\infty$