$$ f(x) = \begin{cases} \pi & -\pi \leq x \leq \pi/2 \\ 0 & \pi/2< x < \pi\end{cases}$$
I tried following the definition to find the coefficients of the Fourier series for the above function but my answer doesn't match with the one given. Please help; I am a beginner at this.