How to find fourier series of a function