\(3x-\sqrt{x^2-2x+1}\left(1\right)=3x-\sqrt{\left(x-1\right)^2}=3x-\left|x-1\right|\)
TH1: x<1
\(\left(1\right)=3x+x-1=4x-1\)
TH2: \(x\ge1\)
\(\left(1\right)=3x-x+1=2x+1\)
\(3x-\sqrt{x^2-2x+1}\)
\(=3x-\left|x-1\right|\)
\(=\left[{}\begin{matrix}3x-x+1=2x+1\left(x\ge1\right)\\3x+x-1=4x-1\left(x< 1\right)\end{matrix}\right.\)