I'm tasked to find the Fourier series of $f(x)=|\sin{x}|$ in $(-\pi,\pi)$.
The period of $f$ is clearly $\pi$ since $|\sin(x+\pi)|=|\sin(x)|.$ So we set $2L=\pi\Leftrightarrow L=\pi/2.$ Since this is an even function we know that $b_n=0.$ For $a_0$ we use the formula
$$a_0=\frac{1}{L}\int\limits_{-L}^{L}f(x)dx\tag1$$
we have that
$$a_0=\frac{2}{\pi}\int\limits_{-\pi/2}^{\pi/2}|\sin(x)|dx=\frac{4}{\pi}\int\limits_0^{\pi/2}\sin{x}dx=\frac{4}{\pi}.$$
Which is correct. However, in the solution example, they just set $L=\pi$ and solve
$$\frac{2}{\pi}\int\limits_0^\pi\sin(x)dx=\frac{4}{\pi}.$$ How can they just set $L$ to $\pi$ if the formula says that if $f$ has a period $P$ then $P=2L?$