Analytical technique for solving the quadratic nonlinear oscillator