In this paper,a formula of modified variational iteration method and Fourier series for solving linear and nonlinear non-homogeneous differential equations is derived. Particularly the method is derived and applied to nonhomogeneous differential equation. If the non-homogeneous part of the equation is non-continuous periodic function with a period 2π.