Finding the fourier series representation for a piecewise function

359 Views Asked by At

Expand the given function in the appropriate Fourier series: $$\begin{align} f(x) = \begin{cases} x+1 &\mbox{if } -1 \leq x \leq 0 \\ x-1 &\mbox{if } 0 \leq x \lt 1 \end{cases} \end{align}$$

To my knowledge, the first step is to determine whether the function is even or odd and that's where I get stuck.

UPDATE AFTER DISCUSSION WITH MARIANO:

on $[-1,0]$, $f(-x)=-x+1 \neq -f(x)$

on $[0, 1]$, $f(-x)=-x-1 \neq -f(x)$

so now i'm at a loss as to how to continue...

1

There are 1 best solutions below

0
On

It would be easier to determine that $f(x)=x+\operatorname{sign}x$ (sign function), where both terms are odd. Hence $f$ is odd, and we only worry about the sines; thus, integrate $f(x)\sin \pi n x$ over $[0,1]$ and multiply by $2$ to get the coefficient of $\sin \pi n x$ in the expansion. The key ingredient is
$$\int_0^1 (x-1)\,\sin \pi nx \,dx = -\frac{x-1}{\pi n}\cos \pi n x\bigg|_0^1 +\frac{1}{\pi n}\int_0^\pi \cos \pi nx \,dx = -\frac{1}{\pi n}+0 $$