yes that is correct, the negative sign is because the x coordinate is decreasing for IntegralRet. So all you need do is add IntegralRet to IntegralExt instead of subtracting. Actually, adding the two is consistent with the idea of integrating your way around the entire loop, taking into account the sign change of dx when the direction reverses.
ans = 3
ans = -3