Here, we propose a method to obtain local analytic approximate solutions of ordinary differential equations with variable coefficients, or even some non-linear equations, inspired in the Lyapunov method, where instead of polynomial approximations, we use truncated Fourier series with variable coefficients as approximate solutions. In the case of equations admitting periodic solutions, an averaging over the coefficients gives global solutions. We show that, under some restrictive condition, the method is equivalent to the Picard-Lindel\”of method. After some numerical experiments showing the efficiency of the method, we apply it to equations of interest in Physics, in which we show that our method possesses an excellent precision even with low iterations.