Given any positive integer $n$, let $t(n)$ be the smallest real number such that for any real numbers $x_1,\dots,x_n$, the following inequality holds $$ \sum\limits_{k=1}^n (x_1+\dots+x_k)^2 \leqslant t(n) \sum\limits_{i=1}^n x_i^2.$$ Please give an expression for $t(n)$.
Attempt:
The problem is equivalent to calculating the maximum of $\sum\limits_{k=1}^n (x_1+\dots+x_k)^2$ on the unit $n$-sphere $\sum\limits_{i=1}^n x_i^2=1$. Let
$$ A := \begin{pmatrix} n & n-1 & n-2 & \cdots & 1\\ n-1 & n-1 & n-2 & \cdots & 1\\ n-2 & n-2 & n-2 & \cdots & 1\\ \vdots & \vdots & \vdots & \ddots & \vdots\\ 1 & 1 & 1 & \cdots & 1 \end{pmatrix}$$
Then
$$\sum\limits_{k=1}^n (x_1+\cdots+x_k)^2=xAx^T$$
where $x=(x_1,\dots,x_n)$. According to Lagrange multipliers, we know the problem is equivalent to calculating the maximum eigenvalue of $A$. Then I'm stuck. The book says that the answer is
$$\frac{1}{4\sin^2\left(\frac{\pi}{4n+2}\right)}.$$
It is really amazing. I would appreciate it if someone could please give me some hints.