Method of Averaging for Differential Equations on an Infinite Interval