Example 5 When $1 \leqslant x \leqslant 2$, simplify
$$
\sqrt{x+2 \sqrt{x-1}}+\sqrt{x-2 \sqrt{x-1}}
$$

The value equals $\qquad$ [5]
(2009, Beijing Middle School Mathematics Competition (Grade 8))
Solution 1
$$
p=\sqrt{x+2 \sqrt{x-1}}+\sqrt{x-2 \sqrt{x-1}} \text {. }
$$

Then $p^{2}=2 x+2 \sqrt{x^{2}-(2 \sqrt{x-1})^{2}}$
$$
=2 x+2 \sqrt{(x-2)^{2}} \text {. }
$$

Since $1 \leqslant x \leqslant 2$, therefore,
$$
\begin{array}{l}
p^{2}=2 x+2 \sqrt{(x-2)^{2}} \\
=2 x+2(2-x)=4 .
\end{array}
$$

And $p \geqslant 0$, so $p=2$.
Solution 2 Let
$$
p=\sqrt{x+2 \sqrt{x-1}}, q=\sqrt{x-2 \sqrt{x-1}}
$$

Then $p^{2}+q^{2}=2 x, p q=2-x$.
Since $(p+q)^{2}=p^{2}+q^{2}+2 p q$
$$
=2 x+2(2-x)=4(p \geqslant 0, q \geqslant 0) \text {, }
$$

Therefore, $p+q=2$, that is, the original expression $=2$.