<s>[INST] What's the solution to this binomial? what's the coefficient of $x^6$ in the expansion of $(1+X^2+X)^{-3}$?
I have factorized the term to $\left(\frac{1-x^{-3}}{1-x}\right)^3$
after this I'm having problem solving it
 [/INST] According to Wolfram alpha, the Taylor series of your function is
$$1-3 x+3 x^2+2 x^3-9 x^4+9 x^5+3 x^6-18 x^7+18 x^8+4 x^9-30 x^{10}+\dots.$$
You can calculate this by solving linear equations. For example, here is how to find the first three coefficients. Let the beginning of the Taylor expansion be $A + Bx + Cx^2 + \dots$. Multiplying this by $(1+x+x^2)^3 = 1 + 3x + 6x^2 + \cdots$, we get
$$
A + (3A + B)x + (6A + 3B + C)x^2 + \dots.
$$
Since the result should be $1$, we get the system of equations
$$
A = 1 \\
3A + B = 0 \\
6A + 3B + C = 0
$$
This is a triangular system of equations, and so not difficult to solve. The first equation gives $A = 1$, the second $B = -3$, and the third $C = 3$. This matches what Wolfram alpha gave us above. In this way you can find all coefficients of the Taylor series.
</s>