Solving a quadratic by completing the square