Test - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Student[ODEs]

 Test
 test the validity of a candidate solution to an ODE

 Calling Sequence Test(sol, ODE, var)

Parameters

 sol - equation, or set or list of equations; a candidate solution of an ODE or system of ODEs ODE - equation, or set or list of equations; an ODE or system of ODEs var - function, or set or list of functions; the dependent variable(s)

Description

 • The Test(sol, ODE, y(x)) tests whether the candidate solution sol is in fact a valid solution of the given equation or system ODE.
 • The equation or system ODE is evaluated using the supplied candidate solution sol, and an attempt is made to remove all occurrences of the dependent variables var and their derivatives; whatever remains is then simplified and returned.
 • If this remainder is 0 (or a set or list of zeros), then sol is in fact a valid solution.
 • Conversely, if sol is in fact a valid solution, then this remainder must be mathematically equivalent to 0 (or a set or list of zeros), but it may not have been simplified fully.

Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{ODEs}\right]\right):$
 > $\mathrm{ode1}≔{t}^{2}\left(z\left(t\right)+1\right)+{z\left(t\right)}^{2}\left(t-1\right)\mathrm{diff}\left(z\left(t\right),t\right)=0$
 ${\mathrm{ode1}}{≔}{{t}}^{{2}}{}\left({z}{}\left({t}\right){+}{1}\right){+}{{z}{}\left({t}\right)}^{{2}}{}\left({t}{-}{1}\right){}\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{z}{}\left({t}\right)\right){=}{0}$ (1)
 > $\mathrm{sol1}≔\mathrm{Solve}\left(\mathrm{ode1},z\left(t\right)\right)$
 ${\mathrm{sol1}}{≔}\frac{{{z}{}\left({t}\right)}^{{2}}}{{2}}{-}{z}{}\left({t}\right){+}{\mathrm{ln}}{}\left({z}{}\left({t}\right){+}{1}\right){=}{-}\frac{{{t}}^{{2}}}{{2}}{-}{t}{-}{\mathrm{ln}}{}\left({t}{-}{1}\right){+}{\mathrm{_C1}}$ (2)
 > $\mathrm{Test}\left(\mathrm{sol1},\mathrm{ode1},z\left(t\right)\right)$
 ${0}$ (3)
 > $\mathrm{ode2}≔\mathrm{diff}\left(y\left(x\right),x,x\right)-\mathrm{diff}\left(y\left(x\right),x\right)-x\mathrm{exp}\left(x\right)=0$
 ${\mathrm{ode2}}{≔}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){-}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){-}{x}{}{{ⅇ}}^{{x}}{=}{0}$ (4)
 > $\mathrm{sol2}≔\mathrm{Solve}\left(\mathrm{ode2},y\left(x\right)\right)$
 ${\mathrm{sol2}}{≔}{y}{}\left({x}\right){=}{\mathrm{_C1}}{+}{\mathrm{_C2}}{}{{ⅇ}}^{{x}}{+}\frac{{{ⅇ}}^{{x}}{}\left({{x}}^{{2}}{-}{2}{}{x}{+}{2}\right)}{{2}}$ (5)
 > $\mathrm{Test}\left(\mathrm{sol2},\mathrm{ode2},y\left(x\right)\right)$
 ${0}$ (6)
 > $\mathrm{ode3}≔\mathrm{diff}\left(y\left(x\right),x,x\right)+\frac{5{\mathrm{diff}\left(y\left(x\right),x\right)}^{2}}{y\left(x\right)}=0$
 ${\mathrm{ode3}}{≔}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){+}\frac{{5}{}{\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right)}^{{2}}}{{y}{}\left({x}\right)}{=}{0}$ (7)
 > $\mathrm{sol3}≔\mathrm{Solve}\left(\mathrm{ode3},y\left(x\right)\right)$
 ${\mathrm{sol3}}{≔}\left\{{y}{}\left({x}\right){=}{\left({6}{}{{ⅇ}}^{{\mathrm{_C1}}}{}{x}{+}{6}{}{\mathrm{_C2}}\right)}^{{1}}{{6}}}{,}{y}{}\left({x}\right){=}{-}{\left({6}{}{{ⅇ}}^{{\mathrm{_C1}}}{}{x}{+}{6}{}{\mathrm{_C2}}\right)}^{{1}}{{6}}}\right\}$ (8)
 > $\mathrm{Test}\left(\mathrm{sol3},\mathrm{ode3},y\left(x\right)\right)$
 ${0}$ (9)
 > $\mathrm{ode4}≔{x}^{3}\mathrm{diff}\left(y\left(x\right),x,x,x\right)+3{x}^{2}\mathrm{diff}\left(y\left(x\right),x,x\right)-6x\mathrm{diff}\left(y\left(x\right),x\right)-6y\left(x\right)=0$
 ${\mathrm{ode4}}{≔}{{x}}^{{3}}{}\left(\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){+}{3}{}{{x}}^{{2}}{}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){-}{6}{}{x}{}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){-}{6}{}{y}{}\left({x}\right){=}{0}$ (10)
 > $\mathrm{sol4}≔\mathrm{Solve}\left(\mathrm{ode4},y\left(x\right)\right)$
 ${\mathrm{sol4}}{≔}{y}{}\left({x}\right){=}{3}{}{\mathrm{_C2}}{}{{x}}^{{3}}{-}\frac{{\mathrm{_C1}}}{{x}}{-}\frac{{2}{}{\mathrm{_C3}}}{{{x}}^{{2}}}$ (11)
 > $\mathrm{Test}\left(\mathrm{sol4},\mathrm{ode4},y\left(x\right)\right)$
 ${0}$ (12)
 > $\mathrm{ode5}≔\left\{\mathrm{diff}\left(y\left[1\right]\left(x\right),x\right)=7y\left[1\right]\left(x\right)+y\left[2\right]\left(x\right),\mathrm{diff}\left(y\left[2\right]\left(x\right),x\right)=-4y\left[1\right]\left(x\right)+3y\left[2\right]\left(x\right)\right\}$
 ${\mathrm{ode5}}{≔}\left\{\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{y}}_{{1}}{}\left({x}\right){=}{7}{}{{y}}_{{1}}{}\left({x}\right){+}{{y}}_{{2}}{}\left({x}\right){,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{y}}_{{2}}{}\left({x}\right){=}{-}{4}{}{{y}}_{{1}}{}\left({x}\right){+}{3}{}{{y}}_{{2}}{}\left({x}\right)\right\}$ (13)
 > $\mathrm{sol5}≔\mathrm{Solve}:-\mathrm{System}\left(\mathrm{ode5},\mathrm{output}=\mathrm{solution}\right)$
 ${\mathrm{sol5}}{≔}\left\{{{y}}_{{1}}{}\left({x}\right){=}{-}\frac{{{ⅇ}}^{{5}{}{x}}{}\left({2}{}{\mathrm{_C2}}{}{x}{+}{2}{}{\mathrm{_C1}}{+}{\mathrm{_C2}}\right)}{{4}}{,}{{y}}_{{2}}{}\left({x}\right){=}{{ⅇ}}^{{5}{}{x}}{}\left({\mathrm{_C2}}{}{x}{+}{\mathrm{_C1}}\right)\right\}$ (14)
 > $\mathrm{Test}\left(\mathrm{sol5},\mathrm{ode5},\left\{\mathrm{seq}\left(y\left[j\right]\left(x\right),j=1..2\right)\right\}\right)$
 $\left\{{0}\right\}$ (15)

Compatibility

 • The Student[ODEs][Test] command was introduced in Maple 2021.
 • For more information on Maple 2021 changes, see Updates in Maple 2021.

 See Also