This is a question regarding the answer presented here.
In order to make this post self-contained, I am wondering if someone can explain why the sum $$ \sum_{k=0}^{n}(-1)^{n+k}\binom{n}{k}\binom{n+k}{k}\frac{1}{k+2} \tag{1} $$ can be re-written as $$ \int_{0}^{1}x\, Q_n(x)\,dx \tag{2} $$ where in the above $Q_n(x)$ is the shifted Legendre polynomial that satisfy $$ Q_n(x)=P_n(2x-1)=\sum_{k=0}^{n}(-1)^{n+k}\binom{n}{k}\binom{n+k}{k}x^k \tag{3} $$ with $P_n(x)$ the ordinary Legendre polynomials.
I am aware of how to re-write a sum as an integral, but I have never encountered an example of the form of eq.(1) and I find passing from eq.(1) to eq.(2) a bit confusing.