Following my last question (Study the uniform convergence of $f (x) = \sum_{n=1}^{\infty} \frac{\sin(nx)}{n^2}$ in $\mathbb{R}$.), the second part of the problem goes as it follwos down below.
Consider the series of functions $\sum_{n=1}^{\infty} \frac{\sin(nx)}{n^2}$.
Show that the function $f(x) = \sum_{n=1}^{\infty} \frac{\sin(nx)}{n^2}$ is integrable in $[0,1]$ and express the integral $\int_0^1 f(x) dx$ as a series.
I'm not sure if I justified every step in order to express the wanted integral as a series. Before proving that the function is integrable, do I need to prove that it is well defined or, since I already proved it converges uniformly, only prove that it is integrable before exchanging the limits (sum and integral)?
Regardless, here is what I did.
From my last question we can conclude that the series of functions $\sum_{n=1}^{\infty} \frac{\sin(nx)}{n^2}$ converges pointwise in $\mathbb{R}$ and, in consequence, $f$ is well defined in $\mathbb{R}$. In particular, we have that $f$ is well defined in $[0,1]$.
Given that $\frac{sin(nx)}{n^2}$ are continuous functions in $\mathbb{R}$ and the series of functions $\sum_{n=1}^{\infty} \frac{sin(nx)}{n^2}$ converges uniformly in $\mathbb{R}$, $f$ is a continuous function in $\mathbb{R}$. Consequently, $f$ is continuous in $[0,1]$.
$\therefore f$ is integrable in $[0,1]$.
We can now express
$$\int_0^1 f(x) dx$$
as a series.
Given that the series of functions $\sum_{n=1}^{\infty} \frac{\sin(nx)}{n^2}$ converges uniformly in $\mathbb{R}$, it also converges uniformly in $[0,1]$. Thus
$$\int_0^1 f(x) dx = \sum_{n=1}^{\infty} \int_0^1 \frac{\sin(nx)}{n^2} dx = \sum_{n=1}^{\infty} \frac{1}{n^2} \int_0^1 \sin(nx) dx = \sum_{n=1}^{\infty} \frac{1}{n^2} \bigg [ -\frac{\cos(nx)}{n} \bigg ]_0^1 =$$
$$=\sum_{n=1}^{\infty} \frac{1-\cos(n)}{n^3}.$$