Coefficient of $x^2$ in a polynomial 
Let $p(x)$ be an polynomial given by
  $$p(x)=(1+x)(1+3x)(1+5x)\cdots(1+19x)$$ Find the coefficient of $x^2$.

I see that this coefficient is the sum of products of roots of $p(x)$ get eight to eight. But, there is ${10 \choose 8}=45$ terms in this sum. Someone know other way more fast?
 A: The coefficient of $x^2$ is given by 
$$ \sum_{\substack{0<i<j\leq 19 \\ i,j\text{ odd}}} ij = \frac{1}{2}\left[\Big(\sum_{\substack{0<i\leq 19\\ i\text{ odd}}}i\Big)^2-\sum_{\substack{0<i\leq 19\\ i\text{ odd}}}i^2\right]=\frac{10000-1330}{2}=\color{red}{4335}.$$
In general:
$$ [x^2]\prod_{k=1}^{N}(1+(2k-1)x)=\frac{N^4-\frac{1}{3}(4N^3-N)}{2}=\color{red}{\frac{N(N-1)(3N^2-N-1)}{6}}. $$
A: You can write
$$p(x)=(1+10x-9x)(1+10x+9x)\cdots (1+10x-x)(1+10x+x)=((1+10x)^2-(9x)^2)((1+10x)^2-(7x)^2)\cdots ((1+10x)^2-x^2)=(19x^2+20x+1)(51x^2+20x+1)(75x^2+20x+1)(91x^2+20x+1)(99x^2+20x+1)$$
Now you can see that the main coefficients of $x^2$ sum to $19+51+75+91+99=335$ now we can look $\mod x^2$ to get the remaining coefficient of $x^2$ we get  $(20x+1)^5$ and the coefficient of the $x^2$ is $4000$ summing those two you get $4335$.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

Lets
  $\ds{\mrm{f}\pars{x} \equiv
\pars{1 + x}\pars{1 + 3x}\pars{1 + 5x}\cdots\pars{1 + 19x}}$ such that
  $\ds{\bbx{\bracks{x^{2}}\mrm{f}\pars{x} = {1 \over 2!}\,\mrm{f}''\pars{0}}}$

  and
  $\ds{\ln\pars{\mrm{f}\pars{x}} =
\sum_{n = 0}^{9}\ln\pars{1 + \bracks{2n + 1}x}}$. Note that
  $\ds{\mrm{f}\pars{0} = 1}$  

Then,
\begin{align}
{\mrm{f}'\pars{x} \over \mrm{f}\pars{x}} & =
\sum_{n = 0}^{9}{2n + 1 \over \pars{2n + 1}x + 1} \implies
\mrm{f}'\pars{0} = \sum_{n = 0}^{9}\pars{2n + 1} = 100.
\\[1cm]
{\mrm{f}''\pars{x}\mrm{f}\pars{x} - \bracks{\mrm{f}'\pars{x}}^{2} \over \mrm{f}^{2}\pars{x}} & =
-\sum_{n = 0}^{9}{\pars{2n + 1}^{2} \over \bracks{\pars{2n + 1}x + 1}^{\,2}}
\\[2mm] \implies
\mrm{f}''\pars{0} &= 100^{2} - \sum_{n = 0}^{9}\pars{2n + 1}^{2} = 10000 - 1330 = 8670.
\end{align}

$$\bbx{%
\bracks{x^{2}}
\bracks{\pars{1 + x}\pars{1 + 3x}\pars{1 + 5x}\cdots\pars{1 + 19x}} =
{8670 \over 2!} = \bbox[10px,#ffe,border:1px dotted navy]{\ds{4335}}}
$$
A: If $$(1+x)(1+3x) \ldots (1 + (2k+1) x) = a_0(k) + a_1(k) x + a_2(k) x^2 + \ldots$$
we have $a_0(k) = 1$, $a_1(k) = 1 + 3 + \ldots + (2k+1) = (k+1)^2$, and
$$ a_2(k) = a_2(k-1) + (2k+1) a_1(k-1) = a_2(k-1) + (2k+1) k^2$$
Thus 
$$ a_2(k) = \sum_{j=0}^k (2j+1) j^2 = \frac{k(k+1)(3k^2+5k+1)}{6}$$
In your case $a_2(9) = 4335$.
See also OEIS sequence A024196.
A: Coefficient of $x^2$ in $(1+x)(1+3x)(1+5x)\cdots (1+(2n-1)x)$ is:
$$\begin{align}
&&1\cdot (3+5+7+9+\cdots +(2n-1))&\\
&&+3\cdot (5+7+9+\cdots +(2n-1))&\\
&&+5\cdot (7+9+\cdots +(2n-1))&\\
&&+7\cdot (9+\cdots +(2n-1))&\\
&&\vdots&\\
&&\cdots +(2n-3)\cdot((2n-1))\\
& && =\sum_{i=1}^{n-1}\sum_{j=i+1}^n(2i-1)(2j-1)\\
& && =\sum_{j=2}^n(2j-1)\;\sum_{i=1}^{j-1}(2i-1)\\
& && =\sum_{j=2}^n(2j-1)\;(j-1)^2\\
& && =\sum_{j=1}^{n-1}(2j+1)\;j^2\\
& && =\sum_{j=1}^{n-1}(2j^3+j^2)\\
& && =2\cdot \left[\frac {n(n-1)}2\right]^2+\frac 16(n-1)n(2n-1)\\
& && =\frac 16n(n-1)(3n^2-n-1)
\end{align}$$
Putting $n=10$ gives
$$[x^2]\; (1+x)(1+3x)(1+5x)\cdots (1+19x)=\color{red}{4335}$$
