Let $\displaystyle (1+x+x^2)^n = \sum_{i=0}^{2n} a_i x^i$. Then prove that $\displaystyle (r+1) \cdot a_{r+1} = (n-r) \cdot a_{r} + (2n+1-r) \cdot a_{r-1}$
What I try : $\displaystyle (1+x+x^2)^n=\sum^{2n}_{i=0}a_ix^i$
Now Differentiate both side w r to $x$, we get
$\displaystyle n(1+x+x^2)^{n-1}\cdot (1+2x)=\sum^{2n}_{i=0} (i) \cdot a_{i}x^{i-1}$
$\displaystyle n(1+2x)(1+x+x^2)^{n}=\sum^{2n}_{i=0}; a_{i}x^{i-1}\cdot i$
Now i did not understand How can i equate Coefficient of $x^{r-1},x^{r},x^{r+1}$, please Help me , Thanks