Solution (source code)

= Solution

For ultrarelativistic particles with fixed magnet settings, $A(\delta)=A_0(1-\delta)$ and $B(\delta)=B_0(1-\delta)$. Hence the half-trace is
$$
\boxed{C(\delta)=C_0+\delta\left[d(A_0+B_0)-d^2A_0B_0\right]+O(\delta^2),\quad
C_0=1-d(A_0+B_0)+\tfrac12d^2A_0B_0.}
$$
Off-energy motion is stable when $|C(\delta)|<1$, separately in each transverse plane. Where $\sin\mu_0\ne0$, its first-order phase shift is
$$
\Delta\mu=-\frac{d(A_0+B_0)-d^2A_0B_0}{\sin\mu_0}\,\delta.
$$
For equal opposite strengths,
$$
\boxed{\mu(\delta)=\mu_0-2\tan(\mu_0/2)\delta+O(\delta^2).}
$$
Thus positive momentum error reduces the focusing and phase advance; negative error moves toward the overfocused unstable boundary. The unexpanded symmetric stability condition is $|f_0|(1+\delta)>d/2$, with $1+\delta>0$, within the ultrarelativistic energy scaling. Its natural <chromaticity> per cell is $d(\mu/2\pi)/d\delta=-\tan(\mu_0/2)/\pi$. Away from the ultrarelativistic limit replace the displayed first-order energy error by $\delta/\beta_0^2$. Linearizing at a stability boundary is singular and needs separate treatment.