For context, I wish to evaluate the below contour integral
$$\int_\Gamma \frac1z dz$$
where $\Gamma$ is a circle of radius $1$ centered at distance $x$ away from origin on positive x-axis. In particular, I want to show that
$$\int_\Gamma \frac1z dz=\int_{\Gamma_0} \frac1z dz=2\pi i$$
when $0\le x < 1$. Here, $\Gamma_0$ is the unit circle. So, I am trying to explicitly evaluate the integral to show that
$$\int_0^{2\pi}\frac{1}{e^{it}+x}ie^{it}dt=\begin{cases}2\pi i & \text{if $0\le x<1$} \\ 0 & \text{if $x\ge 1$} \end{cases}$$
I started with substitution $u=e^{it}+x$ to get $dt=-ie^{-it}du$ which results in
$$\int_{\frac32}^{\frac32}du=1-1=0$$
I am not sure where I did wrong.
If you want a real-analytic approach, you may invoke the geometric series formula
$$ \frac{1}{1-r} = \sum_{n=0}^{\infty} r^n $$
which converges uniformly on any compact subset of the unit disk $\mathbb{D} = \{z\in\mathbb{C}:|z|<1\}$.
Case 1. If $|x|<1$, then
\begin{align*} \int_{0}^{2\pi} \frac{ie^{it}}{e^{it} + x} \, \mathrm{d}t &= \int_{0}^{2\pi} \frac{i}{1 + xe^{-it}} \, \mathrm{d}t \\ &= \int_{0}^{2\pi} i \sum_{n=0}^{\infty} (-xe^{-it})^n \, \mathrm{d}t \\ &= i \sum_{n=0}^{\infty} (-x)^n \int_{0}^{2\pi} e^{-int}\, \mathrm{d}t \\ &= i \sum_{n=0}^{\infty} (-x)^n \cdot 2\pi \mathbf{1}_{\{n = 0\}} \\ &= 2\pi i. \end{align*}
Case 2. If $|x|>1$, then
\begin{align*} \int_{0}^{2\pi} \frac{ie^{it}}{e^{it} + x} \, \mathrm{d}t &= \int_{0}^{2\pi} \frac{ix^{-1}e^{it}}{1 + x^{-1}e^{it}} \, \mathrm{d}t \\ &= \int_{0}^{2\pi} i \sum_{n=0}^{\infty} (-1)^n (x^{-1}e^{it})^{n+1} \, \mathrm{d}t \\ &= i \sum_{n=0}^{\infty} \frac{(-1)^n}{x^{n+1}} \int_{0}^{2\pi} e^{i(n+1)t} \, \mathrm{d}t \\ &= 0. \end{align*}