# How to verify series solution to an ode generated by AsymptoticDSolveValue?

To verify solution returned by DSolve, one can use the method shown in howto/CheckTheResultsOfDSolve.html and look for True (may be after a Simplify

But how to verify the solution from AsymptoticDSolveValue? Trying to do something similar to the above will not work, since simple substitution would not work because the solution is now a truncated series and so one will not get an exact zero on the left side.

Clear["Global*"]
ode = x^2*(-x^2 + 2)*y''[x] - x*(4*x^2 + 3)*y'[x] + (-2*x^2 + 2)*y[x] == 0;
sol = AsymptoticDSolveValue[ode, y[x], {x, 0, 8}]


And now

sol2 = y -> Function[{x}, Evaluate[sol]]


And now

 Simplify[ode /. sol2]


Does not give True (understandably) , it gives

I think Mathematica needs a specialized function for verification of solution of DSolve and AsymptoticDSolveValue. Maple has such a function called odetest which works for standard solution and series solution

restart;
ode:=x^2*(-x^2+2)*diff(diff(y(x),x),x)-x*(4*x^2+3)*diff(y(x),x)+(-2*x^2+2)*y(x) = 0;
Order:=9;
sol:=dsolve(ode,y(x),series,x=0);


To verify the above, one can do

 odetest(sol,ode,series,x=0)

0


And look for zero as result. If the result is not zero, then it did not verify the solution.

Is there something in Mathematica that can be used to verify result of AsymptoticDSolveValue? For example, one can obtain a series solution in some other way, and want to use Mathematica to verify this solution against the ODE. How to do this?

V 12.3.1

Perhaps Asymptotic helps:
Asymptotic[ode /. sol2,x->0]
`