Solving Linear Ordinary Differential Equations (LODEs) by computing integrating factors for them
Description
Examples
Integrating factors for second and higher order linear ODEs
For linear ODEs (LODEs) of order 2 or greater, it is possible to calculate integrating factors by solving the adjoint of the LODE. This could be as difficult as the original problem, or much easier, depending on the example. This method is implemented in dsolve.
with⁡DEtools,adjoint,firint,intfactor:
ode≔diff⁡y⁡x,x,x=y⁡x⁢x+y⁡x⁢ln⁡x⁢x2+diff⁡y⁡x,x⁢ln⁡x⁢x2ln⁡x⁢x2⁢exp⁡x−y⁡xln⁡x⁢x2
ode≔ⅆ2ⅆx2y⁡x=y⁡x⁢x+y⁡x⁢ln⁡x⁢x2+ⅆⅆxy⁡x⁢ln⁡x⁢x2⁢ⅇxln⁡x⁢x2−y⁡xln⁡x⁢x2
This ODE has the following adjoint
adjoint⁡ode,y⁡x
−ⅇx⁢x−1⁢y⁡xln⁡x⁢x2+ⅇx⁢ⅆⅆxy⁡x+ⅆ2ⅆx2y⁡x
This adjoint equation is in turn solvable by dsolve
dsolve⁡
y⁡x=∫ⅇ−ⅇxln⁡x2ⅆx⁢c__1+c__2⁢ln⁡x
Now the solutions to the adjoint equation are integrating factors of the original LODE, so the two independent solutions implied in the general solution above
eval⁡rhs⁡,_C1=0,_C2=1
ln⁡x
eval⁡rhs⁡,_C1=1,_C2=2
∫ⅇ−ⅇxln⁡x2ⅆx+2⁢ln⁡x
are integrating factors of ode. These integrating factors could also be found using the intfactor directly
Μ≔intfactor⁡ode
Μ≔ln⁡x,∫ⅇ−ⅇxln⁡x2ⅆx⁢ln⁡x
Constructing solutions using integrating factors
How are these integrating factors transformed into a solution to the original problem? By using them to construct two first integrals; that is: two ODEs of lower order (in this case two first order ODEs). For that purpose it is provided the firint command which receives an exact ODE and returns a first integral. The idea is simple: an exact ODE is a total derivative - say dR/dx; firint returns the R + _C1:
firint⁡Μ1⁢ode
−ln⁡x⁢x2⁢ⅇx+x⁢y⁡xx2+ln⁡x⁢ⅆⅆxy⁡x+c__1=0
firint⁡Μ2⁢ode
−∫ⅇ−ⅇxln⁡x2ⅆx⁢ln⁡x2⁢ⅇx⁢x2+∫ⅇ−ⅇxln⁡x2ⅆx⁢ln⁡x⁢x+ⅇ−ⅇx⁢x2⁢y⁡xln⁡x⁢x2+∫ⅇ−ⅇxln⁡x2ⅆx⁢ln⁡x⁢ⅆⅆxy⁡x+c__1=0
Eliminating y' from these two first integrals (and replacing _C1 by _C2 in one of them) leads to the solution f(x,y(x),_C1,_C2) = 0 to this ode. So this process could be run interactively, as shown, or in one step
dsolve⁡ode
y⁡x=c__1⁢ⅇⅇx⁢ln⁡x+c__2⁢ⅇⅇx⁢∫ⅇ−ⅇxln⁡x2ⅆx⁢ln⁡x
See Also
DEtools
dsolve,education
firint
firtest
intfactor
muchange
mutest
PDEtools
redode
Download Help Document