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$?.
 A: 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*}

A: The desired inequality is written as
$$2 \left(\sum_{n=0}^k nx^n\right)^2 + \sum_{n=0}^k x^n  \sum_{n=0}^k nx^n - \sum_{n=0}^k x^n \sum_{n=0}^k n^2x^n \geq 0$$
or
$$2 \sum_{n=0}^k nx^n \cdot \sum_{m=0}^k mx^m + \sum_{n=0}^k x^n  \sum_{m=0}^k mx^m - \sum_{n=0}^k x^n \sum_{m=0}^k m^2x^m \geq 0$$
or
$$\sum_{m=0}^k \sum_{n=0}^k (2nm + m - m^2)x^{m+n} \ge 0.$$
Let
$$\sum_{m=0}^k \sum_{n=0}^k (2nm + m - m^2)x^{m+n} \equiv \sum_{q=0}^{2k} c_q x^q.$$
If $0 \le q\le k$, we have
$$c_q = \sum_{m=0}^q [2(q-m)m + m - m^2] = 0.$$
If $k < q \le 2k$, we have
$$c_q = \sum_{m=q-k}^k [2(q-m)m + m - m^2] = (k+1)(q-k)(2k+1-q) \ge 0.$$
We are done.
A: Let's define
$$P(x) = \sum_{n = 1}^Kx^n$$
Then
$$P'(x) =\sum_{n = 1}^K nx^{n-1}$$
$$P''(x) =\sum_{n = 1}^K n(n-1)x^{n-2}$$
The initial inequality is equal to
$$\begin{align}
&\Longleftrightarrow 2 \left(x\sum_{n=1}^K nx^{n-1}\right)^2 + \left( \sum_{n=1}^K nx^n -  \sum_{n=1}^K n^2x^n\right) \sum_{n=0}^K x^n  
\geq 0  \\
&\Longleftrightarrow 2 \left(x\sum_{n=1}^K nx^{n-1}\right)^2 - x^2\left(\sum_{n=1}^K n(n-1)x^{n-2}\right)\sum_{n=0}^K x^n  
 \geq 0  \\
&\Longleftrightarrow 2 \left(P'(x)\right)^2 - P''(x).P(x)  \geq 0  \\
&\Longleftrightarrow 2 \frac{P'(x)}{P(x)}  -\frac{P''(x)}{P'(x)}  \geq 0  \\
&\Longleftrightarrow (2 \ln(P(x))  -\ln(P'(x)))'  \geq 0  \\
&\Longleftrightarrow \left(\ln\frac{P^2(x)}{P'(x)}\right) '  \geq 0  \\
&\Longleftrightarrow \ln\frac{P^2(x)}{P'(x)}  \text{: increasing function} \\
&\Longleftrightarrow  \frac{P'(x)}{P^2(x)}  \text{: decreasing function} \\
&\Longleftrightarrow  \left(-\frac{1}{P(x)}\right)'  \text{: decreasing function} \\
&\Longleftrightarrow  -\frac{1}{P(x)}  \text{: concave function} \tag{1} \\
\end{align}$$
It's easy to prove that

*

*$h(x):=\frac{1}{x}$ is a nonincreasing( $h'(x)=-\frac{1}{x^2}<0$) and concave function ($h''(x) = \frac{2}{x^3}$) for $x<0$

*$g(x):=-P(x)$ is a concave function for $x>0$
Applying the $(3.10)$, third result, at the page 84 of this course : "$f(x) = h(g(x))$ is concave if $h = \frac{1}{x}$ is concave and nonincreasing, and $g = -P(x)$ is concave ", we have that $(1)$ holds true. Q.E.D
