\(y=\sqrt{x^2-2x+1}+\sqrt{x^2-6x+9}\)
\(=\sqrt{x^2-2\cdot x\cdot1+1^2}+\sqrt{x^2-2\cdot x\cdot3+3^2}\)
\(=\sqrt{\left(x-1\right)^2}+\sqrt{\left(x-3\right)^2}\)
\(=\left|x-1\right|+\left|x-3\right|\)
TH1: x<1
\(y=1-x+3-x=4-2x\)
TH2: 1<=x<3
\(y=x-1+3-x=2\)
TH3: x>=3
\(y=x-1+x-3=2x-4\)
Bảng giá trị:
x | 0 | 1 | 2 | 3 | 4 |
y | 4 | 2 | 2 | 2 | 4 |
Đồ thị của hàm số sẽ là: