# Homework Help: Finding Fourier coefficients and Fourier Series

1. May 20, 2013

### Smazmbazm

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

Find the Fourier coefficients for the function

*Should be a piecewise function, not sure how to write one in [itex /itex] tags*

$f(x) =$
$|x|, |x| < 1,$
$1, 1≤|x|< 2;$

$f(x+4) = f(x)$

and

Find the Fourier series for

$f(x) = cos1/2\pi x, -1≤x<1; f(x+2)=f(x)$

Would be great if someone could explain how to solve these. It feels like our lecturer rushed over Fourier series / coefficients, without giving any similar examples. Thanks for any help

2. May 20, 2013

The Fourier coefficients for a function, f, defined on interval [a, b]. are the coefficients $A_i$ and $B_i[/tex] such that $$f(x)= A_0+ A_1 cos((2\pi/(b-a))x)+ B_1 sin((2\pi/(b-a))x)+ A_2 cos((4\pi/(b-a))x)+ B_2sin((4\pi/(b-a))x)+ \cdot\cdot\cdot= \sum_{i= 0}^\inft A_i cos((2i\pi/(b-a))x)+ B_i sin((2i\pi/(b-a))x)$$ The "theoretical" point is that the sines and cosines form an "orthonormal basis" for such functions and so we can find the coefficients by taking the "inner product" of f with each of those functions: $$A_i= \frac{2}{b- a}\int_a^b f(x)cos((2\pi/(b-a))x) dx$$ $$B_i= \frac{2}{b- a}\int_a^b f(x)sin((2\pi/(b-a))x) dx$$ Surely those formulas are in your text book? 3. May 20, 2013 ### Smazmbazm These are the equations we are given in our notes [itex]f(x) = \frac{a_{0}}{2} + \sum^{∞}_{m=1} [a_{m}cos\frac{mx\pi}{L} + b_{m}sin\frac{mx\pi}{L}]$

where $a_{m}$ and $b_{m}$ are the Fourier constants.

To determine the Fourier coefficients, we are given

$a_{m} = <cos\frac{mx\pi}{L},f(x)>_{L} = \frac{1}{L} ∫^{L}_{-L}cos\frac{mx\pi}{L}f(x)dx$
$b_{m} = <sin\frac{mx\pi}{L},f(x)>_{L} = \frac{1}{L} ∫^{L}_{-L}sin\frac{mx\pi}{L}f(x)dx$

L is calculated from $T = 2L$ where T is the period which is found from $f(x+T) = f(x)$ So L must be 2.

Since the function involves a piecewise function, am I supposed to take the integral of the function over the intervals [0,1] and [1,2]?

4. May 20, 2013

### micromass

Yes. Except that your domain also has negative numbers. So you should also include [-1,0] and [-2,-1] somewhere.

5. May 20, 2013

### Smazmbazm

Ok so here is my attempt for $a_{0}$

$a_{0} = \frac{1}{2}∫^{-1}_{-2}1dx + \frac{1}{2}∫^{0}_{-1}xdx + \frac{1}{2}∫^{1}_{0}xdx + \frac{1}{2}∫^{2}_{1}1dx$

Evaluated, I get

$a_{0} = 1$

Correct? Should be able to do the rest fine now if that's correct

6. May 23, 2013

### Smazmbazm

Can someone please confirm that this is incorrect / correct so that I know that I'm on the right track or not. Thanks