6. The maximum value of the function $f(x)=\sqrt{x^{4}-3 x^{2}-6 x+13}-\sqrt{x^{4}-x^{2}+1}$ is . $\qquad$
6. Given $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}} \text {. }
$$

It can be known that the geometric meaning of the function $y=f(x)$ is:
the difference in distances from a point $P\left(x, x^{2}\right)$ on the parabola $y=x^{2}$ to the points $A(3,2)$ and $B(0, 1)$.

Since point $A$ is below the parabola and point $B$ is above the parabola, the line $A B$ intersects the parabola. The intersection points are determined by the system of equations
$$
\left\{\begin{array}{l}
y=x^{2} \\
\frac{y-1}{x-0}=\frac{2-1}{3-0}
\end{array}\right.
$$

Eliminating $y$ yields the equation $3 x^{2}-x-1=0$. Since the constant term of this equation is negative, the equation must have a negative root.

Because the difference between two sides of a triangle is less than the third side, when point $P$ is at the intersection point $C$ corresponding to the negative root, $f(x)$ has a maximum value of $|A B|=\sqrt{10}$.