This paper presents a bio-evolutionary metaheuristic approach to study the harmonically oscillating behavior of the Duffing equation. The proposed methodology is an amalgamation of the artificial neural network with the firefly algorithm. A novelty in the activation of neurons of artificial neural network is described using the cosine function with the angular frequency. Chronologically, artificial neural network approximates discretizes the nonlinear functions of the governing problem, which then undergoes an optimization process by the firefly algorithm that then later generates the effective values of the unknown parameters. Generally, the algorithm and implementation of the scheme are assimilated by considering an application of Duffing-harmonic oscillator. Some error measurements, in order to discuss the convergence and accuracy of the scheme, are also visualized through tables and graphs. An effective optimized relationship between the angular frequency and amplitude is derived and its results are depicted in a tabular form. The comparison of the proposed methodology is also deliberated by homotopy perturbation method. Moreover, the geometrical illustration of the trajectories of the dynamic system is also added in the phase plane for different values of amplitude and angular frequency.