DEtools - Maple Programming Help

DEtools

 redode
 return the nth order ODE having a given integrating factor

 Calling Sequence redode(mu, n, y(x), R)

Parameters

 mu - integrating factor - one or a list of them - depending on $x,y,...,\mathrm{_ym}$, $m=n-1$ n - order of the requested ODE y(x) - dependent variable R - (optional) expected reduced ODE depending on $x,y,...,\mathrm{_yk}$

Description

 • Given an integrating factor (x,y,..._yn), where $\mathrm{_yn}$ represents the nth order derivative, or a list of them, redode returns the ODE of order n having all the values of mu as integrating factors.
 • This command is useful to identify the general ODE problem related to a given mu, and to understand the possible links between the integrating factor scheme for reducing the order and other reduction schemes (for example, symmetries).
 • When the expected reduced ODE, here called R, is also given as argument, its differential order, say $m$, must satisfy $m. The routine then proceeds as follows. First, it redefines R by differentiating it such that its differential order becomes $n-1$. Then it performs a test to see if the problem is solvable. The test for solvability is
 > mu(x,y,...,_ym) = nu(x,y,...,_y||(m-1))*diff(R(x,y,...,_ym),_ym);
 ${\mathrm{μ}}{}\left({x}{,}{y}{,}{\mathrm{...}}{,}{\mathrm{_ym}}\right){=}{\mathrm{ν}}{}\left({x}{,}{y}{,}{\mathrm{...}}{,}{\mathrm{_y}}{||}\left({m}{-}{1}\right)\right){}\left(\frac{{\partial }}{{\partial }{\mathrm{_ym}}}{}{R}{}\left({x}{,}{y}{,}{\mathrm{...}}{,}{\mathrm{_ym}}\right)\right)$ (1)
 for some function $\mathrm{nu}\left(x,y,...,\mathrm{_ym}\right)$. If the problem is solvable, redode then returns an nth order ODE satisfying
 > mu(x,y,...,diff(y(x),x$m)) * ODE=Diff(R(x,y(x),...,diff(y(x),x$m)),x);
 ${\mathrm{μ}}{}\left({x}{,}{y}{,}{\mathrm{...}}{,}\frac{{{ⅆ}}^{{m}}}{{ⅆ}{{x}}^{{m}}}{}{y}{}\left({x}\right)\right){}{\mathrm{ODE}}{=}\frac{{\partial }}{{\partial }{x}}{}{R}{}\left({x}{,}{y}{}\left({x}\right){,}{\mathrm{...}}{,}\frac{{{ⅆ}}^{{m}}}{{ⅆ}{{x}}^{{m}}}{}{y}{}\left({x}\right)\right)$ (2)
 Note that the reduced ODE being differentiated on the right-hand side is defined up to a constant. For example, $R+\mathrm{_C1}$ also satisfies the above equation.
 • When the given mu does not depend on $\mathrm{_ym}$ and R is nonlinear in $\mathrm{_ym}$, the requested nth order ODE exists if R can be solved for $\mathrm{_ym}$; then nu can be determined as the ratio $\frac{\mathrm{\mu }\mathrm{d_ym}}{\mathrm{dR}}$.
 • This function is part of the DEtools package, and so it can be used in the form redode(..) only after executing the command with(DEtools). However, it can always be accessed through the long form of the command by using DEtools[redode](..).

Examples

The redode command is interesting mainly as a tool for generating solving schemes for given ODE families; we illustrate this with two examples.

 > $\mathrm{with}\left(\mathrm{DEtools}\right):$

1. Consider the second order ODE family having an integrating factor $\mathrm{\mu }=F\left(x\right)$ -- an arbitrary function -- such that the reduced ODE has the same integrating factor. We want to set up an algorithm such that, given a second order linear ODE,

 > $\mathrm{ode_psi}≔\frac{{ⅆ}^{2}}{ⅆ{x}^{2}}y\left(x\right)=\mathrm{ψ1}\left(x\right)\left(\frac{ⅆ}{ⅆx}y\left(x\right)\right)+\mathrm{ψ2}\left(x\right)y\left(x\right)+\mathrm{ψ3}\left(x\right)$
 ${\mathrm{ode_psi}}{:=}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right){=}{\mathrm{ψ1}}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right){+}{\mathrm{ψ2}}{}\left({x}\right){}{y}{}\left({x}\right){+}{\mathrm{ψ3}}{}\left({x}\right)$ (3)

