3. 1. 10 * 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}$.
Let the common difference be $d$, and $a_{n+1}=a$, then $S=a_{n+1}+a_{n+2}+\cdots+a_{2 n+1}=(n+1) a+$ $\frac{1}{2} n(n+1) d$, so $a+\frac{1}{2} n d=\frac{S}{n+1}$, and
$$
\begin{aligned}
M \geqslant a_{1}^{2}+a_{n+1}^{2} & =(a-n d)^{2}+a^{2} \\
& =\frac{4}{10}\left(a+\frac{1}{2} n d\right)^{2}+\frac{1}{10}(4 a-3 n d)^{2} \geqslant \frac{4}{10}\left(\frac{S}{n+1}\right)^{2},
\end{aligned}
$$

Therefore, $|S| \leqslant \frac{1}{2} \sqrt{10}(n+1) \sqrt{M}$, and when $a=\frac{3}{\sqrt{10}} \sqrt{M}, d=\frac{1}{\sqrt{10}} \cdot \frac{1}{n} \cdot \sqrt{M}$,
$$
\begin{aligned}
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) \cdot \frac{5}{\sqrt{10}} \sqrt{M}-\frac{\sqrt{10}}{2}(n+1) \sqrt{M},
\end{aligned}
$$

Since at this time $4 a=3 n d$, so $a_{1}^{2}+a_{n+1}^{2}=\frac{4}{10}\left(\frac{S}{n+1}\right)^{2}=\frac{4}{10} \cdot \frac{10}{4} M=M$.
Therefore, the maximum value of $S$ is $\frac{\sqrt{10}}{2}(n+1) \sqrt{M}$.