 remove RootOf - Maple Help

DEtools

 remove_RootOf
 rewrite a given expression removing RootOf. Calling Sequence remove_RootOf(expr, R) Parameters

 expr - any Maple algebraic expression or equation R - (optional) identifies which specific RootOf is to be removed Description

 • The remove_RootOf command receives an algebraic expression containing a RootOf and removes it by rewriting the expression. In general, this command is used to directly and naturally convey the mathematical meaning of algebraic expressions that contain RootOfs.
 Note that remove_RootOf is different from allvalues; remove_RootOf attempts to remove the RootOf -- typically resulting in implicit algebraic expressions -- while allvalues attempts to return all the values implied by the RootOf.
 remove_RootOf is of particular value for understanding or further manipulating ODE solutions, and especially when allvalues fails in evaluating the RootOf.
 • When the given expression has no RootOf inside it, remove_RootOf returns it as given; when the expression has many RootOfs, only one RootOf (the one with greatest length) is removed. It is also possible to direct remove_RootOf to remove a specific RootOf, say R, by passing R to remove_RootOf as its second argument.
 • When the removal of a RootOf itself requires the introduction of another RootOf, the removal is not performed and the expression received is returned as given. Also remove_RootOf only removes RootOfs of one argument (so RootOfs with indices or labels will remain in the output).
 • This function is part of the DEtools package, and so it can be used in the form remove_RootOf(..) only after executing the command with(DEtools). However, it can always be accessed through the long form of the command by using DEtools[remove_RootOf](..). Examples

 > $\mathrm{with}\left(\mathrm{DEtools}\right):$
 > $\mathrm{diff}\left(y\left(x\right),x\right)=-\frac{1}{2}\left(a{x}^{2}-2F\left(y\left(x\right)+\frac{1}{8}a{x}^{4}\right)\right)x$
 $\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){=}{-}\frac{\left({a}{}{{x}}^{{2}}{-}{2}{}{F}{}\left({y}{}\left({x}\right){+}\frac{{a}{}{{x}}^{{4}}}{{8}}\right)\right){}{x}}{{2}}$ (1)
 > $\mathrm{dsolve}\left(\right)$
 ${y}{}\left({x}\right){=}{-}\frac{{a}{}{{x}}^{{4}}}{{8}}{+}{\mathrm{RootOf}}{}\left({-}{{x}}^{{2}}{+}{2}{}\left({{\int }}_{{}}^{{\mathrm{_Z}}}\frac{{1}}{{F}{}\left({\mathrm{_a}}\right)}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_a}}\right){+}{2}{}{\mathrm{_C1}}\right)$ (2)
 > $\mathrm{remove_RootOf}\left(\right)$
 ${-}{{x}}^{{2}}{+}{2}{}\left({{\int }}_{{}}^{{y}{}\left({x}\right){+}\frac{{a}{}{{x}}^{{4}}}{{8}}}\frac{{1}}{{F}{}\left({\mathrm{_a}}\right)}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_a}}\right){+}{2}{}{\mathrm{_C1}}{=}{0}$ (3)

Here is an example that shows the difference between remove_RootOf and allvalues.

 > $\mathrm{expr}≔\frac{y}{x}+\mathrm{RootOf}\left(\mathrm{_Z}+\mathrm{exp}\left(\mathrm{_Z}\right)\right)=C$
 ${\mathrm{expr}}{≔}\frac{{y}}{{x}}{+}{\mathrm{RootOf}}{}\left({\mathrm{_Z}}{+}{{ⅇ}}^{{\mathrm{_Z}}}\right){=}{C}$ (4)

is rewritten by remove_RootOf as:

 > $\mathrm{DEtools}\left[\mathrm{remove_RootOf}\right]\left(\mathrm{expr}\right)$
 ${-}\frac{{y}}{{x}}{+}{C}{+}{{ⅇ}}^{{-}\frac{{y}}{{x}}{+}{C}}{=}{0}$ (5)
 > $\mathrm{allvalues}\left(\mathrm{expr}\right)$
 $\frac{{y}}{{x}}{-}{\mathrm{LambertW}}{}\left({\mathrm{_Z2~}}{,}{1}\right){=}{C}$ (6)

An example with nested RootOfs

 > $\mathrm{ode}≔\mathrm{diff}\left(y\left(x\right),x\right)=\frac{\left(xy\left(x\right)+1\right)\left({x}^{2}{y\left(x\right)}^{2}+{x}^{2}y\left(x\right)+2xy\left(x\right)+1+x+{x}^{2}\right)}{{x}^{5}}$
 ${\mathrm{ode}}{≔}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){=}\frac{\left({x}{}{y}{}\left({x}\right){+}{1}\right){}\left({{x}}^{{2}}{}{{y}{}\left({x}\right)}^{{2}}{+}{{x}}^{{2}}{}{y}{}\left({x}\right){+}{2}{}{x}{}{y}{}\left({x}\right){+}{1}{+}{x}{+}{{x}}^{{2}}\right)}{{{x}}^{{5}}}$ (7)
 > $\mathrm{dsolve}\left(\mathrm{ode}\right)$
 ${y}{}\left({x}\right){=}\frac{{17}{}{\mathrm{RootOf}}{}\left({162}{}\left({{\int }}_{{}}^{{\mathrm{_Z}}}\frac{{1}}{{289}{}{{\mathrm{_a}}}^{{3}}{+}{54}{}{\mathrm{_a}}{-}{54}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_a}}\right){}{x}{+}{3}{}{\mathrm{_C1}}{}{x}{+}{2}\right){}{x}{-}{3}{}{x}{-}{9}}{{9}{}{x}}$ (8)

