Example 6 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}$.
Given the problem, $S=\frac{1}{2}(n+1)\left(a_{n+1}+a_{2 n+1}\right)$.
$\because a_{1}+a_{2 n+1}=2 a_{n+1}$, i.e., $a_{2 n+1}=2 a_{n+1}-a_{1}$,
$$\therefore S=\frac{1}{2}(n+1)\left(3 a_{n+1}-a_{1}\right) \text {. }$$

By the Cauchy-Schwarz inequality,
$$\begin{array}{l}
S \leqslant \frac{1}{2}(n+1) \cdot \sqrt{\left[3^{2}+(-1)^{2}\right]\left(a_{1}^{2}+a_{n+1}^{2}\right)} \\
\leqslant \frac{1}{2}(n+1) \sqrt{10 M}
\end{array}$$

Equality holds if and only if $3 a_{n+1}-a_{1}>0, a_{1}^{2}+a_{n+1}^{2}=M, \frac{a_{n+1}}{3}=$ $\frac{a_{1}}{-1}$, i.e., when $a_{1}=-\frac{\sqrt{10 M}}{10}, a_{n+1}=\frac{3 \sqrt{10 M}}{10}$, $S_{\text {max }}=\frac{1}{2}(n+1) \sqrt{10 M}$.