 muchange - Maple Help

DEtools

 muchange
 change variables in the integrating factor of an ODE Calling Sequence muchange(tr, Mu, y(x), [t, u(t)]) Parameters

 tr - set of transformation equations of the form {x=.., y(x)=..} from the old variables on the left hand side to the new variables on the right hand side Mu - integrating factor of an ordinary differential equation (ODE) y(x) - 'dependent variable' of the problem (it can be any unknown function of one variable) [t, u(t)] - (optional) new independent and dependent variables; required when they cannot be inferred from the transformation Description

 • The muchange command receives a change of variables, an integrating factor of an ODE, and the dependent variable y(x), and it returns the integrating factor of the problem in the new variables. The change of variables is performed by making calls to dchange, and hence the same extra arguments accepted by dchange are accepted by muchange as well.
 • The change of variables performed by muchange is complementary to the (same) change of variables performed in the ODE in that, if $\mathrm{\mu }\left(x,y\left(x\right)\right)$ is an integrating factor of an ODE in y(x), then their product is a total derivative,
 > mu*ODE = Diff(R1(x,y(x)),x);
 ${\mathrm{\mu }}{}{\mathrm{ODE}}{=}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{R1}}{}\left({x}{,}{y}{}\left({x}\right)\right)$ (1)
 and then, under a change of variables
 > tr := {x=X(t,u(t)), y(x)=Y(t,u(t))};
 ${\mathrm{tr}}{≔}\left\{{x}{=}{X}{}\left({t}{,}{u}{}\left({t}\right)\right){,}{y}{}\left({x}\right){=}{Y}{}\left({t}{,}{u}{}\left({t}\right)\right)\right\}$ (2)
 where the new variables are {t, u(t)}, the following ODE is also exact:
 > 'muchange(tr, mu, y(x)) * dchange(tr, ODE)' = Diff(R2(t,u(t)),t);
 ${\mathrm{muchange}}{}\left({\mathrm{tr}}{,}{\mathrm{\mu }}{,}{y}{}\left({x}\right)\right){}{\mathrm{dchange}}{}\left({\mathrm{tr}}{,}{\mathrm{ODE}}\right){=}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{R2}}{}\left({t}{,}{u}{}\left({t}\right)\right)$ (3)
 (note however that $\mathrm{R1}\ne \mathrm{dchange}\left(\mathrm{tr},\mathrm{R2}\right)$).
 • This function is part of the DEtools package, and so it can be used in the form muchange(..) only after executing the command with(DEtools). However, it can always be accessed through the long form of the command by using DEtools[muchange](..). Examples

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

1. The following nonlinear second order ODE

 > $\mathrm{ODE1}≔\frac{{ⅆ}^{2}}{ⅆ{x}^{2}}y\left(x\right)+\frac{x{\left(\frac{ⅆ}{ⅆx}y\left(x\right)\right)}^{2}+y\left(x\right)\left(\frac{ⅆ}{ⅆx}y\left(x\right)\right)+1+\frac{ⅆ}{ⅆx}y\left(x\right)}{y\left(x\right)x}=0$
 ${\mathrm{ODE1}}{≔}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){+}\frac{{x}{}{\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right)}^{{2}}{+}{y}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){+}{1}{+}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)}{{y}{}\left({x}\right){}{x}}{=}{0}$ (4)

has the following integrating factor.

 > $\mathrm{Μ1}≔\mathrm{intfactor}\left(\mathrm{ODE1}\right)$
 ${\mathrm{Μ1}}{≔}{x}{}{y}{}\left({x}\right)$ (5)

This integrating factor can be tested using mutest:

 > $\mathrm{mutest}\left(\mathrm{Μ1},\mathrm{ODE1}\right)$
 ${0}$ (6)

We now change variables

 > $\mathrm{tr}≔\left\{x=\frac{1}{u\left(t\right)},y\left(x\right)=\frac{1}{t}\right\}$
 ${\mathrm{tr}}{≔}\left\{{x}{=}\frac{{1}}{{u}{}\left({t}\right)}{,}{y}{}\left({x}\right){=}\frac{{1}}{{t}}\right\}$ (7)

