A Fourier Spectral Method To Solve Linear And Non-Linear Differential Equations And Its Applications