0

I'm testing dsolve method of sympy package in order to check if any differential can be solved and return solution if it is. Trying to solve equation of this kind

from sympy import dsolve
t = symbols('t')
x = Function('x')
dsolve(x(t).diff(t) - x(t)**2 + t**2)

returns an answer:

enter image description here

The last term of this expression tells me that an equation doesn't have explicit solution. How can I check if equation has an explicit solution using sympy?

I hope something like this:

is_solution_explicit(x(t).diff(t) - x(t)**2 + t**2) returns False is_solution_explicit(2*x(t)/(1+t) + (1+t)**3) returns True

mathfux
  • 5,759
  • 1
  • 14
  • 34
  • 1
    This particular example is a series solution from the series solver. There should be a way to disable these: https://github.com/sympy/sympy/issues/15916 You can check for it with `sol.has(O)` – Oscar Benjamin Mar 15 '20 at 23:31
  • @Oscar Thanks a lot for this link. I have at least one working solution now :) – mathfux Mar 16 '20 at 00:07

0 Answers0