Finding the coefficient of a term in an expansion. I was looking over some problems from the American Invitational Mathematics Examination (AIME) and this problem from the 2004 AIME caught my eye:

Let $C$ be the coefficient of $x^2$ in the expansion of the product $(1 - x)(1 + 2x)(1 - 3x)\cdots(1 + 14x)(1 - 15x).$ Find $|C|.$

Evidently, the coefficient of $x$ is $-8$, since summing the coefficients of $x$ within the binomials gives $-1+2-3+\cdots+14-15 = -8$, but how would I go about finding the coeffecient of $x^2$?
 A: Same answer as Edouardb but with IMHO slightly simpler working.  We'll use the generalised product rule in the form
$$\frac{\frac{d}{dx}\prod u_k}{\prod u_k}=\sum\frac{\frac{d}{dx}u_k}{u_k}\ .$$
Let
$$p(x)=\prod_{k=1}^n(1+(-1)^kkx)\ .$$
Then clearly $p(0)=1$, and
$$\frac{p'(x)}{p(x)}=\sum_{k=1}^n\frac{(-1)^kk}{1+(-1)^kkx}$$
so that
$$p'(0)=\sum_{k=1}^n(-1)^kk\ ,$$
which you have already evaluated.  By the quotient rule,
$$\frac{p(x)p''(x)-p'(x)^2}{p(x)^2}
  =-\sum_{k=1}^n\frac{k^2}{(1+(-1)^kkx)^2}$$
and hence
$$p''(0)=p'(0)^2-\sum_{k=1}^nk^2\ .$$
Your answer is $\frac12p''(0)$.
A: Your expression is polynomial. Therefore, the coefficient you're looking for is half of the constant coefficient of the second derivative. Let's call $P(X)$ your polynomial.
$P(X) = \prod_{n=1}^{15} (1 + (-1)^n n X)$
$P'(X) = \sum_{i=1}^{15} (-1)^i i\prod_{n=1 \\ n \neq i}^{15} (1 + (-1)^n nX)$
$P''(X) = \sum_{i=1}^{15} (-1)^i i \sum_{j=1 \\ j \neq i}^{15}  (-1)^j j \prod_{n=1 \\ n \neq i \\ n \neq j}^{15} (1 + (-1)^n nX)$
The coefficient constant is
\begin{align*} 
P''(0)
& = \frac{1}{2}\sum_{i=1}^{15} (-1)^i i \sum_{j=1 \\ j \neq i}^{15}  (-1)^j j \\
& = \frac{1}{2}\sum_{i=1}^{15} (-1)^i i \left(\sum_{j=1}^{15}  (-1)^j j - (-1)^i i\right) \\
& = \frac{1}{2}\left(\sum_{i=1}^{15} (-1)^i i\right)^2 - \frac{1}{2}\sum_{i=1}^{15} i^2
\end{align*}
You know the first sum (-8) and you can compute the second.
It gives the general formula for any number (not only 15).
A: Here is a hint:
$$f(x):=(1 - x)(1 + 2x)\cdots(1 - 13x)(1 + 14x)$$
$$=(1  + x -1\cdot2x^2)\cdots(1  + x -13\cdot 14x^2)\tag{1}$$
$$=\sum_{k=0}^{14}c_k x^k$$
Now you can find out $c_1$ using your own method. You can then find out $c_2$ from the pattern of second line in (1).  Finally $C=c_2-15c_1$
A: FIRST METHOD
$$\begin{align}
&\;\;\;\;\underbrace{\color{magenta}{(1-x)(1+2x)}\color{blue}{(1-3x)(1+4x)}\cdots \color{green}{(1-13x)(1+14x)}}_{14\text{ terms}}(1-15x)\\
&=\underbrace{\color{magenta}{(1+x-2x^2)}\color{blue}{(1+x-12x^2)}\cdots \color{green}{(1+x-182x^2)}}_{7\text{ terms}} (1-15x)\\
&=(1+ax+bx^2+\cdots+\bullet\;  x^{14})(1-15x)\\
&=1+(a-15)x+(b-15a)x^2+\cdots
\end{align}$$
Equating coefficients gives 
$$a=7\\ 
b=-(\underbrace{1\cdot 2}_2+\underbrace{3\cdot 4}_{12}+\cdots +\underbrace{13\cdot 14}_{182})+\binom 72=-483$$
The coefficient of $x^2$ is 
$$C=b-15a=-588\\
|C|=\color{red}{588}$$

SECOND METHOD
Consider combination of two factors at a time.
Coefficient if $x^2$ is
$$\begin{align}
\sum_{i=2}^{15}(-1)^i\ i\color{green}{\sum_{j=1}^{i-1}(-1)^j\ j}
&=\sum_{i=2}^{15}(-1)^i\ i\cdot \color{green}{(-1)^{i-1}\bigg\lfloor \frac i2\bigg\rfloor}\\
&=-\sum_{i=2}^{15}i\bigg\lfloor \frac i2\bigg\rfloor\\
&\color{lightgrey}{=-\left[(2+3)\cdot 1+(4+5)\cdot 2+(6+7)\cdot 3+\cdots+(14+15)\cdot 7\right]}\\
&\color{lightgrey}{=\sum_{r=1}^7 (2r+(2r+1))r}\\
&=\color{red}{-588}
\end{align}$$
