<s>[INST] Any trick for evaluating $\left(\frac{\sqrt{3}}{2}\cos(\theta) + \frac{i}{2}\sin(\theta)\right)^7$? Expressions of the form $(a\cos(\theta) + bi\sin(\theta))^n$ come up from time to time in applications of complex analysis, but to my knowledge the De Moivre's formula can only be applied with $a = b$. Is there some trick to deal with the case of $a \neq b$, for example when the expression is $\left(\frac{\sqrt{3}}{2}\cos(\theta) + \frac{i}{2}\sin(\theta)\right)^7$?
 [/INST] Long Comment:
For your particular problem there is a small tiny tiny algebraic simplification as
$$T=\sin \left(\frac{\pi }{3}\right) \cos (\theta )-i \cos \left(\frac{\pi }{3}\right) \sin (\theta )=\frac{1}{2} \sqrt{3} \cos (\theta )-\frac{1}{2} i \sin (\theta )\tag1$$
or
$$T=\cos \left(\frac{\pi }{6}\right) \cos (\theta )-i \sin \left(\frac{\pi }{6}\right) \sin (\theta )=\frac{1}{2} \sqrt{3} \cos (\theta )-\frac{1}{2} i \sin (\theta )\tag2$$
Rewriting (1) as
$$S=\left( \sin \left(\omega\right) \cos (\theta )-i \cos \left(\omega\right) \sin (\theta )\right)^n \tag3$$
we can get to
$$S= \left(\frac{1}{2}+\frac{i}{2}\right)^n (\sin (\theta +\omega )+i \sin (\theta -\omega ))^n \tag4$$
and likewise for (2)
$$S=\left(\cos (\theta ) \cos \left(\frac{\omega }{2}\right)+i \sin (\theta ) \sin \left(\frac{\omega }{2}\right) \right)^n$$
we get
$$S= \left(\frac{1}{2}-\frac{i}{2}\right)^n \left(\cos \left(\theta +\frac{\omega }{2}\right)+i \cos \left(\theta -\frac{\omega }{2}\right)\right)^n$$
Using @Buraian 's methods we have the interesting general result for (3)
$$S=\left( \sin \left(\omega\right) \cos (\theta )-i \cos \left(\omega\right) \sin (\theta )\right)^n=\left(\frac{1}{2}+\frac{i}{2}\right)^n\left(1-\cos (2 \theta ) \cos (2 \omega )\right)^{n/2} e^{ \left(i \,n \tan ^{-1}(\sin (\theta +\omega ),\sin (\theta -\omega ))\right)}\tag5$$
where $\tan ^{-1}(x,y)=\tan ^{-1}(\frac{y}{x})$ gives the angle of the point $[x,y]$ and where $\sin ^2(\theta -\omega )+\sin ^2(\theta +\omega )$ simplifies to $1-\cos (2 \theta ) \cos (2 \omega )$.
</s>