I have this expression, and I have to simplify it:
$D=\sqrt{x^2}+\sqrt{x^2-2x+1}$
Answer: $1)$ If $x<0, D=1-2x$, $2)$ if $0\le x<1, D=1;$ $3)$ if $x>1, D=2x-1$.
I received $|x-1| + |x|$, but I am not sure how to continue, and I have problems with understanding the answer.
$D = \sqrt{x^2}+\sqrt{(x-1)^2}=|x| + |x-1|$
$\sqrt{x^{2}}=|x|$ and $\sqrt {x^{2}-2x=1}=\sqrt {(x-1)^{2}}=|x-1|$. Now use the definition of absolute value function to complete the answer.
For example, $0 \leq x \leq 1$ implies $|x|=x$ and $|x-1|=1-x$ so $D=x+(1-x)=1$.