I am learning sympy dsolve. I find that it sometimes solve the ode using series when not asked to do this.
I know dsolve has hints to ask it to solve using series.
Is there a way to tell dsolve not to use series solution if it can't solve the ode using exact methods?
Here is an example. Using sympy 1.13.1
-----------------------------------
>python
Python 3.13.1 (main, Dec 4 2024, 18:05:56) [GCC 14.2.1 20240910] on linux
Type "help", "copyright", "credits" or "license" for more information.
from sympy import *
x = symbols("x")
y = Function("y")
ode = Eq(x*(1 - x)*Derivative(y(x), x) + y(x)*exp(x) + Derivative(y(x), (x, 2)),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
It gives
Eq(y(x), C2*(x**4*exp(2*x)/24 + x**4*exp(x)/12 - x**2*exp(x)/2 + 1) + C1*x*(x**3/12 - x**2*exp(x)/6 - x**2/6 + 1) + O(x**6))
You see, the solution is series solution as it has O(...) at the end even though there is no hint to use series in the command.
Is it possible to do this?
--Nasser