Canonical Perturbation theory of Keplerian orbits Preamble
The motion of a test particle around a point mass $\mu$ is governed by the Hamiltonian
$$
(*)\qquad\qquad
H(r,p_r,p_\phi) = \frac{p_r^2}{2} + \frac{p_\phi^2}{2r^2} - \frac{\mu}{r}
$$
which has well-known solutions and action representation
$$
H(J_r,J_\phi) = -\frac{\mu^2}{2(J_r+J_\phi)^2} = -\frac{\mu^2}{2J_\phi^2} \left(1 - 2\frac{J_r}{J_\phi} + 3 \frac{J_r^2}{J_\phi^2} + O(J_r^3) \right),
$$
where $J_\phi=p_\phi$. Now, at fixed $p_\phi=J_\phi$, one can consider the Hamiltonian $(*)$ as that for the radial motion only and re-write it as
$$
H_r(r,p_r) = \frac{p_r^2}{2} + \Phi_{\mathrm{eff}}(r)
\qquad\text{with}\qquad
\Phi_{\mathrm{eff}}(r) = -\frac{\mu}{r} + \frac{J_\phi^2}{2r^2},
$$
which has $J_\phi$ as a parameter. The minimum of $\Phi_{\mathrm{eff}}$ occurs at the radius $r_{\mathrm{c}}=J_\phi^2/\mu$ of the circular orbit with angular momentum $J_\phi$.  $\Phi_{\mathrm{eff}}$ has the Taylor expansion
$$
\Phi_{\mathrm{eff}}(r) = -\frac{\mu}{2r_{\mathrm{c}}} + \frac{\mu}{2r_{\mathrm{c}}^3} x^2 - \frac{\mu}{r_{\mathrm{c}}^4} x^3 + \frac{3\mu}{2r_{\mathrm{c}}^5} x^4 + O(x^5)
$$
with $x\equiv r-r_{\mathrm{c}}(J_\phi)$. Here, the first term is the energy of the circular orbit. Now split $H_r=H_0 + H_1$ with
\begin{align}
H_0 &= -\frac{\mu}{2r_{\mathrm{c}}} + \frac{p_x^2}{2} + \frac{\mu}{2r_{\mathrm{c}}^3} x^2,&
H_1 &= - \frac{\mu}{r_{\mathrm{c}}^4} x^3 + \frac{3\mu}{2r_{\mathrm{c}}^5} x^4.
\end{align}
Classicle epicycle theory (e.g. Lindblad 1926) corresponds to ignoring $H_1$ and solving $H_0$, which is simple harmonic motion with epicycle frequency $\kappa\equiv\sqrt{\mu/r_{\mathrm{c}}^3}=\mu^2/J_\phi^3$, giving
\begin{align}
x_0 &= \sqrt{\frac{2J_r}{\kappa}}\sin\theta, &\theta&=\vartheta+\kappa t,\\
H_0 &= -\frac{\mu^2}{2J_\phi^2} + \kappa J_r &&= -\frac{\mu^2}{2J_\phi^2} \left(1 - 2 \frac{J_r}{J_\phi}\right),
\end{align}
which is the first-order of the full Hamiltonian $H(J_r,J_\phi)$ above.
All this is standard textbook stuff, except for $H_1(x)$ (which is correct).
Question
Now, use canonical perturbation theory to get to the next order. According to Lichtenberg & Liebermann (Springer 1983), this amounts to averaging the perturbation $H_1(x)$ over the unperturbed orbit (note that $\langle\sin^3\theta\rangle=0$ and $\langle\sin^4\theta\rangle=3/8$):
$$
\left\langle H_1\left(x=x_0(\theta)\right)\right\rangle = \frac{3\mu}{2r_{\mathrm{c}}^5} \frac{4J_r^2}{\kappa^2}\frac{3}{8} = \frac{9\mu^2}{4J_\phi^2}\frac{J_r^2}{J_\phi^2}.
$$
However, from the full $H(J_r,J_\phi)$ above, we expect
$$
H_1 = -\frac{3\mu^2}{2J_\phi^2}\frac{J_r^2}{J_\phi^2}
$$
which differes by a factor $-3/2$. 
What went wrong with my derivation?
 A: The problem is that the $x^3$ term also contributes to the first order (in $J_r$) correction to $H$ and we must go to second-order perturbation theory. Using the Deprit perturbation series (Lichtenberg & Liebermann 1983, §2.5), we have
\begin{align}
H_1 &= -\frac{\mu}{r_{\mathrm{c}}^4} x^3
    &&= -\frac{\mu}{r_{\mathrm{c}}^4}\left(\frac{2J_r}{\kappa}\right)^{3/2}\sin^3\theta
    &&= -\frac{\mu}{4r_{\mathrm{c}}^4}\left(\frac{2J_r}{\kappa}\right)^{3/2}\left(3\sin\theta-\sin3\theta\right) \\
H_2 &= \frac{3\mu}{2r_{\mathrm{c}}^5} x^4
    &&= \frac{3\mu}{2r_{\mathrm{c}}^5}\left(\frac{2J_r}{\kappa}\right)^{2}\sin^4\theta
    &&= \frac{3\mu}{16r_{\mathrm{c}}^5}\left(\frac{2J_r}{\kappa}\right)^{2}\left(3-4\cos2\theta+\cos4\theta\right)
\end{align}
Then the first order correction to the Hamiltonian, $\overline{H}_1=\langle H_1\rangle=0$. For the second order, one needs
\begin{align}
\kappa\frac{d w_1}{d\theta} = \langle H_1\rangle - H_1
&& \to &&
w_1 = \frac{\mu}{12r_{\mathrm{c}}^4\kappa} \left(\frac{2J_r}{\kappa}\right)^{3/2} \left(\cos3\theta-9\cos\theta\right),
\end{align}
when
$$
\left[w_1,H_1-\langle H_1\rangle\right] = \frac{3\mu}{8r_{\mathrm{c}}^5}\left(\frac{2J_r}{\kappa}\right)^{2}\left(-5+4\cos2\theta+\cos4\theta\right)
$$
and
\begin{align}
\overline{H}_2 &= \left\langle H_2 + \tfrac12\left[w_1,H_1-\langle H_1\rangle\right]\right\rangle
&& = -\frac{3J_r^2}{2r_{\mathrm{c}}^2}
\end{align}
as required.
