How can an improper integral have multiple values? Integrals like this are said to dependend on the contour of integration:
$$\int^{\infty}_{-\infty}\frac{x\sin x}{x^2-\sigma^2}dx=\pi e^{i\sigma}\space \mathrm{or}\quad \pi \cos\sigma $$
How is it possible that an improper integral has multiple values? Is this similar to the case where the improper integral doesn't exist and we have to use the Cauchy principal value (because the integral would depend on the limit)? 
Does the problem remain if we don't use contours at all?
I've encountered this type of integrals in Quantum Field Theory and in Arkfen's Mathematical methods, so I don't if this is one of the cases were physicists are being sloppy. Since my complex calculus followed Churchill, I never saw how to deal with this problem.
To give some more context, in QFT, we have the propagator (related to Green's functions):
$$D(r)=\int dp^0 d^3p \frac{e^{-ip_0r^0+i\vec{p}\vec{r}}}{p_0^2-p^2-m^2}$$
 A: I would call this a definite integral, rather than an improper integral, and it seems it will take different values depending on your parameter $\sigma$, since for a fixed $\sigma$ there is one integral and it either is integrable or it isn't.
For instance, for $\sigma =\pi/2$, you have that $\pi e^{i\sigma}=\pi e^{i\pi/2}=\pi\sin(\pi/2)=\pi$. So in this case the results you have coincide, (and they will also coincide for $\sigma =\pi/2+k\pi$ for $k\in\Bbb Z$).
I do not know this integral well, perhaps it is the case that if $\sigma\ne \pi/2+k\pi$, you can achieve different values, it which case the integral diverges.
But a well defined integral will only have one value.
A: If this specific integral is of concern to you, you could notice that $$\int_{-a}^{a}\frac{x\sin x}{x^2-\sigma^2}dx$$ is given by$$\frac{1}{2} \sin (\sigma ) (-\text{Ci}(-a-\sigma )+\text{Ci}(a-\sigma
   )+\text{Ci}(\sigma -a)-\text{Ci}(a+\sigma ))+$$ $$\cos (\sigma ) (\text{Si}(a-\sigma
   )+\text{Si}(a+\sigma ))$$ provided $$\Re\left(\frac{\sigma }{a}\right)\geq 1\lor \Re\left(\frac{\sigma }{a}\right)\leq
   -1\lor \frac{\sigma }{a}\notin \mathbb{R}$$ For the given formula, the limit when $a$ tends to $\infty$ is given by $$\pi  \left(\cos (\sigma )-i \sin (\sigma ) \left(\left\lfloor \frac{\arg (-\sigma
   )}{2 \pi }\right\rfloor -\left\lfloor \frac{\arg (\sigma )}{2 \pi }\right\rfloor
   \right)\right)$$
A: This is a definite integral. What I think is happening here is that the integration is done over complex plane, and thus there are many different possible contour of integration. If we assume that $\sigma$ is not a multiple of $2\pi$ and is positive real, then the function have 2 simple poles at $\pm\sigma$, thus the value of the integral is dependent on the contour chosen. The residue on these poles are $\pm\frac{\sin(\sigma)}{2}$ so the depend on the contour chosen the value could be off by a multiple of $i\pi\sin(\sigma)$. Note that the difference of $\pi e^{i\sigma}$ and $\pi\cos\sigma$ is indeed $i\pi\sin(\sigma)$. If we further assume that we only choose a reasonable contour (so it won't do something like looping everywhere like a roller coaster), then the 4 likely choice are a contour that stay in upper half plane, a contour that stay in the lower half plane, the one that go from upper half to lower half through the gap between the 2 poles, and the one that go from lower half to upper half through that gap. Since the sum of 2 residues are 0, the 1st and 2nd choice give the same values, and 3rd and 4th give the same values, so there are 2 different values in total. I have not done the integral, but a geometric argument suggest that the 1st and 2nd choice will give $\pi\cos\sigma$ and the 3rd and 4th choice will give $\pi e^{i\sigma}$.
Of course, other contour are still possible and give different values, so in a sense, this is still sloppy, unless there are physical reasons to choose only those simplest contour.
EDIT:


*

*For the above integral, assuming $\sigma$ is real and is not a multiple of $2\pi$, then the above integral does not even converge on the real line. In other word, using contour is pretty much required.

*I have not learnt much about QFT, but I remember reading somewhere about renormalization, which is what you do when you could produce infinite result (such as in this case where integral along the real line diverge). One thing you could do is instead of substituting the measured mass of the particle into $m$, you substitute in a mass that allow the integral to be performed, under the idea that we never know the true mass of the particle, only the effective mass, so everything is fine as long as the effective mass remained correct.
