Expand function into power series of X F (x) = 1 / 1 + X + x ^ 2, it's better to write the steps

Expand function into power series of X F (x) = 1 / 1 + X + x ^ 2, it's better to write the steps

f(x)=(1-x)/(1-x)(1+x+x^2)
(1-x)*[x^3+x^6+...+x^3n+...)]