I'm asked to check that the following line integral is zero:
$$\int_{C(0,r)} \frac {\log(1+z)}z dz=0$$
(where $C(0,r)$ is the circle of radius $r$ centered at $0$) and then to conclude that for every $r\in (0,1)$ the following integral is also $0$:
$$\int_0^{\pi}\log(1+r^2+2r\cos t)dt=0$$
I've managed to calculated the first integral expanding in Taylor series (we didn't do any residue yet in class) and I can imagine that it is connected in some way with the second, however I cannot find out exactly how.
Parametrizing the contour integral by setting $z = re^{it}$, $-\pi \le t \le \pi$, we write $$0 =\int_{C(0,r)} \frac{\log(1 + z)}{z}\, dz = \int_{-\pi}^\pi \frac{\log(1 + re^{it})}{re^{it}} ire^{it}\, dt = i \int_{-\pi}^\pi \log(1 + re^{it})\, dt$$ Taking imaginary parts, $0 = \int_{-\pi}^\pi \log|1 + re^{it}|\, dt$, or $$0 = \frac{1}{2}\int_{-\pi}^\pi \log|1 + re^{it}|^2\, dt$$ Expanding $|1 + re^{it}|^2$ and using symmetry, the result is obtained.