where there are no restrictions on $\mathrm{psi1}\left(x\right),\mathrm{psi2}\left(x\right)$, or $\mathrm{psi3}\left(x\right)$, the scheme determines if the ODE belongs to the family just described, and if so it also determines $F\left(x\right)$. The knowledge of $F\left(x\right)$ is enough to completely solve the given ODE.

To start with, we obtain the general first order ODE having $F\left(x\right)$ as integrating factor using:

 > $\mathrm{ode_1}≔\mathrm{redode}\left(F\left(x\right),y\left(x\right)\right)$
 ${\mathrm{ode_1}}{:=}\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right){=}{-}\frac{\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right){}{y}{}\left({x}\right){+}{\mathrm{_F1}}{}\left({x}\right)}{{F}{}\left({x}\right)}$ (4)

where $\mathrm{_F1}\left(x\right)$ is an arbitrary function. To obtain the second order ODE mentioned above, we pass ode_1 as an argument (playing the role of the reduced ODE) with the integrating factor $F\left(x\right)$ to obtain:

 > $\mathrm{ode_2}≔\mathrm{redode}\left(F\left(x\right),y\left(x\right),\mathrm{ode_1}\right)$
 ${\mathrm{ode_2}}{:=}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right){=}{-}\frac{{2}{}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right){+}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{F}{}\left({x}\right)\right){}{y}{}\left({x}\right){+}\frac{{ⅆ}}{{ⅆ}{x}}{}{\mathrm{_F1}}{}\left({x}\right)}{{F}{}\left({x}\right)}$ (5)

Taking this general ODE pattern as our starting point, we set up the required solving scheme by comparing coefficients in ode_2 and ode_psi obtaining the following expressions.

 > $\mathrm{e1}≔-\frac{2\left(\frac{ⅆ}{ⅆx}F\left(x\right)\right)}{F\left(x\right)}=\mathrm{ψ1}\left(x\right)$
 ${\mathrm{e1}}{:=}{-}\frac{{2}{}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right)}{{F}{}\left({x}\right)}{=}{\mathrm{ψ1}}{}\left({x}\right)$ (6)
 > $\mathrm{e2}≔-\frac{1\left(\frac{{ⅆ}^{2}}{ⅆ{x}^{2}}F\left(x\right)\right)}{F\left(x\right)}=\mathrm{ψ2}\left(x\right)$
 ${\mathrm{e2}}{:=}{-}\frac{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{F}{}\left({x}\right)}{{F}{}\left({x}\right)}{=}{\mathrm{ψ2}}{}\left({x}\right)$ (7)

By solving $\mathrm{e1}$, we get $F\left(x\right)$ as:

 > $\mathrm{ans_F}≔\mathrm{dsolve}\left(\mathrm{e1}\right)$
 ${\mathrm{ans_F}}{:=}{F}{}\left({x}\right){=}{\mathrm{_C1}}{}{{ⅇ}}^{{∫}\left({-}\frac{{1}}{{2}}{}{\mathrm{ψ1}}{}\left({x}\right)\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}}$ (8)

and by substituting this result into the second one we get the pattern identifying the ODE family.

 > $\mathrm{ode_pattern}≔\mathrm{expand}\left(\mathrm{eval}\left(\mathrm{e2},\mathrm{ans_F}\right)\right)$
 ${\mathrm{ode_pattern}}{:=}\frac{{1}}{{2}}{}\frac{{ⅆ}}{{ⅆ}{x}}{}{\mathrm{ψ1}}{}\left({x}\right){-}\frac{{1}}{{4}}{}{{\mathrm{ψ1}}{}\left({x}\right)}^{{2}}{=}{\mathrm{ψ2}}{}\left({x}\right)$ (9)

2. Consider the second order ODE family having an integrating factor $\mathrm{\mu }=F\left(x\right)$ -- an arbitrary function -- and the symmetry $\left[\mathrm{\xi }=0,\mathrm{\eta }=F\left(x\right)\right]$ (see infgen), and such that the reduced ODE is the most general first order linear ODE:

 > $\mathrm{ode_1}≔\frac{ⅆ}{ⅆx}y\left(x\right)=A\left(x\right)y\left(x\right)+B\left(x\right)$
 ${\mathrm{ode_1}}{:=}\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right){=}{A}{}\left({x}\right){}{y}{}\left({x}\right){+}{B}{}\left({x}\right)$ (10)

