# Find the coefficient of $x^6$ in $(2+2x+2x^2+2x^3+2x^4+x^5)^5$

Find the coefficient of $$x^6$$ in $$(2+2x+2x^2+2x^3+2x^4+x^5)^5$$

I did this with a change of variables:

• $$a = 2$$
• $$b = 2x$$
• $$c = 2x^2$$
• $$d = 2x^3$$
• $$e = 2x^4$$
• $$f = x^5$$

And then I found out the ways I could get $$x^6$$ in the expansion of $$(a+b+c+d+e+f)^5$$

1. $$a^3bf \to \frac{5!}{3!}=20$$
2. $$a^2c^3 \to \frac{5!}{2!3!}=10$$
3. $$a^3d^2 \to \frac{5!}{2!3!}=10$$
4. $$a^3ce \to \frac{5!}{3!}=20$$
5. $$a^2bcd \to \frac{5!}{2!}=60$$
6. $$a^2b^2e \to \frac{5!}{2!2!}=30$$

Undoing the change of variables:

1. $$(2)^3(2x)(x^5)=16x^5=16(20)=320$$
2. $$(2)^2(2x^2)^3=4(8)x^5=32(10)=320$$
3. $$(2)^3(2x^3)^2 = 8(4)x^5 = 32(10) = 320$$
4. $$(2)^3(2x^2)(2x^4) = 32(20) = 640$$
5. $$(2)^2(2x)(2x^2)(2x^3) = 32(60)= 1920$$
6. $$(2)^2(2x)^2(2x^4) = 32(30) = 960$$

So the coefficient of $$x^6$$ would be $$320+320+320+640+1920+960=4480$$, but the correct answer is $$6240$$. Is there an easier way to do this problem?

• Hint: convert this problem into a stars and bars problem, it'll become much easier. – Don Thousand Aug 11 at 19:59
• @DonThousand didn't think about that! Could you please explain more? – Moria Aug 11 at 20:00
• From each term of the multiplication, you only can pick one of the $2,2x,2x^2,...,x^5$ to multiply into your overall term. Think about the powers of these terms, and it becomes a stars and bars problem, with a few modifications to handle the coefficients. – Don Thousand Aug 11 at 20:02

Inside your list, you are missing

1. $$ab^3d \to \frac{5!}{3!}=20$$
2. $$ab^2c^2 \to \frac{5!}{2!2!}=30$$
3. $$b^4c \to \frac{5!}{4!}=5$$

which after the change of variables gives you

1. $$(2)(2x)^3(2x^3)=32(20)=640$$
2. $$(2)(2x)^2(2x^2)^2=32(30)= 960$$
3. $$(2x)^4(2x^2)=32(5)=160$$

and therefore $$4480+640+960+160=6240$$.

The special form of the polynomial makes it possible to use simple facts about the geometric series $${1\over1-x}=1+x+x^2+x^3+\cdots$$ and its derivatives. We can also ignore any powers of $$x$$ greater than $$6$$, which we'll indicate here with congruence mod $$x^7$$ notation.

To begin, we have

\begin{align} 2+2x+2x^2+2x^3+2x^4+x^5 &=2(1+x+x^2+x^3+x^4+x^5)-x^5\\ &={2(1-x^6)\over1-x}-{x^5(1-x)\over1-x}\\ &={2-x^5(1+x)\over1-x} \end{align}

so

\begin{align} (2+2x+2x^2+2x^3+2x^4+x^5)^5 &\equiv\left(2-x^5(1+x)\over1-x \right)^5\\ &\equiv{2^5-5\cdot2^4x^5(1+x)\over(1-x)^5}\\ &\equiv{32-80x^5-80x^6\over(1-x)^5}\mod x^7 \end{align}

Now

\begin{align} {1\over(1-x)^5} &={1\over24}\left(1\over1-x \right)''''\\ &={1\over24}(1+x+x^2+x^3+\cdots)''''\\ &={1\over24}(x^4+x^5+x^6+x^7+\cdots)''''\quad\text{(since }(1+x+x^2+x^3)''''=0)\\ &={1\over24}(4\cdot3\cdot2\cdot1+5\cdot4\cdot3\cdot2x+6\cdot5\cdot4\cdot3x^2+7\cdot6\cdot5\cdot4x^3+\cdots)\\ &=1+5x+15x^2+35x^3+70x^4+126x^5+210x^6+\cdots \end{align}

so the coefficient of $$x^6$$ in $$(2+2x+2x^2+2x^3+2x^4+x^5)^5$$ is

$$32\cdot210-80\cdot5-80\cdot1=6240$$

Hint

$$\left(\sum_{i=1}^{n} x_i\right)^m=\sum_{i_1,\cdots i_n\\i_1+\cdots+ i_n=m}{m!\over i_1!\cdots i_n!}x_1^{i_1}\cdots x_n^{i_n}$$

One possible way is to work in $$\Bbb Q[x]/(x^7)=\Bbb Q[[x]]/(x^7)$$ (i.e. in the ring of polynomials, respectively the ring of power series in $$x$$, taken modulo $$O(x^7)$$), and i will factor $$1/2^5$$ first, so we compute: \begin{aligned} &\left(1+x+x^2+x^3+x^4+\frac 12x^5+O(x^7)\right)^5 \\ &\qquad = \left(\frac {1-x^5}{1-x}+\frac 12x^5+O(x^7)\right)^5 \\ &\qquad = \binom 50 \left(\frac {1-x^5}{1-x}\right)^5 +\binom 51\left(\frac {1-x^5}{1-x}\right)^4\cdot\frac 12x^5+O(x^7) \\ &\qquad = \frac {(1-x^5)^5}{(1-x)^5} +5\frac {(1-x^5)^4}{(1-x)^4}\cdot\frac 12x^5+O(x^7) \\ &\qquad = (1-5x^5) \left( 1-\binom{-5}1 x +\binom{-5}2 x^2 -\binom{-5}3 x^3 +\binom{-5}4 x^4 -\binom{-5}1 x^5 +\binom{-5}6 x^6 \right) \\ &\qquad\qquad +5\cdot(1+O(x^2)) \cdot \left( 1-\binom{-4}1 x +O( x^2) \right) \frac 12x^5 \\ &\qquad\qquad\qquad+O(x^7) \end{aligned} and the coefficient in $$x^6$$ can be extracted as $$\binom{-5}6+5\binom{-5}1 -\frac 52\binom{-4}1 =210-25+10=195\ .$$ Recall that we have to multiply with $$2^5=32$$ to get the final answer $$195\cdot 32= 6240\ .$$