I see sympy 1.13.3 giving many errors from dsolve when asking it to solve using series, saying
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.
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