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$
 A: Note that $\sqrt{x^2}=|x|$. For example, $\sqrt{(-2)^2}=\sqrt4=2$.
A: Let $y=\sqrt{x^2}$, which is identical to $y=|x|.$ Recall the latter equation is equivalent to the piecewise function below: $$y=\begin{cases}-x\ \big|\ (-\infty,0)\\ x\ \big|\ (0,\infty) \end{cases}. $$ Consequently, $$\frac{dy}{dx}=\begin{cases}-1\ \big|\ (-\infty, 0)\\ 1\ \big|\ (0,\infty) \end{cases}. $$
A: You're applying rules of exponents which are not universal.  In particular, you're trying to use
$$(x^a)^b = x^{ab}$$
with $a=2$ and $b=\tfrac12$.  The problem is that this is not true for all real $x, a, b$.  But often this gets glossed over in courses.  To add to the confusion, it does work and is frequently used in several common, overlapping contexts:


*

*when $x > 0$, for all real $a,b$;

*when $x \ge 0$, for all $a,b > 0$;

*when $a$ and $b$ are positive integers, for all $x$;

*when $a$ and $b$ are rationals with odd denominator, for all real $x \ne 0$.


The lack of one narrow context can lead some to the impression that it always holds, even when it obviously does not:
$$((-1)^2)^{1/2} = 1^{1/2} = 1.$$
A moment's reflection on this calculation should tell you that in general, $(x^2)^{1/2} = |x|$ for any real $x$.
The reason you got $x^1$ instead of $|x|$ is that by simplifying the exponent you were effectively assuming that $x\ge 0$ (note that $x<0, a=2, b=\tfrac12$ does not fall into any of the contexts listed above).  And indeed it is true that $x^1$ and $|x|$ are identical for $x \ge 0$ (likewise $x/|x|$ and $1$ are identical for $x>0$).
This misconception is sometimes exacerbated by selectively ignoring it in contexts where it's inconvenient.  For instance, when teaching trigonometric substitution I think it's very common to see $\sqrt{1-\sin^2 \theta}$ simplified to $\cos \theta$ rather than $|\cos \theta|$, without explicitly stating that the domain of $\theta$ has been chosen to render the distinction moot.
A: 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.
