Example 18 (1985 Poland-Austria Joint Competition Problem) Let $x, y, z, w$ be four real numbers, not all zero, find the maximum value of $S=$ $\frac{x y+2 y z+z w}{x^{2}+y^{2}+z^{2}+w^{2}}$.
Introducing a parameter $t>0$, decompose the terms: $y^{2}=t y^{2}+(1-t) y^{2}, z^{2}=(1-t) z^{2}+t z^{2}$, thus $S=$ $\frac{x y+2 y z+z w}{\left(x^{2}+t y^{2}\right)+(1-t) y^{2}+(1-t) z^{2}+\left(t z^{2}+w^{2}\right)} \leqslant \frac{x y+2 y z+z w}{2 \sqrt{t} x y+2(1-t) y z+2 \sqrt{t} z w}$; let $2 \sqrt{t}: 2(1-t)=1$ : 2 , or $t^{2}-6 t+1=0$, solving gives $t=3-2 \sqrt{2}$, hence
$$
S \leqslant \frac{x y+2 y z+z w}{2 \sqrt{t}(x y+2 y z+z w)}=\frac{1}{2 \sqrt{t}}=\frac{1}{2 \sqrt{3-2 \sqrt{2}}}=\frac{\sqrt{2}+1}{2} \text {. }
$$

Therefore, when $x^{2}=(3-2 \sqrt{2}) y^{2}=(3-2 \sqrt{2}) z^{2}=w^{2}$, $S_{\max }=\frac{\sqrt{2}+1}{2}$.