The coefficient of $x^2$ in the expansion of $\left(x^3+2x^2+x+4\right)^{15}$ To find the coefficient of $x^2$ in the expansion of $\left(x^3+2x^2+x+4\right)^{15}$.
I saw a solution to this problem in which the above expression was differentiated 2 times and they put x=0. I really can't understand the significance behind these steps.
 A: We know that, whatever the expansion of $\left(x^3 + 2x^2 + x +4 \right)^{15}$ is, it will look something like
$$
\left(x^3 + 2x^2 + x +4 \right)^{15} = c_0 + c_1 x + c_2 x^2 +c_3x^3+ ... + c_{45} x^{45}
$$
where $c_i$'s are some constants possibly equal to $0$. Now, in the above equation what you want to know is the value of $c_2$. So now what happens if we differentiate the above equation twice? We get
\begin{align*}
\frac{d^2}{dx^2}\left(x^3 + 2x^2 + x +4 \right)^{15} & = \frac{d^2}{dx^2}\left(c_0 + c_1 x + c_2 x^2 + c_3 x^3 + ... + c_{45} x^{45}\right)\\
& = \frac{d}{dx}\left(c_1  + 2c_2 x + 3c_3 x^2 + ... + 45c_{45} x^{44}\right)\\
& =  2c_2  + (3\cdot 2c_3) x + ... + (45 \cdot 44c_{45}) x^{43}
\end{align*}
Plugging in $x=0$ in the R.H.S. of the above makes all the terms after $2c_2$ go to $0$, so we get
$$
\frac{d^2}{dx^2}\left(x^3 + 2x^2 + x +4 \right)^{15} \Bigg\vert_{x=0} = 2 c_2
$$
from where, by using the chain rule on the L.H.S., it's easy to solve for $c_2$.
A: Let $f(x)=(x^3+2x^2+x+4)^{15}=\sum_{k=0}^{45}a_kx^k$. Now $f''(x)=\sum_{k=2}^{45}k(k-1)a_kx^{k-2}$ and on plugging zero we get $f''(0)=2(2-1)a_2$.
An alternative is to note that to get a term with $x^2$, we either select the $2x^2$ term from any one of the $15$ factors and the constant term from the remaining factors, or the $x$ term from any two of the $15$ factors and constants from the rest. The required coefficient thus should be$$\binom{15}14^{14}2+\binom{15}24^{13}$$
