Suppose we have a function $f: [0,1] \to \mathbb{R}$ that has $2\beta$, $\beta \in \mathbb{N}$, weak derivatives. Defining $e_k(x) := \sqrt{2}\sin(k \pi x)$ the orthonormal sine-basis of $L^2([0,1])$, we can write $f = \sum_{k = 1}^{\infty} f_k e_k$ with $f_k = \langle f, e_k \rangle$. I was wondering if there is a relationship between $\beta$ and the decay of the coefficients $f_k$ as $k \to \infty$.
Suppose we take $2\beta$ weak derivatives of $f$, then because the $e_k$ are an eigenfunction of $D^2$, we have $$\tag{1} D^{2\beta} f = (-1)^{\beta} \pi^{2\beta} \sum_{k=1}^{\infty} f_k k^{2\beta} e_k. $$ Since the left-hand-side is an element of $L^2([0,1]$ by assumption, the coefficients in the right-hand-side must be square-summable, i.e. $$\tag{2} \sum_{k=1}^{\infty} f_k^2 k^{4\beta} < \infty. $$
On the other hand, if we assume that the right-hand-side of Equation $2$ is finite, then one can easily check that the right-hand-side of Equation $1$ satisfies the definition of the $2\beta$ weak-derivative of $f$.
But when I for example take the analytic function $f(x) = x(x-1)$, I see that $f_k \sim k^{-3}$. Following the reasoning above, I would expect this to go to zero faster than any polynomial.
What's wrong with my proof and what is the actual relationship between the decay and the smoothness?
The problem here is the following: the series converges in $L^2(0,1)$. (And if $u\in H^1_0(0,1)$ then in $H^1$ as well). However, taking derivatives is not a continuous linear map on $L^2$, so we cannot pull the derivative operator into the infinite sum.
A more extreme example is the function $f(x)=1$. Write it as an infinite sum, $f = \sum_k f_k e_k$. Now calculate the second derivative, and suppose we can interchange taking derivative and sum. This would imply $0=\sum (k\pi)^2 f_k e_k$. Since the $e_k$ are orthonormal, it follows $f_k=0$, which is absurd.