Quadratic geodesic first integral (source code)

= Quadratic geodesic first integral
{title2=$K(x,p)=K^{ij}(x)p_ip_j,\quad\{K,H\}=0$}

A quadratic <homogeneous polynomial> in the fibre variables of the <cotangent bundle> is a first integral of the <geodesic Hamiltonian> exactly when its symmetric lowered coefficients form a <rank-two Killing tensor>. For $v=g^{-1}p$, the <Poisson bracket> is $\{K,H\}=\nabla_{(a}K_{bc)}v^av^bv^c$, so the equivalence follows by comparing cubic coefficients at every point.