# How do I calculate Fourier series of an $f(x)$ with discontinuities inside its period?

I need to calculate Fourier series of:

$$\sin(x)- \operatorname{IntegerPart}[\sin(x)]$$

This seems just a common sine function, with its value set to 0 at its max and mins, so the period is just the same as that of $\sin(x)$. But however I take it, it has at least 1 (2?) discontinuities inside it, and I don't know how to proceed.

My only guess comes from what I've read here:

If you have a removable discontinuity at a point, the Fourier series will converge to the limit of the function at the point.

Does it mean that Fourier series will just ignore that (removable) discontinuity, and hence my answer is $\sin(x)$?

Note: this is not homework, but I'm preparing for an exam and this exercise is from an old one.

-
Is $\operatorname{IntegerPart}(-0.1)$ equal to $0$ or to $-1$ in your exam? –  Rahul Feb 9 '12 at 17:52
@RahulNarain Well I intended it as 0. But now I'm curious to know how should I proceed in the other case. –  bigstones Feb 9 '12 at 17:55
@myself: oh well now that I understood, I guess I would just have to integrate over continuous intervals and sum them up. –  bigstones Feb 9 '12 at 18:12
@bigstones : I apologize for the incorrect answer I gave and which you seem to have accepted over a year ago. In case you care, at a jump discontinuity, like you have in your function, the Fourier series converges to the average of the left-hand and right-hand limits. I don't know how useful this is; some people only care about the $L^2$ convergence of a Fourier series. But I think this fact is used sometimes to evaluate certain infinite series. –  Stefan Smith Mar 13 '13 at 1:11
@bigstones : mathematicians will almost always consider the integer part, or "floor", of $-0.1$, for example, to be $-1$. Some computer languages' "integer part" function may give you a different answer. –  Stefan Smith Mar 14 '13 at 15:22

When the sine is negative, then its integer part, as usually defined, is $-1$. So you have jump discontinuities as well as removable discontinuities. You'd have to add the integrals over $[-\pi,0]$ and $[0,\pi]$. The one removable discontinuity can be ignored; it doesn't affect the integral.