Find $\int \frac{e^{-x}\sin x}{x} \ dx$. I'm trying to compute $\int \frac{e^{-x}\sin x}{x} \ dx$.  This resembles integrating $\int e^{-x}\sin x \ dx$ so my main thought about how to approach this is by finding some connection with that.  I know that $\int e^{-x}\sin x \ dx = -\frac 1 2 e^{-x}(\sin x + \cos x)$. If I try to use integration by parts setting
$$u=x^{-1}$$
and
$$dv=e^{-x}\sin x \ dx$$
then we get
$$\frac{du}{dx}=-\frac{1}{x^2}$$
and also
$$v=-\frac 1 2 e^{-x}(\sin x + \cos x)$$
Then the integral becomes
$$ \int u \ dv = uv-\int v\ du = x^{-1}\left(-\frac 1 2 e^{-x}(\sin x + \cos x) \right) - \int \left( -\frac 1 2 e^{-x}(\sin x + \cos x) \right) \left( -\frac{1}{x^2} \right) \ dx $$
I seem to have made things worse.  I am sorry.
If I try to make any other assignment of $u$ and $dv$ in integration by parts, I don't foresee them going any better.  No substitution seems helpful, either $u$ or trig.  I don't think I can integrate twice and get back to where I started.  That almost seems possible if I take what I have done above and now choose $\frac 1 {x^2}$ for integration, except that the derivative part will now have much more in it than I started with.  I think my bag of tricks may be empty.
 A: Since no one is going to post an answer I will prove that
$$I = \int \frac{e^{-x}\sin x}{x}\,\mathrm{d}x = -\frac{\mathrm{i}\left(\operatorname{Ei}\left(\left(\mathrm{i}-1\right)x\right)-\operatorname{Ei}\left(-\left(\mathrm{i}+1\right)x\right)\right)}{2}+C,$$
where $\operatorname{Ei}$ is the expontial integral and $C$ is an arbitrary real constant.
Lemma. Let $z$ be a complex number. Then
$$\sin z = \frac{e^{iz}-e^{-iz}}{2i}.$$
If we rewrite the sine in the integral, we may add exponents and use linearity of the integral to get to
$$I = \frac{1}{2i}\int \frac{e^{ix-x}}{x}\,\mathrm{d}x-\frac{1}{2i}\int \frac{e^{-ix-x}}{x}\,\mathrm{d}x.$$
Substitute in the first integral $u_1=(i-1)x$ and in the second one $u_2=-(i+1)x$.
$$\frac{1}{2i}\operatorname{Ei}(u_1)-\frac{1}{2i}\operatorname{Ei}(u_2).$$
Substituting $u_{1,2}$ back yields
$$\frac{\operatorname{Ei}((i-1)x)-\operatorname{Ei}(-(i-1)x)}{2i}+C.$$
The last step is a matter of taste. You can write $\tfrac{1}{i}$ as $-i$, so
$$\frac{-i(\operatorname{Ei}((i-1)x)-\operatorname{Ei}(-(i-1)x))}{2}+C.$$
