This ODE is extremely unlikely to have an explicit solution. Mathematica cannot do anything with this ODE even when $g(x)\equiv x$. Here is an image of the corresponding Mathematica notebook: [![enter image description here][1]][1] And here is [a link][2] to the Mathematica notebook itself. [1]: https://i.sstatic.net/08hTe.png [2]: https://u.pcloud.link/publink/show?code=XZA40TVZCAyy3X73DjYvXzl1ySX8IybILJ07