6
$\begingroup$

I know that $$f(x)=x\cdot|x|$$ have no derivative at $$x=0$$ but how do I calculate it's derivative for the rest of the points? When I calculate for $$x>0$$ I get that $$f'(x) = 2x $$ but for $$ x < 0 $$ I can't seem to find a way to solve the limit. As this is homework please don't put the answer straight forward.

$\endgroup$
4
  • 6
    $\begingroup$ Hint: what is $|x|$ if $x<0$? $\endgroup$
    – Sigur
    Commented Jan 7, 2013 at 23:49
  • $\begingroup$ I know that it's -x but I still can't get further... I'm stuck with a big polynom $\endgroup$
    – Georgey
    Commented Jan 7, 2013 at 23:51
  • 6
    $\begingroup$ I believe you have a derivative at $x=0$. $\endgroup$
    – timur
    Commented Jan 7, 2013 at 23:51
  • $\begingroup$ Do you know the following characterization, which is the root of linear approximation: $f$ is differentiable at $0$ with derivative $f'(0)$ if and only if $f(x)=f(0)+xf'(0)+x\epsilon(x)$ with $\lim_{x\rightarrow 0}\epsilon (x)=0$? In your case, $\epsilon(x)=|x|$ and $f(0)=f'(0)=0$. Here is a reference: pirate.shu.edu/~wachsmut/ira/cont/proofs/diffaprx.html $\endgroup$
    – Julien
    Commented Jan 8, 2013 at 0:22

6 Answers 6

11
$\begingroup$
  • For $x \ge 0$ you have $f(x)=x \times |x| = x \times x = x^2$

  • For $x \le 0$ you have $f(x)=x \times |x| = x \times (-x) = -x^2$

so you can calculate the derivative when $x \gt 0$ and the derivative when $x \lt 0$ in the usual way.

You are wrong when you say there is no derivative when $x=0$.

$\endgroup$
7
$\begingroup$

First, draw a picture. Second, make a guess. Third, confirm your guess.

enter image description here

Hmm, looks like $x \mapsto x^2$ for $x \geq 0$ and $x \mapsto -x^2$ for $x \leq 0$. Indeed $f(x) = x^2$ for $x >0 $, so $f'(x) = 2 x$ when $x > 0$. Similarly, $f(x) = -x^2$ when $x <0$, so $f'(x) = -2x$ for $x <0$.

The only issue is $x=0$. Looking at the picture, and indeed, looking at the limiting value for $x \downarrow 0$ and $x \uparrow 0$ suggests that if $f$ is differentiable at $x=0$, then $f'(0) = 0$.

So, working with this guess, we try $$|f(x)-f(0) - 0.x| = |(x|x|)-0 -0.x| = |x|^2$$ If $x\neq 0$, we have $\frac{|f(x)-f(0) - 0.x|}{|x|} = |x|$, from which it follows that $f'(0) = 0$. Formally.

To wrap up, notice that $f'(x) = 2|x|$.

Working without the intuition is difficult. For me, drawing a rough picture provides much of the intuition. If the intuition is sound, then it is often straightforward to formalize the result.

$\endgroup$
8
  • $\begingroup$ I'm not supposed to draw the graph, just calculate the derivative. $\endgroup$
    – Georgey
    Commented Jan 7, 2013 at 23:52
  • 7
    $\begingroup$ Do the extra work. $\endgroup$
    – copper.hat
    Commented Jan 7, 2013 at 23:52
  • $\begingroup$ But how can I formally prove with tools I'm not allowed to use? $\endgroup$
    – Georgey
    Commented Jan 7, 2013 at 23:52
  • 2
    $\begingroup$ I think the idea is that the picture can help you figure out what answer you're supposed to get; it might not end up being the method you ultimately use in your written answer. $\endgroup$ Commented Jan 8, 2013 at 0:03
  • $\begingroup$ You can turn it into a slightly more formal proof by observing that the definition of the derivative of a function at a point only depends on its values around that point. So if two functions agree near that point, they have the same derivative there. For example, since $f(x)=x^2$ for $x>0$, the derivative of $f$ and the derivative of $x\mapsto x^2$ are equal at any point $x$ with $x>0$. $\endgroup$
    – user108903
    Commented Jan 8, 2013 at 0:04
6
$\begingroup$

There's a great trick that you can use. Notice that for all real $x \neq 0$ you have $|x| \equiv \sqrt{x^2}$.

If you want to know the derivative of $x|x|$ away from $x=0$ then consider $x\sqrt{x^2}$. Using the chain rule and the product rule we can show that, assuming $x \neq 0$,

$$\frac{d}{dx}x|x| \equiv \frac{d}{dx} x\sqrt{x^2} = \sqrt{x^2} + \frac{x^2}{\sqrt{x^2}} \equiv |x| + \frac{x^2}{|x|} \, . $$

Moreover, this little trick works in many more situations. For example, consider $f(|x|)$. Provided we stay away from $x = 0$, $g(|x|) \equiv g(\sqrt{x^2})$ and so:

$$\frac{d}{dx} g(|x|) = \frac{x}{|x|}\frac{d}{dx}g(|x|) \, . $$

$\endgroup$
0
3
$\begingroup$

When $x<0$ replace $|x|$ by $-x$ (since that is what it is equal to) in the formula for the function and proceed.

Please note as well that the function $f(x)=x\cdot |x|$ does have a derivative at $0$.

$\endgroup$
5
  • 2
    $\begingroup$ so is $f(x)' = 2x$ for $x >= 0$ and $f(x)' = -2x$ for $x < 0$? $\endgroup$
    – Georgey
    Commented Jan 7, 2013 at 23:58
  • 1
    $\begingroup$ @Eran Strictly speaking, $f(x)$ is a number and so $f(x)' = 0$ for all $x$. It's better to write $f'(x)$, i.e. $f'$ evaluated at $x$. $\endgroup$ Commented Jan 8, 2013 at 0:10
  • 2
    $\begingroup$ @Fly by Night Even more strictly speaking, f(x) is a number and so it is not a function and thus can't be differentiated at all. $\endgroup$ Commented Jan 8, 2013 at 0:19
  • $\begingroup$ @IttayWeiss Of course it can. You can think of it as a constant function if you like. $\endgroup$ Commented Jan 8, 2013 at 0:28
  • 2
    $\begingroup$ Not if you are being strict about the notation. Otherwise, you can also think of f(x)' as the derivative of f at x. Either f(x)' has no meaning (if you want to be strict), or you assign to it some plausible meaning. There are at least two (inconsistent) ways to do the latter. $\endgroup$ Commented Jan 8, 2013 at 0:36
3
$\begingroup$

Hint If $x\gt 0$ we are looking at $x^2$, easy. If $x\lt 0$, we are looking at $-x^2$, easy. For $x=0$, use the definition of the derivative.

So at $0$ we want $\displaystyle\lim_{h\to 0}\,\dots$,

$\endgroup$
0
$\begingroup$

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle #1 \right\rangle} \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace} \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left( #1 \right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $$ \color{#00f}{\large\totald{\pars{x\verts{x}}}{x}} =\verts{x} + x\sgn\pars{x} = \verts{x} + \verts{x} = \color{#00f}{\large 2\verts{x}} $$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .