We wish to define the $\arctan(z)$ to be:
$$\arctan(z) := \int_{\gamma_z} \frac{1}{1+w^2}dw$$ Where $\gamma_z$ is a curve connecting $0$ and $z$
I am asked to:
(a) find an open set $U \subset \mathbb C$ for which the integral is well-defined for all $z\in U$, thus the integral does not depend on the chosen curve connecting $0$ and $z$.
Observe $\frac{1}{1+w^2}= \frac{1}{(w-i)(w+i)}$
As a hint the question gives: Consider $S= (- i \infty , -i] \cup [i, + \infty i)$. Clearly this set is not open and the begin and endpoints $-i$ and $i$ give a problem, since then the quotient is not defined (singularities). But I don't see how to provide an argument why in $ \mathbb C \setminus S$ it does not matter which path we take. This set is open because it is the the complement of a closed set.
(b) find an explicit formula for arctan in terms of $g(z)$ where: $$g(z)= \int_{\Gamma_z} \frac{1}{z}dz$$ where $\Gamma_z$ is any curve connecting $1$ to $z \in \mathbb C \setminus (-\infty , 0]$
What kind of tricks can I use here? I don't see a direction to move forward in. Earlier we had to show that this function $g(z)$ coincides with the principal value logarithm, maybe I can use this somehow....
(a) You got to consider branch cuts. $$\int_{\gamma_z} \frac{1}{1+w^2}dw=2\pi i(n+m),$$ where $n,m$ are winding number of $\gamma_z$ around $i$ and $-i$, resp.. Every time you go around $i$ or $-i$, you are changing the integral by $2\pi i$. The point is to avoid such "going around". In order to prevent spinning around those singularities, it is necessary to remove two curves that connect those singularities to $\infty$.
$S= (- i \infty , -i] \cup [i, + \infty i)$ is a good example for this. So $U=\mathbb C- S$ is the open set you want. However, there are other possible $U$ as well. e.g. $U=\mathbb C-[-i,i]\cup[0,+\infty]$.
(b) $$ \frac{1}{1+w^2}=\frac{(1/2)i}{w+i}+\frac{-(1/2)i}{w-i}. $$ Using this result, $$ \arctan w=\int_{\gamma_z}\frac{(1/2)idw}{w+i} + \int_{\gamma_z}\frac{-(1/2)idw}{w-i}\\ =\frac{i}{2}(g(w+i)-g(i))-\frac{i}{2}(g(w-i)-g(-i)). $$