9. Given $n \in \mathbf{Z}^{+}$ and $M \in \mathbf{R}$, for all arithmetic sequences $a_{1}, a_{2}, \cdots, a_{n}, \cdots$ satisfying $a_{1}^{2}+a_{n+1}^{2} \leqslant M$, find the maximum value of $S=a_{n+1}+a_{n+2}+\cdots+a_{2 n+1}$.
9. Let the common difference of the arithmetic sequence $\left\{a_{n}\right\}$ be $d, a_{n+1}=a$, then $S=a_{n+1}+a_{n+2}+\cdots+a_{2 n+1}=(n+1) a+\frac{n(n+1)}{2} d$, hence $a+$ $\frac{n d}{2}=\frac{S}{n+1}$, then $M \geqslant a_{1}^{2}+a_{n+1}^{2}=(a-n d)^{2}+a^{2}=\frac{4}{10}\left(a+\frac{n d}{2}\right)^{2}+\frac{1}{10}(4 a-3 n d)^{2} \geqslant \frac{4}{10}\left(a+\frac{n d}{2}\right)^{2}$, so the maximum value of $S$ is $\frac{\sqrt{10}}{2}(n+1) \sqrt{M}$.