Let's consider a continuous function $f(x)$ and real numbers $\lambda_n=(\alpha+\beta n)\pi$ where both $\alpha$ and $\beta$ are integers. In any interval $I$, is it true that $$ f(x)=\sum_{n\geq 0}a_n\sin(\lambda_n x) \quad\text{and}\quad a_n=\frac{\int_I f(x)\sin (\lambda_n x)\,\mathrm{d}x}{\int_I \sin^2(\lambda_n x)\,\mathrm{d}x}? $$
If not, can I modify the hypothesis so that it becomes true?