Second Derivative of Abs(x) | Richard Seeking Answer

  • Thread starter robousy
  • Start date
  • Tags
    Derivative
In summary, the conversation discusses the second derivative of the absolute value function and how it can be proven using the Mean Value Theorem. The conversation also mentions the existence of delta functions in the answer and how the derivative of |x| is undefined at x=0. The conversation then delves into the concept of distributions and how the derivative of |x| can be represented using the Dirac delta function. Finally, there is a discussion about differentiating step functions and the relationship between the first and second derivatives.
  • #1
robousy
334
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
  • #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.
 
  • #3
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.
 
  • #4
|x| isn't differentiable (everywhere) so you must specify the domain, and if you want to include 0 then you're stuck.
 
  • #5
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:

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

Then:

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

Is this wrong?
 
  • #6
What happens to your proof when g(x) = 0 and g'(x) != 0?
 
  • #7
Hurkyl said:
What happens to your proof when g(x) = 0 and g'(x) != 0?
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.
 
  • #8
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:
 
  • #9
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:

[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:
  • #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:

[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:
 
  • #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:

[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.
 
  • #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:

[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]
 
  • #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:

[tex]y = \left| \sin \left( \frac{1}{x} \right) \right|[/tex]

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
[tex]|x| = + \sqrt{x^2}[/tex]

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:

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

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

Iff f(x)=0 and f'(x)=0 you need to look at the algebra and cancel it down. For the eqatuion [itex]y = x^{0.5}[/itex] 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:

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

By quotiont rule:

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

As:

[tex]\frac{x}{|x|} = \frac{|x|}{x}[/tex]

Then:

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

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

When [tex] x \neq 0[/tex] then:

[tex]\frac{d^2}{dx^2} (|x|) = 0[/tex]
 
  • #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:

[tex]y = \left| \sin \left( \frac{1}{x} \right) \right|[/tex]

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 [tex]((2m\pi)^{-1},((2m+1)\pi)^{-1})[/tex] or [tex](((2m+1)\pi)^{-1},(2m\pi)^{-1})[/tex] 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 [tex]((2m\pi)^{-1},((2m+1)\pi)^{-1})[/tex] or [tex](((2m+1)\pi)^{-1},(2m\pi)^{-1})[/tex] 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
 

Similar threads

Replies
5
Views
2K
  • Calculus
Replies
15
Views
1K
Replies
5
Views
1K
Replies
3
Views
2K
Replies
4
Views
322
Replies
8
Views
145
Replies
1
Views
908
Replies
12
Views
2K
Replies
9
Views
6K
  • Calculus
Replies
2
Views
1K
Back
Top