2
$\begingroup$

I am given a $2 \pi$ periodic function $f$:

$$ f(x) = \begin{cases} x+\pi, & -\pi \le x < -\frac{\pi}{2} \\ \frac{\pi}{2}, & -\frac{\pi}{2} \le x <\frac{\pi}{2} \\ x-\pi, & \frac{\pi}{2} \le x <\pi \end{cases}$$

I want to determine the fourier series:

$$\frac{a_0}{2}+\sum_{n=0}^\infty a_n \cos{(nx)}+\sum_{n=1}^\infty b_n \sin{(nx)}$$

where $a_n=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cos{(nx)}dx$ and $b_n=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\sin{(nx)}dx$.

Since $f$ is even and $[-\pi,\pi]$ is a symmetric interval, all the $b_n$ will be zero. I tried to calculate $a_n$ by integrating piecewise over the interval and (without writing out all the calculations) I got:

$$a_n=\frac{2 \sin{(\frac{n\pi}{2})}}{n}$$

I have two problems now:

  1. $a_0 $ seems to be undefined according to this definition
  2. I know that for $n \space \text{even}$ $a_n=0$. However, I can't really find a nice expression for $n \space \text{odd}$. Is there anyway I can rewrite it (maybe eliminate the $\sin{nx}$ from the term)?
$\endgroup$
  • 1
    $\begingroup$ You can use linearity of FT together with box and triangle functions whose transforms you should learn by heart if you haven't already. $\endgroup$ – mathreadler Jul 6 at 17:30
1
$\begingroup$

If $a_{n} = \frac{2\sin(\frac{n \pi}{2})}{n}$ then note that

$$ \sin(\frac{n \pi}{2}) = 1, -1,1, \cdots $$ for odd n. So the first few expressions are

$$ a_{1} = \frac{2}{1} = 2 , a_{3} = \frac{-2}{3} , a_{5} = \frac{2}{5}$$

Note that $a_{0}$ is given by the following equation for that interval

$$ a_{0} = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \textrm{d}x $$

Alternatively, you can see that

$$ a_{n} = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos(n x) \textrm{d}x $$

and $\cos(nx) = 1$ for $n =0$.

$\endgroup$
  • $\begingroup$ Is there any way to condense that into a closed-form formula? Somthing like $(-1)^k$ (which would be wrong in this case because it yields a negative for the $a_1$ term.) Also, how do I deal with $a_0$? Do I use the limit ? $\endgroup$ – qmd Jul 6 at 15:14
  • $\begingroup$ Probably. $a_{0} = \int_{-\pi}^{\pi} f(x) \textrm{d}x $ so it is equal to $2\pi^{2} + \pi^{2} - 2\pi^{2} $ which is $\pi^{2}$ there should be $\frac{1}{\pi}$ too. Then $a_{0} = \pi $ I think $\endgroup$ – воитель Jul 6 at 15:21
  • 2
    $\begingroup$ @qmd the general term is $$a_n=\frac{2(-1)^{(n-1)/2}}{n}$$ apart from $a_0=\pi$. $\endgroup$ – Peter Foreman Jul 6 at 18:07
  • $\begingroup$ @PeterForeman Exactly what I was looking for. Thanks for your help! $\endgroup$ – qmd Jul 7 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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