fully exact - Maple Help

Solving Linear ODEs Which Are Fully Exact

Description

 • A fully exact nth-order linear ODE is one which can be obtained by directly differentiating a first order linear ODE n-1 times; for example, a fourth order ODE of this type is of the form:
 > fully_exact_linear_4th_order_ODE := Diff( A(x)*diff(y(x),x) + B(x)*y(x) + C(x) = 0, x\$3);
 ${\mathrm{fully_exact_linear_4th_order_ODE}}{≔}\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({A}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){+}{B}{}\left({x}\right){}{y}{}\left({x}\right){+}{C}{}\left({x}\right){=}{0}\right)$ (1)
 • Linear ODEs (LODEs) of this form can be recognized by the fact that the adjoint of their homogeneous part is always a first order ODE in disguised form (see "How it works" below). This type of LODE is systematically solved by dsolve.

Examples

 > $\mathrm{with}\left(\mathrm{DEtools},\mathrm{adjoint},\mathrm{firint},\mathrm{odeadvisor}\right)$
 $\left[{\mathrm{adjoint}}{,}{\mathrm{firint}}{,}{\mathrm{odeadvisor}}\right]$ (2)
 > $\mathrm{PDEtools}\left[\mathrm{declare}\right]\left(y\left(x\right),\mathrm{prime}=x\right)$
 ${y}{}\left({x}\right){}{\mathrm{will now be displayed as}}{}{y}$
 ${\mathrm{derivatives with respect to}}{}{x}{}{\mathrm{of functions of one variable will now be displayed with \text{'}}}$ (3)

Consider the following 4th order ODE:

 > $\mathrm{ODE4}≔\left({x}^{2}+\mathrm{exp}\left(x\right)x\right)\mathrm{diff}\left(y\left(x\right),x,x,x,x\right)+\left(4\mathrm{exp}\left(x\right)+6x+3\mathrm{exp}\left(x\right)x\right)\mathrm{diff}\left(y\left(x\right),x,x,x\right)+\left(6+3\mathrm{exp}\left(x\right)x+9\mathrm{exp}\left(x\right)\right)\mathrm{diff}\left(y\left(x\right),x,x\right)+\left(\mathrm{exp}\left(x\right)x+6\mathrm{exp}\left(x\right)\right)\mathrm{diff}\left(y\left(x\right),x\right)+\mathrm{exp}\left(x\right)y\left(x\right)=0$
 ${\mathrm{ODE4}}{≔}\left({{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}\right){}{\mathrm{y\text{'}\text{'}\text{'}\text{'}}}{+}\left({4}{}{{ⅇ}}^{{x}}{+}{6}{}{x}{+}{3}{}{{ⅇ}}^{{x}}{}{x}\right){}{\mathrm{y\text{'}\text{'}\text{'}}}{+}\left({6}{+}{3}{}{{ⅇ}}^{{x}}{}{x}{+}{9}{}{{ⅇ}}^{{x}}\right){}{\mathrm{y\text{'}\text{'}}}{+}\left({{ⅇ}}^{{x}}{}{x}{+}{6}{}{{ⅇ}}^{{x}}\right){}{\mathrm{y\text{'}}}{+}{{ⅇ}}^{{x}}{}{y}{=}{0}$ (4)
 > $\mathrm{odeadvisor}\left(\mathrm{ODE4},y\left(x\right)\right)$
 $\left[\left[{\mathrm{_high_order}}{,}{\mathrm{_fully}}{,}{\mathrm{_exact}}{,}{\mathrm{_linear}}\right]\right]$ (5)

Once we know ODE4 is fully exact we can reduce it to a first order linear ODE straightforwardly; this reduction can be performed interactively, for instance, using the firint command as follows:

 > $\mathrm{ODE3}≔\mathrm{firint}\left(\mathrm{ODE4},y\left(x\right)\right)$
 ${\mathrm{ODE3}}{≔}{{ⅇ}}^{{x}}{}{y}{+}\left({{ⅇ}}^{{x}}{}{x}{+}{4}{}{{ⅇ}}^{{x}}{+}{2}\right){}{\mathrm{y\text{'}}}{+}\left({2}{}{{ⅇ}}^{{x}}{}{x}{+}{3}{}{{ⅇ}}^{{x}}{+}{4}{}{x}\right){}{\mathrm{y\text{'}\text{'}}}{+}\left({{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}\right){}{\mathrm{y\text{'}\text{'}\text{'}}}{+}{\mathrm{_C1}}{=}{0}$ (6)
 > $\mathrm{ODE2}≔\mathrm{firint}\left(\mathrm{ODE3},y\left(x\right)\right)$
 ${\mathrm{ODE2}}{≔}{{ⅇ}}^{{x}}{}{y}{+}\left({{ⅇ}}^{{x}}{}{x}{+}{2}{}{{ⅇ}}^{{x}}{+}{2}{}{x}\right){}{\mathrm{y\text{'}}}{+}\left({{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}\right){}{\mathrm{y\text{'}\text{'}}}{+}{\mathrm{_C1}}{}{x}{+}{\mathrm{_C2}}{=}{0}$ (7)
 > $\mathrm{ODE1}≔\mathrm{firint}\left(\mathrm{ODE2},y\left(x\right)\right)$
 ${\mathrm{ODE1}}{≔}{{ⅇ}}^{{x}}{}{y}{+}\left({{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}\right){}{\mathrm{y\text{'}}}{+}\frac{{\mathrm{_C1}}{}{{x}}^{{2}}}{{2}}{+}{\mathrm{_C2}}{}{x}{+}{\mathrm{_C3}}{=}{0}$ (8)

and the first order LODE above - ODE1 - can be solved using dsolve leading to the solution to ODE4

 > $\mathrm{sol1}≔\mathrm{dsolve}\left(\mathrm{ODE1},y\left(x\right)\right)$
 ${\mathrm{sol1}}{≔}{y}{=}\left({\int }{-}\frac{{{ⅇ}}^{{\int }\frac{{{ⅇ}}^{{x}}}{{x}{}\left({{ⅇ}}^{{x}}{+}{x}\right)}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}}{}\left({\mathrm{_C1}}{}{{x}}^{{2}}{+}{2}{}{\mathrm{_C2}}{}{x}{+}{2}{}{\mathrm{_C3}}\right)}{{2}{}{x}{}\left({{ⅇ}}^{{x}}{+}{x}\right)}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}{+}{\mathrm{_C4}}\right){}{{ⅇ}}^{{\int }{-}\frac{{{ⅇ}}^{{x}}}{{x}{}\left({{ⅇ}}^{{x}}{+}{x}\right)}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}}$ (9)
 > $\mathrm{odetest}\left(\mathrm{sol1},\mathrm{ODE4}\right)$
 ${0}$ (10)

The solution above is essentially the same one obtains by calling dsolve directly:

 > $\mathrm{dsolve}\left(\mathrm{ODE4},y\left(x\right)\right)$
 ${y}{=}\left({\mathrm{_C4}}{+}{\int }\frac{\left({3}{}{\mathrm{_C1}}{}{{x}}^{{2}}{+}{2}{}{\mathrm{_C2}}{}{x}{+}{\mathrm{_C3}}\right){}{{ⅇ}}^{{\int }\frac{{{ⅇ}}^{{x}}}{{{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}}}{{{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}\right){}{{ⅇ}}^{{-}\left({\int }\frac{{{ⅇ}}^{{x}}}{{{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}\right)}$ (11)

How it works

To detect that ODE4 is fully exact, we first look at the equation's adjoint:

 > $\mathrm{ADJ}≔\mathrm{adjoint}\left(\mathrm{ODE4},y\left(x\right)\right)$
 ${\mathrm{ADJ}}{≔}\left({{ⅇ}}^{{x}}{}{x}{+}{2}{}{x}\right){}{\mathrm{y\text{'}\text{'}\text{'}}}{+}\left({{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}\right){}{\mathrm{y\text{'}\text{'}\text{'}\text{'}}}$ (12)

This adjoint contains only third and fourth order derivatives, and hence can be seen as a first order ODE in y'''. This means that the original fourth order ODE4 can be obtained by differentiating 3 times a certain first order linear ODE1 (not the one obtained with firint lines above). In turn, this ODE1 can be obtained directly from the adjoint equation ADJ above by replacing y''' -> y and calculating the adjoint again:

 > $\mathrm{subs}\left(\mathrm{diff}\left(y\left(x\right),\mathrm{}\left(x,3\right)\right)=y\left(x\right),\mathrm{ADJ}\right)$
 $\left({{ⅇ}}^{{x}}{}{x}{+}{2}{}{x}\right){}{y}{+}\left({{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}\right){}{\mathrm{y\text{'}}}$ (13)
 > $\mathrm{adjoint}\left(,y\left(x\right)\right)$
 ${{ⅇ}}^{{x}}{}{y}{+}\left({{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}\right){}{\mathrm{y\text{'}}}$ (14)

Actually, differentiating 3 times the equation above one reobtains the original fourth order ODE:

 > $\mathrm{diff}\left(,\mathrm{}\left(x,3\right)\right)=0$
 ${{ⅇ}}^{{x}}{}{y}{+}{3}{}{\mathrm{y\text{'}}}{}{{ⅇ}}^{{x}}{+}{3}{}{\mathrm{y\text{'}\text{'}}}{}{{ⅇ}}^{{x}}{+}{\mathrm{y\text{'}\text{'}\text{'}}}{}{{ⅇ}}^{{x}}{+}\left({{ⅇ}}^{{x}}{}{x}{+}{3}{}{{ⅇ}}^{{x}}\right){}{\mathrm{y\text{'}}}{+}{3}{}\left({2}{+}{{ⅇ}}^{{x}}{}{x}{+}{2}{}{{ⅇ}}^{{x}}\right){}{\mathrm{y\text{'}\text{'}}}{+}{3}{}\left({2}{}{x}{+}{{ⅇ}}^{{x}}{}{x}{+}{{ⅇ}}^{{x}}\right){}{\mathrm{y\text{'}\text{'}\text{'}}}{+}\left({{x}}^{{2}}{+}{{ⅇ}}^{{x}}{}{x}\right){}{\mathrm{y\text{'}\text{'}\text{'}\text{'}}}{=}{0}$ (15)
 > $\mathrm{normal}\left(-\mathrm{ODE4}\right)$
 ${0}{=}{0}$ (16)

The method just explained works with ODEs of arbitrary order, and - as in the homogeneous case - if the given fully exact LODE is non-homogeneous, then it can be obtained by differentiating a non-homogeneous linear first order ODE, and this fact can be detected in the same way by analyzing the adjoint of the homogeneous part of the given LODE.

One of the interesting properties of this method is that a closed form "solution-formula" can be written directly, for all differential orders and for the "non-homogeneous case" (the homogeneous one is just a particular case) - thus shortcutting all the steps and the need for first solving the homogeneous part to afterwards finding a particular solution, for instance, through variation of parameters.

What is at the base of this method is the fact that integrating factors for a LODE are solutions of its adjoint (see for instance Murphy's book and others in dsolve, references).