What is the closed form expression for the $n$th order derivative of the Gaussian function? $$ \frac{d^n}{dx^n}\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{1}{2}\frac{(x-\mu)^2}{\sigma^2}}$$ Wikipedia says that it can be expressed in terms of the Gaussian times Hermite polynomials, but it does not illuminate any further.
closed form for arbitrary derivatives of gaussian function
473 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
For this, I will find what Wikipedia https://en.wikipedia.org/wiki/Hermite_polynomials calls the "probabilist's Hermite polynomials", which differ from the "physicist's" version by the factor of $\frac{1}{2}$ in the exponent.
There are actually multiple equivalent definitions. The first one given by the article actually solves your problem by definition! There are other equivalent versions: defined by orthogonality conditions, or through a generating function, or through the Hermite differential equation.
First of all, change variables so that $u = \frac{x - \mu}{\sigma}$. That way $\frac{d}{dx} = \frac{1}{\sigma} \cdot \frac{d}{du}$. Also let $k = \frac{1}{2\pi \sigma^2}$.
Let $$G = k\cdot e^{\frac{-u^2}{2}}$$ denote that Gaussian function $G(u)$, and $G^{(n)}$ denote its $n$th derivative with respect to $u$.
$G^{(0)} = (-1)^0 \cdot 1 \cdot G$
$G^{(1)} = -uG = (-1)^1 \cdot u \cdot G$
$G^{(2)} = -G + u^2G = (-1)^2 \cdot (u^2 - 1)\cdot G $
$G^{(3)} = (2u)G + (u^2-1)(-u)G = (-1)^3 \cdot (u^3 - 3 u)\cdot G$
The first few Hermite polynomials are $1, u, (u^2 -1), (u^3 - 3u),...$ To get the physicist version, multiply by $2^n$.
The relation
Indeed, via Rodrigues' formula, the Hermite polynomials are $$H_n(x) = (-1)^n \, e^{x^2} \, \frac{d^n}{dx^n} e^{-x^2} \; , $$ for $n \in \mathbb{N}$ including zero. And by changing variables $x \to \frac{x-\mu}{\sigma\sqrt{2}}$ ones get $$ H_n\left(\frac{x-\mu}{\sigma\sqrt{2}}\right) = (-1)^n \, e^{\frac{1}{2}\frac{(x-\mu)^2}{\sigma^2}} \, 2^{\frac{n}{2}} \, \sigma^n \, \frac{d^n}{dx^n} e^{-\frac{1}{2}\frac{(x-\mu)^2}{\sigma^2}} \; , $$ and the answer for your question is $$ \frac{d^n}{dx^n} e^{-\frac{1}{2}\frac{(x-\mu)^2}{\sigma^2}} = (-1)^n \left( \frac{1}{2 \sigma^2} \right)^{\frac{n}{2}} \, e^{-\frac{1}{2}\frac{(x-\mu)^2}{\sigma^2}} \, H_n\left(\frac{x-\mu}{\sigma\sqrt{2}}\right) \; . $$
The Hermite polynomials
The above expression is useful only if you know the polynomial that you are interested in. For n = 0, ... , 10 there is a table here and some polynomials are \begin{align} H_0(x) &= 1 \; , \\ H_1(x) &= 2x \; , \\ H_2(x) &= 4x^2 - 2 \; ,\\ & \; \; \vdots \end{align} and the polynomial $H_n(x)$ is of order $n$ and the polynomial has the same parity (odd or even) of $n$. The general expression for this polynomials is not trivial and normally one use its property instead of its explicitly expression. If you desire the explicitly expression I copy it from the wiki and it is \begin{align} H_{2n}(x) \; & = \; (2n)! \, \sum_{l=0}^{n} \frac{(-1)^{n-l}}{(2l)!(n-l)!} \, (2x)^{2l} \; ,\\ H_{2n+1}(x) \; & = \; (2n+1)! \, \sum_{l=0}^{n} \frac{(-1)^{n-l}}{(2l+1)!(n-l)!} \, (2x)^{2l+1} \; ,\\ \end{align} where I separate the case for odd and even polynomials for ease notation.