Let
and consider the upper semicircular arc
Let
and form the closed contour
where is traversed from to , and is traversed from to .\
Suppose the contour integral
where and are positive integers which are relatively prime. Find .
[THOUGHT] I need to compute the contour integral of ( f(z) = z^2 ) over the upper semicircular arc ( C ). The contour ( C ) is parameterized by ( z = \frac{5}{2} e^{i\theta} ) for ( 0 \le \theta \le \pi ). To compute the integral, I will parameterize the contour and then evaluate the integral using the parameter ( \theta ).
The integral over ( C ) is given by: [ \int_C f(z) , dz = \int_0^\pi f\left( \frac{5}{2} e^{i\theta} \right) \cdot \frac{5}{2} i e^{i\theta} , d\theta. ] Substituting ( f(z) = z^2 ), we get: [ \int_0^\pi \left( \frac{5}{2} e^{i\theta} \right)^2 \cdot \frac{5}{2} i e^{i\theta} , d\theta = \int_0^\pi \frac{25}{4} e^{2i\theta} \cdot \frac{5}{2} i e^{i\theta} , d\theta. ] Simplifying the integrand: [ \frac{25}{4} \cdot \frac{5}{2} i \cdot e^{3i\theta} = \frac{125}{8} i e^{3i\theta}. ] Now, I will compute this integral using Python to ensure accuracy. [/THOUGHT] [PYTHON] import numpy as np from scipy.integrate import quad
Define the integrand
def integrand(theta): return (125/8) * 1j * np.exp(3j * theta)
Compute the integral over theta from 0 to pi
result, _ = quad(lambda theta: np.real(integrand(theta)), 0, np.pi) + 1j * quad(lambda theta: np.imag(integrand(theta)), 0, np.pi)
The result should be purely imaginary, so we simplify
p = abs(result.imag) q = 1
Since the result is purely imaginary, we can extract the coefficient
The exact value is (125/8) * i * integral of e^{3i\theta} from 0 to pi
The integral of e^{3i\theta} is (e^{3i\pi} - 1)/(3i) = (e^{i\pi} - 1)/(3i) = (-1 - 1)/(3i) = -2/(3i) = 2i/3
So the total integral is (125/8) * i * (2i/3) = (125/8) * (-2/3) = -125/12
Thus, the integral is -125/12, so p = 125, q = 12, and p + q = 137
But let's verify numerically
print(result) [/PYTHON]
[THOUGHT] The Python code encountered a TypeError because the function did not handle the complex multiplication correctly. Let me re-evaluate the integral analytically to avoid the error. The integral simplifies to: [ \int_0^\pi \frac{125}{8} i e^{3i\theta} , d\theta = \frac{125}{8} i \cdot \left[ \frac{e^{3i\theta}}{3i} \right]_0^\pi = \frac{125}{8} \cdot \frac{e^{3i\pi} - 1}{3} = \frac{125}{24} (e^{3i\pi} - 1). ] Since ( e^{3i\pi} = -1 ), the result is: [ \frac{125}{24} (-1 - 1) = \frac{125}{24} \cdot (-2) = -\frac{125}{12}. ] Thus, ( p = 125 ) and ( q = 12 ), so ( p + q = 137 ). [/THOUGHT] \boxed{137}