<s>[INST] Evaluation of $\sum_{k=0}^n{n\choose k}^2u^k$ I am trying to evaluate the finite sum
\begin{equation}
f(u)=\sum_{k=0}^n{n\choose k}^2u^k,\quad 0<u\le1
\end{equation}
In an first attempt, I think of the generating function
\begin{equation}
(1+x)^n(u+x)^n = \sum_{k\ge0}{n\choose k}x^k\sum_{k\ge0}{n\choose k}u^kx^{n-k}=\cdots+x^n\sum_{k\ge0}{n\choose k}^2u^k+\cdots
\end{equation}
which means that $f(u)$ is the coefficients of the term $x^n$.
Expanding $(1+x)^n(u+x)^n$ into $[1+(1+u)x+x^2]^n$, and using the multinomial expansion, I get an expression for the coefficient of $x^n$. However, such an expression is more complicated than $f(u)$. It seems I am making the problem even more difficult.
Can someone help me find the value of $f(u)$.
Thank you.
 [/INST] The Legendre polynomial $P_n$ happens to satisfy
$$P_n(x) = \frac{1}{2^n} \sum_{k=0}^n \binom{n}{k}^2 (x - 1)^{k}(x + 1)^{n-k}.$$
Hence
$$(1-x)^n P_n\left(\frac{x-1}{x+1}\right) = \frac{1}{2^n} \sum_{k=0}^n \binom{n}{k}^2 (2x)^{k} 2^{n-k} =\sum_{k=0}^n \binom{n}{k}^2 x^k.$$
To prove the earlier equation, note that Rodrigues' formula gives
$$P_n(x) = \frac{1}{2^n n!} \frac{d^n}{dx^n} \left((x^2 - 1)^n\right).$$
Hence
\begin{align*}
2^n P_n(x) 
  &= \frac{1}{n!} \sum_{k=0}^n \binom{n}{k} \left[\frac{d^k}{dx^k} (x - 1)^n\right] \left[\frac{d^{n-k}}{dx^{n-k}} (x + 1)^n\right] \\
  &= \frac{1}{n!} \sum_{k=0}^n \binom{n}{k}  \left[k! \binom{n}{k} (x - 1)^{n-k}\right] \left[(n-k)! \binom{n}{n-k} (x + 1)^k \right] \\
  &= \sum_{k=0}^n \binom{n}{k}^2 (x - 1)^{n-k} (x + 1)^k \\
  &= \sum_{k=0}^n \binom{n}{k}^2 (x - 1)^{k} (x + 1)^{n-k}.
\end{align*}
</s>