where A(x) and B(x) are arbitrary functions. To start with, we obtain the second order ODE mentioned above which has the integrating factor $F\left(x\right)$ as in example 1.

 > $\mathrm{ode_2}≔\mathrm{redode}\left(F\left(x\right),y\left(x\right),\mathrm{ode_1}\right)$
 ${\mathrm{ode_2}}{:=}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right){=}\frac{{A}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right){}{F}{}\left({x}\right){+}{A}{}\left({x}\right){}{y}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right){+}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{A}{}\left({x}\right)\right){}{y}{}\left({x}\right){}{F}{}\left({x}\right){+}{B}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right){+}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{B}{}\left({x}\right)\right){}{F}{}\left({x}\right){-}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right)}{{F}{}\left({x}\right)}$ (11)

In the previous step, ode_2 is in fact the most general second order linear ODE we can imagine. If we now impose the symmetry condition $X\left(\mathrm{ode_2}\right)=0$ (see odepde), where $X=\left[0,F\left(x\right)\right]$, we arrive at the following restriction on $A\left(x\right)$.

 > $\mathrm{constraint}≔\mathrm{expand}\left(\mathrm{odepde}\left(\mathrm{ode_2},y\left(x\right),\left[0,F\left(x\right)\right]\right)\right)$
 ${\mathrm{constraint}}{:=}{-}{2}{}{A}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right){-}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{A}{}\left({x}\right)\right){}{F}{}\left({x}\right){+}\frac{{\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right)}^{{2}}}{{F}{}\left({x}\right)}{+}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{F}{}\left({x}\right)$ (12)

We can solve this ODE for $A\left(x\right)$.

 > $\mathrm{ans_A}≔\mathrm{dsolve}\left(\mathrm{constraint},A\left(x\right)\right)$
 ${\mathrm{ans_A}}{:=}{A}{}\left({x}\right){=}\frac{{F}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right){+}{\mathrm{_C1}}}{{{F}{}\left({x}\right)}^{{2}}}$ (13)

Introducing the result into ode_2 and disregarding the nonhomogeneous term (irrelevant in the solving scheme), we obtain the homogeneous ODE family pattern:

 > $\mathrm{ode_2_H}≔\frac{{ⅆ}^{2}}{ⅆ{x}^{2}}y\left(x\right)=\mathrm{collect}\left(\mathrm{select}\left(\mathrm{has},\mathrm{expand}\left(\mathrm{rhs}\left(\mathrm{ode_2}\right)\right),y\right),\left\{y\left(x\right),\frac{ⅆ}{ⅆx}y\left(x\right)\right\}\right)$
 ${\mathrm{ode_2_H}}{:=}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right){=}\left({A}{}\left({x}\right){-}\frac{\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)}{{F}{}\left({x}\right)}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right){+}\left(\frac{{A}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)\right)}{{F}{}\left({x}\right)}{+}\frac{{ⅆ}}{{ⅆ}{x}}{}{A}{}\left({x}\right)\right){}{y}{}\left({x}\right)$ (14)
 > $\mathrm{ode_pattern}≔\mathrm{subs}\left(\mathrm{_C1}=1,\mathrm{collect}\left(\mathrm{expand}\left(\mathrm{subs}\left(\mathrm{ans_A},\mathrm{ode_2_H}\right)\right),y\right)\right)$
 ${\mathrm{ode_pattern}}{:=}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right){=}\left({-}\frac{\frac{{ⅆ}}{{ⅆ}{x}}{}{F}{}\left({x}\right)}{{{F}{}\left({x}\right)}^{{3}}}{+}\frac{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{F}{}\left({x}\right)}{{F}{}\left({x}\right)}\right){}{y}{}\left({x}\right){+}\frac{\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)}{{{F}{}\left({x}\right)}^{{2}}}$ (15)

where we have set the constant $\mathrm{_C1}$ equal to 1 without loss of generality ($\mathrm{\mu }=F\left(x\right)$ is defined up to a constant factor). To set up a solving scheme here, check if the coefficient of $\frac{\mathrm{dy}}{\mathrm{dx}}$ in a given ODE is related to the coefficient of $y$ as in the equation above, in which case the integrating factor is just $F\left(x\right)$.

3. Consider the following three integrating factors of some (unknown) third order ODE:

 > $\mathrm{μ}≔\left[y\left(x\right)x,{x}^{-\frac{1}{4}+\frac{1{29}^{\frac{1}{2}}}{4}}y\left(x\right),{x}^{-\frac{1}{4}-\frac{1{29}^{\frac{1}{2}}}{4}}y\left(x\right)\right]$
 ${\mathrm{μ}}{:=}\left[{y}{}\left({x}\right){}{x}{,}{{x}}^{{-}\frac{{1}}{{4}}{+}\frac{{1}}{{4}}{}\sqrt{{29}}}{}{y}{}\left({x}\right){,}{{x}}^{{-}\frac{{1}}{{4}}{-}\frac{{1}}{{4}}{}\sqrt{{29}}}{}{y}{}\left({x}\right)\right]$ (16)

