# Thread: Fourier series of step function

1. ## Fourier series of step function

Hiya,

I'm having a bit of trouble figuing out the fourier series for a function f(x) defined as 1 if 0 < x < pi, -1 if -pi < x < 0.

The problem I'm having is that $\displaystyle \int$ f(x) dx from -pi to pi equals 0, therefore all of the fourier coefficients are 0. Am I doing something wrong?

Thanks

2. Originally Posted by CorruptioN
Hiya,

I'm having a bit of trouble figuing out the fourier series for a function f(x) defined as 1 if 0 < x < pi, -1 if -pi < x < 0.

The problem I'm having is that $\displaystyle \int$ f(x) dx from -pi to pi equals 0, therefore all of the fourier coefficients are 0. Am I doing something wrong?

Thanks
The "therefore" is wrong the conclusion does not follow from your premiss. You have shown that $\displaystyle a_0$ is zero, and as the function is odd all of the $\displaystyle a$'s are zero, but the $\displaystyle b$'s are non-zero. Write out the integral for $\displaystyle b_1$ and see.

CB

3. Originally Posted by CorruptioN
Hiya,

I'm having a bit of trouble figuing out the fourier series for a function f(x) defined as 1 if 0 < x < pi, -1 if -pi < x < 0.

The problem I'm having is that $\displaystyle \int$ f(x) dx from -pi to pi equals 0, therefore all of the fourier coefficients are 0. Am I doing something wrong?

Thanks
$\displaystyle f(x) = \begin{cases} -1, & \mbox{if}~~ -\pi < x < 0 \\ 1, & \mbox{if}~~~~~~ 0 < x < \pi \end{cases}$

You have an odd function, so you need to find only $\displaystyle b_n$.

$\displaystyle b_n = -\frac{1}{\pi}\int\limits_{-\pi}^0 \sin nx\,dx + \frac{1}{\pi}\int\limits_0^\pi \sin nx\,dx = \frac{2}{\pi}\int\limits_0^\pi \sin nx\,dx =$

$\displaystyle = \left. {-\frac{2}{\pi n}\cos nx} \right|_0^\pi = \frac{2}{\pi}\frac{1-(-1)^n}{n} = \begin{cases} 0, & \mbox{if} \quad n~~\text{is}~~\text{even} \\ \dfrac{4}{\pi}\dfrac{1}{2n-1}, & \mbox{if} \quad n~~\text{is}~~\text{odd}\end{cases}$

Finally you have

$\displaystyle f(x) = \frac{4}{\pi}\sum\limits_{n=1}^\infty \frac{\sin\bigl[(2n-1) x\bigl]}{2n-1},~~ - \pi < x < \pi .$

4. Thank you DeMath! I had just reached the same answer myself, but attempts to plot the function were failing, so I thought I had done something wrong I was about to scrap what I had and start again before you came along!

,
,

,

,

,

,

,

,

# Fourier series of three step functions

Click on a term to search for related topics.