so that the ODE becomes the following.

 > $\mathrm{ODE2}≔\mathrm{dchange}\left(\mathrm{tr},\mathrm{ODE1},\mathrm{normal}\right)$
 ${\mathrm{ODE2}}{≔}\frac{{u}{}\left({t}\right){}\left({{t}}^{{4}}{}{\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)}^{{3}}{+}{{u}{}\left({t}\right)}^{{2}}{}{\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)}^{{2}}{}{{t}}^{{2}}{+}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right){}{{u}{}\left({t}\right)}^{{3}}{}{t}{-}{{u}{}\left({t}\right)}^{{2}}{}{\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)}^{{2}}{}{t}{+}{3}{}{{u}{}\left({t}\right)}^{{3}}{}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)\right)}{{{t}}^{{3}}{}{\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)}^{{3}}}{=}{0}$ (8)

The integrating factor for this transformed ODE can be obtained from the integrating factor of ODE1 as follows:

 > $\mathrm{Μ2}≔\mathrm{muchange}\left(\mathrm{tr},\mathrm{Μ1},y\left(x\right)\right)$
 ${\mathrm{Μ2}}{≔}{-}\frac{\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)}{{{u}{}\left({t}\right)}^{{3}}{}{t}}$ (9)
 > $\mathrm{mutest}\left(\mathrm{Μ2},\mathrm{ODE2}\right)$
 ${0}$ (10)

