I'm struggling with the following task:
Find all possible values of the complex integral $\int_0^1 \frac{dz}{z^2 + 1}$ if we are integrating it along all possible curves from $0$ to $1$.
The official answer is $\frac{\pi}{4} + k\pi, k \in \mathbb{Z}$. I understand that if we integrate it along the line from $0$ to $1$, we get the answer $\frac{\pi}{4}$, but I don't understand how do we get all other possible values of the integral, so help would be much appreciated.
To enlighten the solution, let me first state the residue formula:
Although the proof of the general statement requires some work, this hints how we may proceed in OP's case, assuming we know that winding numbers are always integers.
Indeed, let $\gamma$ be any contour from $0$ to $1$ that does not pass through $\pm i$. Also, let $\tilde{\gamma} = \gamma \cup [1, 0]$ denote the contour obtained by by appending the line segment from $1$ to $0$ to $\gamma$. Then
\begin{align*} \int_{\gamma} \frac{\mathrm{d}z}{z^2+1} &= \int_{\tilde{\gamma}}\frac{\mathrm{d}z}{z^2+1} + \int_{[0,1]}\frac{\mathrm{d}z}{z^2+1} \\ &= \frac{1}{2i} \int_{\tilde{\gamma}}\frac{\mathrm{d}z}{z - i} - \frac{1}{2i} \int_{\tilde{\gamma}}\frac{\mathrm{d}z}{z + i} + \frac{\pi}{4} \tag{by partial fractions} \\ &= \pi \operatorname{Ind}_{\tilde{\gamma}}(i) - \pi \operatorname{Ind}_{\tilde{\gamma}}(-i) + \frac{\pi}{4}. \end{align*}
Since $\operatorname{Ind}_{\tilde{\gamma}}(i)$ and $\operatorname{Ind}_{\tilde{\gamma}}(-i)$ can assume any integer values, it follows that $\int_{\gamma} \frac{\mathrm{d}z}{z^2+1}$ can assume any values of the form $ k\pi + \frac{\pi}{4}$ for any $k \in \mathbb{Z}$.