why dsolve gives "does not match hint 2nd_power_series_regular"?

63 views
Skip to first unread message

nma%12...@gtempaccount.com

unread,
Mar 8, 2025, 12:41:38 AM3/8/25
to sympy
I see sympy 1.13.3 giving many errors from dsolve when asking it to solve using series, saying

                    does not match hint 2nd_power_series_regular

when asking it to solve second order ode using hint

         hint="2nd_power_series_regular"

Which should be solved using method of Frobenius ofcourse. 

Does this mean sympy does not fully handle  Frobenius power series and this is just a limitation? Or Am I doing something wrong? Example below.

It will also be much better if the user just gave dsolve hint="series" and let the dsolve figure out if the expansion point is ordinary, regular or even essential singularity.

The user should not have to tell dsolve the type of the point. It should figure it out. But I see no option that says "series" only.

-------------------------------------
from sympy import *
x = symbols("x")
y = Function("y")
ode = Eq(2*x**2*Derivative(y(x), (x, 2)) - x**2 - x*Derivative(y(x), x) + (1 - x**2)*y(x),0)
dsolve(ode,func=y(x),hint="2nd_power_series_regular",x0=0,n=6)
--------------------------

gives

--------------------------------
Traceback (most recent call last):
File "<python-input-9>", line 1, in <module>
dsolve(ode,func=y(x),hint="2nd_power_series_regular",x0=0,n=6)
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/sympy/solvers/ode/ode.py", line 605, in dsolve
hints = _desolve(eq, func=func,
hint=hint, simplify=True, xi=xi, eta=eta, type='ode', ics=ics,
x0=x0, n=n, **kwargs)
File "/usr/lib/python3.13/site-packages/sympy/solvers/deutils.py", line 268, in _desolve
raise ValueError(string + str(eq) + " does not match hint " + hint)
ValueError: ODE 2*x**2*Derivative(y(x), (x, 2)) - x**2 - x*Derivative(y(x), x) + (1 - x**2)*y(x) does not match hint 2nd_power_series_regular
----------------------------------------------

Below is same thing using Maple, with trace also, showing it solved it as regular point series.

restart;
infolevel[dsolve]:=5;
ode:=2*x^2*diff(y(x),x$2)-x*diff(y(x),x)+(1-x^2)*y(x)=x^2;
dsolve(ode,y(x),type='series',x=0);

it gives

dsolve/series/froben: trying method of Frobenius
dsolve/series/froben: indicial eqn is 1/2-(3/2)*r+r^2
dsolve/series/froben: roots of indicial eqn are [[1/2] [1]]
etc...

y(x) = c__1*x^(1/2)*(series(1+1/6*x^2+1/168*x^4+O(x^6),x,6))
+c__2*x*(series(1+1/10*x^2+1/360*x^4+O(x^6),x,6))+x^2*(series(1/3+1/63*x^2+O(x^4),x,4))

Python version: 3.13.1 (main, Dec 4 2024, 18:05:56) [GCC 14.2.1 20240910]
Sympy version 1.13.3

--Nasser

Aaron Meurer

unread,
Mar 8, 2025, 12:37:28 PM3/8/25
to sy...@googlegroups.com
On Fri, Mar 7, 2025 at 10:41 PM 'nma%12...@gtempaccount.com' via sympy
<sy...@googlegroups.com> wrote:
>
> I see sympy 1.13.3 giving many errors from dsolve when asking it to solve using series, saying
>
> does not match hint 2nd_power_series_regular
>
> when asking it to solve second order ode using hint
>
> hint="2nd_power_series_regular"
>
> Which should be solved using method of Frobenius ofcourse.
>
> Does this mean sympy does not fully handle Frobenius power series and this is just a limitation? Or Am I doing something wrong? Example below.

This is most likely just a limitation. The power series ode code is
not very well fleshed out.

>
> It will also be much better if the user just gave dsolve hint="series" and let the dsolve figure out if the expansion point is ordinary, regular or even essential singularity.
>
> The user should not have to tell dsolve the type of the point. It should figure it out. But I see no option that says "series" only.

Agreed.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sympy/671c5c2b-5b0c-462e-bf30-efa9f750e409n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages