Ok, so suppose, I roll a seven sided die (has an extra side of 0) three times to find how many ways I get a sum of nine, I need take coefficent of $ x^9$ in this,
$$ S=(1+x+x^2 + x^3 + x^4 + x^5 + x^6)^3$$
Now, a way which a friend told we could do it is
$$ S= ( \frac{1-x^7}{1-x})^3$$
$$ S= (1-x^7)^3 (1-x)^{-3} = (1-x^7)^3 ( 1 +3x +6 x^2...stuff) $$
So, the coefficent of $x^9$ in this is the ways to get the sum of nine.. And this fact completely baffled me. Because, if we compute S by cubing the original equation, we get a finite polynomial. However, if we do it in this way, get an infinite polynomial and for some reason the coefficent of $x^9$ is same in each?? Like what is the intuition for this to work? I think that the two polynomials we get from g.p simplification and direct cubing are different.