<s>[INST] If $ \alpha_i, i=0,1,2...n-1 $ be the nth roots of unity, the $\sum_{i=0}^{n-1} \frac{\alpha_i}{3- \alpha_i}$ is equal to? If $ \alpha_i,  i=0,1,2...n-1 $ be the nth roots of unity, the $\sum_{i=0}^{n-1} \frac{\alpha_i}{3- \alpha_i}$ is equal to?
A) $ \frac{n}{3^n-1} $
B) $ \frac{n-1}{3^n-1} $
C) $ \frac{n+1}{3^n-1} $
D) $ \frac{n+2}{3^n-1} $
Attempt: I know that $(3- \alpha_0)(3- \alpha_1)....(3-\alpha_{n-1})= (3^n-1)/2 $
But I have no clue about the numerator. Adding 3 and subracting 3 from the numberator would make the fraction simpler, but I would still have to sum up $ 1/(3- \alpha_i) $
 [/INST] (For future reference.) Introducing
$$f(z) = \frac{z}{3-z} \frac{nz^{n-1}}{z^n-1}$$
we get
$$S_n = \sum_{q=0}^{n-1} 
\frac{\exp(2\pi i q/n)}{3-\exp(2\pi i q/n)}
= \sum_{q=0}^{n-1} \mathrm{Res}_{z=\exp(2\pi i q/n)} f(z).$$
Residues sum to zero so we have
$$S_n + \mathrm{Res}_{z=3} f(z) +
\mathrm{Res}_{z=\infty} f(z) = 0$$
Observe that
$$\mathrm{Res}_{z=3} f(z) =
- \frac{n3^n}{3^n-1}$$
and
$$\mathrm{Res}_{z=\infty} f(z) =
-\mathrm{Res}_{z=0} \frac{1}{z^2} f(1/z) 
\\ = -\mathrm{Res}_{z=0} 
\frac{1}{z^2} \frac{1/z}{3-1/z} \frac{n/z^{n-1}}{1/z^n-1}
\\ = -\mathrm{Res}_{z=0} 
\frac{1}{z^2} \frac{1}{3z-1} \frac{nz}{1-z^n}
\\ = -\mathrm{Res}_{z=0} 
\frac{1}{z} \frac{1}{3z-1} \frac{n}{1-z^n}
= n.$$
Hence
$$S_n - \frac{n3^n}{3^n-1} + n = 0$$
or
$$S_n = \frac{n3^n-n(3^n-1)}{3^n-1} 
= \frac{n}{3^n-1}.$$
</s>