Consider the integral $\int_C \frac{1}{z} dz$ where $C:z(t)=\sin(t)+i\cos(t)$ on the interval $ 0 \leq t \leq 2\pi$.
I applied the definition of a line integral and got:
$ \int_0^{2\pi} \frac{1}{\sin(t)+i\cos(t)}(\cos(t)-i\sin(t))dt $
However, I got two different answers when doing this in two different ways:
If I do the substitution $ u=\sin(t)+i\cos(t) $ and $ du = cos(t)-i\sin(t) $, I get: $ \int \frac{1}{u} du = \ln(\sin(t)+i\cos(t))+C $ Plugging in the limits of integration yields $ \ln(i) - \ln(i) = 0 $ which is incorrect.
Doing the integral by either using the Cauchy integral formula or by simplifying the integrand to $ -i $ yields the correct answer of $ -2\pi i $.
Where does this inconsistency come from?