Question: tricky ode with IC. Why this verification fail?

Maple does not give solution to this first order ode with IC, if asked to do it implicit. It only solves it explicit. 

ode := diff(y(x), x) - 2*(2*y(x) - x)/(x + y(x)) = 0;
ic:=y(0)=2;
dsolve([ode,ic],'implicit'); #maple gives no solution when implicit!

Then I asked Maple for an implicit solution but with no IC. Then solved for the constant of integration myself, and plugged this back in the solution. But odetest now says the initial conditions do not verify. 

Here are the steps I did to solve for the constant of integration. I do not see any error I made. Does any one see where my error is and why odetest does not verify the solution for IC?

This first order ode has unique solution. Here is my worksheet.
 

35220

restart;

35220

ode := diff(y(x), x) - 2*(2*y(x) - x)/(x + y(x)) = 0;
ic:=y(0)=2;
dsolve([ode,ic],'implicit'); #maple gives no solution when implicit!

diff(y(x), x)-2*(2*y(x)-x)/(x+y(x)) = 0

y(0) = 2

#lets now try finding the constant of integration ourself
sol:=dsolve(ode,'implicit')

2*ln(-(-y(x)+x)/x)-3*ln(-(-y(x)+2*x)/x)-ln(x)-c__1 = 0

#setup equation and plugin the IC. Raise both sides to exp. RHS becomes 1
eq:=exp(lhs(sol))=1;

exp(2*ln(-(-y(x)+x)/x)-3*ln(-(-y(x)+2*x)/x)-ln(x)-c__1) = 1

simplify(eq,exp);

(y(x)-x)^2*exp(-c__1)/(y(x)-2*x)^3 = 1

#plugin in y=2 at x=0
eval(%,[y(x)=2,x=0]);

(1/2)*exp(-c__1) = 1

#solve for constant of integration
solve(%,c__1)

-ln(2)

#subtitute back in the solution
sol:=eval(sol,c__1=%);

2*ln(-(-y(x)+x)/x)-3*ln(-(-y(x)+2*x)/x)-ln(x)+ln(2) = 0

#verify. Why it failed check on IC?? Notice it is not [0,0].
odetest(sol,[ode,ic])

[0, 2]

 


 

Download why_fails_to_verify.mw

 

Please Wait...