Solution (source code)

= Solution

Put $d=a-b$. The rational factor has <Taylor expansion> $1+dx-bdx^2+b^2dx^3+O(x^4)$. Multiplication by the logarithmic <power series> makes the coefficients of $x^2,x^3$ equal to $d-1/2$ and $1/3-d/2-bd$. Setting both to zero gives $d=1/2$ and $b=1/6$, hence
$$
\boxed{a=\frac23,\qquad b=\frac16.}
$$
The coefficient of $x^4$ is $-1/4+d/3+bd/2+b^2d=-1/36$. Thus the resulting expansion begins $x-x^4/36+O(x^5)$.