Wolfram-Alpha's choice of $k$ in a complex logarithm I'm puzzling on this complex integral:
$$ \int \frac{2ie^{it}}{2e^{it} - 1}dt = \log(2e^{it} -1)$$
The numerator is the derivative of the divisor, so the primitive is the log of the divisor.
When you ask Wolfram-Alpha to compute the integral over the range $0..2\pi$:
$$\left. \log(2e^{it} -1) \right|_0^{2\pi}$$
The answer is $2i\pi$.  And that's probably a valid answer:
$$\log(2e^{i2\pi}-1) - \log(2e^{i0}-1) = \ln(1) - \ln(1) + 2k\pi i = ..., -2\pi i, 0, 2\pi i, ... $$
Still in this case, the canonical answer should be the one where $k=0$. When you ask Wolfram-Alpha for $log(1)$, it returns $0$, and not $2\pi i$.
Why does Wolfram-Alpha return $2 \pi i$ and not $0$ for the integral?

Wolfram's answer is correct, and the only correct answer here. If you consider the integral as a function of the upper bound,
$$I(x) = \int_0^x \frac{2ie^{it}}{2e^{it}-1}\,dt,$$
you have a continuous function of $x$, and indeed we have
$$I(x) = \log (2e^{ix} - 1)$$
for some value of the logarithm, but that value depends continuously on $x$. When $x$ increases from $0$ to $2\pi$, the curve described by $2e^{it}-1$ winds once around the origin, so the imaginary part of the logarithm increases from $0$ to $2\pi i$, and $I(2\pi) = 2\pi i$.
