An analytical technique for solving quadratic nonlinear oscillator