2. muchange works as follows. Consider for instance a first order ODE turned exact by means of an integrating factor

 > $\mathrm{exact_ODE}≔\mathrm{μ}\left(x,y\left(x\right)\right)\mathrm{ODE}\left(x,y\left(x\right),\frac{ⅆ}{ⅆx}y\left(x\right)\right)=\frac{ⅆ}{ⅆx}R\left(x\right)$
 ${\mathrm{exact_ODE}}{≔}{\mathrm{\mu }}{}\left({x}{,}{y}{}\left({x}\right)\right){}{\mathrm{ODE}}{}\left({x}{,}{y}{}\left({x}\right){,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){=}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{R}{}\left({x}\right)$ (11)

and now consider the most general point transformation of variables:

 > $\mathrm{tr}≔\left\{x=X\left(t,u\left(t\right)\right),y\left(x\right)=Y\left(t,u\left(t\right)\right)\right\}$
 ${\mathrm{tr}}{≔}\left\{{x}{=}{X}{}\left({t}{,}{u}{}\left({t}\right)\right){,}{y}{}\left({x}\right){=}{Y}{}\left({t}{,}{u}{}\left({t}\right)\right)\right\}$ (12)

Perform a change of variables in the exact_ODE as a whole:

 > $\mathrm{dchange}\left(\mathrm{tr},\mathrm{exact_ODE},\left[t,u\left(t\right)\right],\mathrm{known}=\left\{\mathrm{μ},\mathrm{ODE}\right\}\right)$
 ${\mathrm{\mu }}{}\left({X}{}\left({t}{,}{u}{}\left({t}\right)\right){,}{Y}{}\left({t}{,}{u}{}\left({t}\right)\right)\right){}{\mathrm{ODE}}{}\left({X}{}\left({t}{,}{u}{}\left({t}\right)\right){,}{Y}{}\left({t}{,}{u}{}\left({t}\right)\right){,}\frac{{{\mathrm{D}}}_{{1}}{}\left({Y}\right){}\left({t}{,}{u}{}\left({t}\right)\right){+}{{\mathrm{D}}}_{{2}}{}\left({Y}\right){}\left({t}{,}{u}{}\left({t}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)}{{{\mathrm{D}}}_{{1}}{}\left({X}\right){}\left({t}{,}{u}{}\left({t}\right)\right){+}{{\mathrm{D}}}_{{2}}{}\left({X}\right){}\left({t}{,}{u}{}\left({t}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)}\right){=}\frac{{{\mathrm{D}}}_{{1}}{}\left({R}\right){}\left({t}{,}{u}{}\left({t}\right)\right){+}{{\mathrm{D}}}_{{2}}{}\left({R}\right){}\left({t}{,}{u}{}\left({t}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)}{{{\mathrm{D}}}_{{1}}{}\left({X}\right){}\left({t}{,}{u}{}\left({t}\right)\right){+}{{\mathrm{D}}}_{{2}}{}\left({X}\right){}\left({t}{,}{u}{}\left({t}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)}$ (13)

The left hand side in the above equation will also be an exact ODE if we multiply it by the denominator of the right hand side:

 > $\frac{{ⅆ}}{{ⅆ}t}X\left(t,u\left(t\right)\right)$
 $\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{X}{}\left({t}{,}{u}{}\left({t}\right)\right)$ (14)

The new integrating factor for the transformed ODE is, generally speaking, given by

 > $\mathrm{μ2}\left(t,u\left(t\right)\right)=\left(\frac{{ⅆ}}{{ⅆ}t}X\left(t,u\left(t\right)\right)\right)'\mathrm{dchange}'\left('\mathrm{tr}',\mathrm{μ}\left(x,y\right)\right)$
 ${\mathrm{μ2}}{}\left({t}{,}{u}{}\left({t}\right)\right){=}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{X}{}\left({t}{,}{u}{}\left({t}\right)\right)\right){}{\mathrm{dchange}}{}\left({\mathrm{tr}}{,}{\mathrm{\mu }}{}\left({x}{,}{y}\right)\right)$ (15)

It is easy to see that this result is valid irrespective of the differential order of the ODE under consideration.

3. Consider the most general second order ODE having an integrating factor depending on (x, y'); this ODE is given by (see redode)

 > $\mathrm{Μ1}≔\mathrm{μ}\left(x,\frac{ⅆ}{ⅆx}y\left(x\right)\right)$
 ${\mathrm{Μ1}}{≔}{\mathrm{\mu }}{}\left({x}{,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right)$ (16)
 > $\mathrm{ODE1}≔\mathrm{redode}\left(\mathrm{Μ1},y\left(x\right),2\right)$
 ${\mathrm{ODE1}}{≔}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){=}{-}\frac{{{\int }}_{{}}^{\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)}\left(\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{\mu }}{}\left({x}{,}{\mathrm{_a}}\right)\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_a}}{+}{{\mathrm{D}}}_{{1}}{}\left({\mathrm{_F1}}\right){}\left({x}{,}{y}{}\left({x}\right)\right){+}{{\mathrm{D}}}_{{2}}{}\left({\mathrm{_F1}}\right){}\left({x}{,}{y}{}\left({x}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right)}{{\mathrm{\mu }}{}\left({x}{,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right)}$ (17)

What will be the integrating factor if we interchange the roles of the dependent and independent variables? The related transformation is given by

 > $\mathrm{tr}≔\left\{x=u\left(t\right),y\left(x\right)=t\right\}$
 ${\mathrm{tr}}{≔}\left\{{x}{=}{u}{}\left({t}\right){,}{y}{}\left({x}\right){=}{t}\right\}$ (18)

The new integrating factor is

 > $\mathrm{Μ2}≔\mathrm{muchange}\left(\mathrm{tr},\mathrm{Μ1},y\left(x\right),\left[t,u\left(t\right)\right]\right)$
 ${\mathrm{Μ2}}{≔}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right){}{\mathrm{\mu }}{}\left({u}{}\left({t}\right){,}\frac{{1}}{\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)}\right)$ (19)

Transform the ODE and test the new integrating factor:

 > $\mathrm{ODE2}≔\mathrm{dchange}\left(\mathrm{tr},\mathrm{ODE1},\left[t,u\left(t\right)\right],\mathrm{known}=\mathrm{all},\mathrm{normal}\right)$
 ${\mathrm{ODE2}}{≔}{-}\frac{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)}{{\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right)}^{{3}}}{=}{-}\frac{\left({{\int }}_{{}}^{\frac{{1}}{\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)}}{{\mathrm{D}}}_{{1}}{}\left({\mathrm{\mu }}\right){}\left({u}{}\left({t}\right){,}{\mathrm{_a}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_a}}\right){}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right){+}{{\mathrm{D}}}_{{1}}{}\left({\mathrm{_F1}}\right){}\left({u}{}\left({t}\right){,}{t}\right){}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right){+}{{\mathrm{D}}}_{{2}}{}\left({\mathrm{_F1}}\right){}\left({u}{}\left({t}\right){,}{t}\right)}{\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)\right){}{\mathrm{\mu }}{}\left({u}{}\left({t}\right){,}\frac{{1}}{\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}\right)}\right)}$ (20)
 > $\mathrm{mutest}\left(\mathrm{Μ2},\mathrm{ODE2}\right)$
 ${0}$ (21)

(Note that, when testing an integrating factor, mutest tests it against $\mathrm{lhs}\left(\mathrm{ODE2}\right)-\mathrm{rhs}\left(\mathrm{ODE2}\right)=0$.)