DEtools
polysols
find polynomial solutions of a linear ODE
Calling Sequence
Parameters
Description
Examples
polysols(ODE, v, opts)
polysols(coeff_list, g, x, output=solution)
ODE
-
ordinary differential equation - linear or not - or a set or list of them
v
optional - the unknown function of the ODE, or a set or list of them in the case of an ODE system
coeff_list
list of coefficients of a Linear ODE, or list of lists in the case of a Linear ODE system
g
right-hand side of a Linear ODE or a list of them in the case of a Linear ODE system
x
independent variable of a Linear ODE or system of them
output = solution
optional, for Linear ODEs, the output is returned as a solution expression, as dsolve does
opts
optional, for Nonlinear ODEs and systems of them, could be any of the optional arguments accepted by casesplit
The polysols command returns polynomial solutions of an ODE or a system of them with rational function coefficients.
The first calling sequence has an ODE or a system of them as the first argument, and, optionally, a variable, set or list of them indicating who are the unknown functions as the second argument - say v. If v is not given, all differentiated functions found in ODE are taken as the unknown functions of the problem. In the case of Nonlinear ODE systems, v can also be a solving ranking as described in casesplit and any of the optional arguments accepted by the casesplit command are valid for polysols.
The second calling sequence is valid only for Linear ODEs and is described as follows.
Case of a single Linear ODE
- The first argument is the list of coefficients cn⁡x
c0,c1,...,cn
entering the ODE, say, in y(x),
c0⁢y+c1⁢y'+...+cn⁢yn=g⁡x
- The second argument is the right-hand side of such an equation, g(x), so-called non-homogeneous term;
- The third argument is the independent variable of the ODE, say x.
The output is a list of independent polynomial solutions representing a solution basis. If the ODE admits as many polynomial solutions as the differential order, the basis returned is complete. In the nonhomogeneous case, the returned value is a two-element list, with the first element a basis for the homogeneous case and the second element a particular polynomial solution (if it exists). When the optional argument output=solution is given, the output is an explicit closed form solution as the ones returned by dsolve.
Case of a system of Linear ODEs
- The first argument is a list of list(s) where each inner list corresponds to one equation in the system; in turn this list contains list(s) of the coefficients corresponding to each function and its derivatives in the linear ODE system, as explained in the previous paragraph for a single Linear ODE. For example, suppose a system with unknowns fi⁡x, this shows the correspondence between the list and function representations in typical cases (see also the examples at the end)
0,1,−1=ⅆⅆxf1⁡x−f2⁡x=0
,0,1,−1,−1=ⅆⅆxf2⁡x−f3⁡x−f4⁡x=0
,−x2,2,,,0,1=−x2⁢f2⁡x+2⁢f3⁡x+ⅆⅆxf6⁡x=0
- The second argument is a list containing the right-hand sides of each equation of the system
- The third argument is the independent variable of the Linear ODE system
The output consists of a list of solution basis corresponding to each function. When no polynomial solutions exist for one function, the corresponding list is empty. In the nonhomogeneous case, the output consists of a two-element list, with the first element a list of lists of solution basis for the homogeneous case and the second element a particular polynomial solution (if it exists). When the optional argument output=solution is given, the output is an explicit closed form solution as the ones returned by dsolve, enclosed into a list.
The polysols command is implemented as a module and provides direct access to each of its subroutines. These subroutines are of use as programmer entry points by shortcutting the identification of the type of problem and testing of arguments for correctness, e.g., when you know a priori what the type of problem is, and are sure that test for correctness of arguments is not necessary. For each type of problem you can use the corresponding subroutine as follows.
- Problem: an ODE system, Linear or not, represented by standard equations. Subroutine: `DEtools/polysols`:-ODESystem
- Problem: a Linear ODE system represented by a list of lists of lists. Subroutine: `DEtools/polysols`:-ODESystemList
- Problem: a single ODE, Linear or not, represented by an equation or algebraic expression: `DEtools/polysols`:-ODE
- Problem: a single Linear ODE represented by a list of coefficients. Subroutine: `DEtools/polysols`:-ODEList
- Problem: particular solution for a single Linear ODE represented by a list of coefficients. Subroutine: `DEtools/polysols`:-ODEListParticularSolution
- Problem: switch the output from a list consisting of a solution basis to the standard solution form used by dsolve. Subroutine: `DEtools/polysols`:-FormatOutput
Libraries in use
In order to find solutions:
- In the Linear ODE system case, or the case of a single ODE enclosed into a list, polysols uses the LinearFunctionalSystems[PolynomialSolution] command;
- In the single Linear ODE case, polysols uses its own optimized code;
- In the case of a Nonlinear ODE or a system of them, polysols uses the libraries for computing traveling wave solutions for autonomous PDE systems.
with⁡DEtools,polysols:
Linear ODEs
Homogeneous case
odeH≔diff⁡z⁡t,`$`⁡t,2−3t⁢diff⁡z⁡t,t+3t2⁢z⁡t=0
odeH≔ⅆ2ⅆt2z⁡t−3⁢ⅆⅆtz⁡tt+3⁢z⁡tt2=0
polysols⁡odeH
t,t3
The same result can be obtained using the programmer's entry point, `DEtools/polysols`:-ODE(ode, z(t)), which shortcuts the identification of the type of problem and avoids spending time testing the arguments for correctness.
Same problem but using the optional argument output = solution
polysols⁡odeH,output=solution
z⁡t=_C2⁢t3+_C1⁢t
Adding a non-homogeneous term
odeNH≔lhs⁡odeH=3⁢t2⁢t+12
odeNH≔ⅆ2ⅆt2z⁡t−3⁢ⅆⅆtz⁡tt+3⁢z⁡tt2=3⁢t2⁢t+12
polysols⁡odeNH
t,t3,15⁢t6+34⁢t5+t4
The same Linear ODE but given as a list of coefficients (see DEtools[convertAlg]), with the right-hand-side (non-homogeneous term) passed as second argument to polysols
odeH_list,NHterm≔op⁡DEtoolsconvertAlg⁡odeNH,z⁡t
odeH_list,NHterm≔3t2,−3t,1,3⁢t4+6⁢t3+3⁢t2
polysols⁡odeH_list,NHterm,t
When giving a Linear ODE system, the number of equations and unknowns must be the same. The default format for the output is a list of polynomial solution basis for each function
sys≔diff⁡y1⁡x,x−y2⁡x,diff⁡y2⁡x,x−y3⁡x−y4⁡x,diff⁡y3⁡x,x−y5⁡x,diff⁡y4⁡x,x−2⁢y1⁡x−2⁢x⁢y2⁡x−y5⁡x,diff⁡y5⁡x,x−x2⁢y1⁡x−2⁢x⁢y3⁡x−y6⁡x,diff⁡y6⁡x,x−x2⁢y2⁡x+2⁢y3⁡x
sys≔ⅆⅆxy1⁡x−y2⁡x,ⅆⅆxy2⁡x−y3⁡x−y4⁡x,ⅆⅆxy3⁡x−y5⁡x,ⅆⅆxy4⁡x−2⁢y1⁡x−2⁢x⁢y2⁡x−y5⁡x,ⅆⅆxy5⁡x−x2⁢y1⁡x−2⁢x⁢y3⁡x−y6⁡x,ⅆⅆxy6⁡x−x2⁢y2⁡x+2⁢y3⁡x
vars≔y1⁡x,y2⁡x,y3⁡x,y4⁡x,y5⁡x,y6⁡x
polysols⁡sys,vars
0,1,x,0,0,1,1,−x,−x2,−1,x,x2,0,−1,−2⁢x,−2⁢x,x2,x3−2
The same result can be obtained using the corresponding programmer's entry point, `DEtools/polysols`:-ODESystem(sys, vars).
The equivalent closed form solution using the output = solution option
polysols⁡sys,vars,output=solution
y1⁡x=_C3⁢x+_C2,y2⁡x=_C3,y3⁡x=−_C3⁢x2−_C2⁢x+_C1,y4⁡x=_C3⁢x2+_C2⁢x−_C1,y5⁡x=−2⁢_C3⁢x−_C2,y6⁡x=_C3⁢x3+_C2⁢x2−2⁢_C1⁢x−2⁢_C3
The same Linear ODE system given as a list of lists of lists
sys≔0,1,−1,,0,1,−1,−1,,,0,1,,−1,−2,−2⁢x,,0,1,−1,−x2,,−2⁢x,,0,1,−1,,−x2,2,,,0,1
polysols⁡sys,0,0,0,0,0,0,x
Using polysols to reduce the order of an ODE: combining the functionality of various DEtools commands
Consider the list of four infinitesimals for symmetry generators of the form ξ=0,η=f⁡x (see symgen)
S≔0,x,0,x−12,0,x3,0,1x
For linear ODEs, the function f⁡x entering symmetries of the form 0,f⁡x is always a solution of the ODE. So we can construct the most general Linear ODE of fourth order having the four solutions (symmetries) above, three of which are polynomial in x, via (see DEtools[equinv])
lin_DE≔DEtoolsequinv⁡S,y⁡x,4
lin_DE≔ⅆ4ⅆx4y⁡x=−x2+3⁢ⅆ3ⅆx3y⁡xx3−x+3⁢ⅆ2ⅆx2y⁡xx2−6⁢ⅆⅆxy⁡xx3−x+6⁢y⁡xx2⁢x2−1+_F1⁡x
For the purpose of using polysols in this example, we remove here the arbitrary non-homogeneous and non-rational term _F1⁡x
ode≔subs⁡_F1⁡x=0,lin_DE
ode≔ⅆ4ⅆx4y⁡x=−x2+3⁢ⅆ3ⅆx3y⁡xx3−x+3⁢ⅆ2ⅆx2y⁡xx2−6⁢ⅆⅆxy⁡xx3−x+6⁢y⁡xx2⁢x2−1
Compute the polynomial solutions
sol_basis≔polysols⁡ode,y⁡x
sol_basis≔x,x3,x2+1
Since this ODE is of fourth order and there are only three polynomial solutions, the above is not sufficient to construct the most general solution for ode. However, each ODE solution leads to a reduction of order (see DEtools[reduce_order]), so using the polynomial solutions above we can reduce the order by three
R≔DEtoolsreduce_order⁡ode,basis=sol_basis
R≔y⁡x=_a⁢∫2⁢_a⁢∫−_a2−3⁢∫_b⁡_aⅆ_a+_C32⁢_a4ⅆ_a+_C2ⅆ_a+_C1where−_a⁢_a2−1⁢_a2−3⁢ⅆⅆ_a_b⁡_a+−4⁢_a4+6⁢_a2−6⁢_b⁡_a=0,_a=x,_b⁡_a=−x⁢ⅆ3ⅆx3y⁡x⁢x3−3⁢ⅆ2ⅆx2y⁡x⁢x2−3⁢ⅆ3ⅆx3y⁡x⁢x+6⁢ⅆⅆxy⁡x⁢x+3⁢ⅆ2ⅆx2y⁡x−6⁢y⁡xx2−32,x=_a,y⁡x=_a⁢∫2⁢_a⁢∫−_a2−3⁢∫_b⁡_aⅆ_a+_C32⁢_a4ⅆ_a+_C2ⅆ_a+_C1
In above we see an ODESolStructure where the solving of the original fourth order ODE problem is reduced to the solving of one first order linear ODE in _b⁡_a
op⁡2,2,1,1,R
−_a⁢_a2−1⁢_a2−3⁢ⅆⅆ_a_b⁡_a+−4⁢_a4+6⁢_a2−6⁢_b⁡_a=0
You can also request to reduce_order to automatically attempt integrating that remaining ODE using the option output = solution
S≔DEtoolsreduce_order⁡ode,basis=sol_basis,output=solution
S≔y⁡x=x⁢∫2⁢x⁢∫−x2−3⁢∫x2−1⁢_C4x2−32⁢x2ⅆx+_C32⁢x4ⅆx+_C2ⅆx+_C1
value⁡S
y⁡x=x⁢_C2⁢x2+_C3⁢x+_C3x+_C424⁢x2+_C1
In the solution above we see the four solutions used to construct the problem, three of which are polynomial and were used to reduce the problem from a fourth order ODE to a first order one.
Nonlinear ODEs
A nonlinear fourth order equation, a constant and two linear solutions for it
ODE≔13⁢q2⁢a2⁢−1+t22s⁢u⁡t+16⁢p⁢q⁢a2⁢−1+t22s⁢diff⁡u⁡t,t2+13⁢q2⁢a2⁢−1+t2⁢ts⁢u⁡t2+13⁢p⁢q⁢a2⁢−1+t2⁢ts⁢u⁡t−118⁢a2⁢t−1⁢3⁢612⁢a⁢r⁢q⁢t2−13⁢s⁢q12+12⁢q2⁢a2⁢t2−6⁢q2⁢a2−32⁢p2⁢s+r2⁢q⁢t⁢t+1s2⁢diff⁡u⁡t,t−136⁢a3⁢−1+t23⁢r⁢612⁢s⁢q32+12⁢q2⁢a⁢t⁢s2s3⁢diff⁡u⁡t,`$`⁡t,3+16⁢q2⁢a2⁢−1+t22s⁢u⁡t2+16⁢p⁢q⁢a2⁢−1+t22s⁢u⁡t−172⁢−1+t22⁢a2⁢12⁢r⁢612⁢s⁢q32⁢a⁢t+2⁢s⁢r2⁢q−3⁢s2⁢p2−12⁢q2⁢a2⁢s2+72⁢s2⁢q2⁢a2⁢t2s3⁢diff⁡u⁡t,`$`⁡t,2−136⁢q2⁢a4⁢−1+t24s⁢diff⁡u⁡t,`$`⁡t,4
ODE≔q2⁢a2⁢t2−12⁢u⁡t3⁢s+p⁢q⁢a2⁢t2−126⁢s⁢ⅆⅆtu⁡t2+q2⁢a2⁢t2−1⁢t⁢u⁡t23⁢s+p⁢q⁢a2⁢t2−1⁢t⁢u⁡t3⁢s−a2⁢t−1⁢3⁢6⁢a⁢r⁢q⁢t2−13⁢s⁢q+12⁢q2⁢a2⁢t2−6⁢q2⁢a2−32⁢p2⁢s+r2⁢q⁢t⁢t+118⁢s2⁢ⅆⅆtu⁡t−a3⁢t2−13⁢r⁢6⁢s⁢q32+12⁢q2⁢a⁢t⁢s2⁢ⅆ3ⅆt3u⁡t36⁢s3+q2⁢a2⁢t2−12⁢u⁡t26⁢s+p⁢q⁢a2⁢t2−12⁢u⁡t6⁢s−t2−12⁢a2⁢12⁢r⁢6⁢s⁢q32⁢a⁢t+2⁢s⁢r2⁢q−3⁢s2⁢p2−12⁢q2⁢a2⁢s2+72⁢s2⁢q2⁢a2⁢t272⁢s3⁢ⅆ2ⅆt2u⁡t−q2⁢a4⁢t2−14⁢ⅆ4ⅆt4u⁡t36⁢s
ODE_sol≔DEtoolspolysols⁡ODE
ODE_sol≔u⁡t=_C3,u⁡t=−t⁢a−s⁢q⁢r⁢6+3⁢p⁢s6⁢s⁢q,u⁡t=t⁢a+s⁢q⁢r⁢6−3⁢p⁢s6⁢s⁢q
Solutions can be tested as usual with odetest
map⁡odetest,ODE_sol,ODE
0,0,0
Using the optional argument singsol=false, the singular cases (in this example: the constant solution) are not computed
DEtoolspolysols⁡ODE,singsol=false
u⁡t=−t⁢a−s⁢q⁢r⁢6+3⁢p⁢s6⁢s⁢q,u⁡t=t⁢a+s⁢q⁢r⁢6−3⁢p⁢s6⁢s⁢q
A nonlinear seventh order equation depending on three parameters a,b,c and polynomial solutions for it taking these parameters as solving variables:
ODE≔−a⁢t2+a⁢u⁡t−12159⁢13185⁢a3⁢c⁢t2−4335⁢a3⁢c+315⁢a3⁢c⁢t6−525⁢a3⁢c⁢t4+259080⁢a5⁢t4−259080⁢a5⁢t2+34544⁢a5+2159⁢b⁢t+1⁢t−1⁢diff⁡u⁡t,t−54318⁢a3⁢t+14⁢t−14⁢105⁢t2⁢c+17272⁢a2−35⁢c⁢t⁢diff⁡u⁡t,`$`⁡t,4−117272⁢a3⁢t+15⁢t−15⁢315⁢t2⁢c+17272⁢a2−35⁢c⁢diff⁡u⁡t,`$`⁡t,5−152159⁢a3⁢63⁢t4⁢c−70⁢t2⁢c+34544⁢a2⁢t2+879⁢c−17272⁢a2⁢t⁢t+12⁢t−12⁢diff⁡u⁡t,`$`⁡t,2−54318⁢a3⁢315⁢t4⁢c+103632⁢a2⁢t2−210⁢t2⁢c+879⁢c−17272⁢a2⁢t+13⁢t−13⁢diff⁡u⁡t,`$`⁡t,3−2117272⁢c⁢a3⁢−1+t26⁢t⁢diff⁡u⁡t,`$`⁡t,6−134544⁢c⁢a3⁢−1+t27⁢diff⁡u⁡t,`$`⁡t,7
ODE≔−a⁢t2+a⁢u⁡t−315⁢a3⁢c⁢t6+259080⁢a5⁢t4−525⁢a3⁢c⁢t4−259080⁢a5⁢t2+13185⁢a3⁢c⁢t2+34544⁢a5−4335⁢a3⁢c+2159⁢b⁢t+1⁢t−12159⁢ⅆⅆtu⁡t−5⁢a3⁢t+14⁢t−14⁢105⁢t2⁢c+17272⁢a2−35⁢c⁢t⁢ⅆ4ⅆt4u⁡t4318−a3⁢t+15⁢t−15⁢315⁢t2⁢c+17272⁢a2−35⁢c⁢ⅆ5ⅆt5u⁡t17272−15⁢a3⁢63⁢t4⁢c+34544⁢a2⁢t2−70⁢t2⁢c−17272⁢a2+879⁢c⁢t⁢t+12⁢t−12⁢ⅆ2ⅆt2u⁡t2159−5⁢a3⁢315⁢t4⁢c+103632⁢a2⁢t2−210⁢t2⁢c−17272⁢a2+879⁢c⁢t+13⁢t−13⁢ⅆ3ⅆt3u⁡t4318−21⁢c⁢a3⁢t2−16⁢t⁢ⅆ6ⅆt6u⁡t17272−c⁢a3⁢t2−17⁢ⅆ7ⅆt7u⁡t34544
DEtoolspolysols⁡ODE,parameters=a,b,c
a=a,b=b,c=c,u⁡t=_C3,a=a,b=−109525⁢a5−_C3⁢a,c=−2159⁢a225,u⁡t=83165⁢a4⁢t6−332645⁢a4⁢t4+8316⁢a4⁢t2+_C3,a=0,b=0,c=c,u⁡t=_C9⁢t6+_C8⁢t5+_C7⁢t4+_C6⁢t3+_C5⁢t2+_C4⁢t+_C3
A nonlinear ODE system
ode1≔−12+12⁢t2⁢a⁢u⁡t+2+6⁢t4−8⁢t2⁢a3−4⁢b⁢t2+4⁢b⁢diff⁡u⁡t,t+−12+12⁢t2⁢a⁢diff⁡w⁡t,t+24−24⁢t2⁢a⁢v⁡t⁢diff⁡v⁡t,t+6⁢a3⁢−1+t22⁢t⁢diff⁡u⁡t,`$`⁡t,2+a3⁢−1+t23⁢diff⁡u⁡t,`$`⁡t,3=0
ode1≔12⁢t2−12⁢a⁢u⁡t+6⁢t4−8⁢t2+2⁢a3−4⁢b⁢t2+4⁢b⁢ⅆⅆtu⁡t+12⁢t2−12⁢a⁢ⅆⅆtw⁡t+−24⁢t2+24⁢a⁢v⁡t⁢ⅆⅆtv⁡t+6⁢a3⁢t2−12⁢t⁢ⅆ2ⅆt2u⁡t+a3⁢t2−13⁢ⅆ3ⅆt3u⁡t=0
ode2≔6−6⁢t2⁢a⁢u⁡t+−2−6⁢t4+8⁢t2⁢a3−2⁢b⁢t2+2⁢b⁢diff⁡w⁡t,t−6⁢a3⁢−1+t22⁢t⁢diff⁡w⁡t,`$`⁡t,2−a3⁢−1+t23⁢diff⁡w⁡t,`$`⁡t,3=0
ode2≔−6⁢t2+6⁢a⁢u⁡t+−6⁢t4+8⁢t2−2⁢a3−2⁢b⁢t2+2⁢b⁢ⅆⅆtw⁡t−6⁢a3⁢t2−12⁢t⁢ⅆ2ⅆt2w⁡t−a3⁢t2−13⁢ⅆ3ⅆt3w⁡t=0
ode3≔6−6⁢t2⁢a⁢u⁡t+−2−6⁢t4+8⁢t2⁢a3−2⁢b⁢t2+2⁢b⁢diff⁡v⁡t,t−a3⁢−1+t23⁢diff⁡v⁡t,`$`⁡t,3−6⁢a3⁢−1+t22⁢t⁢diff⁡v⁡t,`$`⁡t,2=0
ode3≔−6⁢t2+6⁢a⁢u⁡t+−6⁢t4+8⁢t2−2⁢a3−2⁢b⁢t2+2⁢b⁢ⅆⅆtv⁡t−a3⁢t2−13⁢ⅆ3ⅆt3v⁡t−6⁢a3⁢t2−12⁢t⁢ⅆ2ⅆt2v⁡t=0
sys≔ode1,ode2,ode3:
Set the infolevel to 1 to see basic information on the computation of a non-singular polynomial solutions for it
infolevelpolysols≔1
DEtoolspolysols⁡sys,parameters=a,b,singsol=false
* Power series solution [1]: {u(t) = t^2*A[1,2]+t*A[1,1]+A[1,0], v(t) = t*A[2,1]+A[2,0], w(t) = t^4*A[3,4]+t^3*A[3,3]+t^2*A[3,2]+t*A[3,1]+A[3,0]}, splitting into cases with respect to the parameters {a, b} * Power series solution [2]: {u(t) = t^2*A[1,2]+t*A[1,1]+A[1,0], v(t) = t^2*A[2,2]+t*A[2,1]+A[2,0], w(t) = t*A[3,1]+A[3,0]}, splitting into cases with respect to the parameters {a, b}
a=a,b=−a4−3⁢_C322⁢a,u⁡t=−a2⁢t2+a4−_C322⁢a2,v⁡t=_C3⁢t+_C52⁢_C3,w⁡t=_C5⁢t+_C4
To see the whole set of solutions including the singular ones try the input above without singsol=false.
See Also
DEtools/reduce_order
DEtools[dcoeffs]
DEtools[equinv]
dsolve
LinearFunctionalSystems[PolynomialSolution]
Download Help Document