Evaluating the complex integral $\int_{0}^{\infty} \frac{\sin(x+i)}{x+ i } \, \mathscr{d}x$ Through the course of a problem I am working on I have reached two integrals that look similar to some of the trigonometric integrals. The integrals I have are the following:
$$\int_{0}^{\infty} \frac{\sin(x+i)}{x+ i } \, \mathscr{d}x$$ and $$\int_{0}^{\infty} \frac{\cos(x+i)}{x+ i } \, \mathscr{d}x$$
I do not know much about complex number theory, and am nervous to evaluate these integrals without help. However, I have evaluated these integrals in Maple and got that 
$$\int_{0}^{\infty} \frac{\sin(x+i)}{x+ i } \, \mathscr{d}x = - \int_{i}^{\infty} \frac{\sin(t)}{t } \, \mathscr{d}t = -\text{Si}(i) + \frac{\pi}{2} $$ and $$\int_{0}^{\infty} \frac{\cos(x+i)}{x+ i } \, \mathscr{d}x =- \int_{0}^{i} \frac{\cos(t)}{t} \, \mathscr{d}t = -\text{Ci}(i)$$
All I am looking is for some explanation (that is suitable for someone with very little experience with complex numbers) as to how Maple obtained this solution. Thanks!
 A: Let $I$ be the integral given by 
$$I=\int_0^\infty \frac{\sin (x+i)}{x+i}\,dx \tag 1$$
We will use Cauchy's Integral Theorem to evaluate the integral in $(1)$.  
Let $f$ be the function given by $f(z)=\frac{\sin z}{z}$ and let $\gamma$ be the closed contour comprised of the four line segments 
(i)   from $(0,0)$ to $(R,0)$;
(ii)  from $(R,0)$ to $(R,1)$;
(iii) from $(R,1)$ to $(0,1)$;
(iv)  from $(0,1)$ to $(0,0)$.  
Since $f$ is analytic within the region bounded by $\gamma$, we have from Cauchy's Integral Theorem
$$\oint_\gamma \frac{\sin z}{z}\,dz=0 \tag 2$$
We can also write the closed contour integral in $(2)$ as 
$$\begin{align}
\oint_\gamma \frac{\sin z}{z}&=\int_0^R \frac{\sin x}{x}\,dx+\int_0^1\frac{\sin (R+iy)}{R+iy}\,idy\\\\
&+\int_{R+i}^i \frac{\sin x}{x}\,dx+\int_{i}^0 \frac{\sin z}{z}\,dz \tag 3
\end{align}$$
As $R\to \infty$, the first integral on the right-hand side of $(3)$ approaches the Dirichlet Integral, which has a value of $\pi/2$.  
The second integral goes to $0$ as $R\to \infty$ since 
$$\left|\frac{\sin (R+iy)}{R+iy}\right|=\sqrt{\frac{\sin^2(R)+\sinh^2(y)}{R^2+1}} \le \frac{\sqrt{1+e^2/4}}{R}$$
The third integral goes to $-1$ times the integral of interest $\int_i^{\infty+i}\frac{\sin x}{x}\,dx$.
And finally, the fourth integral is $-1$ times the Sine Integral,  $\text{Si}(x)=\int_0^x\frac{\sin z}{z}\,dz$ evaluated at $x=i$.  
Putting everything together, we can write, therefore, 
$$\int_0^\infty \frac{\sin(x+i)}{x+i}\,dx=\frac{\pi}{2}-\text{Si}(i)$$
as expected!
