5. When $1 \leqslant x \leqslant 2$, simplify
$$
\sqrt{x+2 \sqrt{x-1}}+\sqrt{x-2 \sqrt{x-1}}=
$$
$\qquad$ .
5. 2 .

Notice that
$$
\begin{array}{l} 
\sqrt{x+2 \sqrt{x-1}}+\sqrt{x-2 \sqrt{x-1}} \\
= \sqrt{(x-1)+2 \sqrt{x-1}+1}+ \\
\sqrt{(x-1)-2 \sqrt{x-1}+1} \\
= \sqrt{(\sqrt{x-1}+1)^{2}}+\sqrt{(\sqrt{x-1}-1)^{2}} \\
=|\sqrt{x-1}+1|+|\sqrt{x-1}-1| .
\end{array}
$$

Since $1 \leqslant x \leqslant 2$, we have $\sqrt{x-1}-1 \leqslant 0$.
$$
\begin{array}{l}
\text { Therefore, } \sqrt{x+2 \sqrt{x-1}}+\sqrt{x-2 \sqrt{x-1}} \\
=\sqrt{x-1}+1-(\sqrt{x-1}-1)=2 \text {. }
\end{array}
$$