Time-Dependent First Integrals, Nonlinear Dynamical Systems, and Numerical Integration