\(\left(1+x\right)\left(1+2x\right)...\left(1+nx\right)-1\)
\(=x+\sum\limits^n_{k=2}kx\left(1+x\right)...\left(1+\left(k-1\right)x\right)\)
\(=x+\sum\limits^n_{k=2}kx\left[\left(1+x\right)...\left(1+\left(k-1\right)x\right)-1+1\right]\)
\(=\sum\limits^n_{k=1}kx+\sum\limits^n_{k=2}kx\left[\left(1+x\right)\left(1+2x\right)...\left(1+\left(k-1\right)x\right)-1\right]\)
\(=\sum\limits^n_{k=1}kx+\sum\limits^n_{k=2}kx\left(\sum\limits^{k-1}_{i=1}ix\left(1+x\right)\left(1+2x\right)...\left(1-\left(i-1\right)x\right)\right)\)
Do đó tổng của các hệ số chứa \(x^2\) là: \(\sum\limits^n_{k=2}k\left(\sum\limits^{k-1}_{i=1}i\right)\)
Hay \(a_2=\sum\limits^n_{k=2}k\left(\frac{k\left(k-1\right)}{2}\right)=\sum\limits^n_{k=2}\frac{k^2\left(k-1\right)}{2}\)
Do đó:
\(S=1+\sum\limits^{2019}_{k=2}\frac{k^2\left(k-1\right)}{2}+\sum\limits^{2019}_{k=2}k^2=1+\sum\limits^{2019}_{k=2}\left(\frac{k^2\left(k-1\right)}{2}+k^2\right)\)
\(=1+\sum\limits^{2019}_{k=2}\left(\frac{k^2\left(k+1\right)}{2}\right)\)