There is a footnote on Goldstein's Classical Mechanics (3rd ed., page 15) which says the following:
In principle, an integrating factor can always be found for a first-order differential equation of constraint in systems involving only two coordinates and such constraints are therefore holonomic.
I am trying to show this but I can only do that for linear constraints. In that case the constraint can be written as $$\frac{dy}{dx}+a(x)y=b(x),\tag1$$ and after multiplying both sides by an integrating factor $e^{\left(\int a(x)dx\right)}$, one readily gets the integrable equation $$d\left(e^{\left(\int a(x)dx\right)}y\right)=b(x)e^{\left(\int a(x)dx\right)}dx.$$
The point is I cannot write constraints such as $$dy+\left[a(x)y^2+b(x)\right]dx=0,\tag2$$ in the form of $(1)$. Is there something missing in Goldstein's claim? If not, how to prove it for non-linear constraints?