A resonance formulation for invariants of particle motion in a one-dimensional time-dependent potential