Completing the square when a is not 1