How to solve $\binom{n}{1}^2+2\binom{n}{2}^2 + 3\binom{n}{3}^2 + 4\binom{n}{4}^2+\cdots + n\binom{n}{n}^2$? I have tried something to solve the series
$$\binom{n}{1}^2+2\binom{n}{2}^2 + 3\binom{n}{3}^2 + 4\binom{n}{4}^2+\cdots + n\binom{n}{n}^2.$$
My approach is :
$$(1+x)^n=\binom{n}{0} + \binom{n}{1}x + \binom{n}{2}x^2 + \cdots + \binom{n}{n}x^n.$$
Differentiating the above equation
$$n(1+x)^{n-1} = \binom{n}{1} + \binom{n}{2}x + \cdots + n\binom{n}{n}x^{n-1}$$
Also,
$$
\left(1+\frac{1}{x}\right)^n =\binom{n}{0} + \binom{n}{1}\frac{1}{x} + \binom{n}{2}\left(\frac{1}{x}\right)^2 + \cdots + \binom{n}{n}\left(\frac{1}{x}\right)^n$$
Multiplying above two equation I get,
$$\begin{align*}
&{n(1+x)^{n-1}\left(1 + \frac{1}{x}\right)^n}\\
&\quad= \left(
\binom{n}{1}^2 + 2\binom{n}{2}^2 + 3\binom{n}{3}^2 + 4\binom{n}{4}^2 + \cdots + n\binom{n}{n}^2\right)\left(\frac{1}{x}\right) + \text{other terms}
\end{align*}$$
So I can say that coefficient of $\frac{1}{x}$ in expansion of $n(1+x)^{n-1}(1+\frac{1}{x})^n$ will give me the required answer.
Am I doing it correct,please correct me if I'm wrong ?
If I'm right,please tell me how to calculate the coefficient of $\frac{1}{x}$ ?
Based on the answers,I tried to implement the things in a C++ code.
I tried implementing the code using extended euclidean algorithm so that the problem of truncated division can be eliminated but still not abled to figure out why am I getting wrong answer for n>=3. This is my updated code : http://pastebin.com/imS6rdWs I'll be thankful if anyone can help me to figure out what's wrong with this code.
Thanks.
Solution:
Finally abled to solve the problem.Thanks to all those people who spent their precious time for my problem.Thanks a lot.This is my updated code :
http://pastebin.com/WQ9LRy6F 

First recall that the coefficient of $x^n$ in $(1+x)^n(1+x)^n=(1+x)^{2n}$ implies
$$
\begin{align}
\sum_{k=0}^n\binom{n}{k}^2
&=\sum_{k=0}^n\binom{n}{k}\binom{n}{n-k}\\
&=\binom{2n}{n}\tag{1}
\end{align}
$$
and then note that
$$
\begin{align}
\sum_{k=0}^nk\binom{n}{k}^2
&=\sum_{k=0}^nk\binom{n}{n-k}^2\\
&=\sum_{k=0}^n(n-k)\binom{n}{k}^2\tag{2}
\end{align}
$$
Adding the first and last parts of $(2)$ yields
$$
\begin{align}
2\sum_{k=0}^nk\binom{n}{k}^2
&=n\sum_{k=0}^n\binom{n}{k}^2\\
&=n\binom{2n}{n}\tag{3}
\end{align}
$$
Therefore,
$$
\sum_{k=0}^nk\binom{n}{k}^2=\frac{n}{2}\binom{2n}{n}\tag{4}
$$
