This question is inspired by [the MO query here][1], although it has no direct implications.

Define the family of polynomial functions
$$f_n(x)=n^2x^{n-1}-\frac{d}{dx}\left(\frac{x^n-1}{x-1}\right),$$
and the associated family of algebraic functions
$$g_n(x)=\frac{\sqrt{f_n(x)}}n+\sum_{j=1}^{n-1}\frac{\sqrt{f_j(x)}}{j(j+1)}.$$

>**Question.** Despite the complicated expressions for $f_n$ and $g_n$, does 
$$h_n(x)=\sum_{k=0}^n\left(g_n(x)-g_k(x)\right)^2$$
have a neat (closed) formula? 

**Convention:** $g_0:=0$.


[1]: http://mathoverflow.net/questions/260169/lower-bound-for-frac-sum-i-j-minf-i-f-j2-g-i-g-j2-sum-i-j-max