Homework Help: Fourier Series of a Piecewise Function

1. Mar 17, 2017

t.kirschner99

1. The problem statement, all variables and given/known data

f(x) = -1, -π ≤ x ≤ 0
2, 0 ≤ x ≤ π

Given this find the Fourier series using both

$$a) \sum_{n=-∞}^\infty a_n e^{inx}$$
$$b) \sum_{n=0}^\infty [A_n cos(nx) + B_n sin(nx)]$$

2. Relevant equations

$$a_o = \frac {1} {2L} \int_{-L}^L f(t) \, dt$$
$$a_n = \frac {1} {L} \int_{-L}^L f(t)cos(\frac {nπt} {L}) \, dt$$
$$b_n = \frac {1} {L} \int_{-L}^L f(t)sin(\frac {nπt} {L}) \, dt$$

3. The attempt at a solution

Hello everyone. My problem is not calculating the numbers from the equations above, but with the conditions of the question. The question is asking about using 2 ways of completing the Fourier series. I've looked through my notes and online, but cannot find the two separate ways of doing it. Plus I don't know whether a or b is answered from using the three equations I linked above. Would someone be able to point me in the right direction?

Thanks for the help in advance guys!

2. Mar 17, 2017

BvU

Your equations only involve sines and cosines and all three of them together provide the answer for b) !

3. Mar 17, 2017

t.kirschner99

That is what I thought. Thanks for the confirmation!

Any idea on what kind of direction I take for A then? Combed through my notes and it only explains the process for B of course.

4. Mar 17, 2017

BvU

5. Mar 17, 2017

t.kirschner99

6. Mar 17, 2017

BvU

It's not very important: $\ \ e^{iy} = (e^{-iy})^{-1}$

7. Mar 17, 2017

t.kirschner99

Alright. Thanks for the help BvU! Really appreciate it!

8. Mar 17, 2017

BvU

Wait! There's more to be had from this very useful exercise
Fourier series, Fourier transforms are extremely useful and important tools in science and imho worth a hefty investment to master.
Here you are invited to actually do the integral, which is good, provides insight and hones skills.
With experience you'll change over more and more to useful relationships, tables and numerical tools.

A first one you meet here already: your function is asymmetrical, so all $a_n$ are zero (in part b).
A second one is the link between parts a) and b) of the exercise

Have $\mathcal{F}$un !

9. Mar 17, 2017

Ray Vickson

Computer now working again, so here goes.

For (c): a complete, orthonormal system of functions on $(-\pi,\pi)$ is $u_n (x) = \exp(i n x)/ \sqrt{2 \pi}, \: n = 0, \pm 1, \pm 2, \ldots.$ So, if you write $f = \sum_n c_n u_n$, then $c_n = \langle u_n,f \rangle = \int_{-\pi}^{\pi} u_n(x)^* f(x) \, dx$ where $u_n^*(x) = \exp(-i n x)/\sqrt{2 \pi}= u_{(-n)}(x).$ Note that in the summation, $n$ extends from $-\infty$ to $+\infty$.

Last edited: Mar 17, 2017