Solving quadratic equations by factorisation