If we now evaluate the integral, the resulting solution is

 > $\mathrm{sol}≔\mathrm{value}\left(\right)$
 ${\mathrm{sol}}{≔}{y}{}\left({x}\right){=}\frac{{17}{}{\mathrm{RootOf}}{}\left({54}{}\left({\sum }_{{\mathrm{_R}}{=}{\mathrm{RootOf}}{}\left({289}{}{{\mathrm{_Z}}}^{{3}}{+}{54}{}{\mathrm{_Z}}{-}{54}\right)}{}\frac{{\mathrm{ln}}{}\left({\mathrm{_Z}}{-}{\mathrm{_R}}\right)}{{289}{}{{\mathrm{_R}}}^{{2}}{+}{18}}\right){}{x}{+}{3}{}{\mathrm{_C1}}{}{x}{+}{2}\right){}{x}{-}{3}{}{x}{-}{9}}{{9}{}{x}}$ (9)

One RootOf can be removed in the expression above (and the solution can be further evaluated using allvalues).

 > $\mathrm{remove_RootOf}\left(\mathrm{sol}\right)$
 ${54}{}\left({\sum }_{{\mathrm{_R}}{=}{\mathrm{RootOf}}{}\left({289}{}{{\mathrm{_Z}}}^{{3}}{+}{54}{}{\mathrm{_Z}}{-}{54}\right)}{}\frac{{\mathrm{ln}}{}\left(\frac{{3}{}\left({3}{}{x}{}{y}{}\left({x}\right){+}{x}{+}{3}\right)}{{17}{}{x}}{-}{\mathrm{_R}}\right)}{{289}{}{{\mathrm{_R}}}^{{2}}{+}{18}}\right){}{x}{+}{3}{}{\mathrm{_C1}}{}{x}{+}{2}{=}{0}$ (10)

Here, the sum over the Roots of the third degree polynomial is equal to zero.

 > $\mathrm{odetest}\left(,\mathrm{ode}\right)$
 ${0}$ (11)

A second order ODE example in which three solutions with RootOf are returned by dsolve

 > $\mathrm{diff}\left(y\left(x\right),\mathrm{}\left(x,2\right)\right)-\frac{h\left(\frac{y\left(x\right)}{\mathrm{sqrt}\left(x\right)}\right)}{{x}^{\frac{3}{2}}}=0$
 $\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){-}\frac{{h}{}\left(\frac{{y}{}\left({x}\right)}{\sqrt{{x}}}\right)}{{{x}}^{{3}}{{2}}}}{=}{0}$ (12)
 > $\left[\mathrm{dsolve}\left(\right)\right]$
 $\left[{y}{}\left({x}\right){=}{\mathrm{RootOf}}{}\left({\mathrm{_Z}}{}{{x}}^{{3}}{{2}}}{+}{4}{}{h}{}\left(\frac{{\mathrm{_Z}}}{\sqrt{{x}}}\right){}{{x}}^{{2}}\right){,}{y}{}\left({x}\right){=}{\mathrm{RootOf}}{}\left({-}{\mathrm{ln}}{}\left({x}\right){+}{2}{}\left({{\int }}_{{}}^{{\mathrm{_Z}}}\frac{{1}}{\sqrt{{\mathrm{_C1}}{+}{8}{}\left({\int }{h}{}\left({\mathrm{_g}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_g}}\right){+}{{\mathrm{_g}}}^{{2}}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_g}}\right){+}{2}{}{\mathrm{_C2}}\right){}\sqrt{{x}}{,}{y}{}\left({x}\right){=}{\mathrm{RootOf}}{}\left({-}{\mathrm{ln}}{}\left({x}\right){-}{2}{}\left({{\int }}_{{}}^{{\mathrm{_Z}}}\frac{{1}}{\sqrt{{\mathrm{_C1}}{+}{8}{}\left({\int }{h}{}\left({\mathrm{_g}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_g}}\right){+}{{\mathrm{_g}}}^{{2}}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_g}}\right){+}{2}{}{\mathrm{_C2}}\right){}\sqrt{{x}}\right]$ (13)
 > $\mathrm{map}\left(\mathrm{remove_RootOf},\right)$
 $\left[{y}{}\left({x}\right){}{{x}}^{{3}}{{2}}}{+}{4}{}{h}{}\left(\frac{{y}{}\left({x}\right)}{\sqrt{{x}}}\right){}{{x}}^{{2}}{=}{0}{,}{-}{\mathrm{ln}}{}\left({x}\right){+}{2}{}\left({{\int }}_{{}}^{\frac{{y}{}\left({x}\right)}{\sqrt{{x}}}}\frac{{1}}{\sqrt{{\mathrm{_C1}}{+}{8}{}\left({\int }{h}{}\left({\mathrm{_g}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_g}}\right){+}{{\mathrm{_g}}}^{{2}}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_g}}\right){+}{2}{}{\mathrm{_C2}}{=}{0}{,}{-}{\mathrm{ln}}{}\left({x}\right){-}{2}{}\left({{\int }}_{{}}^{\frac{{y}{}\left({x}\right)}{\sqrt{{x}}}}\frac{{1}}{\sqrt{{\mathrm{_C1}}{+}{8}{}\left({\int }{h}{}\left({\mathrm{_g}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_g}}\right){+}{{\mathrm{_g}}}^{{2}}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{_g}}\right){+}{2}{}{\mathrm{_C2}}{=}{0}\right]$ (14)

Although remove_RootOf is mainly useful for manipulating nonlinear ODE solutions, it can also be of help with solutions to linear ODEs, for instance when allvalues fails in evaluating the RootOfs.