find polynomial solutions of a linear ODE
polysols(ODE, v, opts)
polysols(coeff_list, g, x, output=solution)
ordinary differential equation - linear or not - or a set or list of them
optional - the unknown function of the ODE, or a set or list of them in the case of an ODE system
list of coefficients of a Linear ODE, or list of lists in the case of a Linear ODE system
right-hand side of a Linear ODE or a list of them in the case of a Linear ODE system
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
optional, for Non-Linear 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 Non-Linear 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
entering the ODE, say, in y(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)
- 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 Non-Linear ODE or a system of them, polysols uses the libraries for computing traveling wave solutions for autonomous PDE systems.
odeH ≔ ⅆ2ⅆt2⁢z⁡t−3⁢ⅆⅆt⁢z⁡tt+3⁢z⁡tt2=0
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
Adding a non-homogeneous term
odeNH ≔ lhs⁡odeH=3⁢t2⁢t+12
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
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 ≔ ⅆⅆx⁢y1⁡x−y2⁡x,ⅆⅆx⁢y2⁡x−y3⁡x−y4⁡x,ⅆⅆx⁢y3⁡x−y5⁡x,ⅆⅆx⁢y4⁡x−2⁢y1⁡x−2⁢x⁢y2⁡x−y5⁡x,ⅆⅆx⁢y5⁡x−x2⁢y1⁡x−2⁢x⁢y3⁡x−y6⁡x,ⅆⅆx⁢y6⁡x−x2⁢y2⁡x+2⁢y3⁡x
vars ≔ y1⁡x,y2⁡x,y3⁡x,y4⁡x,y5⁡x,y6⁡x
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
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
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