Derivative of$ \sqrt{x^2}$ I found the Derivative of $\sqrt{x^2}$ to be  1 using simplifications and the power rule, but when I checked the answer, it was in fact $=\frac{x}{\left|x\right|}$ and not $=1$.

What could have been wong with my approach?

$f(x)=(x^2)^{1/2}=x^{2/2}=x
\\f'(x)=1$
Note that $\sqrt{x^2}=|x|$. For example, $\sqrt{(-2)^2}=\sqrt4=2$.
The issue here is that $\sqrt{x^2}=\pm x$  which mean that it is not really a function. However, defining $\sqrt{x^2}=|x|$ solves the problem.