Substitute $u=\exp\left(\mathrm{i}t\right)$ in an integral where $t\in\left[-\pi,+\pi\right]$ Consider the following integral.
$$\int_{-\pi}^{\pi}f\left(\exp\left(\mathrm{i}xt\right)\right)\mathrm{d}t$$
Where
$$u=\exp\left(\mathrm{i}t\right),t=\frac{1}{\mathrm{i}}\ln u,\mathrm{d}t=\frac{1}{\mathrm{i}u}\mathrm{d}u$$
makes the integrand
$$\frac{f\left(u^{x}\right)}{\mathrm{i}u}$$
How should we get the new range of integration given $t\in\left[-\pi,+\pi\right]$, and $u=\exp\left(\mathrm{i}t\right),
t=\frac{1}{\mathrm{i}}\ln u$?
TL;DR: How to use u-substitution on an integral using $u=\exp\left(\mathrm{i}t\right)$ where $t\in\left[-\pi,+\pi\right]$?
 A: $
\newcommand{\sint}[1]{ \int \limits_{#1}  }
\newcommand{\soint}[1]{\oint \limits_{#1}  }
\newcommand{\dd}{\mathrm{d}}
$
Naively, the new range of integration will be $u$ (recall, $u$ is a function of $t$, so $u$ is a shorthand for $u(t)$) evaluated at the old bounds. Thus,
$$u(-\pi) = e^{-i \pi} = -1 \qquad u(\pi) = e^{i \pi} = -1$$
But then the integral is obviously zero, but that couldn't be right. The question is -- what went wrong?
The problem is that since we're now working with complex numbers, we need to work with a contour, not just the bounds of integration. So what your original integral is, in the complex analytic sense, over the contour $[-\pi,\pi]$. Then the transformation $u$ provides turns $[-\pi,\pi]$ into a circle. In other words, you get the contour $C$ parameterized by $u(t) = e^{i t}$ for $t \in [-\pi,\pi]$. So, now you have to integrate over the unit circle in the complex plane. We can't naively just focus on the bounds anymore.
(Also, another thing of note: bear in mind that this parameterization ensures we only go around the loop once. This is important in the use of some calculations and techniques.)
Intuitively, you can think of this like your substitution mapping every point of the original interval elsewhere, and then you're integrating over that. Try to think of it in the familiar, one-dimensional case you think of from calculus - your $u$ substitution "stretches" and "squishes" the interval and the function, not just the endpoints. So in a sense, this extends very naturally to how things work in multiple dimensions, and in particular is why we actually are integrating over a circle here. The entire path matters, not just the bounds of integration.
That is, then,
$$\sint{[-\pi,\pi]} f(e^{ixt}) \, \dd t = \frac 1 i \soint{|z|=1} \frac{f(z^x)}{z} \, \dd z$$
Integrals of this form can be handled through techniques such as Cauchy's integral theorem, Cauchy's integral formula, or, the method encompassing both of these and more, the residue theorem. Though I think it ultimately depends on the function $f$ we're working with.
