Starting fuction: $y= \sqrt{x^2-2x+1}$
derivative A: $y^{\prime} = (1/2)(2x-2)(x^2-2x+1)^{-1/2}$
derivative B: rewrote the starting function as: $\sqrt{\left(x-1\right)^2} = \vert x -1 \vert$ thus
$y^{\prime} = $ either 1 if $x > 0$ or -1 if $x < 0$
First, are these the same answer? If they are different please tell me where I went wrong, if they are the same, please explain how and why I can have two different answers?