Second Derivative of Abs(x) | Richard Seeking Answer

  • Thread starter Thread starter robousy
  • Start date Start date
  • Tags Tags
    Derivative
robousy
Messages
332
Reaction score
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
 
Physics news on Phys.org
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.
 
Hmmm, thanks for the response.

I'm reverse engineering a sakurai quantum mechanics problem involving this derivative and have found the the answer definitely contains a delta function - i.e by seeing the corrrect working I know it contains this. I just want to understand it now.
 
|x| isn't differentiable (everywhere) so you must specify the domain, and if you want to include 0 then you're stuck.
 
matt grime said:
|x| isn't differentiable (everywhere) so you must specify the domain, and if you want to include 0 then you're stuck.

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

Where:

f(x) = |g(x)|

Then:

f&#039;(x) = g&#039;(x) \frac{|g(x)|}{g(x)}

Is this wrong?
 
What happens to your proof when g(x) = 0 and g'(x) != 0?
 
Hurkyl said:
What happens to your proof when g(x) = 0 and g'(x) != 0?
Erm what? Well if g(x) = 0 then:

f&#039;(x) = g&#039;(x) \frac{0}{0}

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.
 
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:
 
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.
 
  • #10
Hurkyl said:
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:
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:

\frac{d}{dx} \left( \left|x^3 \right| \right) = 3\frac{\left|x^3 \right|}{x}

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:
  • #11
simple exercise for the reader: if f is continuous at 0, then g(x) = x|f(x)| is differentiable at 0.
 
  • #12
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.
 
  • #13
matt grime sorry I don't know what your talking about :frown:

But my formulae thing might still work:

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

\frac{d}{dx} \left( \left|x^3 \right| \right) = 3\frac{\left|x^3 \right|}{x}

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

\frac{d}{dx} \left( \left|x^3 \right| \right) = 3|x|x

Yey! :smile:
 
  • #14
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.
 
  • #15
matt grime said:
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.
:frown: My formulae is not intuition, I remember working it out from:

|x| = + \sqrt{x^2}

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.
 
  • #16
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.
 
  • #17
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.
 
  • #18
: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?
 
  • #19
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.
 
  • #20
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:

<br /> \begin{align*}<br /> <br /> f(x) = |x| = +\sqrt{x^2} \\ \\<br /> f&#039;(x) = \frac{ \frac{1}{2} 2x}{+\sqrt{x^2}} \\ \\<br /> f&#039;(x) = \frac{x}{|x|}<br /> <br /> \end{align*}<br />

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

y = fg(x)

Then by chain rule:

y&#039; = g&#039;(x)f&#039;g(x)

Using previous result:

y&#039; = g&#039;(x)\frac{g(x)}{|g(x)|}
 
  • #21
and if x is zero, what then? what are you going to claim 0/|0| is? It is obviously undefined as you've said. thus we cannot use your formula whenever we have a 0/0, and thus you must treat these cases differently. sometimes the function will be differentiable, sometimes not, but just using it as you've written it it is undefined for any function g when g is zero. or are we supposed to do the cancellations, and i think this then gets down to me being a fussy bugger; i like all the details worked out.
 
  • #22
Heh... Why is there a +/- in the first place? I thought it can just be sqrt and squared without all that's extra mess...
 
  • #23
O.K, I understand from the point of view of dealing with simple polynomials of finite order but what about if we had something like:

y = \left| \sin \left( \frac{1}{x} \right) \right|

And we wanted to know y', surely it would be plain painful dealing with it a section at a time.
 
  • #24
Ebolamonk3y said:
Heh... Why is there a +/- in the first place? I thought it can just be sqrt and squared without all that's extra mess...
Erm, think about taking the square root of a negative.
 
  • #25
imaginary.
 
  • #26
|x| = + \sqrt{x^2}

dun see the point of +/-
 
Last edited:
  • #27
Sorry I don't understand Ebolamonk3y.

|-1| = 1

If you square root -1 you get i, square that and you get -1. Where as if you square -1 you get 1 and if you then take its positive square root you get 1...
 
  • #28
|x| is not a step function. But it's first derivative is. And what we wanted was the second derivative.
 
  • #29
