How to show $\frac{d}{d x}\left(|x|^{1/2}\right)=\frac{x}{2|x|^{3/2}}$? $$\frac{d}{d x}\left(|x|^{\frac{1}{2}}\right)=\frac{x}{2|x|^{\frac{3}{2}}}$$
and also the second derivative $$\frac{d^{2}}{d x^{2}}\left(\sqrt{|x|}\right)=\frac{\delta(x)}{\sqrt{|x|}}-\frac{x^{2}}{4|x|^{\frac{7}{2}}}$$
I know this may seem basic. But I don't get how the Dirac delta (thanks for the comments for correcting me) comes in. Is it just a way someone has decided to write the result for $x >0$, $x<0$ and $x=0$ cleverly in one line. Is it arbitrary as long as the Kronecker term beats the other term?
If anyone has a clean derivation for these I'd be grateful.
EDIT: thanks for a lot of your answers, I've learnt a lot.
Still not entirely sure with the second derivative, the formula is here: https://www.wolframalpha.com/input/?i=second+derivative+of+%7Cx%7C%5E1%2F2, is this wrong? I still think it is probably correct. From taking something like. d/dx($\operatorname{sign}(x) \frac{1}{2|x|^{\frac{1}{2}}} )=1/2 ($$\frac{\delta(x)}{\sqrt{|x|}} -\frac{sign(x)*x}{2|x|^{5 / 2}})$ Don't know why first summand is missin 1/2. I know its distributions, but can't you still differentiate sign(x), you just have to be careful and when evaluating use test functions and integrals
 A: This is not a complete answer, but for the case of the absolute function defined on the real numbers, this might help.

Since $|x|$ is non-differentiable only at $0$, all the derivatives we calculate will have domain $D \subseteq\mathbb{R} \setminus \{0\}$.
If we write $|x|=\sqrt{x^2}$ we see that
$$
\frac{d}{dx} \left(|x| ^\frac{1}{2} \right) = \frac{d}{dx} \left(x^2\right)^\frac{1}{4} = \frac{1}{4}\left(x^2\right)^{-\frac{3}{4}} \left[\frac{d}{dx}x^2 \right]= \frac{1}{4}\left(x^2\right)^{-\frac{3}{4}}2x = \frac{x}{2\left(x^2\right)^\frac{3}{4}}  = \frac{x}{2\left(\sqrt{x^2}\right)^\frac{3}{2}} = \frac{x}{2|x|^\frac{3}{2}}
$$
As for the second part
$$
\frac{d^2}{dx^2} \left(|x| ^\frac{1}{2} \right) = \frac{d}{dx} \left(\frac{x}{2\left(x^2\right)^\frac{3}{4}}\right) = \frac{2\left(x^2\right)^\frac{3}{4} - 2x\left(\frac{3}{4}(x^2)^{-\frac{1}{4}} (2x)\right)}{4\left(x^2\right)^\frac{3}{2}} = \frac{2\left(x^2\right)^\frac{3}{4}}{4\left[\left(x^2\right)^\frac{3}{4}\right]^2} - \left(\frac{3}{4}\right)\frac{4x^2}{4\left(x^2\right)^\frac{3}{2}(x^2)^{\frac{1}{4}}} = \frac{1}{2\left(x^2\right)^\frac{3}{4}}\left(\frac{2x^2}{2x^2}\right) - \frac{3x^2}{4\left(x^2\right)^\frac{7}{4}} =  \frac{2x^2 -3x^2} {4\left(x^2\right)^\frac{7}{4}} = -\frac{x^2}{4 |x|^\frac{7}{2}}
$$
Now, since the Dirac delta turns it's input into $0$ if $x \neq 0$, and the domain on which we're working on doesn't have $0$, our last answer will be equal to
$$
-\frac{x^2}{4 |x|^\frac{7}{2}} = 0 -\frac{x^2}{4 |x|^\frac{7}{2}} = \frac{\delta(x)}{\sqrt{|x|}} -\frac{x^2}{4 |x|^\frac{7}{2}}
$$
since $\frac{\delta(x)}{\sqrt{|x|}}=0$ for all $x \in D$.
I suspect there might be a more general definition of the absolute value you can work with to get the Dirac delta out directly, but I'm not familiar with it. Hope this helps!
A: Let $f(x) = |x|^{1/2}$. Of course, away from $x=0$, the answer of Robert Lee (without any Dirac delta) is correct, and you will just have
$$
\begin{align*}
f'(x) &= \frac{x}{2\,|x|^{3/2}}
\\
f''(x) &= \frac{-1}{4\,|x|^{3/2}}
\end{align*}
$$
for any $x\in\mathbb{R}\setminus\{0\}$ (since $x^2/|x|^{7/2} = 1/|x|^{3/2}$).

