# Why is $\frac{d^2}{dx^2} e^{-|x|} = e^{-|x|} - 2 \delta(x)$

How can you show that $$\frac{d^2}{dx^2} e^{-|x|} = e^{-|x|} - 2 \delta(x) ?$$ I found this result using Wolfram Alpha and it seems strage to me, how the delta function appears here ...

• Just differentiate it twice. What's the second derivative of $|x|$?
– user223391
Jan 23, 2016 at 0:30
• Also note that $f(x)\delta(x)=f(0)\delta(x)$
– A.S.
Jan 23, 2016 at 1:51

You have $$e^{-|x|} = \begin{cases} e^{-x} & \text{if } x>0, \\ e^x & \text{if } x<0, \\ 1 = e^0 = e^{-0} & \text{if } x = 0. \end{cases}$$ The function above is continuous. So $$\frac d {dx} e^{-|x|} = \begin{cases} -e^{-x} & \text{if } x>0, \\ e^x & \text{if } x<0. \end{cases}$$ This is undefined at $x=0$. Notice the jump discontinuity this function has at $x=0$: it leaps downward from $1$ to $-1$.
According to the notion of derivative you learned in freshman calculus, you would next get $$\frac {d^2} {dx^2} e^{-|x|} = \begin{cases} e^{-x} & \text{if } x>0, \\ e^x & \text{if } x<0 \end{cases}$$ and this is undefined at $0$. However, according to the somewhat different notion of derivative which says the derivative of a generalized function is another generalized function, and which does not necessarily have a value at any particular point, the vertical jump by $-2$ units adds $-2\delta(x)$ to the derivative. This is analogous to the fact that the derivative of the Heaviside step function is $\delta(x)$. If you don't understand that then you won't understand this.
Well, it isn't strange that $\delta$ appears. Generally, the derivative (in the sense of distribution) of a piecewise $C^1$ function $f$, possibly having jumps (discontinuities) at $x_0<x_1<\ldots<x_n$ is $$f'=f'_{\rm class}+\sum_{i=0}^n J_f(x_i)\delta_{x_i}$$ where $J_f(x_i)=f(x_i^+)-f(x_i^-)$ is the jump of $f$ at $x_i$, $\delta_{x_i}$ is a Dirac mass at $x_i$, and $f'_{\rm class}$ is the pointwise derivative of $f$, defined outside $\{x_i~:~1\leq i\leq n\}$ (therefore, almost everywhere). The proof of this fact is very classical; if you don't understand it, try with the classical heaviside function.
In your case, the function $g(x)=e^{-|x|}$ is piecewise $C^\infty$ and has no jump, so its first derivative is simply equal to the usual derivative, and isn't defined at 0: $$g'(x)=\left\{\begin{array}{ccc}e^{x}&\textrm{ if }&x<0\\-e^{-x}&\textrm{ if }&x>0\end{array}\right.$$ This function has now a jump at 0, as $g'(0^+)=-1$ and $g'(0^-)=1$. Therefore, its derivative is
$$g''=g+(g'(0^+)-g'(0^-))\delta_0,$$