Something to note is that the square root function is not differentiable at zero, thus the chain rule doesn't apply in this case.

And, btw, x/|x| = |x|/x
 
  • #30
Hurkyl said:
Something to note is that the square root function is not differentiable at zero, thus the chain rule doesn't apply in this case.

And, btw, x/|x| = |x|/x
Well I've been going over the maths and it appears to work in the general form:

y = |f(x)|

y&#039;= f&#039;(x) \frac{f(x)}{|f(x)|}

Iff f(x)=0 and f'(x)=0 you need to look at the algebra and cancel it down. For the eqatuion y = x^{0.5} isn't the tangent, at x = 0, not simply y = 0? Thus dx/dy = 0 at x = 0.


Gokul43201, if you want to look at it following my formulae and not step by step as has been given before then:

\frac{d^2}{dx^2} (|x|) = \frac{d}{dx} \left( \frac{x}{|x|} \right)

By quotiont rule:

\frac{d^2}{dx^2} (|x|) = \frac{|x| - \frac{x}{|x|} x}{{|x|}^2}

As:

\frac{x}{|x|} = \frac{|x|}{x}

Then:

\frac{d^2}{dx^2} (|x|) = \frac{|x| - |x|}{{|x|}^2}

\frac{d^2}{dx^2} (|x|) = \frac{0}{{|x|}^2}

When x \neq 0 then:

\frac{d^2}{dx^2} (|x|) = 0
 
  • #31
:) Says who that it is not differentiable!
 
  • #32
