I have this Diff Eq:
$$2g''+g'^{2}+ag+a-b=0 $$
We can manipulate this into an equivalent relation:
$$g'^{2}=ce^{-g}-ag+b $$
...which makes c a conserved quantity:
$$c=\left(g'^{2}+ag-b\right)e^{g}$$
If $sign(a)=-sign(c) $ and $|c|<|b-a|e^{\frac{b-a}{a}} $ then g will be periodic. This can be verified by plotting $y=ce^{-g} $ and $y=ag-b $ and noting exactly two points of intersection at which $g'=0 $ in Eq(2)
So my question is, what's the best way to calculate the period of g?
Obviously I could iteratively calculate g(x) from initial conditions, but I doubt that's the best approach because of the accumulating numerical errors. Also, it's calculating a lot of intermediate information that I don't need.
Is there any clever way to numerically calculate the period directly?