Find the power series of $f(x)=\frac{1}{x^2+x+1}$

Solution 1:

$$\frac1{x^2+x+1}=\frac{1-x}{1-x^3}=(1-x)\frac{1}{1-x^3}$$ when $x\ne 1$.

Solution 2:

The polynomial $x^2+x+1=\Phi_3(x)$ has no real roots, but it vanishes at $x=e^{\pm\frac{2\pi i}{3}}$.
In particular, by setting $\omega=\exp\left(\frac{2\pi i}{3}\right)$ and $\overline{\omega}=\omega^2=\exp\left(\frac{4\pi i}{3}\right)$, $$ \frac{1}{x^2+x+1} = \frac{1}{(x-\omega)(x-\omega^2)} = \frac{i\omega^2}{\sqrt{3}}\cdot\frac{1}{1-\omega^2 x}-\frac{i\omega}{\sqrt{3}}\cdot\frac{1}{1-\omega x} $$ where the RHS, expanded as the difference between two geometric series, equals $$ \frac{i}{\sqrt{3}}\sum_{n\geq 0}\left(\omega^{2n+2}-\omega^{n+1}\right)x^n =\frac{2}{\sqrt{3}}\sum_{n\geq 0}\sin\left(\frac{2\pi(n+1)}{3}\right)x^n$$ as wanted. That clearly simplifies, since $$ \frac{1}{1+x+x^2}=\frac{1-x}{1-x^3} = \sum_{m\geq 0}\left(x^{3m}-x^{3m+1}\right),$$ too, and the Taylor series at the origin is unique.