I have the given function:
\begin{equation} f_n(t)=\sum_{j=1}^n\eta_j\chi_{A_j}(t)\text{d}t, \end{equation}
where:
$$\chi_{A_j}(\xi)=\begin{cases} 2, \ \ \ \ -2\le \xi<-1 \\ 1, \ \ \ \ -1\le \xi<0 \\ 2, \ \ \ \ 0\le \xi<1 \\ 3, \ \ \ \ 1\le \xi\le2 \end{cases}$$
and I generate its Fourier series as follows:
With $L=\frac{b-a}{2}=2$ and $\omega=\frac{\pi}{L}=\frac{\pi}{2}$. Using the substitution $t = \frac{Ly}{\pi} = \frac{2y}{\pi}, \ (-\pi \le t \le \pi)$, we can convert the function above into the function:
\begin{equation} F(t)=f\bigg(\frac{2y}{\pi}\bigg) \end{equation}
By the Fourier series we have therefore:
\begin{equation} F(y)=f\bigg(\frac{2y}{\pi}\bigg)=\frac{\alpha_0}{2}+\sum_{k=1}^\infty\alpha_k\cos ky+\beta_k\sin ky \end{equation}
Now at this stage I got confused by that substitution, and I did as follows for the first coefficient:
\begin{equation} \begin{split} &\alpha_0=\frac{1}{\pi}\int_{-\pi}^{\pi}F(y)\text{d}y=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}\text{d}y+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}\text{d}y+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\text{d}y+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}\text{d}y=4 \end{split} \end{equation}
Even though this gives the same result as in Mathematica for that given Series, I am unsure about the coefficients in front of each integral sign.
I can't seem to conclude if they are correct!
Any ideas appreciated
Thanks