2

The absolute value $|x|$ can be represented as $\sqrt{x^{2}}$, as per this question.

Let $f(x) = |x| = \sqrt{x^{2}}$. Solving for $f'(x)$, let $u = x^{2}$. Then, \begin{align*}\frac{df}{dx} &= \frac{df}{du}\cdot\frac{du}{dx} \\ &= \frac{d}{du}(\sqrt{u})\cdot\frac{d}{dx}(x^{2}) \\ &=\frac{1}{2\sqrt{u}}\cdot2x \\ &= \frac{x}{\sqrt{x^{2}}} \\ &= \frac{x}{|x|}\end{align*}

We can also see that $\sqrt{x^{2}} = \left(\sqrt{x}\right)^{2}$. Then, let $u = \sqrt{x}$. Solving for $f'(x)$, \begin{align*}\frac{df}{dx} &= \frac{df}{du}\cdot\frac{du}{dx} \\ &= \frac{d}{du}(u^{2})\cdot\frac{d}{dx}(\sqrt{x}) \\ &= 2u\cdot \frac{1}{2\sqrt{x}} \\ &= \frac{\sqrt{x}}{\sqrt{x}} \\ &= 1\end{align*}

I think the problem here is by letting $u = \sqrt{x}$. What seems to be the problem?

soupless
  • 2,344

3 Answers3

3

Both are fine. What happens is that the second approach only makes sense when $x>0$. And then you do indeed have $(\sqrt{x^2})'=1\left(=\frac x{|x|}\right)$.

2

Yes. You are working over the reals, so how can $\sqrt{-1}$ be defined when you substitute $u=\sqrt x$?

Parcly Taxel
  • 103,344
2

Consider real valued functions $f(x)=\sqrt { x^2}$ and $g(x)=(\sqrt{ x})^2$. $f$ and $g$ have different domains. Domain of $f=\mathbb R$ and that of $g$ is $[0,\infty)$ and hence $f$ and $g$ are not the same.

We'll have $f(x)=g(x)$ if $x\in [0,\infty)$.

Therefore in second part, you have unknowingly assumed that $x\gt 0$ and therefore derivative is $1$ which tallies with your result in first part.

Koro
  • 11,402