Example 2 Let $x, y, z, w$ be real numbers, not all zero. Find the maximum value of $P=\frac{x y+2 y z+z w}{x^{2}+y^{2}+z^{2}+w^{2}}$.
Solution: Introducing undetermined constants $\alpha, \beta, \gamma > 0$, we have
$$
\begin{array}{l}
\alpha^{2} x^{2}+y^{2} \geqslant 2 \alpha x y, \beta^{2} y^{2}+z^{2} \geqslant 2 \beta y z, \\
\gamma^{2} z^{2}+w^{2} \geqslant 2 \gamma z w .
\end{array}
$$

Thus, $\frac{\alpha}{2} x^{2}+\frac{y^{2}}{2 \alpha} \geqslant x y=\beta y^{2}+\frac{z^{2}}{\beta} \geqslant 2 y z$,
$$
\frac{\gamma}{2} z^{2}+\frac{w^{2}}{\overline{ } \gamma} \geqslant z w \text {. }
$$

Adding the above three inequalities and rearranging, we get
$$
\begin{array}{l}
\frac{\alpha}{2} x^{2}+\left(\frac{1}{2 \alpha}+\beta\right) y^{2}+\left(\frac{1}{\beta}+\frac{\gamma}{2}\right) z^{2}+\frac{w^{2}}{2 \gamma} \\
\geqslant x y+2 y z+z w . \\
\text { Let } \frac{\alpha}{2}=\frac{1}{2 \alpha}+\beta=\frac{1}{\beta}+\frac{\gamma}{2}=\frac{1}{2 \gamma}, \text { solving for } \alpha=
\end{array}
$$

Let $\frac{\alpha}{2}=\frac{1}{2 \alpha}+\beta=\frac{1}{\beta}+\frac{\gamma}{2}=\frac{1}{2 \gamma}$, solving yields $\alpha=$ $\sqrt{2}+1>0$. Therefore,
$$
\begin{array}{l}
\frac{\sqrt{2}+1}{2}\left(x^{2}+y^{2}+z^{2}+w^{2}\right) \\
\geqslant x y+2 y z+z w .
\end{array}
$$

Thus, $\frac{x y+2 y z+z w}{x^{2}+y^{2}+z^{2}+w^{2}} \leqslant \frac{\sqrt{2}+1}{2}$.
Hence, $P_{\text {max }}=\frac{\sqrt{2}+1}{2}$ (when $x=w=1$ and $y=z$ $=1+\sqrt{2}$).