2

How to differentiate $x^2-|x^3|$?

I tried breaking it into a piecewise function but I've been told this is not necessary.

How can I approach this in another way?

YoTengoUnLCD
  • 13,384

5 Answers5

6

use $|x|=\sqrt{x^2}$

so the equation becomes equivalent to $$x^2-\sqrt{x^6}$$

E.H.E
  • 23,280
2

$$f(x)=x^2-|x^3|=\begin{cases}x^2-x^3~,~x\geq 0\\ x^2+x^3~,~x\leq 0\end{cases}$$

$$\implies f'(x)=\begin{cases}2x-3x^2=x(2-3x)~,~x\gt 0\\ 0~,~x=0\\ 2x+3x^2=x(2+3x)~,~x\lt 0\end{cases}$$

I think this is the simplest way to do it.

You can use piecewise functions. There is no problem with that. Any other approach mimics the same thing and will give you the exact same result.

0

We have the case of a composition of functions $g \circ f; g(x)=|x|, f(x)=x^3 $. The general result is that then $g \circ f $ is differentiable if (not of iff! ) g is differentiable at $f(x)$. But $g$ is differentiable everywhere except at 0 , so $g(f(x)$ may at worst not be differentiable at $0$, so that the only possible problem with the derivative of $|x^3|$ is at $0$, since $x^3$ is everywhere -differentiable and $|x|$ is differentiable everywhere but 0. But let of $0$, $3x^2 $ and $-3x^2$ both approach 0, so $x^2- |x^3|$ is everywhere differentiable.

EDIT: ultimately, the derivatives of $-x^3 , x^3$ are both everywhere continuous, and, in particular, are both continuous at $0$. By sequential continuity it follows that the limit t $0$ is $0$.

gary
  • 4,027
  • You seem to be using a theorem of sorts: If $\lim_{x\to 0} f'(x)= L ,$ then $f'(0) = L.$ Well, that's true, but is this what you intended? It might be easier just to compute $f'(0)$ from the definition. – zhw. Apr 15 '15 at 00:13
  • Well, I am using that g is differentiable everywhere except at $x=0$, and so $g(f(x)$ is differentiable when $f(x) \ neq 0 $, an possibl not at $x=0$. But the case at $x=0$ s clearly seen to be differentiable. – gary Apr 15 '15 at 00:18
  • @zhw.: But I also want to justify that $g(f(x))$ is differentiable when $g$ is differentiable at $f(x)$ , to justify that $|x^3|$ is differentiable everywhere outside of possibly $0$ an then showing that it is also differentiable at $0$.. – gary Apr 15 '15 at 00:23
  • Fine, but the route you chose to show the derivative exists at $0$ depends on the result I noted. It's a valid approach, but needs justification (it follows from the MVT). The easier route in this case, I think, is to just to go back to the definition of the derivative. – zhw. Apr 15 '15 at 00:36
  • I think you can also use continuity, i.e., show that here both derivatives are continuous at $0$. But the MVT would show it too. I will edit to rigorize. – gary Apr 15 '15 at 00:42
0

Alternatively:

We have $f(0) = 0$ and $f(x) = x^2(1 - |x|)$, as $|x|^3 = |x|x^2$.

Hence the derivative at zero,

$$f'(0) = \lim_{x \to 0} \frac{f(x) - f(0)}{x} = \lim_{x \to 0} \frac{x^2(1-|x|)}{x} = \lim_{x \to 0} x(1-|x|) = 0$$

Simon S
  • 26,524
0

One trick you can use is :

$$\frac{\rm d}{{\rm d}x} \vert x \vert = \frac{\vert x \vert}{x}$$

So with the chain rule you get:

$$\begin{align} \frac{\rm d}{{\rm d}x} x^2 - \vert x^3 \vert &= 2x - \frac{\rm d}{{\rm d}x} \vert x^3 \vert \\ &= 2x - \frac{\vert x^3 \vert}{x^3} \frac{\rm d}{{\rm d}x} x^3 \\ &= 2x - \frac{\vert x^3 \vert}{x^3} 2x^2 \\ &= 2x - \frac 2x \vert x^3 \vert \\ \end{align}$$

DanielV
  • 23,556