# Fourier Series of a piecewise function

I have to find the Fourier series of the following function:

f(x)= $$\begin{cases} 1 & \pi/2 < |x| < \pi \\ \ 0 & otherwise \\ \end{cases}$$

I don't understand how to find the bounds for the integration (to find $$b_k$$ and $$a_k$$)

• They meant the Fourier series of the $2\pi$-periodic function $f(x+2\pi n) = 1$ if $|x|\in (\pi/2,\pi)$, $0$ otherwise. The Fourier coefficients are found as usual with $a_k = \int_{c}^{c+2\pi} f(x) \cos(kx)dx$ – reuns Sep 23 at 19:05
• @reuns I'm afraid they don't, as this is this is another question in the book – Shaun Sep 23 at 19:09
• I'm affraid you don't understand that Fourier series is for periodic functions, those being fully determined by their values on one period. What I wrote is what they meant. The biggest problem in your question is that you didn't give the period $T$, for each $T$ you'll have a different periodic function and Fourier series. – reuns Sep 23 at 19:11
• @reuns T is not given in the question, I copied everything that is given in the question – Shaun Sep 23 at 19:15
• That's why I said $T$ is given somewhere else as $2\pi$. Once $T$ is given do you see that the question is unambiguous ? If so there is nothing else to say (except of course the main theorem, that the Fourier series converges to $f$ because it is piecewise $C^1$) – reuns Sep 23 at 19:19

Let $$m\in \Bbb{Z}$$

$$\pi \geq|x| \geq \pi/2$$ if and only if $$x \in [-\pi,-\pi/2]\cup [\pi/2,\pi]$$

Also note that $$e^{ix}=\cos{x}+i\sin{x}$$

Then $$\hat{f}(m)=\frac{1}{2\pi}\int_{-\pi}^{-\frac{\pi}{2}}e^{-imx}dx+\frac{1}{2\pi}\int_{-\frac{\pi}{2}}^{\pi}e^{-imx}dx$$

So from this you can find $$a_m,b_m$$

• Can you please explain this? – Shaun Sep 23 at 19:10
• @Shaun i edited my answer – Marios Gretsas Sep 23 at 19:13
• Note that the coefficines have bound of integration the interval $[-\pi,\pi]$, and you functions vanishes somewhere so you have the answer above. – Marios Gretsas Sep 23 at 19:14