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)