I am reading a paper (https://arxiv.org/abs/math/9907210), and the author first gives the following differential equation:
$$\ddot{p}-\frac{\dot{p}^2}{p}+\frac{A}{p}-p^3=0$$
Later, they state that the first integral is given by
$$\dot{p}^2=p^4+Kp^2+A$$
where $K$ is a real constant. I can't get this; here is my attempt.
Multiply by $\dot{p}$ and integrate with respect to $s$, $$\int \dot{p}\ddot{p} ds=\int (\frac{\dot{p}^2}{p}-\frac{A}{p}+p^3)\dot{p}ds$$ Left hand side is good, $\frac{1}{2}\dot{p}^2$, but the right hand side is not: $$\int (\frac{\dot{p}^2}{p}-\frac{A}{p}+p^3)\dot{p}ds=\int\frac{\dot{p}^3}{p}ds-A\ln(p)+\frac{1}{4}p^4.$$
Maybe my naive understanding of "first integral" is incorrect. Can anyone spot my error?
The other method for autonomous second order ODE is to assume that for some specific solution one can find a relation $\dot p=v(p)$. Then the second order equation for $p$ transforms into a first order equation for $v$, $$ vv'-\frac{v^2}p+\frac Ap-p^3=0. $$ As is visible, this is linear in $u(p)=v(p)^2$, $$u'-\frac{2u}{p}+\frac{2A}{p}-2p^3.$$ The integrating factor is $\frac1{p^2}$, so that $$ \frac{d}{dp}\frac{u}{p^2}=\frac{pu'-2u}{p^3}=2p-\frac{2A}{p^3} \implies \frac{u}{p^2}=p^2+\frac{A}{p^2}+K $$ Substituting backwards gives the expression for $K=\frac{\dot p^2}{p^2}-\frac{A}{p^2}-p^2$ as first integral.