I have seen examples of complex contour integrals whose value depends on the choice of the contour of integration and some integrals where the value does not depend on the choice of the contour. Is there any indication by which we can know whether the choice of contour matters?
Just to give an example, the value of the improper integral $I_1=\int_{-\infty}^{\infty}\frac{\sin x}{x}$ does not depend on the choice of the contour but $I_2=\int_{-\infty}^{\infty}\frac{e^{-ix}}{x^2-4}$ does! When we try to evaluate these improper integrals by converting them to complex contour integrals and then using Cauchy's residue theorem, $I_1$ is found to be independent of the choice of contour while $I_2$ is not.