Evaluate the integral
where
If the value of the integral is , is the imaginary unit, compute
[PYTHON] import sympy from sympy import I, exp, pi, diff, factorial, floor, re, im
def solve_integral(): x = sympy.symbols('x')
# Define the polynomial P(x)
# P(x) = x^7 - 14ix^6 + (85 - 60i)x^5 - (240 + 210i)x^4 + (420 - 840i)x^3 - (560 + 1680i)x^2 + (1344 - 2688i)x + 3840
P = x**7 \
- 14*I*x**6 \
+ (85 - 60*I)*x**5 \
- (240 + 210*I)*x**4 \
+ (420 - 840*I)*x**3 \
- (560 + 1680*I)*x**2 \
+ (1344 - 2688*I)*x \
+ 3840
# The function to differentiate for the residue is g(x) = P(x) * e^(ix)
# We need the 7th derivative evaluated at x = 3i
g = P * exp(I*x)
# Calculate the 7th derivative
# Since P is degree 7, we can compute this.
# Using sympy to differentiate
d7g = diff(g, x, 7)
# Evaluate at x = 3i
val_at_3i = d7g.subs(x, 3*I)
# The residue is 1/7! * val_at_3i
residue = val_at_3i / factorial(7)
# The integral value is 2 * pi * i * residue
integral_val = 2 * pi * I * residue
# Simplify the result
integral_val = sympy.simplify(integral_val)
print(f"Integral value: {integral_val}")
# Extract a and b
# I = a + bi
# Note: The result might contain pi and e. We need numerical values for floor.
# But let's check the form first.
a = re(integral_val)
b = im(integral_val)
print(f"a: {a}")
print(f"b: {b}")
# Calculate floor(10a) + floor(b)
# We need to evaluate them numerically if they are not integers/rationals
val_a = a.evalf()
val_b = b.evalf()
print(f"Numerical a: {val_a}")
print(f"Numerical b: {val_b}")
res = floor(10 * val_a) + floor(val_b)
print(f"Final result: {res}")
solve_integral() [/PYTHON] The integral is given by
We evaluate this integral using contour integration. We close the contour in the upper half-plane (UHP) because of the term. The integrand has a pole of order 8 at , which lies in the UHP. By the Residue Theorem,
where . The residue at a pole of order 8 is given by
Using Python to compute the 7th derivative of at , we found:
Substituting this into the expression for :
Simplifying the fractions:
Thus,
We identify the real and imaginary parts and :
We compute the required values numerically:
Finally, the sum is:
The integral is given by
We evaluate this integral using the Residue Theorem by closing the contour in the upper half-plane. The function has a pole of order 8 at . The value of the integral is
where . The residue is given by
Using the Python code, we computed the integral to be:
Thus, the real part and imaginary part are:
Numerically evaluating these values:
The sum is: