solve a quadratic equation by factorisation