How I show this :$\sum_{k,j=0}^{n}\frac{a_k a_j}{k+j+1} \leq \pi \sum_{k=0}^{n}a_k^2$? let $P$ be a polynomial such that $P \in \mathbb{R}[x] $ , I want to prove the below inequality $(A)$ using this identity :$\displaystyle i \int_{-1}^{1} P(t)dt=\int_{0}^{\pi}P(e^{i \theta})e^{i \theta}d \theta$. but i don't succeed however i have showed the latter identity eaisly .
The inequality I want to prove:
$$\sum_{k,j=0}^{n}\frac{a_k a_j}{k+j+1} \leq \pi \sum_{k=0}^{n}a_k^2\tag{A}$$ ?
Note:  $a_k$ are polynomial $P$ coeffecients and $a_k > 1$, for all $k$ 
 A: Notice that, for $a_0, \cdots, a_n \in \mathbb{R}$,
$$ \sum_{j,k=0}^{n} \frac{a_j a_k}{j+k+1}
= \int_{0}^{1} \left( \sum_{k=0}^{n} a_k x^k \right)^2 \, dx
\leq \int_{-1}^{1} \left( \sum_{k=0}^{n} a_k x^k \right)^2 \, dx. $$
Applying the identity, we get
\begin{align*}
\int_{-1}^{1} \left( \sum_{k=0}^{n} a_k x^k \right)^2 \, dx
&= \left| \int_{0}^{\pi} \left( \sum_{k=0}^{n} a_k e^{ik\theta} \right)^2 e^{i\theta} \, d\theta \right| \\
&\leq \int_{0}^{\pi} \left| \left( \sum_{k=0}^{n} a_k e^{ik\theta} \right)^2 e^{i\theta} \right| \, d\theta \\
&= \int_{0}^{\pi} \left( \sum_{j=0}^{n} a_j e^{ij\theta} \right)\overline{\left( \sum_{k=0}^{n} a_k e^{ik\theta} \right)} \, d\theta \\
&= \sum_{j,k=0}^{n} a_j a_k \int_{0}^{\pi} e^{i(j-k)\theta} \, d\theta \\
&= \pi \sum_{k=0}^{n} a_k^2 + \underbrace{ 2 \sum_{j < k} a_j a_k \int_{0}^{\pi} \cos((k-j)\theta) \, d\theta }_{=0}.
\end{align*}
A: I will outline the "usual" proof of Hilbert's inequality. The idea it to use a weighted Cauchy-Schwarz inequality, via $\frac{a_j a_k}{j+k+1} = \frac{a_j}{j+k+1}\left(\frac{j+1}{k+1}\right)^{\alpha}\cdot \frac{a_k}{j+k+1}\left(\frac{k+1}{j+1}\right)^{\alpha}$, posponing the choice of $\alpha>0$. We have
$$ \left|\sum_{j,k}\frac{a_j a_k}{j+k+1}\right|^2 \leq \sum_{j}a_j^2\sum_{k}\frac{\left(\frac{j+1}{k+1}\right)^{2\alpha}}{j+k+1}\cdot\sum_{k}a_k^2\sum_{j}\frac{\left(\frac{k+1}{j+1}\right)^{2\alpha}}{j+k+1}$$
and by Riemann sums
$$\sum_{j}\frac{\left(\frac{k+1}{j+1}\right)^{2\alpha}}{j+k+1}\leq \int_{0}^{+\infty}\frac{dx}{k+1+x}\left(\frac{k+1}{x}\right)^{2\alpha}=\int_{0}^{+\infty}\frac{dx}{(x+1)x^{2\alpha}}=\frac{\pi}{\sin(2\pi\alpha)} $$
hence with the choice $\alpha=\frac{1}{4}$ we recover the claim
$$ \left|\sum_{j,k}\frac{a_j a_k}{j+k+1}\right|\leq \pi\sum_{k}a_k^2 $$
and such inequality can be proved to be sharp by considering suitable sequences.
