Example 6.2.4 Find the smallest $t$ such that the following inequality holds for any real numbers $x_{1}, x_{2}, \cdots, x_{n}$.
$$x_{1}^{2}+\left(x_{1}+x_{2}\right)^{2}+\cdots+\left(x_{1}+x_{2}+\cdots+x_{n}\right)^{2} \leq t\left(x_{1}^{2}+x_{2}^{2}+\cdots+x_{n}^{2}\right) \quad \text { (MYM 2004) }$$
Solution: Let $c_{1}, c_{2}, \cdots, c_{n}$ be positive real numbers (to be chosen later). According to the Cauchy-Schwarz inequality, we have
\[
\left(\sum_{i=1}^{k} x_{i}\right)^{2} \leq S_{k}\left(\sum_{i=1}^{k} \frac{x_{i}^{2}}{c_{i}}\right)
\]
(*)

Here, $S_{1}, S_{2}, \cdots, S_{n}$ are determined by
\[
S_{k}=\sum_{i=1}^{k} c_{i} \quad(k=1,2, \cdots, n)
\]

According to (*), we have (for $k=1,2, \cdots, n$, summing all results)
\[
\sum_{k=1}^{n}\left(\sum_{i=1}^{k} x_{i}\right)^{2} \leq \sum_{k=1}^{n}\left(\sum_{j=k}^{n} \frac{S_{j}}{c_{j}}\right) x_{i}^{2}
\]

We choose the coefficients $c_{1}, c_{2}, \cdots, c_{n}$ such that
\[
\frac{S_{1}+S_{2}+\cdots+S_{n}}{c_{1}}=\frac{S_{2}+\cdots+S_{n}}{c_{2}}=\cdots=\frac{S_{n}}{c_{n}}=t
\]

After some calculations, we have
\[
c_{i}=\sin i \alpha-\sin (i-1) \alpha, \quad k=1,2, \cdots, n
\]

Here, $\alpha=\frac{\pi}{2 n+1}$, so $t=\frac{1}{4 \sin ^{2} \frac{\pi}{2(2 n+1)}}$, and we obtain
\[
\sum_{k=1}^{n}\left(\sum_{i=1}^{k} x_{i}\right)^{2} \leq t\left(\sum_{i=1}^{n} x_{i}^{2}\right)=\frac{1}{4 \sin ^{2} \frac{\pi}{2(2 n+1)}}\left(\sum_{i=1}^{n} x_{i}^{2}\right)
\]