4
$\begingroup$

I have a function x * |x|

To get the derivative I used the first principals:

$$ f'(x) = ( (x-h) * | x + h | - (x * |x|) )/ h $$

So if x is + I got

$$ x ^ 2 + xh - xh - h^2 - x^2 / h $$ $$ -h^2/h$$ $$ -h $$ $$ 0 $$

If x is negative:

$$ x^2 - 2xh + h^2 - x^2$$ $$ -2xh+h^2 $$ $$ h (-2x + h)/h$$ $$ -2x + h $$ $$ -2x $$

So I checked with a derivative calculator and it says the answer is 2x....

So I'm not exactly sure why I got -2x, and why do we only used the negative part, why is the answer not -2x for negative x and 0 for positive x... why is only one chosen?

$\endgroup$

2 Answers 2

5
$\begingroup$

Since $|x|=\sqrt{x^2}$ we have $f(x)=x\cdot\sqrt{x^2}\Rightarrow f'(x)=\sqrt{x^2}+x\cdot\dfrac{1}{2\sqrt{x^2}}\cdot2x=|x|+\dfrac{x^2}{\left|x\right|}$.

EDIT: Further simplification: $f(x)=\dfrac{\left|x\right|^2+x^2}{\left|x \right|}= \dfrac{2\left| x\right|^2}{\left| x\right|}=2\left| x\right|$.

$\endgroup$
5
  • 1
    $\begingroup$ but f is differentiable at 0? $\endgroup$
    – Ghozt
    Commented Oct 15, 2013 at 13:13
  • $\begingroup$ I get it now, |x| = $sqrt(x^2)$ thats my problem. $\endgroup$
    – Ghozt
    Commented Oct 15, 2013 at 13:39
  • $\begingroup$ So at f'(0) = 0, so it is defined at 0 $\endgroup$
    – Ghozt
    Commented Oct 15, 2013 at 13:39
  • $\begingroup$ So f(x) is a continous function $\endgroup$
    – Ghozt
    Commented Oct 15, 2013 at 13:40
  • $\begingroup$ One should treat the (easy) case $x=0$ separately. $\endgroup$ Commented Oct 15, 2013 at 13:54
2
$\begingroup$

I think if you use the following equivalent definition, then the result will be achieved more concrete: $$f'(x_0)=\lim_{x\to x_0}\frac{f(x)-f(x_0)}{x-x_0}$$ In fact, while $x_0>0$ then $x\to x_0$ make $x$ to be positive and when $x_0<0$ then $x\to x_0$ make $x$ to be negative. So we will have $x|x|=x^2$ or $x|x|=-x^2$ respectively. Just think about $x_0=0$.

$\endgroup$
1
  • $\begingroup$ I still don't understand, if we say x|x| is either +x^2 or -x^2 then solving f'(x) would be 2x for +x^2 and -2x^2 - 2x for -x^2... so is the derivative of x|x| both 2x and -2x^2 - 2x? $\endgroup$
    – Ghozt
    Commented Oct 15, 2013 at 13:22

You must log in to answer this question.

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