I try to solve an integration as follows,
$$\int \frac{sy^{-1}}{(1+sy^{-1})} \text{exp}(-\sqrt{y})dy$$
as you can see its pretty complicated, and I get an answer like the following using Wolfram Alpha $$e^{-i \sqrt{s}} s \left(e^{2 i \sqrt{s}} \text{Ei}\left(-i \sqrt{s}-\sqrt{y}\right)+\text{Ei}\left(i \sqrt{s}-\sqrt{y}\right)\right)$$
My question is I dont understand where this imaginary part is coming from? Any thoughts?
The complex form comes from the fact that, after subbing $y=u^2$, you get an integral of the form
$$\int du \frac{2 s u}{s+u^2} e^{-u} $$
This is a deceptively nasty integral. The only way to get something even remotely recognizable is to use partial fractions, which delivers complex numbers:
$$\frac{2 s u}{s+u^2} = s \left (\frac1{u-i \sqrt{s}} - \frac1{u+i \sqrt{s}} \right ) $$
The antiderivatives are then expressed in terms of those Ei functions.