Prove that the number of combinations of $n$ objects out of $3n$ objects in which $n$ are of one kind, $n$ of the other kind and rest $n$ are distinct is $(n+2)2^{n-1}$
My generatingfunctionological approach was as follows: I take three gen. funcs. for each of the three types of objects and multiply them, which gives: $$(1+x^2+\ldots+x^n)^3 \Rightarrow ( \frac {1-x^{n+1}} {1-x})^3 \Rightarrow (1-x^{3n+3}-3x^{n+1}+3x^{2n+2}) {{r+3-1} \choose r}x^r$$
Now, removing $x's$ with powers greater than $n$, I get a solution as the coefficient of $x^n$: $${n+2} \choose 2$$ But this is certainly incorrect. Please help me in rectifying my error.