Completing the square for negative terms