<s>[INST] Proving the inequality with finite sums I would like to show the following inequality involving finite sums ($x>0$):
$$2 \left(\sum_{n=1}^k nx^n\right)^2 + \sum_{n=0}^k x^n  \sum_{n=1}^k nx^n - \sum_{n=0}^k x^n \sum_{n=1}^k n^2x^n \geq 0 $$
I thought an induction would work, but then realized what really matters is the first few terms in series. In my view, induction will be of no use. After plugging in some value for $k$, I noticed  a nice pattern. For ex: when $k=3$, first $3$ terms get cancelled. When $k=4$, first 4 terms get cancelled. However, I am unable to write things precisely. For a given $k$, the coefficients of first $k$ terms are $1,5,14,30,55...$. The hard part is actually to figure out the stuff after $k$ terms.
I was wondering if there would be another way to go about showing this. Any help/hint would be great.

A direct approach will definitely work. Is there a way to write these products of the form $\sum_{n=1}^{2k} c_n x^n$?.
 [/INST] We obtain
\begin{align*}
\color{blue}{2}&\color{blue}{\left(\sum_{n=1}^knx^n\right)^2+\sum_{n=0}^kx^n\sum_{n=1}^knx^n
-\sum_{n=0}^kx^n\sum_{n=1}^kn^2x^n}\\
&=2\left(\sum_{n=1}^knx^n\right)^2
+\sum_{n=0}^kx^n\left(\sum_{n=0}^knx^n-\sum_{n=0}^kn^2x^n\right)\tag{1}\\
&=2\left(\sum_{n=1}^knx^n\right)^2
+\left(\sum_{n=0}^kx^n\right)\left(\sum_{n=0}^kn(1-n)x^n\right)\tag{2}\\
&=2\sum_{q=0}^{2k}\left(\sum_{{m+n=q}\atop{0\leq m,n\leq k}}mn\right)x^q
+\sum_{q=0}^{2k}\left(\sum_{{m+n=q}\atop{0\leq m,n\leq k}}n(1-n)\right)x^q\tag{3}\\
&=\sum_{q=0}^{2k}\left(\sum_{{m+n=q}\atop{0\leq m,n\leq k}}2mn+n(1-n)\right)x^q\\
&\,\,\color{blue}{=\sum_{q=0}^{k}\left(\sum_{n=0}^q\left(2n(q-n)+n(1-n)\right)\right)x^q}\\
&\,\,\color{blue}{\qquad+\sum_{q=k+1}^{2k}\left(\sum_{n=q-k}^k\left(2n(q-n)+n(1-n)\right)\right)x^q}\tag{4}\\
\end{align*}
Comment:

*

*In (1) we factor out $\sum_{n=0}^kx^k$ and start indices with zero which is simply an addition of zero terms.


*In (2) we merge the inner sums.


*In (3) we apply the Cauchy product of series.


*In (4) we eliminate the index variable $m$ by substituting $m=q-n$. We also split the sum due to the restriction $0\leq m,n\leq k$.
The left-hand inner sum of (4) simplifies to
\begin{align*}
\color{blue}{\sum_{n=0}^q}&\color{blue}{\left(2n(q-n)+n(1-n)\right)}\\
&=\sum_{n=0}^q\left((2q+1)n-3n^2\right)\\
&=(2q+1)\sum_{n=0}^qn-3\sum_{n=0}^qn^2\\
&=(2q+1)\frac{q(q+1)}{2}-3\,\frac{q(q+1)(2q+1)}{6}\\
&\,\,\color{blue}{=0}\tag{5}
\end{align*}
The right-hand inner sum of (4) simplifies to
\begin{align*}
\color{blue}{\sum_{n=q-k}^k}&\color{blue}{\left(2n(q-n)+n(1-n)\right)}\\
&=\sum_{n=q-k}^k\left((2q+1)n-3n^2\right)\\
&=(2q+1)\frac{1}{2}\,k(k+1)-3\frac{1}{6}\,k(k+1)(2k+1)\\
&\qquad-(2q+1)\frac{1}{2}\,(q-k-1)(q-k)+3\frac{1}{6}\,(q-k-1)(q-k)(2q-2k-1)\\
&\,\,\qquad\color{blue}{=(k+1)\left(3kq-2k^2-q^2+q-k\right)}\tag{6}
\end{align*}

From (1) and (4) to (6) we finally derive
\begin{align*}
\color{blue}{2}&\color{blue}{\left(\sum_{n=1}^knx^n\right)^2+\sum_{n=0}^kx^n\sum_{n=1}^knx^n
-\sum_{n=0}^kx^n\sum_{n=1}^kn^2x^n}\\
&\qquad\,\,\color{blue}{=(k+1)\sum_{q=k+1}^{2k}\left(3kq-2k^2-q^2+q-k\right)x^q}\tag{7}
\end{align*}
A plausibility check for small values $k$ verifies (7) with somewhat help from Wolfram Alpha.
\begin{align*}
\begin{array}{c|c}
k&\mathrm{polynomial}\\
\hline
1&2x^2\\
2&3\left(2x^3+2x^4\right)\\
3&4\left(3x^4+4x^5+3x^5\right)\\
4&5\left(4x^5+6x^6+6x^7+5x^8\right)\\
5&6\left(5x^6+8x^7+9x^8+8x^9+5x^{10}\right)\\
6&7\left(6x^7+10x^8+12x^9+12x^{10}+10x^{11}+6x^{12}\right)\\
\end{array}
\end{align*}

</s>