Five. (Full marks 20 points) Given a positive integer $n$ and a positive number $M$, for all arithmetic sequences $a_{1}, a_{2}, a_{3}, \cdots$ satisfying the condition $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}$.
$$
\frac{\sqrt{10}}{2}(n+1) \sqrt{M}
$$

V. 【Analysis and Solution】Let the common difference 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$,
so $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(\frac{S}{n+1}\right)^{2}$.
Therefore, $|S| \leqslant \frac{\sqrt{10}}{2}(n+1) \sqrt{M}$,
and when $a=\frac{3}{\sqrt{10}} \sqrt{M}, d=\frac{4}{\sqrt{10}} \cdot \frac{1}{n} \sqrt{M}$,
$$
S=(n+1)\left[\frac{3}{\sqrt{10}} \sqrt{M}+\frac{n}{2} \cdot \frac{4}{\sqrt{10}} \cdot \frac{1}{n} \sqrt{M}\right]=(n+1) \frac{5}{\sqrt{10}} \sqrt{M}=\frac{\sqrt{10}}{2}(n+1) \sqrt{M} \text {. }
$$

Since at this time $4 a=3 n d$, we have $a_{1}^{2}+a_{n+1}^{2}=\frac{4}{10}\left(\frac{S}{n+1}\right)^{2}=\frac{4}{10} \cdot \frac{10}{4} \sqrt{M}=\sqrt{M}$.

Therefore, the maximum value of $S$ is $\frac{\sqrt{10}}{2}(n+1) \sqrt{M}$.