Degree of a map $f:S^1 \to S^1$ given a polynomial $p$ I'm preparing for some comprehensive exams and this is a question from a previous year that I think I'm close to solving but some details may need to be filled in. Any help would be great.
"Let $p:\mathbb{C} \to \mathbb{C}$ be a polynomial with simple roots, none of which lie on the unit circle $S^1$. Show that the number of roots inside the unit disk $D$ is the degree of the map $f:S^1 \to S^1$ defined by $f(e^{i \theta}) = \frac{p(e^{i \theta})}{|p(e^{i \theta})|}$."
First, let $p, q$ be two polynomials satisfying the above. If $f_p (e^{i \theta}) = \frac{p(e^{i \theta})}{|p(e^{i \theta})|}$ and $f_q(e^{i \theta}) = \frac{q(e^{i \theta})}{|q(e^{i \theta})|}$, observe that $f_{pq}$ defined as just taking the polynomial $pq = p(z)q(z)$ (multiplication, not composition) and churning out a function $f$ as we have been doing, then $f_{pq} = f_p \cdot f_q$ (it is multiplicative).
Then, 
$$\frac{f'_{pq}}{f_{pq}} = \frac{d}{d \theta}(\log f_{pq}) = \frac{d}{d \theta}(\log f_{p}) + \frac{d}{d \theta}(\log f_{q}) =\frac{f'_p}{f_p}+\frac{f'_q}{f_q}.$$
Now, these $f$ functions are maps from $S^1 \to S^1$ so they're loops in $S^1$; thus, $[f] \in \pi_1(S^1) = \mathbb{Z}$. So we can consider degree of these $f$ by considering their winding numbers.
The winding number of $f$ can be given as an integral:
$$\deg  f = \int^{2 \pi}_0 \frac{f'}{f} \, d \theta = \text{winding number of $f$ around 0.}$$
From the above, we have then that $\deg f_{pq} = \deg f_p + \deg f_q$.
So now just consider one polynomial $p(z) = \prod^n (z-a_i)$. Setting $p_i = z-a_i$, we have that $\deg f = \sum^n \deg f_{p_i}$. We want to show that if $a_i \notin D$, then $\deg f_{p_i} = 0$.
WLOG, we can suppose that $a_i \in \mathbb{R}^+$ (just rotate the picture). Draw a vector from $0$ to $z \in S^1$ and a vector from $0$ to $a_i$. Then the vector $z-a_i$ makes an obtuse angle with the real axis; this means that $z-a_i$ lies somewhere in the left half plane and when normalized, is on the left semicircle. Thus, $f_{p_i}$ is not surjective as everything on the right semicircle is missed. So $\deg f_{p_i} = 0$.
On the other hand, if $a_i \in D$, then we can use similar simple geometry as above to show that for each point on $S^1$, there is a unique point mapping to it. Just choose your point $w \in S^1$ and draw its vector. Then translate that vector to $a_i$ and extend it till it hits $S^1$. Where it intersects $S^1$ is the point $z$ which maps to $w$. Thus, $f_{p_i}$ in this case is bijective and hence, the winding number must be $1 = \deg f_{p_i}$ (all other positive degrees = other positive winding numbers imply a non-injective map $f$). 
Therefore, if there are $k$ roots of $p$ inside $D$, $\deg f = k$.
Issues that I would like help resolving:


*

*$\log$ isn't well-defined though I think this isn't a problem when we consider its derivative.

*The last part about $f_{p_i}$ being bijective when $a_i \in D$ doesn't seem airtight to me and could be wrong. However, when picturing the map, I think I can visualize a clear homotopy between $f$ and $g(z)=z$.

*I'm not really familiar with this definition for degree on $S^1$; I was told that it's equivalent and the bit about $[f] \in \pi_1(S^1)$ convinces me that it's true but I couldn't justify it that rigorously from the definition about regular values or differential forms.

 A: I realize there's a simpler way. We define a homotopy between $f$ and $z^k$ where $k$ is the number of zeros inside the unit disk $D$. Let's write our polynomial as $p(z) = \alpha(z-a_1)...(z-a_k)(z-b_1)...(z-b_l)$. The $a_i$'s are roots inside the unit disk and the $b_n$'s are outside. $\alpha$ is just a constant. Our homotopy is
$$H:S^1 \times I \to S^1; \, H(z,t) = \frac{\alpha(z-ta_1)...(z-ta_k)(tz-b_1)...(tz-b_l)}{|\alpha(z-ta_1)...(z-ta_k)(tz-b_1)...(tz-b_l)|}$$
Note that $H(z,0) = Cz^k$ where $C$ is just some constant; we don't need to worry about the norm on the bottom because it comes out to be some constant times $|z| = 1$ as we're on $S^1$. $H(z,1) = f = p(z)/|p(z)|$. This is continuous as the bottom is never $0$.
Note that if we had swapped the location of the $t$'s in the homotopy; e.g. $(tz-a_1)....(z-tb_1)$, then since $a_1 \in D$, there would be a pair $t \in [0,1], z \in S^1$ where $tz = a_1$. This is because we can just choose $z$ to have the same angle as $a_1$ and then scale down using $t$. Then there would be division by $0$.
Lastly, we can homotope $Cz^k$ to $z^k$ via $F(z,t) = Cz^k + (1-C)tz^k$ (not that it really matters). The degree of $z^k$ is easily computed to be $k$ using the integral definition I gave in the question. Since degree of a map is homotopy invariant, we're done.
I still like the approach I gave above however. I think it highlights some connections between topology and analysis.
