# Fourier series for a non-periodic function

My textbook says that:

'If we which to find the Fourier series of a non-periodic function only within a fixed range then we must continue the function outside the range so as to make it periodic.'

In the questions at the end of the chapter it then asked you to find the Fourier series for $f(x)=x$ for the range $-\pi<x\le\pi$. So I did what they said and made the function periodic turning it into $f(x)=|x+\pi|-\pi$ for the range $2\pi<x\le2\pi$ which represents a triangular wave.

When I checked the answers they had found the Fourier series straight on the original function without making it periodic.

Which is the right method? If they are both right which do we use when? thanks.

(Here is a link to a website that did it the same way as my textbook did it http://www.sosmath.com/fourier/fourier1/fourier1.html)

• Actually, there are many ways to make a function periodic. The simplest is to take the interval on which it is defined as one period (what your textbook did), but it may happen that it's discontinuous on the border. You may also complete first by symmetry, then by periodicity, and it's what you have done. Both ways are correct. Notice also that in some cases, you can complete to an odd periodic function, or an even periodic function: then you have resp. a decomposition in sine and in cosine. – Jean-Claude Arbaut Sep 23 '14 at 9:50
• Which to use? Whichever you want. Anyway, if it converges, it will always converge to your function in its original interval (or the regularized $(f(a+)+f(a-))/2$ at discontinuities). – Jean-Claude Arbaut Sep 23 '14 at 9:53

If you consider the function $f(x)=x$ on the interval $[-\pi,\pi)$, and you continue it periodically, then you don't get a triangular wave but you get a ramp (sawtooth) function. It has a positive slope everywhere except at the discontinuities at odd of multiples of $\pi$.
• @MattL. I edited the Wiki page, as the statement is obviously wrong. Notice $\Bbb R$ is an interval. – Jean-Claude Arbaut Sep 23 '14 at 10:31
• @Joseph If $f$ is periodic and has a finite number of discontinuities on any interval, then since $\Bbb R$ is an interval, it must have no discontinuities at all. The correct statement is "a finite number of discontinuities on any bounded interval". – Jean-Claude Arbaut Sep 23 '14 at 10:38