Nonlinear behavior in a piezoelectric resonator: A method of analysis