# Fourier series for $\operatorname{sgn}(\sin(x))+\operatorname{sgn}(\cos(x))$

I'm having trouble figuring out the Fourier series of $\operatorname{sgn}(\sin(x))+\operatorname{sgn}(\cos(x))$ from $−\pi$ to $\pi$. How to determine if it's odd or even function? And how to determine period? This is the first time I'm seeing sgn function under integral and I don't know how to calculate anything I need for Fourier series.

• Is $sgn$ just the function returns $+1$ or $-1$ according to the sign of $x$? If so then it should be easy to integrate. – badjohn Jun 21 '17 at 15:24
• – Shaun Jun 21 '17 at 15:27
• Note that $f(x)=\text{sgn}(\sin(x))+\text{sgn}(\cos(x))$ can be written $$f(x)=\begin{cases}2&, x\in [0,\pi/2]\\\\-2&, x\in [-\pi,-\pi/2]\\\\0&\text{elsewhere}\end{cases}$$ – Mark Viola Jun 21 '17 at 15:28

Rewrite your function as a branch function. Note that $$\operatorname{sgn}(\sin(x)) = \begin{cases} 1, & x \in (0, \pi] \\ -1, & x \in [-\pi,0) \end{cases}$$ and you can do the same to the other term and then add them together. Once you have the branch function completely, it will be easy both to integrate and determine exact properties.