[Math] Absolute value: First Derivative Heaviside Function + Second Derivative Dirac Delta Function Distribution

absolute valuederivativesdirac delta

I have some issues concerning the derivative of an absolute value $|x|$, the Heaviside function $\theta(x)$ and the Dirac Delta Distribution.

Given the definition of the Heaviside function
\begin{equation}
\theta(x) = \left\{
\begin{array}{ll}
1 \quad \text{for} \quad x \ge 0\\
0 \quad \text{for} \quad x<0
\end{array}
\right.
\end{equation}
I suppose it is right to express the first derivative of an absolute value as
\begin{equation}
\frac{d |x|}{dx} = \left\{
\begin{array}{ll}
+1 \quad \text{for} \quad x > 0\\
-1 \quad \text{for} \quad x<0
\end{array}
\right.
\overset{!}{=} \theta(x) – \theta(-x),
\end{equation}
evaluating the derivatives of $|x|$ from the left and right side. Here I have some issues with the case of $x=0$
\begin{equation}
\left.\frac{d |x|}{dx}\right|_{x=0}=\theta(0)-\theta(0)=1-1=0,
\end{equation}
which is not defined in my original "first derivative" of $d |x|/ dx$.
So how can the first derivative of an absolute value be correctly expressed in terms of the Heaviside function?

Anyways taking my assumption of the first derivative for granted I want to perform a second derivative with the identity
\begin{equation}
\frac{d \theta(x)}{dx} = \delta(x)
\end{equation},
which then leads to
\begin{equation}
\frac{ d^2 |x|}{dx^2} = \frac{d}{dx}(\theta(x)-\theta(-x)) = \delta(x)-\delta(-x)=\delta(x)-\delta(x)=0.
\end{equation}

The last expression cannot be true and should be
\begin{equation}
\frac{d^2 |x|}{dx^2} = 2 \delta(x)
\end{equation}
following Second derivative of absolute value function proportional to Dirac delta function?

What am I missing to get to the correct expression?

Best Answer

If you draw $|x|$ then you should see the derivative does depend on the direction you approach the point from. Trying to assign it a numerical value does not make sense. Your expressions are correct although you could try to assign the derivative to be infinite at $x=0$.

For your second point, the chain rule is missing from your calculation, $$ \frac{d\theta(-x)}{dx} = \left.\frac{d(-x)}{dx} \frac{d\theta(y)}{dy}\right\vert_{y=-x} = - \delta(y)\vert_{y=-x} = -\delta(-x)=-\delta(x) . $$