8. Given $a, b \in [1,3], a+b=4$. Then
$$
\left|\sqrt{a+\frac{1}{a}}-\sqrt{b+\frac{1}{b}}\right|
$$

the maximum value is $\qquad$.
8. $\sqrt{\frac{10}{3}}-\sqrt{2}$.

From the fact that $x+\frac{1}{x}$ is an increasing function on $[1,3]$, we know that
$$
\sqrt{a+\frac{1}{a}}-\sqrt{(4-a)-\frac{1}{4-a}}
$$

is an increasing function.
Therefore, $\left|\sqrt{a+\frac{1}{a}}-\sqrt{b+\frac{1}{b}}\right| \leqslant \sqrt{\frac{10}{3}}-\sqrt{2}$.
The equality holds if and only if $a=1, b=3$ or $a=3, b=1$.