Number of ways to get $xy^2$ from $(x+y+5)^5$ I am trying to understand a proof of counting number of trees using the conclusion of Cayley's formula.
At the end they got a $(x+y+5)^5$ and they say that the number of ways to get $xy^2$ from this is $5 \cdot \binom{4}{2} \cdot 5^2 = 750 $ and I can't figure how. Can someone please explain?
thanks.
 A: The coefficient of $y^2$ in $$((x+5)+y)^5$$  is $$\binom52(x+5)^3$$
In how many we shall find $x$ in $(x+5)^3?$
A: The coefficient of $a^\alpha b^\beta c^\gamma$ in $(a+b+c)^n$ is:
$$\frac{n!}{\alpha!\beta!\gamma!}$$
where $\alpha+\beta+\gamma=n$.
We want $\alpha=1,\beta=2,\gamma=2$, which is $\dfrac{5!}{1!2!2!}=30$.
As $c=5$, we end with $5^2.30=750$.
A: $$(x+y+z)^n \to \dfrac{n!}{k_1!k_2!k_3!}x^{k_1}y^{k_2}z^{k_3} ,k_1+k_2+k_3=n\\$$
$$(x+y+5)^5 \to \dfrac{5!}{k_1!k_2!k_3!}x^{k_1}y^{k_2}5^{k_3} ,k_1+k_2+k_3=5\\ \to xy^2 \to ,1+2+k_3=5 \to k_3=2\\ \dfrac{5!}{1!2!2!}x^{1}y^{2}5^{2} \\25\dfrac{5!}{1!2!2!}x^{1}y^{2}=25\times 30 xy^2$$
A: Here is a more basic explanation.
You have $5$ terms being multiplied, each of which is $(x+y+5)$.
To get $xy^2$ from the product, you have to choose which term to take $x$ from, and which two terms to take $y$ from. The remaining terms will contribute $5\times 5=25$.
There are $5$ possibilities to choose the term providing $x$. Once this is fixed, the two terms providing $y$ can be chosen in $\binom42 = 6$ ways. Hence we have the $xy^2$ term appearing $5\times6=30$ times, each time with a coefficient of $25$. Hence the coefficient of $xy^2$ in the expansion is $30\times25=750$.
