Analyzing the motion of a forced oscillating system on the verge of resonance