A Fourier inversion method for the estimation of a density and its derivatives