for 1st case:
the most efficient method would be ::
coefficient of x^9 in (x3+x5+x6).(x3+x4).(x+x2+x3+x4+⋯).
=x3(1+x2+x3) x3(1+x) x(1+x+x2+x3....)
=x7(1+x2+x3)(1+x)(1+x+x2+x3......)
coefficient of x^2 in (1+x2+x3)(1+x)(1+x+x2+x3......)
=(1+x2)(1+x)(1+x+x2) removing polynomial >=3.
= (1+x2) (1+x+x2+x+x2+x4)
=(1+x2) (1+2x+2x2) removing polynomial >=3
=(1+2x +2x2 +x2+2x3+2x4)
=(1+2x+3x2)
therefore coefficient of x2 = 3
means coefficient of x9 = 3.
for case 2:
(we dont need to solve that as (1+x+x2)3 will never have x9 as coefficient and it would be 0 as the maximum degree of polynomial would be X6 only).
and if we solve it :
we have (1+x+x^2)^3 = (1-x3)3 / (1-x) 3 = (1-x3)3 / (1--x) -3
= (1-x3)3 (n+r-1)C(n-1) Xr
= (1-x9-3x3(1-x3)) (2+r)C(2) Xr
= (1-x9-3x3-3x6) (2+r)C2 Xr
= 11C2 -2C0 -3*(8C2) + 3(5C2)
= 55-1- 28*3 +30
=0 answer.