Unfortunately, it is this part, that you say you follow, that is wrong.

, , and so the "discriminant" inside the square root should be

You are missing the "4" in first term.

Once you have that, you can factor out a "4" so that .

-2πh ±2 √π^2 h^2 - 2πS

------------------------------------------------------

4π

what I don't understand is how -4(2π)(-S) reduces to 2πS in the above equation.

from there we divide everything by 2 and get

-πh ± √πi^2 h^2 + 2πiS

---------------------------------------------

2π