Let $\angle X O Y=90^{\circ}, P$ be a point inside $\angle X O Y$, and $O P=1, \angle X O P=30^{\circ}$. Draw an arbitrary line through point $P$ that intersects rays $O X$ and $O Y$ at points $M$ and $N$, respectively. Find the maximum value of $O M+O N-M N$.
(2004, IMO China National Training Team Selection Exam)
Solution: As shown in Figure 1, let
$$
\angle P M O=\theta\left(0^{\circ}<\theta\right.
$$
$<90^{\circ}$ ), then
$$
\begin{array}{l}
O M+O N-M N \\
=\frac{\sqrt{3}}{2}+\frac{1}{2} \cot \theta+ \\
\frac{1}{2}+\frac{\sqrt{3}}{2} \tan \theta-\frac{1}{2 \sin \theta}-\frac{\sqrt{3}}{2 \cos \theta} \text {. } \\
\text { Let } \tan \frac{\theta}{2}=t \in(0,1) \text {, then } \\
O M+O N-M N \\
=\frac{\sqrt{3}+1}{2}-\frac{t}{2}-\frac{\sqrt{3}}{2} \cdot \frac{1-t}{1+t} \\
=\sqrt{3}+1-\frac{1}{2}\left[(1+t)+\frac{2 \sqrt{3}}{(1+t)}\right] \\
\leqslant \sqrt{3}+1-\sqrt[4]{12} \text {. } \\
\end{array}
$$

When $t=\sqrt[4]{12}-1 \in(0,1)$, the equality holds.
Therefore, the maximum value of $O M+O N-M N$ is $\sqrt{3}+1-\sqrt[4]{12}$.
Generalization: Let $\angle X O Y=90^{\circ}, P\left(x_{0}, y_{0}\right)$ be a fixed point within $\angle X O Y$, and draw any line through point $P$ intersecting rays $O X$ and $O Y$ at points $M$ and $N$, respectively. Then

When $\frac{1}{2} x_{0}<y_{0}<2 x_{0}$, the maximum value of $O M+O N-M N$ is $2\left(x_{0}+y_{0}\right)-2 \sqrt{2 x_{0} y_{0}}$;

When $0<y_{0} \leqslant \frac{1}{2} x_{0}$, $O M+O N-M N$ has no maximum value, and its range of values is $\left(y_{0}, x_{0}\right)$;

When $y_{0} \geqslant 2 x_{0}$, $O M+O N-M N$ has no maximum value, and its range of values is $\left(x_{0}, y_{0}\right)$.
Proof is omitted.