We introduce a new method with spectral accuracy to solve linear non-autonomous ordinary differential equations (ODEs) of the kind d dt ũ(t) = f (t)ũ(t), ũ(−1) = 1, with f (t) an analytic function. The method is based on a new analytical expression for the solution ũ(t) given in terms of a convolution-like operation, the -product. We prove that, by representing this expression in a finite Legendre polynomial basis, the solution ũ(t) can be found by solving a matrix problem involving the Fourier coefficients of f (t). An efficient procedure is proposed to approximate the Legendre coefficients of ũ(t), and the truncation error and convergence are analyzed. We show the effectiveness of the proposed procedure through numerical experiments. Our approach allows for a generalization of the method to solve systems of linear ODEs.