Hi, Sorry for the late post this week. I couldn’t do much of work last week, but I did manage to write some code.

First of all, I managed to get the lie group hint finally in.Β The Pull Request can be seen here, https://github.com/sympy/sympy/pull/2359 . Its nice to see the work that you have been doing, for around two months, finally in π

I just started work on the power series methods for first order differential equations. Contrary to what I learnt, which is substituting and finding out a recurrence relation, I found out a much better (straightforward) way to find the power series methods to a given differential equation. Before discussing the algorithm, when does any first order differential equation have a power series solution and what is a power series solution?.

1. Condition for power series solution: Let us take a general first order ODE . It has a power series solution, at a given point when \frac{Q(x, y)}{P(x, y)} is analytic at a given point. Analyticity of an expression at a point is confirmed when, either the expression is infinitely differentiable at a given point, or when the expression has a Power series solution, at a given point. Right now, it is impossible to find out (atleast using SymPy) whether,

any of the above conditions are true. So for now, checking is just being done to see if and , exist at the given point.

2. A power series solution is when you can express the solution in the form of a Taylor series. Let us say the solution to a differential equation , is , then a power series solution exists at when, , can be written as . As is evident, this can exist only when is infinitely differentible at

The algorithm is as follows, lets say and . Then

1]

2]

3]

and so on. Since we know the expressions, we can also find their value at a particular point.

A sample session.

from sympy import * f = Function("f") eq = f(x).diff(x) - sin(x*f(x)) pprint(dsolve(eq, hint='1st_power_series', ics={f(2):2, 'terms':1})) f(x) = (x - 2)β sin(4) + 2 pprint(dsolve(eq, hint='1st_power_series', ics={f(2):2, 'terms':3})) 2 (x - 2) β (2β cos(4) + 2β sin(4)β cos(4)) β 3β f(x) = 2 + (x - 2)β sin(4) + βββββββββββββββββββββββββββββββββββββ + Oβx β 2 pprint(dsolve(eq)) 4 β 3 β 2 x β β- Cβ + 3β Cββ Cββ x β 6β f(x) = βββββββββββββββββ + Cβ + βββββ + Oβx β 24 2 eq = f(x).diff(x) - x*f(x) pprint(dsolve(eq, hint='1st_power_series')) 2 4 Cββ x Cββ x β 6β f(x) = Cβ + βββββ + βββββ + Oβx β 2 8

Thats all for now. Cheers!

Ok, this looks promising!

I don’t think we need to check the preconditions within sympy, at least not right now.

Are the lines mixed up in the example? The first two pprint belong the the first eq with sin, the second two to the second, no?

I compared your first example to Axiom/Fricas:

(1) -> y := operator y

(1) y

Type: BasicOperator

(2) -> f := operator f

(2) f

Type: BasicOperator

(3) -> eq := D(y(x), x) + sin(x*f(x))

,

(3) y (x) + sin(x f(x))

Type: Expression(Integer)

(4) -> seriesSolve(eq=0, y, x=2, [2])

Compiling function %D with type List(UnivariateTaylorSeries(

Expression(Integer),x,2)) -> UnivariateTaylorSeries(Expression(

Integer),x,2)

(4)

2

f(x)cos(2f(x)) 2 f(x) sin(2f(x)) 3

2 – sin(2f(x))(x – 2) – ————– (x – 2) + ————— (x – 2)

2 6

+

3 4

f(x) cos(2f(x)) 4 f(x) sin(2f(x)) 5

————— (x – 2) – ————— (x – 2)

24 120

+

5 6

f(x) cos(2f(x)) 6 f(x) sin(2f(x)) 7

– ————— (x – 2) + ————— (x – 2)

720 5040

+

7 8

f(x) cos(2f(x)) 8 f(x) sin(2f(x)) 9

————— (x – 2) – ————— (x – 2)

40320 362880

+

9

f(x) cos(2f(x)) 10 11

– ————— (x – 2) + O((x – 2) )

3628800

Type: UnivariateTaylorSeries(Expression(Integer),x,2)