Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to find the Fourier series of $f(x)$ defined by $f(x)=\begin{cases} 1 , -L\le x<0\\ 0, 0\le x<L. \end{cases} $

Well, to find $a_0$ I do this integral: $$a_0=1/L \int _{-L}^0 dx +1/L \int _0^L0 \, dx=1.$$

Calculating the others:


$$b_n=1/L \int _{-L}^0 \sin\frac{\pi n x }L \, dx=-\frac{1}{\pi n}(1-\cos(\pi n))=-\frac{1}{\pi n}(1-(-1)^n)).$$

Now the answer in the book is this:

$$f(x)=\frac{1}{2}-\frac{2}{\pi}\sum_{n=0}^\infty \frac{\sin{[(2n-1)\frac{\pi n}{L}]}}{2n-1}$$

Why my $a_0$ is wrong? And what about the $\cos (\pi n)$ term? Thank you very much for your help!

share|cite|improve this question
I prefer the complex form as it avoids this silly ${1 \over 2}$ business with $a_0$. – copper.hat Aug 17 '14 at 19:28
For the $\cos(\pi n)$ term, compare what happens when $n$ is even versus odd. – Semiclassical Aug 17 '14 at 19:50

Note that

$$a_0 = \frac{1}{2L}\int_{-L}^{L} \dots$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.