Question: How to verify ode solution in parametric form?

is it possible to ask Maple to verify ode solution obtained from book, which is given in parametric form to check if it is correct?

I know odetest supports both explicit and implicit solutions. But parametric solution is neither of these.

The solution in parametric form makes it look simple to look at and understand, but at same time, not practical in terms of obtaining an explicit solution to verify it and to use it.

The book "handbook of exact solution for ordinary differential equations" by Polyanin and Zaitsev have many such solutions.

Here is one such example of many

I can not just give odetest the y(x) solution above, because the right side depends on tau, which is parameter. If I try to solve for tau in terms of x from the first equation it will become so complicated and odetest hangs. So a whole new different approach is needed as brute force method is not practical in most cases.

restart;

ode:=y(x)*diff(y(x),x)-y(x)=A*x+B;
book_sol:=y(x)=_C1*t*exp( - Int( t/(t^2-t-A),t));
eq:=x=_C1*exp(  - Int( t/(t^2-t-A),t))-B/A;

y(x)*(diff(y(x), x))-y(x) = A*x+B

y(x) = _C1*t*exp(-(Int(t/(t^2-A-t), t)))

x = _C1*exp(-(Int(t/(t^2-A-t), t)))-B/A

value(eq):
solve(%,t):
simplify(eval(book_sol,t=%));

y(x) = _C1*exp(-RootOf(4*A*exp(2*_Z)-4*cosh((ln((A*x+B)/(A*_C1))-_Z)*(4*A+1)^(1/2))^2+exp(2*_Z))+Intat(_a/(-_a^2+A+_a), _a = RootOf(-A*exp(2*RootOf(4*A*exp(2*_Z)-4*cosh((ln((A*x+B)/(A*_C1))-_Z)*(4*A+1)^(1/2))^2+exp(2*_Z)))+_Z^2-exp(RootOf(4*A*exp(2*_Z)-4*cosh((ln((A*x+B)/(A*_C1))-_Z)*(4*A+1)^(1/2))^2+exp(2*_Z)))*_Z+1)*exp(-RootOf(4*A*exp(2*_Z)-4*cosh((ln((A*x+B)/(A*_C1))-_Z)*(4*A+1)^(1/2))^2+exp(2*_Z)))))*RootOf(-A*exp(2*RootOf(4*A*exp(2*_Z)-4*cosh((ln((A*x+B)/(A*_C1))-_Z)*(4*A+1)^(1/2))^2+exp(2*_Z)))+_Z^2-exp(RootOf(4*A*exp(2*_Z)-4*cosh((ln((A*x+B)/(A*_C1))-_Z)*(4*A+1)^(1/2))^2+exp(2*_Z)))*_Z+1)

odetest(%,ode); #hangs

Download how_to_verify_parametric_solution_to_ode.mw

Some more examples from the book where solutions are given only in parametrric form

update

inspired by solution below by @acer, I found if I just use Solve on the x equation, in order to find t as function of x, and use that in the y equation, it will automatically return solution using RootOf.

Hence no need to explicitly evaluate the integral or explicity set up the RootOf manually.

Now odetest work. 

restart;

ode:=y(x)*diff(y(x),x)-y(x)=A*x+B;
book_sol:=y(x)=_C1*t*exp( - Int( t/(t^2-t-A),t));
eq:=x=_C1*exp(  - Int( t/(t^2-t-A),t))-B/A;

y(x)*(diff(y(x), x))-y(x) = A*x+B

y(x) = _C1*t*exp(-(Int(t/(t^2-A-t), t)))

x = _C1*exp(-(Int(t/(t^2-A-t), t)))-B/A

PDEtools:-Solve(eq,t);

t = RootOf(c__1*exp(Intat(_a/(-_a^2+A+_a), _a = _Z))*A-A*x-B)

simplify(eval(book_sol,%));

y(x) = RootOf(c__1*exp(Intat(_a/(-_a^2+A+_a), _a = _Z))*A-A*x-B)*(A*x+B)/A

odetest(%,ode);

0

#compare to Maple's
simplify(dsolve(ode,useInt));

y(x) = -RootOf(-Intat(_a/(-_a^2+A-_a), _a = _Z)+Intat(1/_a, _a = A*x+B)+c__1)*(A*x+B)/A

odetest(%,ode);

0

 

 

Download how_to_verify_parametric_solution_to_ode_V2.mw

Please Wait...