For a positively oriented simple closed contour , with no pole on and with holomorphic inside except at finitely many poles, the residue theorem states
For a more general closed contour, each residue is multiplied by its winding number about the pole.
The powers must be defined using the same branch of the complex logarithm as the numerator. A branch suitable for both requested calculations is
The branch cut is a ray just below the positive real axis, and . Since , the displayed choice of is possible. It includes the required upper half-plane and the sector used below. The origin remains an excluded branch point.
In , all zeros of are
Each is a simple pole, since . Its residue is
The strict inequality matters if a root lies on the negative real axis, which is outside the specified region.
To evaluate the two improper integrals, write them as for the logarithmic numerator and for numerator one, and set , . Use a counterclockwise annular sector with and . It encloses precisely . The outward positive-axis segment contributes in the limit. On the inward segment , the logarithm is and , so that segment contributes .
The small arc is , and the large arc is ; both vanish. These estimates follow from the arc lengths and . The real integrals also converge absolutely at both endpoints for . The residue theorem now gives
After division by , the real and imaginary parts are
Since , . Hence the logarithmic beta integral from a sector contour yields
For the sector angle exceeds . This is why choosing the principal complex logarithm on the whole sector would be invalid; the displaced cut above handles that range as well as .