Put and . The denominator of the complex rational function becomesThe quadratic formula gives its two zeros, hence the two poles:Their product is , so . To locate them one also needs to exclude the possibility of both lying on the unit circle. Here their moduli are explicit:Both are simple poles: takes the nonzero values and at them. In particular their residues are and .
For the real integral, use the change of variables . As runs from to , this traverses the unit circle once counterclockwise, andThus . Only is enclosed. The residue theorem, or Cauchy integral formula after subtracting its simple-pole part, givesThe real denominator is positive because . As an independent check, write ; a period shift reduces the answer to the existing reciprocal affine sine integral.
For , use . The interval traverses once counterclockwise, , and . ThusPut . The two simple poles areTheir moduli are and , so exactly is enclosed, for either sign of . Its residue isThe residue theorem yieldsThis also follows from the reciprocal affine sine integral after an angular shift. At , the original integral is directly , agreeing with the boxed formula. The displayed two-pole formulas require : at zero the contour integrand reduces to with a single pole. Thus the source's claim of two simple poles has this removable special-case exception.
Put . The two roots areSince , their moduli are and . Thus exactly one root is inside the unit circle, and neither lies on it.
For the real integral use , so and . The change of variables givesThe contour is counterclockwise. At its single interior simple pole, the residue isBy the residue theorem, the reciprocal affine sine integral is thereforeThe condition also makes the real denominator strictly positive, consistent with the positive answer and the absence of contour poles on the unit circle.