Analytical approach to the nonlinear free vibration of a conservative oscillator