Second-order Euler identity for homogeneous functions (source code)

= Second-order Euler identity for homogeneous functions
{title2=$x^T(\nabla^2f)x=n(n-1)f(x)$}

Let $f$ be a twice continuously <differentiable function> on an open domain stable under positive scaling, with $f(\lambda x)=\lambda^nf(x)$. Apply the <chain rule> twice to the scalar <function> $\lambda\mapsto f(\lambda x)$ and set $\lambda=1$. The result is
$$
\boxed{\sum_{i,j}x_ix_j\partial_i\partial_jf(x)=n(n-1)f(x).}
$$
In two variables, this reads $x^2f_{xx}+2xyf_{xy}+y^2f_{yy}=n(n-1)f$. In <matrix> notation it is $x^T(\nabla^2f)x=n(n-1)f$, where $\nabla^2f$ is the <Hessian matrix>. Equivalently, the radial <differential operator> $D=\sum_ix_i\partial_i$ obeys $D^2f=Df+\sum_{i,j}x_ix_j\partial_i\partial_jf$; substituting $Df=nf$ explains the factor $n(n-1)$.