$$\begin{equation*} % a_0
f(t)=\begin{cases}0,&-\pi<t<0\\1,&0<t<\pi \end{casos} \end{equation*}$$
\begin{equation*}a=-\pi\qquad l=\pi\qquad a+2l=\pi\qquad\qquad\qquad\end{ecuación *}
$$\begin{equation*}S(t)=\frac{a_0}2+\sum\limits_{k=1}^\infty a_k\cos\left(\frac{k\pi x}l\right)+b_k\sin\left(\frac{k\pi t}l\right)\\
\\
a_0=\frac1l\int\limits_{a}^{a+2l}f(t)\mathrm dt\qquad a_k=\frac1l\int\limits_{a}^{a+2l}f(t)\cos(t)\mathrm dt\qquad b_k=\frac1l\int\limits_{a}^{a+2l}f(t)\sin(t)\mathrm dt\\
\\\end{ecuación *} $$
\begin{align*} % a_0
a_0&=\frac1\pi\int\limits_{-\pi}^\pi f(t)\,\text dt\\
&=\frac1\pi\int\limits_{0}^\pi\,\text dt\\
&=\frac t\pi \Big|_0^\pi\\
&=\frac{\pi-0}\pi\\
&=1\\
\end{align*}
\begin{align*} %a_k
a_k&=\frac1\pi\int\limits_{-\pi}^\pi f(t)\cos(kt)\,\text dt\\
&=\frac1\pi\int\limits_{0}^\pi \cos(kt)\,\text dt\\
&=\frac1\pi\frac{\sin(kt)}k\Big|_0^\pi\\
&=\frac{\sin(k\pi)}{\pi k}\\
&=0
\end{align*}
\begin{align*} % b_k
b_k&=\frac1\pi\int\limits_{-\pi}^\pi f(t)\sin(kt)\,\text dt\\
&=\frac1\pi\int\limits_{0}^\pi\sin(kt)\,\text dt\\
&=\frac{-\cos(kt)}{\pi k}\Big|_0^\pi\\
&=\frac{\cos(0)-\cos(k\pi)}{k\pi }\\
&=\frac{1-(-1)^k}{k\pi }\\
&=\frac{1+(-1)^{k+1}}{k\pi }\\
\end{align*}
\begin{align*} % S(t)
S(t)&=\frac{1}2+\sum\limits_{k=1}^\infty \frac{1+(-1)^{k+1}}{k\pi }\sin\left({k t}\right)\\
&=\frac{1}2+\frac2\pi\sum\limits_{k=1,3,5,\dots}^\infty\frac{\sin({k t})}k\\
&=\frac{1}2+\frac2\pi\sum\limits_{r=1}^\infty\frac{\sin\big((2r-1)t\big)}{2r-1}\\
\\
&=\frac12+\frac2\pi\left(\sin(t)+\frac{\sin(3t)}3+\frac{\sin(5t)}5+\dots\right)
\end{align*}
\begin{align*} % S(t)
S(t)
&=\frac{1}2+\frac2\pi\sum\limits_{r=1}^\infty\frac{\sin\big((2r-1)t\big)}{2r-1}\\
\\
\\% S(π/2)
S\left(\tfrac\pi2\right)
&=\frac{1}2+\frac2\pi\sum\limits_{r=1}^\infty\frac{\sin(\pi r-\tfrac\pi2)}{2r-1}\\
1&=\frac{1}2+\frac2\pi\sum\limits_{r=1}^\infty\frac{(-1)^{r-1}}{2r-1}\\
\frac\pi4&=\sum\limits_{r=1}^\infty\frac{(-1)^{r-1}}{2r-1}\\
\\
\end{align*}