4. (8%) Let f(x) be a periodic function with period $2\pi$ and defined by $$f(x) = \begin{cases} x + \pi, & |x| \le \frac{\pi}{2}, \\ 0, & \frac{\pi}{2} < |x| \le \pi. \end{cases}$$ for $-\pi \le x \le \pi$. Find the Fourier series of f(x).
4. (8%) Let f(x) be a periodic function with period $2\pi$ and defined by $$f(x) = \begin{cases} x + \pi, & |x| \le \frac{\pi}{2}, \\ 0, & \frac{\pi}{2} < |x| \le \pi. \end{cases}$$ for $-\pi \le x \le \pi$. Find the Fourier series of f(x).