Consider the integral
where 0 < b <1 and |Im a| < 1. Below is Mathematica code which evaluates this integral 1) directtly and 2) evaluating the indefinite integral between the two limits.
The Mathematica command:
value1=Assuming[0 < b < 1 && Abs[Im[a]] < Pi,1/(2 Pi I) Integrate[Exp[a z]/Sin[Pi z],{z,b- I Infinity,b+I infinity}]]
produces the result
If we calculate the indefinite integral
indef=1/(2 Pi I) Integrate[Exp[a z]/Sin[Pi z],z]
we obtain
Next, we set
temp = FullSimplify[(indef /. {z -> b + I R}) - (indef /. {z ->
b - I R})]
obtaining
value2 = Assuming[0 < b < 1 && Abs[Im[a]] < Pi && R > 0,
Limit[temp, R -> Infinity]]]
gives
value2 = Factor[FullSimplify[value2]]
gives
{value1, value2}
It can be shown by contour integration that value2 is the correct value.