# Lebesgue integral : Changing the $\sum$ and $\int$

I want to calculate $$\displaystyle\int_0^1 \dfrac{x}{1-x}(-\log x)\ dx$$ in Lebesgue integral theory. I calculated this using the theorem below.

Theorem

Let $$\{f_n \}_{n=1}^{\infty}$$ be a sequence of functions that are Lebesgue-measurable and non negative. And let $$f:=\sum_{n=1}^{\infty} f_n$$.

Then, $$\displaystyle\int f dx=\sum_{n=1}^{\infty} \displaystyle\int f_n (x) dx.$$

My calculation

\begin{align} \displaystyle\int_0^1 \dfrac{x}{1-x}(-\log x) \ dx &=\displaystyle\int \dfrac{x}{1-x}(-\log x) \cdot \chi_{(0,1)} (x) \ dx\\ &=\displaystyle\int \bigg(\sum_{k=1}^{\infty} x^k\bigg)\cdot (-\log x) \cdot \chi_{(0,1)} (x) \ dx\\ &=\displaystyle\int \sum_{k=1}^{\infty} \bigg(x^k (-\log x) \cdot \chi_{(0,1)} (x)\bigg) \ dx\\ &=\sum_{k=1}^{\infty} \displaystyle\int \bigg(x^k (-\log x) \cdot \chi_{(0,1)} (x)\bigg) \ dx \ (\text{ using the Theorem) }\\ &=\sum_{k=1}^{\infty} \displaystyle\int_0^1 x^k (-\log x) \ dx \\ &=\sum_{k=1}^{\infty} \Bigg(\bigg[\dfrac{x^{k+1}}{k+1} (-\log x)\bigg]_0^1+ \displaystyle\int_0^1 \dfrac{x^{k}}{k+1} \ dx\Bigg) \ (\text{Integration by parts})\\ &=\sum_{k=1}^{\infty} \Bigg(0+ \dfrac{1}{(k+1)^2}\Bigg) =\sum_{k=1}^{\infty}\dfrac{1}{(k+1)^2}. \end{align}

But I wonder if I can change $$\sum$$ and $$\displaystyle\int.$$

For each $$k$$, $$x^k(-\log x)\chi_{(0,1)}(x)$$ is non negative but is it Lebesgue-measurable? And why?

Define a $$f_{n} = \sum_{1}^{n} f_{k}.$$ Note that this sequence $$f_{n}$$ is non-negative and measurable. Then apply MCT on this sequence. This will give you the justifications why we can exchange sum and integration. Please ignore this answer if you did not ask the question that I am thinking.