So, to know if there is a Dirac delta, you have to take the derivative in the sense of distributions. To get the first derivative, since $f'(x) = \frac{x}{2\,|x|^{3/2}}$
everywhere except at $x=0$, we see that $f'(x) = \frac{x}{2\,|x|^{3/2}}$ almost everywhere. Moreover, since $|f'| = \frac{1}{2\,|x|^{1/2}}$ is locally integrable, we obtain that the identity $f'(x) = \frac{x}{2\,|x|^{3/2}}$ is also valid locally in $L^1$ and so also in the sense of distributions.
This means that to compute $f''$ in the sense of distributions, we just need to compute the derivative of $f'$ in the sense of distributions. Let $\varphi$ be a smooth compactly supported (let say $\varphi = 0$ in $[-a,a]$ for some $a>0$) test function. Then by definition and the above computation
$$
\langle f'',\varphi\rangle = \langle(f')',\varphi\rangle = -\langle f',\varphi'\rangle = -\langle \tfrac{x}{2\,|x|^{3/2}},\varphi'\rangle
$$
and we can write this as an integral since both functions are locally integrable. Therefore
$$
\begin{align*}
\langle f'',\varphi\rangle &= -\int_{\mathbb{R}} \tfrac{x}{2\,|x|^{3/2}}\,\varphi'(x)\,\mathrm{d}x = -\int_{-a}^a \tfrac{x}{2\,|x|^{3/2}}\,\varphi'(x)\,\mathrm{d}x
\\
&= -\int_{-a}^a \tfrac{x}{2\,|x|^{3/2}}\,(\varphi(x)-\varphi(0))'\,\mathrm{d}x
\end{align*}
$$
Since $\varphi(x)-\varphi(0)$ is vanishing at $x=0$ and even better, $|\varphi(x)-\varphi(0)| ≤ C\,|x|$ (by the fundamental theorem of calculus, with $C= \sup |\varphi'|$ for instance), we can integrate by parts and use the value of $f''$ that was already computed for $x≠0$ to get
$$
\begin{align*}
\langle f'',\varphi\rangle &= \left[-\tfrac{x}{2\,|x|^{3/2}}\,(\varphi(x)-\varphi(0))\right]_{-a}^a - \int_{-a}^a \tfrac{1}{4\,|x|^{3/2}}\,(\varphi(x)-\varphi(0))\,\mathrm{d}x
\\
&= - \int_{-a}^a \tfrac{1}{4\,|x|^{3/2}}\,(\varphi(x)-\varphi(0))\,\mathrm{d}x
\end{align*}
$$
since $\varphi(a) = \varphi(-a) = 0$. The distribution $\mathrm{pf}(\frac{1}{|x|^a})$ for $a\in(1,2)$ is known as the finite part of $\frac{1}{|x|^a}$ and is defined exactly by
$$
\begin{align*}
\langle \mathrm{pf}(\tfrac{1}{|x|^a}),\varphi\rangle &= \int_{\mathbb{R}} \tfrac{1}{|x|^{a}}\,(\varphi(x)-\varphi(0))\,\mathrm{d}x
\end{align*}
$$
so in the sense of distributions
$$
f'' = \frac{-1}{4} \mathrm{pf}\left(\frac{1}{|x|^{3/2}}\right)
$$

Remarks: I do not know where you found the formula with a Dirac delta but it is obviously wrong, since there is no meaning to $\frac{\delta(x)}{\sqrt{x}}$.
Even if it is true that $\mathrm{sign}' = \delta_0$ in the sense of distributions, the following computation
$$
\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{x}{|x|^{3/2}}\right) = \frac{\mathrm{d}}{\mathrm{d}x}\left(\mathrm{sign}(x)\frac{1}{|x|^{1/2}}\right) = 2\delta_0(x)\left(\frac{1}{|x|^{1/2}}\right) + \mathrm{sign}(x)\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{1}{|x|^{1/2}}\right)
$$
is not valid since one cannot multiply singular distributions in general.
A: $$\sqrt{\pm x}\to\pm\frac1{2\sqrt{\pm x}}$$ so
$$\sqrt{|x|}\to\text{sgn}(x)\frac1{2\sqrt{|x|}}.$$
For the second derivative, you can use the same method. But as there is a discontinuity, you can represent its derivative with a $\delta$.
A: You may split your function $f(x):=|x|^{1/2}$ on whether $x\geq0$ or $x<0$. If the former case,
you have
$$\frac{d}{dx} (x^{1/2})=\frac12 x^{-1/2}=\frac12\frac{x}{x^{3/2}}=\frac12\frac{x}{|x|^{3/2}}
$$
In the later
$$
\frac{d}{dx}\big((-x)^{1/2}\big) = -\frac12\big((-x)^{-1/2}\big)=-\frac12 |x|^{1/2}=-\frac12\frac{|x|}{|x|^{3/2}}=\frac{1}{2}\frac{x}{|x|^{3/2}}
$$
For the second order integral you may proceed in a similar manner. It may be helpful to notice that  notice that the first derivative is discontinuous at $x=0$ (division by $0$ kind of thing).
For $x>0$,
$$f''(x) = -\frac14 x^{-3/2}=-\frac14\frac{x^2}{|x|^{7/2}}$$
For $x<0$ $f'(x)=\frac{1}{2}\big((-x)^{-1/2}\big)$ and so,
$$f''(x)=-\frac{1}{4}(-x)^{-3/2} = -\frac14\frac{x^2}{|x|^{7/2}}$$
At $x=0$, $f''$ is not defined, but $\lim_{x\rightarrow0}f''(x)=-\infty$.So to reflect that (in a rather pedantic way) one may write
$f''(x)=-\frac{\delta(x)}{|x|^{1/2}}-\frac{1}{4}\frac{x^2}{|x|^{7/2}}$
Here $\delta(x)=1$ if $x=0$ and $\delta(x)=0$ otherwise. Any constant factor in the $\delta$ will produce the idea that $f''$ is not defined at $x=0$.
A: According to my calculations the correct answer is
$$
(|x|^{1/2})''
= \lim_{\epsilon \to 0} \left( - \epsilon^{-1/2} \, \delta(x) + \frac14 (1-\chi_{(-\epsilon,\epsilon)}(x)) |x|^{-3/2} \right)
$$
Calculation (sorry for lack of comments):
$$\begin{align}
\langle |x|_+^{1/2}, \varphi(x) \rangle &:= \int_0^\infty x^{1/2} \, \varphi(x) \, dx
= \lim_{\epsilon \to 0} \int_\epsilon^\infty x^{1/2} \, \varphi(x) \, dx \\
\langle |x|_-^{1/2}, \varphi(x) \rangle &:= \int_{-\infty}^0 (-x)^{1/2} \, \varphi(x) \, dx = \int_0^\infty x^{1/2} \, \varphi(-x) \, dx = \langle |x|_+^{1/2}, \varphi(-x) \rangle \\
%\langle |x|^{1/2}, \varphi(x) \rangle &:= \langle |x|_+^{1/2}, \varphi(x) \rangle + \langle |x|_-^{1/2}, \varphi(x) \rangle \\
|x|^{1/2} &:= |x|_+^{1/2} + |x|_-^{1/2}
\end{align}$$
$$\begin{align}
\langle D|x|_+^{1/2}, \varphi(x) \rangle
&= -\langle |x|_+^{1/2}, \varphi'(x) \rangle \\
&= -\lim_{\epsilon \to 0} \int_\epsilon^\infty x^{1/2} \, \varphi'(x) \, dx \\
&= -\lim_{\epsilon \to 0} \left( \left[ x^{1/2} \, \varphi(x) \right]_\epsilon^\infty - \int_\epsilon^\infty \frac12 x^{-1/2} \, \varphi(x) \, dx \right) \\
&= \lim_{\epsilon \to 0} \left( \epsilon^{1/2} \, \varphi(\epsilon) + \int_\epsilon^\infty \frac12 x^{-1/2} \, \varphi(x) \, dx \right) \\
&= \lim_{\epsilon \to 0}  \int_\epsilon^\infty \frac12 x^{-1/2} \, \varphi(x) \, dx \\
&= \int_0^\infty \frac12 x^{-1/2} \, \varphi(x) \, dx \\
\end{align}$$
$$\begin{align}
\langle D^2|x|_+^{1/2}, \varphi(x) \rangle
&= -\langle D|x|_+^{1/2}, \varphi'(x) \rangle \\
&= \lim_{\epsilon \to 0} \int_\epsilon^\infty \frac12 x^{-1/2} \, \varphi'(x) \, dx \\
&= \lim_{\epsilon \to 0} \left( \left[ \frac12 x^{-1/2} \, \varphi(x) \right]_\epsilon^\infty - \int_\epsilon^\infty (-\frac14) x^{-3/2} \, \varphi(x) \, dx \right) \\
&= \lim_{\epsilon \to 0} \left( -\frac12 \epsilon^{-1/2} \, \varphi(\epsilon) + \frac14 \int_\epsilon^\infty x^{-3/2} \, \varphi(x) \, dx \right) \\
\end{align}$$
$$\begin{align}
\langle D^2|x|_-^{1/2}, \varphi(x) \rangle
&= \langle |x|_-^{1/2}, \varphi''(x) \rangle \\
&= \langle |x|_+^{1/2}, \varphi''(-x) \rangle \\
&= \langle |x|_+^{1/2}, D^2\left(\varphi(-x)\right) \rangle \\
&= \langle D^2|x|_+^{1/2}, \varphi(-x) \rangle \\
&= \lim_{\epsilon \to 0} \left( -\frac12 \epsilon^{-1/2} \, \varphi(-\epsilon) + \frac14 \int_\epsilon^\infty x^{-3/2} \, \varphi(-x) \, dx \right) \\
\end{align}$$
$$\begin{align}
\langle D^2|x|^{1/2}, \varphi(x) \rangle
&= \langle D^2|x|_+^{1/2}, \varphi(x) \rangle + \langle D^2|x|_-^{1/2}, \varphi(x) \rangle \\
&= \lim_{\epsilon \to 0} \left( -\frac12 \epsilon^{-1/2} \, \varphi(\epsilon) + \frac14 \int_\epsilon^\infty x^{-3/2} \, \varphi(x) \, dx \right) \\
&+ \lim_{\epsilon \to 0} \left( -\frac12 \epsilon^{-1/2} \, \varphi(-\epsilon) + \frac14 \int_\epsilon^\infty x^{-3/2} \, \varphi(-x) \, dx \right) \\
&= \lim_{\epsilon \to 0} \left( -\frac12 \epsilon^{-1/2} \, \left(\varphi(\epsilon)+\varphi(-\epsilon)\right) + \frac14 \int_\epsilon^\infty x^{-3/2} \, \left(\varphi(x)+\varphi(-x)\right) \, dx \right) \\
&= \lim_{\epsilon \to 0} \left( - \epsilon^{-1/2} \, \varphi(0) + \frac14 \int_{|x|>\epsilon} |x|^{-3/2} \, \varphi(x) \, dx \right) \\
&= \langle \lim_{\epsilon \to 0} \left( - \epsilon^{-1/2} \, \delta(x) + \frac14 (1-\chi_{(-\epsilon,\epsilon)}(x)) |x|^{-3/2} \right), \varphi(x) \rangle \\
\end{align}$$
A: First Derivative
For real $x$,
$$
|x|^2=x^2\tag1
$$
so that
$$
2|x|\frac{\mathrm{d}}{\mathrm{d}x}|x|=2x\tag2
$$
Therefore, away from $0$, we have
$$
\frac{\mathrm{d}}{\mathrm{d}x}|x|=\frac{x}{|x|}\tag3
$$
The chain rule then says
$$
\begin{align}
\frac{\mathrm{d}}{\mathrm{d}x}|x|^{1/2}
&=\frac12|x|^{-1/2}\frac{x}{|x|}\tag{4a}\\
&=\frac12\frac{x}{|x|^{3/2}}\tag{4b}
\end{align}
$$

