Coefficient of $x^{n-2}$ in $(x-1)(x-2)(x-3)\dotsm(x-n)$ Question

Find the coefficient of $x^{n-2}$  in the expression $$(x-1)(x-2)(x-3)\dots(x-n)~~.$$

My approach

The coefficient of $x^n$ is $1$. The coefficient of  $x^{n-1}$ is $- \frac{n(n+1)}{2}$

But I cannot proceed from here.
I would appreciate any help.
 A: Observe that the coefficient of $x^1$ in $$(x-1)(x-2)(x-3)$$ is $$2\cdot3+1\cdot2+1\cdot3$$
or the coefficient of $x^{4-2}$ in $$(x-1)(x-2)(x-3)(x-4)=(x-1)(x-4)(x-2)(x-3)=(x^2-(1+4)x+1\cdot4)(x^2-(2+3)x+2\cdot3)$$
is $$2\cdot3+(1+4)(2+3)+1\cdot4$$
So, the required sum
$$=\sum_{1\le r_1<r_2\le n}r_1r_2=\dfrac{(\sum_{r=1}^n r)^2-\sum_{r=1}^n r^2}2$$
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}$

$\ds{\bracks{x^{n - 2}}\pars{x - 1}\pars{x - 2}\cdots\pars{x - n} =\
{\Large ?}}$

\begin{align}
&\bbox[10px,#ffd]{\ds{%
\bracks{x^{n - 2}}\pars{x - 1}\pars{x - 2}\cdots\pars{x - n}}} =
\bracks{x^{2 - n}}{\pars{1 - x}\pars{1 - 2x}\cdots\pars{1 - nx} \over x^{n}} =
\bracks{x^{2}}\pars{1 - x}\pars{1 - 2x}\cdots\pars{1 - nx} = {1 \over 2}\,\mrm{f}''\pars{0}
\end{align}

where $\ds{\mrm{f}\pars{x} = \prod_{k = 1}^{n}\pars{1 - kx}}$.

Then $\ds{\pars{~\mbox{note that}\ \bbx{\mrm{f}\pars{0} = 1}~}}$,
\begin{align}
\totald{\ln\pars{\mrm{f}\pars{x}}}{x} & =
{\mrm{f}'\pars{x} \over \mrm{f}\pars{x}} = \sum_{k = 1}^{n}{k \over kx - 1}
\implies
\bbx{\mrm{f}'\pars{0} = -\sum_{k = 1}^{n}k}
\\[5mm]
\totald[2]{\ln\pars{\mrm{f}\pars{x}}}{x} & =
{\mrm{f}''\pars{x}\mrm{f}\pars{x} - \mrm{f}'^{2}\pars{x} \over \mrm{f}^{2}\pars{x}} = -\sum_{k = 1}^{n}{k^{2} \over \pars{kx - 1}^{2}}
\\[5mm] \implies &\
\bbx{\mrm{f}''\pars{0} =
\pars{\sum_{k = 1}^{n}k}^{2} - \sum_{k = 1}^{n}k^{2}}
\end{align}

\begin{align}
&\bbox[10px,#ffd]{\ds{%
\bracks{x^{n - 2}}\pars{x - 1}\pars{x - 2}\cdots\pars{x - n}}} =
{\pars{\sum_{k = 1}^{n}k}^{2} - \sum_{k = 1}^{n}k^{2} \over 2}
\\[5mm] & =
{1 \over 2}\bracks{{n^{2}\pars{n + 1}^{2} \over 4} -
{n\pars{n + 1}\pars{2n + 1} \over 6}}
\\[5mm] & =
\bbx{%
{1 \over 8}\,n^{4} + {1 \over 12}\,n^{3} - {1 \over 8}\,n^{2} - {1 \over 12}\,n} \\ &
\end{align}
A: Taking the long way:
\begin{align}
f_{n}(x) &= (x-1)(x-2)\cdots(x-n) \\
f_{1}(x) &= x-1 \\
f_{2}(x) &= x^2 - 3x + 2 \\
f_{3}(x) &= x^3 - 6x^2 + 11x - 6\\
f_{4}(x) &= x^4 - 10x^3 + 35x^2 = 50x + 24 \\
f_{5}(x) &= x^5 - 15x^4 + 85x^3 - 215x^2 + 274x - 120.
\end{align}
From here it is determined that $[x^n] \, f_{n}(x) = 1$, $[x^{n-1}] \, f_{n}(x) = -\binom{n+1}{2} = s(n+1,n)$ and $[x^{n-2}] \, f_{n}(x) \in \{ 2, 11, 35, 85, 175, \cdots \}$. This pattern follows the (signed) Stirling numbers of the first kind, $s(n+2,n)$ or 
$$[x^{n-2}] \, f_{n}(x) = \frac{(n-1) (n) (n+1) (3 n + 2)}{4!} = s(n+1, n-1).$$ 
One may compare the values obtained to A000914.
A: For $~x^{n-1}~$ the coefficient would be sum of the roots that is $~1+2+3+4+5+\cdots+n~$ for $~x^{n-2}~$ coefficient would be sum of roots taken two at a time that is $~1.2+2.3+3.4+4.5+\cdots+(n-1)n~$ so let it be $~S~$ them $~S~$ can be find using steps below
$$(1+2+3+4+5+\cdots+n)^2=(1^2+2^2+3^3+\cdots+n^2)+2(1.2+2.3+3.4+\cdots+(n-1)n)$$ 
So 
$$(1+2+3+4+5+\cdots+n)^2=(1^2+2^2+3^3+\cdots+n^2)+2(S)$$ 
So this can be find as we know sum of $~n~$ natural no 
That is $~\frac{1}{2}\{n(n+1)\}~$ and sum of squares of first $~n~$ natural number is $~\frac{1}{6}\{n(n+1)(2n+1)\}~$ so this value can be found
Thanks for opportunity to solve the problem
A: Finding the coefficient of $x^{n-2}$ requires picking $2$ terms from the product to multiply the constants. Thus, we get the coefficient to be
$$
\begin{align}
\sum_{k=2}^n\sum_{j=1}^{k-1}jk
&=\sum_{k=2}^n\sum_{j=1}^{k-1}\binom{j}{1}k\\
&=\sum_{k=2}^n\binom{k}{2}k\\
&=\sum_{k=2}^n\binom{k}{2}((k-2)+2)\\
&=\sum_{k=2}^n\left(3\binom{k}{3}+2\binom{k}{2}\right)\\
&=3\binom{n+1}{4}+2\binom{n+1}{3}\\[3pt]
&=\frac{(3n+2)(n^3-n)}{24}
\end{align}
$$
