dsolve
find exact solutions for systems of ordinary differential equations (ODEs)
Calling Sequence
Parameters
Options
Description
Examples
References
dsolve(ODE_sys, opts)
ODE_sys
-
system of ODEs; it can contain inequations
opts
(optional) argument(s) that can be given in any order and are described in Options
funcs - set or list with indeterminate functions or just their names - can also be a ranking
explicit - request the composition of the sets appearing in the solution in the case of nonlinear systems of ODEs
useInt - request the use of Inert integrals instead of performing the integrations involved in the solution
singsol=false - avoid the computation of the singular solutions when the system is nonlinear
mindim=N - avoid the computation of solutions when the dimension of the solution space is less than N
parameters=P - P is a list or set of names or functions which are solving variables with priority lower than any other variable
rif - request that the differential elimination step for nonlinear ODE systems should also be done using the DEtools[Rif] package
Given an ODE system, possibly including algebraic constraints and inequations, dsolve returns an exact solution when: 1) it succeeds in uncoupling the system and 2) dsolve's routines for solving a single ODE succeed in solving each of the ODEs arising in the uncoupling process. Depending on the complexity of the system, step 2) may not be fully successful. However, step 1) is systematic in that, whenever the system is consistent, the uncoupling of systems rational in the unknowns and their derivatives is feasible (up to the amount of memory available on your computer).
ODE systems rational in the unknowns: The solving process
The solving process consists of two steps.
1. The system is first triangularized by using differential algebra techniques for polynomial systems. When the ODE system, rational in the unknowns and their derivatives, contains non-polynomial coefficients, the triangularization-also called sequential uncoupling-is performed by rewriting the system in polynomial form by using a differential extension approach (see PDEtools[dpolyform]).
Due to the intrinsic nature of the differential algebra elimination process, this first step always produces (possibly many) ODEs or algebraic equations, such that:
The union of the non-singular solutions of each of these ODEs and algebraic equations is equal to the set of general and singular solutions of the original ODE system.
Provided that the original ODE system is not subdetermined, one of the ODEs arising in step 1 depends on a single unknown.
2. This ODE depending on a single unknown is solved, and the unknown removed from the other ODEs. Due to nature of the differential elimination process, after removing this single unknown, there is another ODE depending on a single unknown.
Step 2 is repeated until all the ODEs obtained in step 1 are solved, thus arriving at the solution to the original input ODE system.
The output
When successful, in the case of linear ODE systems, dsolve returns a single solution set, with all the unknowns expressed in terms of the corresponding independent variable.
In the case of nonlinear ODE systems, dsolve, by default, returns sequences of solutions, including the singular solutions of the problem (if any). These singular solutions can be identified by the fact that the dimension of the solution space (the number of integration constants _Cn appearing) is less than the dimension of the general solution.
In the nonlinear case, each of the solutions is returned as a list, whose elements, in turn, are sets, each containing the (possibly many) solutions found for each of the unknowns of the system. The first set appearing inside each list contains the solution for one unknown expressed in terms of the independent variable. The next sets express other unknowns in terms of the independent variable and possibly also the previously solved unknowns. See the Examples section. In this way, the solution is expressed as compactly as possible, permitting an easy analysis of the solving process. Note that, depending on the solving ordering, the form of the solution can be quite different.
When dsolve is successful, in a second step, or even in a first single step, it is usually of interest to obtain a solution in built or explicit format, as a sequence of sets, where each set contains all the unknowns of the problem in solved form, with the right-hand sides containing just the independent variable(s) of the problem. To obtain the solution in such explicit format it suffices to add the keyword explicit to the arguments passed to dsolve. Note that solutions expressed in this format do not show how the system was uncoupled/solved, and usually appear much bigger than the default solution format described in the previous paragraph. The explicit format may also take noticeably more time to be compute because the simplification and integration processes involved are more expensive.
When dsolve is partially successful, the elements of each "solution list" are either sets or lists. The sets contain solutions while the lists also contain unsolved differential equations. It is valuable to have these partial solutions because they may be easier to solve. For example, the unsolved equations may be fewer in number or of lower differential order. See the Examples section.
The unknowns of the problem and rankings
By default, when only the ODE system is given, dsolve considers all the unknown functions present in the system as the unknowns of the problem, herein also called the solving variables. This default can be changed by calling dsolve with an extra argument, specifying which are the solving variables, as a set or as a list containing the names of these unknown functions (for example, {f,g,...} ) or the unknown functions (for example, {f⁡x,g⁡x,...} ).
For ODE systems rational in the unknowns and their derivatives, when the solving variables are indicated as a set, the ordering chosen by dsolve for uncoupling the system is chosen by the PDEtools[casesplit] command, where the triangularization is performed. When the solving variables are indicated as a list, for instance, f,g,h, the uncoupling ordering attempted is to obtain an ODE only depending on h, another ODE only depending on g,h, and another one depending on f,g,h. If such a triangularization is successful, dsolve first solves the ODE for h, then the one for g,h (assuming h is known - even if the ODE for h remained unsolved), and finally the one for f,g,h (assuming g,h are known).
The concept of "solving ordering" for the unknowns of the problem is thus not different from the concept of "ranking" in differential algebra (for a useful discussion on rankings see rifsimp[ranking]). In fact, the indications of a "solving ordering" accepted by dsolve can be more elaborate, as for instance the ones used to indicate a "ranking" when using the DifferentialAlgebra or DEtools[Rif] packages. For example, by indicating the unknowns of the problem as in f,g,h,j,k, one is indicating that dsolve decides whether f comes before g (or the opposite), h is ranked third, and then dsolve decides whether j comes before k. This flexibility is extremely useful when solving nonlinear ODE systems, where slight changes in the solving ordering can lead to solutions in quite different formats or make an otherwise unsolvable (by dsolve) problem solvable.
In addition to indicating the solving variables or the solving ordering as explained above, one can use the optional argument parameters=P, where P is a set or list of solving variables with less priority, meaning that they always appear at the end of the list of solving variables described in the previous paragraph. When P is given as a list, the rules for choosing a particular ordering inside it are the ones just described in the previous paragraph for the main solving variables.
ODE systems nonrational in the unknowns
The scheme used to solve systems depending on the unknowns in a nonrational manner can be summarized as the following.
The whole system is split into subsystems of ODEs, coupled among themselves but independent of the ODEs of the other subsystems (see PDEtools[splitsys]).
Each subsystem is analyzed, looking for a subsubsystem of ODEs that can be solved without using the other ODEs of the subsystem. This step is repeated until the whole subsystem is solved or until no such subsystem exists, in which case dsolve goes to step 3).
This step consists of three different algebraic algorithms for trying to reduce a subsystem of ODEs to the case treated in Step 2.
The scheme summarized above, when successful, usually obtains an answer by solving each uncoupled ODE independently. In some cases it is useful to indicate with which functions dsolve should begin, for example, first f and then g. This can be done by giving the second argument (the indeterminate functions) as a list (such as f,g) instead of as a set. Such an indication is considered only when it is equivalent to begin with f or g.
When one of the uncoupled ODEs cannot be solved by dsolve, the command goes to the next ODE as if the previous one were already solved and the solution contains one or more unsolved ODEs.
Concerning the output for nonrational ODE systems, the conventions are the same as those used for rational ODE systems explained some paragraphs above.
Other optional arguments
When the ODE system is nonlinear, by default, dsolve's output contains, in separate solution lists or sets, the singular solutions of the system. This involves both computing the singular cases, when uncoupling the system inside PDEtools[casesplit], and solving them. In many applications, however, the computation of the singular cases may not be relevant, and also their computation may sometimes be more time consuming than the computation of the general solution. For this reason, an optional argument is provided to override this behavior. By giving singsol=false, these singular solutions are not computed and no time is spent with them.
When an ODE system, is solved, the dimension of the solution space (indicated by the number of integration constants present) depends on various factors, not only the "apparent differential order" of the system. In some applications, however, it is the case that the solutions of interest are only those that have at least a minimum number of dimensions. In such a case, to discard solutions with dimension less than N (a positive integer) use the mindim=N optional argument. For nonlinear ODE systems, this option may also speed up the computational process since there is no time consumed in computing and solving the lower-dimension cases. For linear ODE systems, in which case there is only one solution, dsolve returns NULL if you specify a value of N greater than the dimension of this single solution.
By default, dsolve performs all differential elimination processes for linear ODE systems by using the DEtools[rifsimp] package, and uses the DifferentialAlgebra package for nonlinear systems. This default can be changed by giving the optional argument rif or RIF. In this case, the computation runs using the Rif package, independent of the type of the PDE system.
For further mathematical conventions related to the output by dsolve, see the conventions used in solve, dsolve, and int.
PDEtoolsdeclare⁡x,y,z,f,g⁡t,prime=t
x⁡t⁢will now be displayed as⁢x
y⁡t⁢will now be displayed as⁢y
z⁡t⁢will now be displayed as⁢z
f⁡t⁢will now be displayed as⁢f
g⁡t⁢will now be displayed as⁢g
derivatives with respect to⁢t⁢of functions of one variable will now be displayed with '
A linear system of ODEs:
sys1≔diff⁡x⁡t,t=y⁡t,diff⁡y⁡t,t=−x⁡t
sys1≔x'=y,y'=−x
sol1≔dsolve⁡sys1
sol1≔x=c__1⁢sin⁡t+c__2⁢cos⁡t,y=c__1⁢cos⁡t−c__2⁢sin⁡t
For linear systems, as above, the solution is returned as a single set, with all the unknowns in solved form, expressed in terms of the independent variable of the problem.
These ODE system solutions can be verified by using odetest, which, when the solution is correct, returns zero for each of the ODEs of the system.
odetest⁡sol1,sys1
0,0
A nonlinear system:
sys2≔diff⁡f⁡t,t=cos⁡f⁡t,diff⁡g⁡t,t=−f⁡t12,diff⁡h⁡t,t,t=g⁡tf⁡t
sys2≔f '=cos⁡f,g'=−f,h''=gf
sol2≔dsolve⁡sys2
sol2≔f=arctan⁡ⅇ2⁢t⁢c__42−1ⅇ2⁢t⁢c__42+1,2⁢ⅇt⁢c__4ⅇ2⁢t⁢c__42+1,g=∫−fⅆt+c__3,h⁡t=∫∫gfⅆtⅆt+c__1⁢t+c__2
In the solution above, f is solved as a function of t, then g is expressed in terms of t,f and h⁡t is expressed in terms of t,f,g. In this example, each of these sets contain only one solution for each of the unknowns f,g,h. In other cases, many solutions can appear in each of these sets. Solutions like this one above can also be tested using odetest.
odetest⁡sol2,sys2
0,0,0
To obtain solution sets (in this example there is only one, but typically there can be many) with f,g,h expressed as explicit functions of t, one can give the extra argument explicit, as follows.
sol22≔dsolve⁡sys2,explicit
sol22≔f=arctan⁡ⅇ2⁢t⁢c__42−1ⅇ2⁢t⁢c__42+1,2⁢ⅇt⁢c__4ⅇ2⁢t⁢c__42+1,g=∫−arctan⁡ⅇ2⁢t⁢c__42−1ⅇ2⁢t⁢c__42+1,2⁢ⅇt⁢c__4ⅇ2⁢t⁢c__42+1ⅆt+c__3,h⁡t=∫∫∫−arctan⁡ⅇ2⁢t⁢c__42−1ⅇ2⁢t⁢c__42+1,2⁢ⅇt⁢c__4ⅇ2⁢t⁢c__42+1ⅆt+c__3arctan⁡ⅇ2⁢t⁢c__42−1ⅇ2⁢t⁢c__42+1,2⁢ⅇt⁢c__4ⅇ2⁢t⁢c__42+1ⅆtⅆt+c__1⁢t+c__2
Some polynomial nonlinear systems and their answers in implicit (default) or explicit form:
sys3≔diff⁡x⁡t,t=−x⁡t⁢x⁡t+y⁡t,diff⁡y⁡t,t=y⁡t⁢x⁡t+y⁡t
sys3≔x'=−x⁢x+y,y'=y⁢x+y
dsolve⁡sys3
x=0,y=1−t+c__1,x=tanh⁡c__2+tc__1c__1,y=−x2+x'x
dsolve⁡sys3,explicit
x=0,y=1−t+c__1,x=tanh⁡c__2+tc__1c__1,y=−1c__1⁢tanh⁡c__2+tc__1
The computation of the singular solution shown above (the one with only one integration constant) can be avoided by giving the extra argument singsol=false.
dsolve⁡sys3,singsol=false
x=tanh⁡c__2+tc__1c__1,y=−x2+x'x
Note also the difference in the output when we explicitly request a particular solving ordering to be used by giving the solving variables as a list.
dsolve⁡sys3,x,y
y=0,x=1t+c__1,y=tan⁡c__2+tc__1c__1,x=y'−y2y
dsolve⁡sys3,y,x
In the former solution, by specifying the solving ordering x,y the triangularization leads to a solution for y, then a solution for x expressed as a function of y. In the latter solution, it is the opposite.
sys4≔diff⁡x⁡t,t2+diff⁡y⁡t,t2=x⁡t2+y⁡t2,diff⁡y⁡t,ty⁡t=diff⁡x⁡t,tx⁡t
sys4≔y'y=x'x,x'2+y'2=x2+y2
dsolve⁡sys4
x=c__2⁢ⅇt,y=c__1⁢ⅇt,x=c__2⁢ⅇ−t,y=c__1⁢ⅇ−t,x=x,y=−I⁢x,y=I⁢x
Here, the system contains two solutions the general one, of dimension 2 (depends on c__1,c__2), and a singular one, of lower dimension. In turn, in each of these solutions, one of the two functions x or y can assume two different values. The explicit format of this solution involves four explicit solution sets.
dsolve⁡sys4,explicit
x=c__2⁢ⅇt,y=c__1⁢ⅇt,x=c__2⁢ⅇ−t,y=c__1⁢ⅇ−t,x=x,y=−I⁢x,x=x,y=I⁢x
map⁡odetest,,sys4
0,0,0,0
An example from Kamke's textbook - number 22 - containing two singular solutions and where dsolve is only partially successful in obtaining the general solution:
sys5≔diff⁡x⁡t,t=12⁢x⁡t2−124⁢y⁡t,diff⁡y⁡t,t=2⁢x⁡t⁢y⁡t−3⁢z⁡t,diff⁡z⁡t,t=3⁢x⁡t⁢z⁡t−16⁢y⁡t2
sys5≔x'=x22−y24,y'=2⁢y⁢x−3⁢z,z'=3⁢x⁢z−y26
sol5≔dsolve⁡sys5
sol5≔y=0,x=22⁢c__1−t,z=0,y=256c__1⁢t+c__24,x=y'−3⁢y3232⁢y,x=y'+3⁢y3232⁢y,z=2⁢y⁢x3−y'3,y=ⅇ∫_g⁡_fⅆ_f+c__2where_g_f=15⁢−_f2⁢3⁢_f2⁢_g⁡_f+12⁢_f−5⁢_g⁡_f⁢_f⁢_g⁡_f+42_g⁡_f3⁢_g⁡_f320⁢_f2+_g⁡_f22+_g⁡_f_f,_f=y'y32,_g⁡_f=2⁢y322⁢y⁢y''y'−3⁢y',t=∫_g⁡_f_f⁢ⅇ∫_g⁡_fⅆ_f+c__2ⅆ_f+c__1,y=ⅇ∫_g⁡_fⅆ_f+c__2,x=−2⁢y'''⁢y+3⁢y''⁢y'−12⁢y''⁢y+15⁢y'2,z=−4⁢y'''⁢y2+18⁢y''⁢y⁢y'−15⁢y'3−36⁢y''⁢y+45⁢y'2
In above there are three lists, each one containing a different solution.
The first list, depending on a single arbitrary constant c__1, is a one-dimensional (1-D) singular solution. This list contains three sets, each with the value of a single unknown (here x,y,z) expressed as a function of the independent variable t.
The second list is a 2-D singular solution that depends on c__1,c__2. We see that y is solved in terms of t, a set with two possible values for x expressed in terms of t,y, and then z is solved in terms of t,x,y.
The third list is the general (3-D) solution to the ODE system. We see that y is not fully solved but instead reduced to a first order ODE in _g⁡_f (see ODESolStruc). Then, assuming y(t) is known despite the fact that the ODE was not fully solved, we have x expressed as a function of t,y and finally z expressed as a function of t,x,y.
The value of such a partially successful output is in that it provides two fully integrated solutions (the singular ones, of dimensions 1 and 2) plus the general solution up to solving a single first order ODE. If you could find the solution to that remaining ODE, you could use buildsol to complete the process leading to the general solution in fully integrated form.
In examples like this one, by calling dsolve with the extra argument explicit, you receive the lists with fully solved cases composed into sequences of solution sets, with all the unknowns in solved form, but the partially successful case remains as the list displayed above.
Cheb-Terrab, E. S. "A Computational Approach for the Exact Solving of Systems of Partial Differential Equations." submitted to Computer Physics Communications, (2001).
See Also
casesplit
dchange
DEtools
DEtools,rifsimp
DifferentialAlgebra
int
odetest
pdetest
PDEtools
PDEtools[declare]
PDEtools[dpolyform]
PDEtools[splitsys]
pdsolve,system
Rif
solve
Download Help Document