Let a step-wise function be defined as:
\begin{equation} f(\xi):=\sum_{i=0}^n \eta_i\chi_{A_i}(\xi) \end{equation}
where $n\geq 0$, $\eta_i$ are real numbers, $A_{i}$=$[\xi_i, \xi_{i+1}]$ , $i = 1,2,..., n-1$ are intervals, and $\chi_{A}$ is the indicator function of $A$:
\begin{equation} \chi_{A}=\begin{cases} 1 \ \ \ if \ \ \xi\in A_i \\0 \ \ \ if \ \ \xi \notin A_i \end{cases} \end{equation}
Let furthermore $[a,b]=A_{i}=[\xi_i, \xi_{i+1}]$
we can then develop the Fourier series be defined by
\begin{equation} f(t):=\alpha_0+\sum_{k=1}^\infty \alpha_k \cos kt +\beta_k\sin kt \end{equation}
where we can develop the Fourier integrals of the coefficients for the step wise intervals:
where the coefficients are solved by the Fourier integrals:
\begin{equation} \begin{array}{cc} \alpha_0=\frac{1}{2\pi}\sum_{i=0}^n\eta_i\int_{\xi_i}^{\xi_{i+1}} \text{d}t=\frac{1}{2\pi}\sum_{i=0}^n\eta_i\big(\xi_{i+1}-\xi_{i}\big)\\ \alpha_k=\frac{1}{\pi}\sum_{i=0}^n\eta_i\int_{\xi_i}^{\xi_{i+1}} \cos kt \text{d}t=\frac{1}{\pi}\sum_{i=0}^n\eta_i\bigg( \frac{\sin (k\xi_{i+1})}{k}-\frac{\sin (k\xi_{i})}{k}\bigg) \\ \beta_k=\frac{1}{\pi}\sum_{i=0}^n\eta_i\int_{\xi_i}^{\xi_{i+1}} \sin kt \text{d}t=\frac{1}{\pi}\sum_{i=0}^n\eta_i\bigg( \frac{\cos (k\xi_{i})}{k}-\frac{\cos (k\xi_{i+1})}{k}\bigg) \end{array} \end{equation}
Since we are covering the interval $[a,b]$ composed of multiple steps we also have:
\begin{equation} \bigcup_{j=1}^nA_j=[a,b], \end{equation}
We then get the Fourier series given by the formula, where we put $t=\xi$ for convenience:
\begin{equation} \begin{split} f(\xi)=\bigcup_{j=1}^n\bigg\{\frac{1}{2\pi}\sum_{i=0}^n\eta_i\big(\xi_{i+1}-\xi_{i}\big)+\sum_{k=1}^\infty\bigg[\frac{1}{\pi}\sum_{i=0}^n\eta_i\bigg( \frac{\sin (k\xi_{i+1})}{k}-\frac{\sin (k\xi_{i})}{k}\bigg)\bigg] \cos k\xi + \\ \bigg[\frac{1}{\pi}\sum_{i=0}^n\eta_i\bigg( \frac{\cos (k\xi_{i})}{k}-\frac{\cos (k\xi_{i+1})}{k}\bigg) \bigg]\sin k\xi\bigg\} \end{split} \end{equation}
But somewhat, there is an error in the Fourier integrals, and in the last equation.
I cannot find the error, does anyone have an idea of what I did wrong?
Thanks