Higher-order saddle test (source code)

= Higher-order saddle test

Suppose a function near a <critical point> has <Taylor expansion> $f(p+h)=f(p)+P_m(h)+o(\|h\|^m)$, where $P_m$ is its first nonzero homogeneous polynomial term. If $P_m$ takes both positive and negative values on directions, then $p$ is a <saddle point of a scalar function>. Indeed, on rays $h=rv$ the leading term is $r^mP_m(v)$; for each chosen direction its sign dominates the remainder for small positive $r$. This works even when the <Hessian matrix> is zero. For example, $P_4(\xi,\eta)=-\xi^3(\xi+\eta)$ is negative on $(1,0)$ and positive on $(1,-2)$, hence detects a saddle despite having degree four.