Per the title, I want to evaluate the expression:
$$S = \sum\limits_{k=1}^n(-1)^{k-1}\frac{n \choose k}{k^2}$$
Looked on Approach0 but no luck.
I think it has a nice closed form:
$$S = n^2\sum\frac{1}{i^2}+\left(n\sum \frac{1}{i}\right)^2$$
My attempt:
Using the Binomial theorem:
$$\frac{1-(1-x)^n}{x} = \sum\limits_{k=1}^n (-1)^{k-1}{n \choose k}{x^{k-1}}$$
Integrate both sides from $0$ to $x$.
$$\int\limits_0^x \frac{1-(1-x)^n}{x}dx = \sum\limits_{k=1}^n (-1)^{k-1}{n \choose k}\frac{x^{k}}{k}$$
For the LHS, let $1-x=u$
EDIT: as pointed out by FDP, this is where the issue was. Limits of the integral need to be changed as well. See answer below for correct version.
$$\int\limits_x^0 \frac{1-(u)^n}{1-u}(-du) = \sum\limits_{k=1}^n (-1)^{k-1}{n \choose k}\frac{x^{k}}{k}$$
$$=>\int\limits_0^x \left(\sum\limits_{k=0}^{n-1}u^{k} \right)du = \sum\limits_{k=1}^n (-1)^{k-1}{n \choose k}\frac{x^{k}}{k}$$
$$=>\sum\limits_{k=1}^{n}\frac{x^k} {k} = \sum\limits_{k=1}^n (-1)^{k-1}{n \choose k}\frac{x^{k}}{k}$$
$$=>\sum\limits_{k=1}^{n}\frac{x^{k-1}} {k} = \sum\limits_{k=1}^n (-1)^{k-1}{n \choose k}\frac{x^{k-1}}{k}$$
Integrating both sides from $0$ to $1$,
$$=>\int\limits_0^1\sum\limits_{k=1}^{n}\frac{x^{k-1}} {k} = \int\limits_0^1\sum\limits_{k=1}^n (-1)^{k-1}{n \choose k}\frac{x^{k-1}}{k}$$
$$=>\sum\limits_{k=1}^{n}\frac{1} {k^2} = \sum\limits_{k=1}^n (-1)^{k-1}{n \choose k}\frac{1}{k^2}\tag{1}$$
Equation (1) is incorrect as evidenced by substituting $n=2$. Where did I go wrong?
Why do I care about this? It comes up in calculating the variance of the generalized coupon collector's problem. See here.