Gokul, since |x| isn't differentiable everywhere, it doesn't make sense to talk of the derivative of something that does not exist, especially since the step funcntion is of the form, 0 for x<k, 1 for x=>k, for some k (right continuous, there is of course a left continuous variation, and it's use is in a formal analogy to the FTC in the integral sense, not differential); it is defined at k, which isn't like the 'derivative' of |x| whihc isn't defined at zero.
 
  • #33
Zurtex said:
O.K, I understand from the point of view of dealing with simple polynomials of finite order but what about if we had something like:

y = \left| \sin \left( \frac{1}{x} \right) \right|

And we wanted to know y', surely it would be plain painful dealing with it a section at a time.


not in the slightest: it is clearly not differentiable at the points where 1/x is an integer multiple of pi and the rest is obvious, depending on whether x is in an interval ((2m\pi)^{-1},((2m+1)\pi)^{-1}) or (((2m+1)\pi)^{-1},(2m\pi)^{-1}) for some integer m

you might also find it useful to write sign(x) rather than x/|x|, or |x|/x, cos that's all that's going on.
 
  • #34
matt grime said:
not in the slightest: it is clearly not differentiable at the points where 1/x is an integer multiple of pi and the rest is obvious, depending on whether x is in an interval ((2m\pi)^{-1},((2m+1)\pi)^{-1}) or (((2m+1)\pi)^{-1},(2m\pi)^{-1}) for some integer m

you might also find it useful to write sign(x) rather than x/|x|, or |x|/x, cos that's all that's going on.
lol, simple as eh? I'm obviously missing something because I would find it difficult to work out where a number is in that interval, particularly for very small values of x.

If I was to use sign(x) it would definitely not work for where f(x) = 0 and f'(x) = 0.
 
  • #35
floor(1/xpi) would seem useful if you were actually to want to do anything as dull as work something out explicitly
 
  • #36
|x| is not differentiable at x = 0. If you look at the definition of the derivative you can see why. The derivative is defined as the instantaneous rate of change at a given point (x). In order words, the derivative is the slope of the tangent line at that point. In |x|, at x = 0, you can create a infinite number of tangent lines. Because of that you can't find a single value for the slope of the tangent line. That is why is it non-differentiable at that point. If you wanted to find the derivative of |x| than you would have to look at it as a piece-wise function (ie, break it up into two functions). Find the derivative before x=0 and after x=0. But remember the derivative will not be defined at x=0. You can use this same method for finding the derivative of any absolute value function. Break up the function into a piece-wise function, find the domain of each of those functions, and than find the derivative in that domain.
 
  • #37
Well... I guess Finney can be wrong... In his Calc book he explicity stated that |x| derivate is what someone already said on here...
 
  • #38
matt grime said:
floor(1/xpi) would seem useful if you were actually to want to do anything as dull as work something out explicitly
Riiight, well I seem to have failed in making my point all together. My point was that dealing with it a section at a time for a sufficiently hard equation would be very difficult, so here is a sufficiently ridiculous example:

y = \left| \sin \left( \frac{\sqrt{2}}{x^{ \frac{\pi}{e}}} \right) + \frac{e^{x^\frac{1}{2}}}{\pi} \right| - |x|
 
  • #39
finney is about as trustworthy as nixon (well perhaps not, but it certainly isn't very good), but perhaps it states what the derivative is at all points except 0.

and, zurtex, can you tell me what the derivative is of your function with your formula? since that requires you to know where the zeroes are, just as my notional method would do, i don't see that there's any difference at all, in fact. note, that as the function you've given is not of the form |f|, then your formual does not apply, unless you prove some further results about additivity, which don't seem obvious.
 
Last edited:
  • #40
Fine fine, but do you at least except that my method works?
 
  • #41
i believe I've repeatedly said that except at points where things are zero your method gives the right answer, but that at zeroes you still need to be careful, and not the additional comment that the example you give is not of the form |f| so it doesn't constitute a validd function for your method
 
  • #42
matt grime said:
i believe I've repeatedly said that except at points where things are zero your method gives the right answer, but that at zeroes you still need to be careful, and not the additional comment that the example you give is not of the form |f| so it doesn't constitute a validd function for your method
kk thanks :smile: I might look at writing something up as a method to actually make it easy.

But you can simply apply the standard result:

\frac{d}{dx}(u-v) = \frac{d}{dx}(u) - \frac{d}{dx}(v)

And then use the formulae I gave earlier to work out both.
 
  • #43
how do you know that formula applies at points where u and v aren't differentiable? hint: you don't, it doesn't
 
  • #44
matt grime said:
how do you know that formula applies at points where u and v aren't differentiable? hint: you don't, it doesn't
What?

Are you saying that:

\frac{d}{dx} \left( \frac{1}{x} - x^2 \right) \neq \frac{-1}{x^2} - 2x

Because it is not differentiable at the point x = 0 :confused:
 
Last edited:
  • #45
the function you've written down isn't even defined at 0, so i think asking for its derivative there is a little unreasonable.

i am not talking about the points where a function's derivative is defined, but the points where it is not defined.
 
  • #46
matt grime said:
the function you've written down isn't even defined at 0, so i think asking for its derivative there is a little unreasonable.

i am not talking about the points where a function's derivative is defined, but the points where it is not defined.
:frown: Sorry I clearly don't have enough understanding of calculus because I don't see what is wrong, I'll let it go now.
 
  • #47
f(x) = |x|

lim f(x) = 1
x -> 0+

lim f(x) = -1
x -> 0-

Lateral limits are not equal, so the function is not derivable in x = 0.
 
  • #48
the second derivative of |x| at x=0 is infinite.
and the first derivative at x=0 is undefined
 
  • #49
I'd like to start by saying I agree with everything said above so far, |X| is not differentiable at X=0, but from the OP he's interested in a Quantum Mechanical situation. In QM we can (nay, we are compelled to based on our need for a rigged hilbert space as a basis) use generalized distributions and not functions.

Graphically picture |X|, notice that, as above, its derivative at X<0 is -1 and X>0 is +1. Granted. What about X=0? Well, its not differentiable there. As you zero in on it (As someone has also done above) you notice X->0+ = 1 and X->0- = -1. What generalized distribution do you know looks like this? The Heavyside function! θ(X) ! (There are vastly more rigorous solutions out there using these).

Now what is the derivative of the Heavyside function? Naturally it is also discontinuous (these distributions sure are troublesome), but if you were to examine its slope at 0 it jumps from -1 to 1 rather quickly. This suggests a function who is 0 at all points |X|>0 except exactly at 0 where it diverges. This looks like another friendly distribution, the Dirac delta function!

I apologize for my lack of rigor above. :-)

Edit: Wow sorry to bump this up from 2004, it was just a result on the ol' google search, figured I would add what I learned in QM.
 
  • Like
Likes blue_leaf77

Similar threads

Back
Top