Second Derivative
Approximating $|x|^{1/2}\approx\left(\epsilon^2+x^2\right)^{1/4}$, we get
$$
\frac{\mathrm{d}^2}{\mathrm{d}x^2}\left(\epsilon^2+x^2\right)^{1/4}
=\frac{3\epsilon^2-\left(\epsilon^2+x^2\right)}{4\left(\epsilon^2+x^2\right)^{7/4}}\tag5
$$
Consider
$$
\begin{align}
\lim_{\epsilon\to0}\int_{\mathbb{R}} f(x)\,\frac{3\epsilon^2-\left(\epsilon^2+x^2\right)}{4\left(\epsilon^2+x^2\right)^{7/4}}\,\mathrm{d}x
&=\lim_{\epsilon\to0}\int_{|x|\ge\epsilon^{2/3}} f(x)\,\frac{3\epsilon^2-\left(\epsilon^2+x^2\right)}{4\left(\epsilon^2+x^2\right)^{7/4}}\,\mathrm{d}x\tag{6a}\\
&+\lim_{\epsilon\to0}\int_{|x|\lt\epsilon^{2/3}} f(x)\,\frac{3\epsilon^2-\left(\epsilon^2+x^2\right)}{4\left(\epsilon^2+x^2\right)^{7/4}}\,\mathrm{d}x\tag{6b}\\
&=-\frac14\int_{\mathbb{R}} f(x)\,|x|^{-3/2}\,\mathrm{d}x\tag{6c}\\[3pt]
&+\lim_{\epsilon\to0}\int_{|x|\lt\epsilon^{-1/3}} f(\epsilon x)\,\frac{3-\left(1+x^2\right)}{4\left(1+x^2\right)^{7/4}}\,\epsilon^{-1/2}\,\mathrm{d}x\tag{6d}
\end{align}
$$
Note that for the integral in $\text{(6c)}$ to converge, we must have $f(0)=0$.
Let's look at the size of the integral in $\text{(6d)}$. Since $\frac{3-\left(1+x^2\right)}{4\left(1+x^2\right)^{7/4}}$ is even, we only need to worry about the even part of $f$, which is bounded by $cx^2$ near $x=0$. Therefore,
$$
\begin{align}
\left|\int_{|x|\lt\epsilon^{-1/3}} c(\epsilon x)^2\,\frac{3-\left(1+x^2\right)}{4\left(1+x^2\right)^{7/4}}\,\epsilon^{-1/2}\,\mathrm{d}x\right|
&\le\left.\frac{c}4\epsilon^2|x|^3\epsilon^{-1/2}\right|_{-\epsilon^{-1/3}}^{+\epsilon^{-1/3}}\tag{7a}\\
&=\frac{c}2\epsilon^2\epsilon^{-1}\epsilon^{-1/2}\tag{7b}\\[6pt]
&=\frac{c}2\epsilon^{1/2}\tag{7c}
\end{align}
$$
Thus, under the condition that $f(0)=0$,
$$
\int_{\mathbb{R}} f(x)\,\frac{\mathrm{d}^2}{\mathrm{d}x^2}\sqrt{|x|}\,\mathrm{d}x
=-\frac14\int_{\mathbb{R}} f(x)\,|x|^{-3/2}\,\mathrm{d}x\tag8
$$
A: Okay.... second go.....
If $1 =\int_{-\infty}^{\infty} \delta(x) dx$ then if we have a function $f(x)$ where $f(x)$ "equals $\frac 10$" when $x=0$  I guess can say:
$f(x) = 1*f(x) = [\int_{-\infty}^{\infty} \delta(x) dx]f(x)$ so
$f'(x)= [\int_{-\infty}^{\infty} \delta(x) dx]'f(x) + [\int_{-\infty}^{\infty} \delta(x) dx]f(x)= \delta(x)f(x) + f'(x)$.
When $x\ne 0$ then this is $f'(x)$.  If $x=0$ then... well I'm waving my hands wildly... but as $f(x)$ is assymptotic at $x=0$ then the derivative is infinite.
So.... $|x|^{\frac 12}$ is defined everywhere but has a "divot" at $x=0$.
the first derivative if $sign(x) \frac 1{2|x|^{\frac 12}} = \frac x{2|x|^{\frac 32}}$.
Not the first derivative "equals $\frac 10$ at $x = 0$ so if we take that the first derivative is $[\int_{-\infty}^{\infty} \delta(x) dx]\cdot\frac x{2|x|^{\frac 32}}$ then the second derivative will be $\delta(x)sign(x) \frac 1{2|x|^{\frac 12}} + [sign(x) \frac 1{2|x|^{\frac 12}}]'=$
$\pm \delta(x)sign(x) \frac 1{2|x|^{\frac 12}} -\frac{x^{2}}{4|x|^{\frac{7}{2}}}$
.....
Okay, somehow in my not really knowing what I was doing and handwaving I handwaved $\frac {sign(x)}2$ in whereas the author doing whatever s/he was doing and knowing what she was doing probably had a reason they "canceled" out.
Actually, I think I can almost see why.  $\operatorname{sign}(x) \frac 1{2|x|^{\frac 12}} = \frac x{2|x|^{\frac 32}}$ is negative of $x < 0$ and positive otherwise so so we don't really have the first derivative of $[\int_{-\infty}^{\infty} \delta(x) dx]\cdot\frac x{2|x|^{\frac 32}}$ but the $sign(x)[\int_{-\infty}^{\infty} \delta(x) dx]\cdot\frac x{2|x|^{\frac 32}}$ and so the signs cancel out. And as we are doing it for negative and positive values of $x$ we ... are doing it twice????  Okay.... I'm handwaving again.
....
I don't know what the author was doing but I can see that as the first derivative is infinite at $x=0$ and as $\delta(x) =0$ whe $x \ne 0$ so the result is consistant and that weird chain rule for differentiating $f(x)_{x\ne 0}= 1 = \int \delta(x)dx$ I can squint and almost see what the author had in mind.
A: A good way is to use Einstein summation notation. (https://en.wikipedia.org/wiki/Einstein_notation)
Using $x^2 = x_ix_i$, we have
$$(\frac{d}{dx}|x|^{1/2})_j = \frac{d}{dx_j}(x_ix_i)^{1/4} = \frac{1}{4}(x_ix_i)^{-3/4}(\delta_{ij}x_i + x_i \delta_{ij}) = \frac{x_j}{2(x_ix_i)^{3/4}}$$.
