Example 7 Find the maximum value of the function $f(x)=\sqrt{x^{4}-3 x^{2}-6 x+13}$ $-\sqrt{x^{4}-x^{2}+1}$.
Solution: Since $f(x)=\sqrt{x^{4}-3 x^{2}-6 x+13}-$ $\sqrt{x^{4}-x^{2}+1}=\sqrt{(x-3)^{2}+\left(x^{2}-2\right)^{2}}$ $\sqrt{x^{2}+\left(x^{2}-1\right)^{2}}$,

Let $A(3,2), B(0,1), P\left(x, x^{2}\right)$, then $f(x)=$ $|P A|-|P B|$. Thus, the problem is transformed into finding a point $P$ on the parabola $y=$ $x^{2}$ such that $|P A|-|P B|$ is maximized.

Since point $A$ is below the parabola and point $B$ is above the parabola, the line $A B$ must intersect the parabola. The intersection points are found by solving the equation
eliminating $y$, we get $3 x^{2}-x-3=0$.
Since the constant term of the quadratic equation in $x$ is negative, the equation must have a negative root. Also, the difference of two sides of a triangle is less than the third side, so when point $P$ is at the intersection point corresponding to the negative root, $f(x)$ has a maximum value of $|A B|=\sqrt{10}$.