Multinomial Expansion Question: when variables appear more than once Find the coefficient of $x^{12}y^{24}$ in $(x^3 + 2xy^2 +y + 3)^{18}$.
I have been working on this problem for a while now and I cannot figure out how to use the multinomial theorem to solve it. I tried using auxiliary variables but then I did not know what the total exponent should be. I am really stuck on this.
 A: Break it into cases based on how the $x^{12}$ was formed from some combination of $x^3$ and $2xy^2$.  In each case, you must also check that it is possible that $y$ could be raised to the 24th power using the remaining available options.
Case 1: $(x^3)^4$: You might have had an $x^{12}y^{24}$ term because of $(x^3)^4\cdot (2xy^2)^0\cdot(y)^{24}\cdot 3^n$, but we're only raising to the 18th power, so that can't happen.  
Case 2: $(x^3)^3$:  It could have been $(x^3)^3\cdot(2xy^2)^3\cdot (y)^{18}\cdot 3^n$.  Also not possible, not large enough power available.
Case 3: $(x^3)^2$:  In this case it might have been $(x^3)^2\cdot (2xy^2)^6\cdot y^{12}\cdot3^n$, again not possible.  It would again require too large of a power of the original function (at least being raised to 20th power)
Case 4: $(x^3)^1$: This would imply it would be $(x^3)^1\cdot (2xy^2)^9\cdot (y)^6\cdot(3)^2$  This is infact possible.
Case 5: $(x^3)^0$:  This would imply that it would be $(x^3)^0\cdot (2xy^2)^{12}\cdot (y)^0\cdot (3)^6$  This also is possible.
Now you know that it could have been formed one of two ways.  Reimagining the problem instead as $(a+b+c+d)^{18}$, the question is then what are the coefficients of the $ab^9c^6d^2$ and $b^{12}d^6$ terms.
The coefficient of the $ab^9c^6d^2$ term is $\dfrac{18!}{1!9!6!2!}$ and the coefficient of the $b^{12}d^6$ term is $\dfrac{18!}{12!6!}$
So, we have $\dfrac{18!}{1!9!6!2!}(x^3)^1\cdot (2xy^2)^9\cdot (y)^6\cdot(3)^2 + \dfrac{18!}{12!6!}(2xy^2)^{12}\cdot (3)^6 = Cx^{12}y^{24}$
So, $C = \dfrac{18!}{9!6!2!}\cdot 2^9\cdot3^2 + \dfrac{18!}{12!6!}\cdot 2^{12}\cdot 3^6$
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
$\ds{\tt\mbox{It's a straightforward evaluation !!!.}}$

Find the coefficient of
  $\ds{x^{12}y^{24}\ \mbox{in}\ \pars{x^{3} + 2xy^{2} + y + 3}^{18}:\ {\large ?}}$

\begin{align}&\dsc{\pars{x^{3} + 2xy^{2} + y + 3}^{18}}
=\sum_{\atop{a, b, c, d\ \geq\ 0 \atop\vphantom{\LARGE A} a + b + c + d\ =\ 18}}{18! \over a!\, b!\, c!\, d!}
\pars{x^{3}}^{a}\pars{2xy^{2}}^{b}y^{c}3^{d}
\\[5mm]&=18!\sum_{\atop{a, b, c, d\ \geq\ 0 \atop\vphantom{\LARGE A} a + b + c + d\ =\ 18}}{2^{b}3^{d} \over a!\, b!\, c!\, d!}\,x^{3a + b}y^{2b + c}\,,\qquad
a, b, c, d \in {\mathbb N}
\end{align}

Now, we have three equations which let us to express $\ds{a,b\ \mbox{and}\ c}$
  in terms of $\ds{d}$:
  $$
\left.\begin{array}{rcrcrcl}
a & + & b & + & c & = & 18 - d
\\
3a & + & b &&& = & 12
\\
&& 2b & + & c& = & 24
\end{array}\right\}\
\imp\
\left\{\begin{array}{lcl}
a & = & {1 \over 4}\,\pars{6 - d}
\\[2mm]
b & = & {3 \over 4}\,\pars{10 + d}
\\[2mm]
c & = & {3 \over 2}\,\pars{6 - d}
\end{array}\right.
$$
  From those identities we conclude that $\ds{d = 2}$ or $\ds{d = 6}$.Namely,
  $$
\pars{a = 1\,,\quad b = 9\,,\quad c = 6\,,\quad d = \dsc{\large 2}}\ \mbox{and}\
\pars{a = 0\,,\quad b = 12\,,\quad c = 0\,,\quad d = \dsc{\large 6}}
$$

The coefficient of
$\ds{x^{12}y^{24}\ \mbox{in}\ \pars{x^{3} + 2xy^{2} + y + 3}^{18}}$ becomes:
$$
18!\pars{{2^{9}\ 3^2 \over 1!\, 9!\, 6!\, 2!}
+{2^{12}\ 3^6 \over 0!\, 12!\, 0!\, 6!}}
=\color{#66f}{\large 111\ 890\ 128\ 896}
$$
