A dynamic model for the axial and transverse vibrations of a rotating drillstring is presented. The governing non-linear equations, which are obtained by using a Lagrangian approach, are fully coupled with time varying coefficients. They include the effects of gyroscopic moments, contact with the borehole wall, axial excitation due to bit/formation interactions, and hydrodynamic damping due to the presence of drilling mud outside the drillstring. Simulation results show that parametric resonance and whirling may occur simultaneously within the range of operating conditions of drilling. The dynamic behavior is quite complicated and may become non-periodic, suggesting a chaotic behavior. © 1997 Academic Press Limited.