The most general third order ODE simultaneously admitting all these integrating factors depends on an arbitrary function of $\mathrm{_F1}\left(x\right)$ and can be computed as follows.

 > $\mathrm{redode}\left(\mathrm{μ},3,y\left(x\right)\right)$
 $\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}{}{y}{}\left({x}\right){=}\frac{{13}}{{8}}{}\frac{{y}{}\left({x}\right)}{{{x}}^{{3}}}{+}\frac{{5}}{{2}}{}\frac{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right)}{{x}}{-}\frac{{13}}{{4}}{}\frac{\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)}{{{x}}^{{2}}}{+}\frac{{-}{3}{}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right)\right){+}\frac{{5}}{{2}}{}\frac{{\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right)}^{{2}}}{{x}}{+}{\mathrm{_F1}}{}\left({x}\right)}{{y}{}\left({x}\right)}$ (17)
 > $\mathrm{map}\left({\mathrm{DEtools}}_{\mathrm{mutest}},\mathrm{μ},\right)$
 $\left[{0}{,}{0}{,}{0}\right]$ (18)

The test performed above verifies - returning zero - that the given integrating factors (the list mu) indeed turn the returned ODE exact - see mutest.

The number of given integrating factors can be different than the differential order. For example, taking just the first two integrating factors of the previous example, the most general third order ODE turned exact by them actually depends - in addition - on an arbitrary function of two variables, $\mathrm{_F3}\left(x,y\right)$.

 > ${\mathrm{μ}}_{1..2}$
 $\left[{y}{}\left({x}\right){}{x}{,}{{x}}^{{-}\frac{{1}}{{4}}{+}\frac{{1}}{{4}}{}\sqrt{{29}}}{}{y}{}\left({x}\right)\right]$ (19)
 > $\mathrm{redode}\left(,3,y\left(x\right)\right)$
 $\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}{}{y}{}\left({x}\right){=}{{\mathrm{D}}}_{{2}}{}\left({\mathrm{_F3}}\right){}\left({x}{,}{y}{}\left({x}\right)\right){}{\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right)}^{{2}}{+}\frac{{1}}{{8}}{}\frac{\left({16}{}{{\mathrm{D}}}_{{1}}{}\left({\mathrm{_F3}}\right){}\left({x}{,}{y}{}\left({x}\right)\right){}{{x}}^{{2}}{+}{2}{}{x}{}{\mathrm{_F3}}{}\left({x}{,}{y}{}\left({x}\right)\right){}\sqrt{{29}}{-}{2}{}{x}{}{\mathrm{_F3}}{}\left({x}{,}{y}{}\left({x}\right)\right){-}{5}{}\sqrt{{29}}{+}{19}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right)}{{{x}}^{{2}}}{+}{\mathrm{_F3}}{}\left({x}{,}{y}{}\left({x}\right)\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right)\right){+}\frac{{\mathrm{_F3}}{}\left({x}{,}{y}{}\left({x}\right)\right){}{\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right)}^{{2}}{-}{3}{}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right)\right){+}{{∫}}_{{}}^{{y}{}\left({x}\right)}\frac{{1}}{{8}}{}\frac{\left({2}{}\sqrt{{29}}{}\left(\frac{{\partial }}{{\partial }{x}}{}{\mathrm{_F3}}{}\left({x}{,}{\mathrm{_a}}\right)\right){}{{x}}^{{2}}{+}{8}{}\left(\frac{{{\partial }}^{{2}}}{{\partial }{{x}}^{{2}}}{}{\mathrm{_F3}}{}\left({x}{,}{\mathrm{_a}}\right)\right){}{{x}}^{{3}}{-}{2}{}\left(\frac{{\partial }}{{\partial }{x}}{}{\mathrm{_F3}}{}\left({x}{,}{\mathrm{_a}}\right)\right){}{{x}}^{{2}}{+}{5}{}\sqrt{{29}}{-}{19}\right){}{\mathrm{_a}}}{{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_a}}{+}{\mathrm{_F4}}{}\left({x}\right)}{{y}{}\left({x}\right)}$ (20)
 > $\mathrm{map}\left({\mathrm{DEtools}}_{\mathrm{mutest}},{\mathrm{μ}}_{1..2},\right)$
 $\left[{0}{,}{0}\right]$ (21)