# Sum of Fourier Series

I need to find the Fourier Series for $f\in \mathcal{C}_{st}$ that is given by

$$f(x)=\begin{cases}0,\quad-\pi<x\le 0\\ \cos(x),\quad0\le x<\pi\end{cases}.$$

in the interval $]-\pi,\pi[$ and give the sum of the series for $x=p\pi,p\in\mathbb{Z}$.

What I know:

If $f(x)=\sum_{n=-\infty}^{\infty}\alpha_ne^{inx}$ on $[-\pi,\pi]$, then

$\alpha_n=\frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)e^{-inx}dx$.

Questions:

Can I use the above formula (the intervals are different)?

Should I use integration by parts?

To compute the sum, do I just substitute $x=p\pi$ in?

• So, what's the problem you are facing? – Mhenni Benghorbal Sep 15 '13 at 11:18
• @MhenniBenghorbal updated now. – user37158 Sep 15 '13 at 11:22
• You need to split the interval of integration. – Mhenni Benghorbal Sep 15 '13 at 11:26

Here is how you advance $$\alpha_n=\frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)e^{-inx}dx= \frac{1}{2\pi}\int_{-\pi}^{0}(0)e^{-inx}dx + \frac{1}{2\pi}\int_{0}^{\pi} \cos(x)e^{-inx}dx$$

$$\implies \alpha_n = {\frac {in \left( {{\rm e}^{i\pi \,n}}+1 \right) }{2\pi({n}^{2}-1)}}.$$

The case $n=1$ can be obtained from the above formula as

$$\alpha_1=\lim_{n\to 1}\alpha_{n}=\frac{1}{4}.$$

• Could you provide som more details about what you do in the last step? Also I forgot a pi in in alpha (updated now), so n=1 is not a special case anymore I guess? – user37158 Sep 16 '13 at 5:38
• @pleasedeleteme: See the edit. – Mhenni Benghorbal Sep 16 '13 at 11:10

You can use your expression for $\alpha_n$. In this case, it becomes:

\begin{align} \alpha_n&=\frac12\int_{-\pi}^\pi f(x)e^{-inx} dx\\ &=\frac12\int_{-\pi}^\pi\left.\begin{cases}0&-\pi<x\le 0\\ \cos(x)&0\le x<\pi\end{cases}\right\}dx\\ &=\frac12\int_{-\pi}^0 0 dx + \int_0^\pi \cos(x)e^{-inx}dx\\ &=\frac12\int_0^\pi \cos(x)e^{-inx}dx\\ \end{align}

• I tried using integration by parts after the last step, but it doesn't seem to simplify the expression. What can I do then? – user37158 Sep 16 '13 at 6:01
• @dexterity $\cos(x)=(e^{ix}+e^{-ix})/2$. – John Gowers Sep 16 '13 at 9:20