the value of u you are calculating needs to be fixed with proper use of braces
here's the correct version:
u = ((a + math.sqrt(a**2 - 1))**2) * ((b + (math.sqrt(b**2 - 1)))**2) * (c + (math.sqrt(c**2 - 1))) * (d + (math.sqrt(d**2 - 1)))