Question: how to obtain this implicit solution for this ODE?

Textbook gives this nice short implicit solution for this ode

As

But Maple does not give an implicit solution

restart;
ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x));
ic:=y(0)=2;
sol:=dsolve([ode,ic],'implicit')

Removing implicit gives very complicated solution as it tries to solve for y(x).

book_sol:=(x-y(x))^2-1/2*(y(x)-2*x)^3=0;
odetest(book_sol,[ode,ic])

Any suggestion or a trick or a different approach to make Maple generate the same solution given in the textbook?

ps. manually, it is possible to obtain the same solution as book as follows

restart;
ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x));
ic:=y(0)=2;
sol:=dsolve(ode,'implicit');
sol:=simplify(exp(lhs(sol))=exp(rhs(sol)));
the_constant:=solve(sol,_C1);
the_constant:=eval(the_constant,[y(x)=2,x=0]);
sol:=eval(sol,_C1=the_constant);
odetest((lhs-rhs)(sol)=0,[ode,ic])

 

edit june 14,2021

I found a direct way to get an implicit solution which is close enough to book solution. It is by using Lie symmetry method

restart;
ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x));
ic:=y(0)=2;
sol:=dsolve([ode,ic], y(x),'implicit','Lie');

Another variant which gives book solution but requires one extra step

restart;
ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x));
ic:=y(0)=2;
sol:=dsolve([ode,ic], y(x),'implicit','Lie',way=all,fat);
simplify(exp( (lhs-rhs)(sol)))=1

ps. corrected above now, thanks to comment below by Carl.

Maple 2021.1

 

 

 

Please Wait...