<s>[INST] Advanced Complex numbers Let $\omega$ be a nonreal root of $z^3 = 1.$ Let $a_1,$ $a_2,$ $\dots,$ $a_n$ be real numbers such that
$$\frac{1}{a_1 + \omega} + \frac{1}{a_2 + \omega} + \dots + \frac{1}{a_n + \omega} = 2 + 5i.$$Compute
$$\frac{2a_1 - 1}{a_1^2 - a_1 + 1} + \frac{2a_2 - 1}{a_2^2 - a_2 + 1} + \dots + \frac{2a_n - 1}{a_n^2 - a_n + 1}.$$
I have no clue how to do this. Can someone help?
 [/INST] Rationalize the denominator for each term of the left hand side & the right hand side
For integer $n$ not divisible by$3$
Let $p=\dfrac{2n\pi}3,2\cos p=-1\  \  \ \ (1)$
$$\dfrac1{a_j+w}=\dfrac1{a_j+\cos p+i\sin p}=\dfrac{(a_j+\cos p)-i\sin p}{a_j^2+2a_j\cos p+1}$$
Use $(1)$
Equate the real parts
</s>