Coefficient of a term in an expanded polynomial I came across this question while solving problems on functions. Find the coefficient of $x^{203}$ in the expansion of the following expression: $(x-2)((x)(x+1)(x+2)(x+3)...(x+202))$.
The solution given in the text is:
$(x-2)((x)(x+1)(x+2)(x+3)...(x+202)) = (x-2)(x^{203} + x^{202}(1+2+3+4...+202)+....)$
So the coefficient of $x^{203} = -2 + (1 + 2 + .... + 202) = 20501$
The part I don't understand is how the coefficient of $x^{202}$ can be written directly as (1+2+3+....+202).

*

*Is there any theorem or a method for the expansion of a polynomial in this way?

*Is there a way I can get the coefficient of any term I want($x^{199}, x^{46}$, etc.)

 A: Observe that $$x(x+1)=x^2+x\\x(x+1)(x+2)=x^3+3x^2+2x\\x(x+1)(x+2)(x+3)=x^4+6x^3+11x^2+6x\\x(x+1)(x+2)(x+3)(x+4)=x^5+10x^4+35x^3+50x^2+24x\\\dots$$
There seems to be a pattern forming regarding all coefficients, don't you agree?
But we are primarily interested in the coefficients of the second highest power of $x$.
We notice that these follow the sequence $1,3,6,10,\dots$ which is called the Triangular Number Sequence and whose $n$-th term is given by the formula $$P(n)=\frac{n(n+1)}{2}$$
Thus, for $n=202$, we obtain $P(202)=20503$, from which (because in this particular problem we have the term $(x-2))$ we get the desired $20503-2=20501$.
A: I hope I can explain it in another way.
The given polynomial is of the form $\prod_{j=1}^{204}(x+a_{j})$ for some numbers $a_j$. Ask yourself this question:

How does it look when expanded?


I think a simpler question will help: how does $(x + a) (y + b) (z+c)$ look like when expanded? Third grade arithmetic reveals: $$xyz + xyc + xbz + xbc + ayz +\ldots$$
Note how each summand is formed by choosing between x/y/z and a/b/c from each multiple in $(x + a) (y + b) (z+c)$.
The important bit is that when expanding braces, for each summand we're doing a choice for a summand in each brace, and multiply these choices. For example, $xbc$ was formed by choosing $x$ from $(x-a)$, $b$ from $(y+b)$, and $c$ from $(z+c)$.
We'll apply the same reasoning for your problem.

Now back to $\prod_{j=1}^{204}(x+a_{j})$. For the sake of the exercise, let's try to find:

*

*the free term (in front of $x^0=1$): it is formed by choosing the $a_j$ from each multiple $(x+a_j)$, hence equals $\prod_j a_{j}$.

*the term in front of $x^1$: a first power term is formed by choosing $x$ from any single brace - $(x-a_1)$, or $(x-a_{100})$, or whatever - and choosing the $a_j$ from the rest: for example, $a_1 a_2 \ldots a_{99} x a_{100} \ldots a_{203}$. The sum of all these is $\left(\sum a_{j}\right)x$.

*the main coefficient (in front of $x^{204}$: it is formed by choosing $x$ from every brace $(x-a_j)$, hence it's just $\prod_{j}x=x^{204}$ and its coefficient is just $1$.

Without giving a direct answer, I hope the above is a big hint towards it. How is any single term with $x^{203}$ formed in the expansion? By choosing 203 $x$'s and a single $a_j$! How is then the total term with $x^{203}$ formed? By summing all of these!
