Example 2 Find the maximum value of $f(x)=\sqrt{x^{4}-3 x^{2}-6 x+13}$ $-\sqrt{x^{4}-x^{2}+1}$.
(1992, National High School Competition)
Analysis: From $f(x)=\sqrt{(x-3)^{2}+\left(x^{2}-2\right)^{2}}$ $-\sqrt{x^{2}+\left(x^{2}-1\right)^{2}}$, let $Z_{1}\left(x-3, x^{2}-2\right)$, $Z_{2}\left(x, x^{2}-1\right)$, then $f(x)=\left|O Z_{1}\right|-\left|O Z_{2}\right|$. The above problem is actually a geometric problem, that is, to find the maximum value of the difference in distances from two moving points to the origin in the Cartesian coordinate plane.
Let $z_{1}=(x-3)+\left(x^{2}-2\right) \mathrm{i}, z_{2}=x+\left(x^{2}-1\right) \mathrm{i}$. From $\left|z_{1}\right|-\left|z_{2}\right| \leqslant\left|z_{1}-z_{2}\right|$, we have
$$
\begin{aligned}
f(x)= & \left|(x-3)+\left(x^{2}-2\right) \mathrm{i}\right| \\
& -\left|x+\left(x^{2}-1\right) \mathrm{i}\right| \\
& \leqslant|-3-\mathrm{i}|=\sqrt{10} .
\end{aligned}
$$

The maximum value $\sqrt{10}$ is achieved when and only when $z_{1}=k z_{2}, k>1$, i.e., $x-3=k x$ and $x^{2}-2=k\left(x^{2}-1\right)$. Solving these equations, we get $x=\frac{1-\sqrt{37}}{6}$ and $k=\frac{3+\sqrt{37}}{2}$.

Moreover, the inequality of the modulus of complex numbers is often used to prove some geometric inequalities, such as the proof of the generalized form of Ptolemy's theorem.