DEtools[firint] - calculate first integrals for exact ODEs
|
Calling Sequence
|
|
firint(ODE, y(x), _mu = .., basis = [.., ...], method = formal)
|
|
Parameters
|
|
ODE
|
-
|
an ODE that is either linear, or exact, or otherwise an integrating factor for it shall also be indicated usting the _mu = ... option
|
y(x)
|
-
|
(optional) required if the exact_ODE contains derivatives of more than one function
|
_mu = ..
|
-
|
(optional) to indicate an integrating factor for ODE when it is not exact
|
method = formal
|
-
|
(optional) only for linear ODEs, to request the computation of a complete set of first integrals
|
basis = [...]
|
-
|
(optional) only for linear ODEs, a basis of solutions for ODE, to be used to compute a complete set of first integrals
|
|
|
|
|
Description
|
|
•
|
The firint command receives an nth order ODE, that could be: 1) linear or nonlinear but in exact form, that is, satisfying , 2) not in exact form but an integrating factor for it is indicated using the option _mu = ..., 3) the ODE is linear together with the option method = formal. The output of firint for these problems consists of a related first integral (the ODE , of order , in ), or a complete set of them in case 3). The dependent variable y(x), is required only when the ODE contains derivatives of more than one function. Typically, the given ODE is exact; for calculating integrating factors to use with the option _mu = ... see intfactor.
|
•
|
The optional arguments can be given alone or in conjunction, and in any order.
|
•
|
When a linear ODE is given and the option method = formal is indicated, firint attempts computing a complete basis of solutions for the ODE, or uses a given one if passed with the optional argument basis = [...], and from it computes a complete set of first integrals, that is as many as the differential order and all independent from each other.
|
•
|
This function is part of the DEtools package, and so it can be used in the form firint(..) only after executing the command with(DEtools). However, it can always be accessed through the long form of the command by using DEtools[firint](..).
|
|
|
Examples
|
|
|
Nonlinear and linear ODEs
|
|
|
The general first order linear ODE and its integrating factor
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
|
A related first integral can now be obtained either using the option , as in: firint(L_ODE, _mu = Mu), or multiplying directly L_ODE by Mu (by construction, Mu*L_ODE is exact)
|
>
|
|
| (3) |
|
The most general first order ODE reducible by an integrating factor depending only on is a Linear ODE (see redode):
|
>
|
|
| (4) |
|
An exact nonlinear ODE which also has integrating factors of the form
|
>
|
|
| (5) |
>
|
|
| (6) |
|
Two integrating factors and the related first integrals
|
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
| (9) |
|
The answer to ode2 can be built from these two first integrals interactively, or by calling dsolve with extra arguments, indicating the use of the integrating factor scheme :
|
>
|
|
| (10) |
|
A third order ODE, an integrating factor for it, and the related first integral.
|
>
|
|
| (11) |
>
|
|
| (12) |
>
|
|
| (13) |
|
|
Linear ODEs and 'method = formal'
|
|
|
The firint command treates linear and non linear ODEs in equal footing, unless the optional method = formal, valid only for linear equations, is indicated. Consider
|
>
|
|
| (14) |
|
Calling firint without optional arguments will result in an error message telling ode4 is not exact. Passing method = formal, you instead get a complete set of independent first integrals obtained by first computing a basis of the solution space
|
>
|
|
| (15) |
>
|
|
| (16) |
>
|
|
| (17) |
>
|
|
| (18) |
|
Verify that Basis is a complete basis for the solutions of ode5: from Basis construct the general solution then test it using odetest
|
>
|
|
| (19) |
>
|
|
| (20) |
|
A complete set of first integrals for ode5 computed from Basis
|
>
|
|
| (21) |
>
|
|
| (22) |
|
|
|