ĐKXĐ: \(1\le x\le3\)
Đặt \(\sqrt{x-1}+\sqrt{3-x}=t\)
Ta có: \(\sqrt{x-1}+\sqrt{3-x}\ge\sqrt[]{x-1+3-x}=\sqrt{2}\)
\(\sqrt{x-1}+\sqrt{3-x}\le\sqrt{2\left(x-1+3-x\right)}=2\)
\(\Rightarrow t\in\left[\sqrt{2};2\right]\)
\(t^2=x-1+3-x+2\sqrt{\left(x-1\right)\left(3-x\right)}=2+2\sqrt{-x^2+4x-3}\)
\(\Rightarrow-2\sqrt{-x^2+4x-3}=2-t^2\)
\(\Rightarrow f\left(x\right)=f\left(t\right)=t+2-t^2\)
\(f'\left(t\right)=1-2t=0\Rightarrow t=\dfrac{1}{2}\notin\left[\sqrt{2};2\right]\)
\(f\left(\sqrt{2}\right)=\sqrt{2}\) ; \(f\left(2\right)=0\)
\(\Rightarrow M=\sqrt{2}\)