Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Derivative of Abs(x)

  1. May 6, 2004 #1
    Hi,

    I have spent some time looking in Schaums, Eric Weisstein and google for the answer but cannot find it so I thought i'd see if anyone here could.

    I would like to find the second derivative or |x| please. (wrt x).

    I think there are some delta functions in there but would like to see where they come from.

    Thank-you in advance.

    Richard
     
  2. jcsd
  3. May 6, 2004 #2
    Think about it geometrically, abs(x) looks like f(x) = x for x>0 and f(x) = -x for x<0. So f'(x) = 1 for x>0 and f'(x) = -1 for x<0. The derivative of any constant is 0. So f''(x) = 0 for f = abs(x). I think the easiest way to prove it rigourously would be to use the Mean Value Theorem.
     
  4. May 7, 2004 #3
    Hmmm, thanks for the response.

    I'm reverse engineering a sakurai quantum mechanics problem involving this derivative and have found the the answer definately contains a delta function - i.e by seeing the corrrect working I know it contains this. I just want to understand it now.
     
  5. May 7, 2004 #4

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    |x| isn't differentiable (everywhere) so you must specify the domain, and if you want to include 0 then you're stuck.
     
  6. May 7, 2004 #5

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    :confused: While bored one lesson I'm sure I ended up proving:

    Where:

    [tex]f(x) = |g(x)|[/tex]

    Then:

    [tex]f'(x) = g'(x) \frac{|g(x)|}{g(x)}[/tex]

    Is this wrong?
     
  7. May 7, 2004 #6

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    What happens to your proof when g(x) = 0 and g'(x) != 0?
     
  8. May 8, 2004 #7

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    Erm what? Well if g(x) = 0 then:

    [tex]f'(x) = g'(x) \frac{0}{0}[/tex]

    Which is undefined right? Surely that makes sense as the change of the curve at that point is undefined. I'd be really interested to see if I got this right or not.
     
  9. May 8, 2004 #8

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    The derivative of |x^3| does in fact exist at x = 0.

    BTW, I thought you were refuting that the derivative of the abs function is somewhere nondifferentiable, so I withdraw my implication. :smile:
     
  10. May 8, 2004 #9

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    For x> 0, |x|= x so "locally" (close to x so we are still looking only at positive numbers) |x| is the same as x and has the same derivative: 1
    (You do need x> 0 so that |x|= x is true on both sides of x.)
    For x< 0, |x|= -x so "locally" |x| is the same as -x and has the same derivative: -1.

    Now look at x= 0 ) (|0+h|- |0|)/h= |h|/h which is 1 if h> 1 and -1 if h< 1. That is, the limit "from above" is 1 and the limit "from below" is -1. Since those two are not the same, the limit itself does not exist: |x| is not differentiable at x= 0.
    That is, the derivative of |x| is 1 for x>0, -1 for x< 0 and not defined for x=0.
    (A variation of the "Heavyside function" which is defined as "0 for x< 0, 1 for x> 0, not defined for x= 0".)
    The second derivative is easy: Since the first derivative is a constant (1) for all x>0, the second derivative there is 0. Since the first derivative is a constant (-1) for all x< 0, the second derivative there is 0. Since the first derivative is not defined for x=0, the second derivative is not either.

    That's all in terms of ordinary functions. Since you mention the Dirac delta function, you are actually talking about "distributions" (also called "generalized functions").
    Although the derivative of the absolute value is not defined at 0, since that is only one point, we can talk about integrating it: let f(x) be "-1 for x< 0, 1 for x> 0, not defined for x= 0"- that is, the derivative of |x|. For any continuous function g(x), The integral, from -a to X (-a a fixed negative number, X a variable), of f(x)g(x), is simply the integral of -g(x) from -a to 0 plus the integral of g(x) from 0 to X. Since f(x) is not continuous at 0, the integral is not continuous at 0: there is a jump in the value of the integral at 0. It is easy to calculate that that jump is exactly g(0). If we were to calculate the derivative at x, we would find that the derivative is 0 at every x except 0 and is g(0) at x= 0. That is precisely the definition of the Dirac delta function.
     
  11. May 8, 2004 #10

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    Oh right o.k :smile: , well err I never thought about that one. Are you sure it does exist at 0? I've not got access to any graphical tools on my home computer but other than at x=0 my formulae still works. As it gives that:

    [tex]\frac{d}{dx} \left( \left|x^3 \right| \right) = 3\frac{\left|x^3 \right|}{x} [/tex]

    Oh well never mind, there goes my idea lol. I might try and work it out again from first principles, see if I missed something.
     
    Last edited: May 8, 2004
  12. May 8, 2004 #11

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    simple exercise for the reader: if f is continuous at 0, then g(x) = x|f(x)| is differentiable at 0.
     
  13. May 8, 2004 #12

    Gokul43201

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    The derivative you want is a dirac-delta at the origin. That's what Physicists are most happy with when differentiating a step function.

    Think of the first derivative as the limiting case of a function that is defined as :
    (i) f(x) = 1, x > x0, x0 > 0
    (ii) f(x) = -1, x < -x0,
    (iii) f(x) is an s-shaped curve from (-x0,-1) to (x0,1) passing thru' O,

    The second derivative is thus a bell shaped curve from -x0 to x0.
    And when you make x0 --> 0, you get the dirac-delta.
     
  14. May 8, 2004 #13

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    matt grime sorry I don't know what your talking about :frown:

    But my formulae thing might still work:

    [tex]\frac{d}{dx} \left( \left|x^3 \right| \right) = 3x^2 \frac{ \left| x^3 \right| }{x^3}[/tex]

    [tex]\frac{d}{dx} \left( \left|x^3 \right| \right) = 3\frac{\left|x^3 \right|}{x}[/tex]

    [tex]\frac{d}{dx} \left( \left|x^3 \right| \right) = 3\frac{|x|x^2}{x}[/tex]

    [tex]\frac{d}{dx} \left( \left|x^3 \right| \right) = 3|x|x[/tex]

    Yey! :smile:
     
  15. May 8, 2004 #14

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    gokul, i hope you aren;'t trying to say that |x| is differentiable at the origin. it isn't.

    and zurtex, rather than relying on intuition and/or a graphical calculator why don't you just work out the derivative properly? The limit as h tends to zero of (f(x+h)-f(x))/h, which is after all the definition of derivative, and shows that |x| is not differentiable at the origin since the limit is not well defined.
     
  16. May 8, 2004 #15

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    :frown: My formulae is not intuition, I remember working it out from:

    [tex]|x| = + \sqrt{x^2}[/tex]

    And then some very careful use of the chain rule.

    P.S. Been meaning to ask if it was right for quite some time but kept forgetting.
     
  17. May 8, 2004 #16

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    well, according to your formula, you appear to claim that things are differentiable (at 0) when they aren't; do it from first principles as you mentioned you were going to do and you'll get the answer for all x, not just those points where it works; you need to examine the parts where the function is zero very carefully, but the simple proof that if f is continuous at the origin, then xf(x) is differentiable there can be of some help. you make no restrictions on where your formula is valid, and thus appear to claim |x| is differentiable at 0, when it isn't, but |x|^3 is, with the derivative as you've worked out.
     
  18. May 8, 2004 #17

    Gokul43201

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Matt,

    |x| is strictly not differentiable at x=0. But for physical systems that exhibit step function like behavior, the derivative looks like a spike at the stepping point. Physicists call this the dirac-delta function, and define it as the derivative of the step function, because they can not accept "undifferentiable" if the derivative is a physical thing. Google 'dirac-delta' to see more about this function.

    Robousy,

    If you are solving Sakurai problems, I'm assuming you've gone through more elementary texts like Jackson or Griffiths (E&M). You should have come across dirac-deltas in there, in solving charge density based problems for point charges.
     
  19. May 8, 2004 #18

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    :confused: Sorry but I am getting really confused. Where have I said that |x| is differentiable at 0? In fact if you use my assume my formulae is correct then it is not!

    I'll have a look over the maths, but are you saying my formulae is wrong and if so why?
     
  20. May 8, 2004 #19

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    Gokul, I am pefectly aware of the dirac delta distribution, however mod(x) doesn't display step like properties so that information is useless, unless you wish to clarify for me what you mean by 'step like', and the delta is not a spike, though it is in approximations a limit of spikes. so what do you think a physicist would define the derivative of mod(x) to be? In you limit case you didn't state what the limit would be, but we can imagine it to be -1,0,1 for x strictly negative, zero, and strictly positive respectively.

    Zrutex, in post five if we subs in g(x)=x, then we get that undefined thing, right? but later you use it to work out the derivative of |x|^3, which still has an undefined thing at the origin but is still differentiable there, so which do you want to claim? that the derivative is always undefined for g(x)=0? cos it isn't. you need to clear up these cases; the formula as is is not correct becuase you're omitting the 'interesting' cases. you're correct for the points where g is not zero, since f is either g or -g in some neighbourhood of such point.
     
  21. May 8, 2004 #20

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    Sorry if this seems like I am hijacking somebodies post, if so just say so and I will make a new thread, but this really does seem relevant. Now here is my working please say if I am wrong:

    [tex]
    \begin{align*}

    f(x) = |x| = +\sqrt{x^2} \\ \\
    f'(x) = \frac{ \frac{1}{2} 2x}{+\sqrt{x^2}} \\ \\
    f'(x) = \frac{x}{|x|}

    \end{align*}
    [/tex]

    Whoops looks like I got x and |x| the wrong way around in my previous post. But if we carry this on, where:

    [tex]y = fg(x)[/tex]

    Then by chain rule:

    [tex]y' = g'(x)f'g(x)[/tex]

    Using previous result:

    [tex]y' = g'(x)\frac{g(x)}{|g(x)|}[/tex]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Derivative of Abs(x)
  1. Derivative of |x| (Replies: 5)

  2. Derivative of x! (Replies: 6)

  3. Derivative of x^sin(x) (Replies: 9)

  4. Derivative of a^x (Replies: 13)

Loading...