Differentiability of the absolute value of a function

  • Thread starter PFuser1232
  • Start date
  • #1
479
20
The derivative of ##|f(x)|## with respect to ##x## is ##f'(x)## for ##f(x) > 0## and ##-f'(x)## for ##f(x) < 0##. However, it is undefined wherever the value of the function is zero. I was wondering, though, if the product of this "undefined derivative" and zero is zero.
 

Answers and Replies

  • #2
35,717
12,295
However, it is undefined wherever the value of the function is zero.
It does not have to be. Consider |f(x)| where f(x)=x^2, for example. It has a derivative everywhere, even at f(x)=0.
I was wondering, though, if the product of this "undefined derivative" and zero is zero.
You cannot calculate a product with "undefined derivative" in it. There might be a way to avoid calculating this product, however, then the result could be well-defined.
 
  • #3
479
20
It does not have to be. Consider |f(x)| where f(x)=x^2, for example. It has a derivative everywhere, even at f(x)=0.
You cannot calculate a product with "undefined derivative" in it. There might be a way to avoid calculating this product, however, then the result could be well-defined.

I actually asked this question because I couldn't deal with the discontinuity in ##\frac{d|y|}{dx}## while deriving something in classical mechanics.
I wanted to show that ##\frac{d|v_r|}{dt} \hat{v}_r = \frac{dv_r}{dt} \hat{r}## where ##\hat{v}_r## is defined to be ##+\hat{r}## if ##v_r > 0##, and ##-\hat{r}## if ##v_r < 0##. How do I make make both sides equal for ##v_r < 0##?
##\hat{v}_r## is a unit vector that is always pointing in the direction of the radial velocity of a particle (i.e., it could point in the same direction, or in the opposite direction as the radial base vector), and ##v_r## is the scalar component of the radial velocity; it can be positive, negative, or zero.
 
  • #4
35,717
12,295
For negative v, converting the left side to the right one gives a minus sign for both components each, they cancel, done. That won't work at r=0 because the radial vectors are not even defined there.
 
  • #5
479
20
For negative v, converting the left side to the right one gives a minus sign for both components each, they cancel, done. That won't work at r=0 because the radial vectors are not even defined there.

How do I make it work for ##v_r = 0##? The equation I want to derive [geometrically] is ##a = (\ddot{r} - r \dot{θ}^2) \hat{r} + (r \ddot{θ} + 2 \dot{r} \dot{θ}) \hat{θ}##, which holds for all values of ##v_r##.
I'm trying to get from ##\frac{d|\dot{r}|}{dt} \hat{v}_r## to ##\ddot{r} \hat{r}##.
 
  • #6
HallsofIvy
Science Advisor
Homework Helper
41,847
966
The derivative of ##|f(x)|## with respect to ##x## is ##f'(x)## for ##f(x) > 0## and ##-f'(x)## for ##f(x) < 0##. However, it is undefined wherever the value of the function is zero. I was wondering, though, if the product of this "undefined derivative" and zero is zero.
You are phrasing this badly! What is the product of "left" and 0? What is the product of "red" and 0?

"Undefined" means exactly that- there is NO derivative at x= 0 so you cannot multiply it by 0 or any other number. Now if you are asking about the limit, a x goes to 0, of 0 times the derivative (for x not 0), then, yes, that limit is 0.
 
  • #7
177
61
You do not need to differentiate absolute value to get your formula, you just need to write x and y coordinates in terms of ##r## and ##\theta##, then differentiate and write everything in vector form, see Wkipedia.
 
  • #8
479
20
You do not need to differentiate absolute value to get your formula, you just need to write x and y coordinates in terms of ##r## and ##\theta##, then differentiate and write everything in vector form, see Wkipedia.

I can easily differentiate velocity in vector form to get acceleration in polar coordinates, but I'm trying to obtain the expression for acceleration in polar coordinates geometrically, like in the book Introduction to Mechanics by K&K.
Here's the other thread:
https://www.physicsforums.com/threads/vector-components-in-polar-coordinates.803069/#post-5041450
 
  • #10
Svein
Science Advisor
Insights Author
2,191
731
Anyone?
Just an anecdote: About 40 years ago, I was doing coordinate transform for a small robot. What I did, was to calculate the position and orientation of the "hand" and subtract from the previous position. This gave me a 6-dimensional matrix D which represented the first order derivative of the transform. Taylor's theorem then gave me [itex] \Delta X=D\circ \Delta M[/itex] where X are the Euclidean coordinates and M the motor positions. Inverting D then gave [itex]\Delta M = D^{-1}\Delta X [/itex], telling me how to step the motors in the next interval. But - at some positions det(D) approached 0, which meant that it was not possible to invert D. What we decided was that we would continue to use the old D-1 until the determinant got bigger than a predefined minimum. It worked!
 
  • #11
15
1
Very simple, define ##g(x)=x^2## and ##f(x)=\sqrt{x}##

Take the derivative of ##f(g(x))##

##\frac{d}{dx} \left [ f(g(x)) \right ] = f'(g(x)) \cdot g'(x) = \frac {1}{2 \sqrt{x^2}} \cdot 2x = \frac{x}{\sqrt{x^2}} = \frac{x}{\left | x \right |} = \mathrm{sgn(x)}##
 
Last edited:
  • #12
Svein
Science Advisor
Insights Author
2,191
731
Very simple, define g(x)=x2g(x)=x^2 and f(x)=x√f(x)=\sqrt{x}
Clever but -
[itex]\frac{d}{dx}f(g(x))=\frac{df}{dg}\frac{dg}{dx}=\frac{1}{2\sqrt{g}}2x [/itex]. The trouble lies with [itex]\frac{1}{2\sqrt{g}} [/itex], which is not defined (or finite) for g=0. In another (famous) proof I have seen a slight variation: Define [itex]g(x)=1-x^{2} [/itex] and [itex] f(x)=\sqrt{1-x}[/itex]. Then [itex] \frac{d}{dx}f(g(x))=\frac{df}{dg}\frac{dg}{dx}=\frac{-1}{2\sqrt{g}}\cdot -2x[/itex], just as before, but the singular point is no longer at 0.
 
  • #13
15
1
Clever but -
[itex]\frac{d}{dx}f(g(x))=\frac{df}{dg}\frac{dg}{dx}=\frac{1}{2\sqrt{g}}2x [/itex]. The trouble lies with [itex]\frac{1}{2\sqrt{g}} [/itex], which is not defined (or finite) for g=0. In another (famous) proof I have seen a slight variation: Define [itex]g(x)=1-x^{2} [/itex] and [itex] f(x)=\sqrt{1-x}[/itex]. Then [itex] \frac{d}{dx}f(g(x))=\frac{df}{dg}\frac{dg}{dx}=\frac{-1}{2\sqrt{g}}\cdot -2x[/itex], just as before, but the singular point is no longer at 0.

Yes but since you've redefined the function as ##x^{\frac{2}{2}}## and applied the chain rule, you've essentially taken the derivative of a fractional exponent.

You can say that ##\forall \: x^n## the derivative has a singularity at zero where ##n \in (0,1)##.
 

Related Threads on Differentiability of the absolute value of a function

Replies
1
Views
4K
  • Last Post
Replies
10
Views
2K
Replies
1
Views
804
Replies
3
Views
4K
  • Last Post
Replies
2
Views
6K
  • Last Post
Replies
1
Views
2K
Replies
4
Views
6K
  • Last Post
Replies
6
Views
5K
  • Last Post
Replies
2
Views
8K
  • Last Post
Replies
8
Views
9K
Top