Solve quadratic equation by factorisation