Implicit differentiation of the first equation leads to dy/dx which has to be brought back into the ODE.
So, you must not have dy/dx remaining after simplification and the equation becomes very simple. Then, a and b are straightforwards obtained.
Probably, there is a mistake somewhere in your calculus. But without seeing the details of your calculus it is impossible to show you where is the mistake.