 Initial Conditions - Maple Help

dsolve

Solve ODE problems with given initial conditions Calling Sequence dsolve({ODE, ICs}, y(x)) dsolve({ODE, ICs}, y(x), extra_args) dsolve({sysODE, ICs}, {funcs}) dsolve({sysODE, ICs}, {funcs}, extra_args) Parameters

 ODE - ordinary differential equation y(x) - the dependent variable (indeterminate function) ICs - initial conditions for y(x) and/or its derivatives sysODE - system of ODEs {funcs} - set with indeterminate functions extra_args - optional, can be 'type=series' or 'type=numeric' Description

 • The basic task being performed by dsolve when solving an "Initial Conditions" (ICs) ODE problem is to find appropriate values for the set of integration constants _Cn appearing in the symbolic solution of the problem, such that the solution will match the given ICs.
 • As general rules for IC problems, the first argument must be a set containing an ODE or a system of ODEs together with the ICs, the second argument must be a set containing the indeterminate functions of the problem, and the number of ICs should not be greater than the sum of the differential orders of the given ODEs (see PDEtools[difforder]).
 If no variable is specified, $x$ is assumed to be the variable.
 • For symbolic problems (that is, when neither series nor numeric solutions were requested) a typical IC can be any equation relating algebraic expressions, or just the algebraic expressions themselves, then assumed to be = 0 (see examples below).
 The derivatives entering the ICs can always be expressed using the D syntax (for example $\mathrm{D}\left(y\right)\left(0\right)=1$, $\mathrm{D}\left(y\right)\left(A+B\right)=C$). Alternately, standard math syntax may be used in 2-D math (for example $y'\left(0\right)=1$ is equivalent to the first example above, and ${y}^{\left(2\right)}\left(x\right)$ is equivalent to $\mathrm{D}\left(\mathrm{D}\left(y\left(x\right)\right)\right)$ or ${\mathrm{D}}^{\left(2\right)}\left(y\left(x\right)\right)$. If the evaluation points are of type symbol, diff will also work (for example, $\frac{ⅆ}{ⅆa}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}y\left(a\right)=1$ means that the derivative of $y$ at $a$ is 1).
 It is also possible to give "coupled" ICs, involving more than one function in each IC equation, and perhaps in a nonlinear manner. When nonlinear ICs are given dsolve might return a sequence of solution sets related to the various possible solutions found for the integration constants.
 • When requesting numeric or series solutions, by giving the extra argument 'type=numeric' or 'type=series'; see dsolve,numeric, or dsolve,series), or the use of integral transforms (see dsolve,inttrans), the ICs must be given as equations. All derivatives entering the ICs must be expressed using the D syntax, each IC must be related to a single indeterminate function (coupled ICs are not allowed), and all ICs must be linear in the indeterminate function or its derivatives. Examples

 > $\mathrm{ode}≔\mathrm{diff}\left(y\left(t\right),t,t\right)+{\mathrm{diff}\left(y\left(t\right),t\right)}^{2}=0$
 ${\mathrm{ode}}{≔}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right){+}{\left(\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right)\right)}^{{2}}{=}{0}$ (1)
 > $\mathrm{ans4}\left[1\right]≔\mathrm{dsolve}\left(\left\{\mathrm{ode},y\left(0\right)=3\right\},y\left(t\right)\right)$
 ${{\mathrm{ans4}}}_{{1}}{≔}{y}{}\left({t}\right){=}{\mathrm{ln}}{}\left({\mathrm{_C1}}{}{t}{+}{{ⅇ}}^{{3}}\right)$ (2)
 > $\mathrm{ans4}\left[2\right]≔\mathrm{dsolve}\left(\left\{\mathrm{ode},y\left(0\right)=3,\mathrm{D}\left(y\right)\left(0\right)=0\right\},y\left(t\right)\right)$
 ${{\mathrm{ans4}}}_{{2}}{≔}{y}{}\left({t}\right){=}{3}$ (3)
 > $\mathrm{ans4}\left[3\right]≔\mathrm{dsolve}\left(\left\{\mathrm{ode},\mathrm{diff}\left(y\left(a\right),a,a\right)=A\right\},y\left(t\right)\right)$
 ${{\mathrm{ans4}}}_{{3}}{≔}{y}{}\left({t}\right){=}{\mathrm{ln}}{}\left({\mathrm{_C1}}{}{t}{-}\frac{\left({a}{}\sqrt{{-}{A}}{-}{1}\right){}{\mathrm{_C1}}}{\sqrt{{-}{A}}}\right){,}{y}{}\left({t}\right){=}{\mathrm{ln}}{}\left({\mathrm{_C1}}{}{t}{-}\frac{\left({a}{}\sqrt{{-}{A}}{+}{1}\right){}{\mathrm{_C1}}}{\sqrt{{-}{A}}}\right)$ (4)
 > $\mathrm{ans4}\left[4\right]≔\mathrm{dsolve}\left(\left\{\mathrm{ode},{\mathrm{D}}^{\left(2\right)}\left(y\right)\left(a\right)-y\left(b\right)=A,\mathrm{exp}\left(y\left(b\right)\right)=B\right\},y\left(t\right)\right)$
 ${{\mathrm{ans4}}}_{{4}}{≔}{y}{}\left({t}\right){=}{\mathrm{ln}}{}\left({t}{}{\mathrm{RootOf}}{}\left(\left({A}{}{{a}}^{{2}}{-}{2}{}{A}{}{a}{}{b}{+}{A}{}{{b}}^{{2}}{+}{{a}}^{{2}}{}{\mathrm{ln}}{}\left({B}\right){-}{2}{}{a}{}{b}{}{\mathrm{ln}}{}\left({B}\right){+}{{b}}^{{2}}{}{\mathrm{ln}}{}\left({B}\right){+}{1}\right){}{{\mathrm{_Z}}}^{{2}}{+}{\mathrm{ln}}{}\left({B}\right){+}{A}{+}\left({2}{}{A}{}{a}{-}{2}{}{A}{}{b}{+}{2}{}{\mathrm{ln}}{}\left({B}\right){}{a}{-}{2}{}{\mathrm{ln}}{}\left({B}\right){}{b}\right){}{\mathrm{_Z}}\right){}{B}{-}{b}{}{\mathrm{RootOf}}{}\left(\left({A}{}{{a}}^{{2}}{-}{2}{}{A}{}{a}{}{b}{+}{A}{}{{b}}^{{2}}{+}{{a}}^{{2}}{}{\mathrm{ln}}{}\left({B}\right){-}{2}{}{a}{}{b}{}{\mathrm{ln}}{}\left({B}\right){+}{{b}}^{{2}}{}{\mathrm{ln}}{}\left({B}\right){+}{1}\right){}{{\mathrm{_Z}}}^{{2}}{+}{\mathrm{ln}}{}\left({B}\right){+}{A}{+}\left({2}{}{A}{}{a}{-}{2}{}{A}{}{b}{+}{2}{}{\mathrm{ln}}{}\left({B}\right){}{a}{-}{2}{}{\mathrm{ln}}{}\left({B}\right){}{b}\right){}{\mathrm{_Z}}\right){}{B}{+}{B}\right)$ (5)

Explicit or implicit answers can be tested, in principle, using odetest:

 > $\mathrm{map}\left(\mathrm{odetest},\left[\mathrm{ans4}\left[1\right],\mathrm{ans4}\left[2\right],\mathrm{ans4}\left[3\right],\mathrm{ans4}\left[4\right]\right],\mathrm{ode}\right)$
 $\left[{0}{,}{0}{,}{0}{,}{0}{,}{0}\right]$ (6)
 > $\mathrm{sys}≔\left\{\mathrm{diff}\left(x\left(t\right),t\right)=y\left(t\right),\mathrm{diff}\left(y\left(t\right),t\right)=-x\left(t\right)\right\}$
 ${\mathrm{sys}}{≔}\left\{\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{x}{}\left({t}\right){=}{y}{}\left({t}\right){,}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right){=}{-}{x}{}\left({t}\right)\right\}$ (7)
 > $\mathrm{IC_1}≔\left\{x\left(a\right)=A,y\left(b\right)=B\right\}$
 ${\mathrm{IC_1}}{≔}\left\{{x}{}\left({a}\right){=}{A}{,}{y}{}\left({b}\right){=}{B}\right\}$ (8)
 > $\mathrm{ans1}≔\mathrm{combine}\left(\mathrm{dsolve}\left(\mathrm{sys}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{union}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{IC_1},\left\{x\left(t\right),y\left(t\right)\right\}\right),\mathrm{trig}\right)$
 ${\mathrm{ans1}}{≔}\left\{{x}{}\left({t}\right){=}\frac{{A}{}{\mathrm{cos}}{}\left({-}{t}{+}{b}\right){-}{B}{}{\mathrm{sin}}{}\left({-}{t}{+}{a}\right)}{{\mathrm{cos}}{}\left({a}{-}{b}\right)}{,}{y}{}\left({t}\right){=}\frac{{A}{}{\mathrm{sin}}{}\left({-}{t}{+}{b}\right){+}{B}{}{\mathrm{cos}}{}\left({-}{t}{+}{a}\right)}{{\mathrm{cos}}{}\left({a}{-}{b}\right)}\right\}$ (9)
 > $\mathrm{IC_2}≔\left\{\mathrm{diff}\left(x\left(a\right),a\right)=B,x\left(a\right)=A\right\}$
 ${\mathrm{IC_2}}{≔}\left\{\frac{{ⅆ}}{{ⅆ}{a}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{x}{}\left({a}\right){=}{B}{,}{x}{}\left({a}\right){=}{A}\right\}$ (10)
 > $\mathrm{ans2}≔\mathrm{combine}\left(\mathrm{dsolve}\left(\mathrm{sys}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{union}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{IC_2},\left\{x\left(t\right),y\left(t\right)\right\}\right),\mathrm{trig}\right)$
 ${\mathrm{ans2}}{≔}\left\{{x}{}\left({t}\right){=}{A}{}{\mathrm{cos}}{}\left({-}{t}{+}{a}\right){-}{B}{}{\mathrm{sin}}{}\left({-}{t}{+}{a}\right){,}{y}{}\left({t}\right){=}{A}{}{\mathrm{sin}}{}\left({-}{t}{+}{a}\right){+}{B}{}{\mathrm{cos}}{}\left({-}{t}{+}{a}\right)\right\}$ (11)
 > $\mathrm{IC_3}≔\left\{\mathrm{diff}\left(x\left(a\right),a\right)=A,\mathrm{diff}\left(y\left(b\right),b\right)=B\right\}$
 ${\mathrm{IC_3}}{≔}\left\{\frac{{ⅆ}}{{ⅆ}{a}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{x}{}\left({a}\right){=}{A}{,}\frac{{ⅆ}}{{ⅆ}{b}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({b}\right){=}{B}\right\}$ (12)
 > $\mathrm{ans3}≔\mathrm{combine}\left(\mathrm{dsolve}\left(\mathrm{sys}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{union}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{IC_3},\left\{x\left(t\right),y\left(t\right)\right\}\right),\mathrm{trig}\right)$
 ${\mathrm{ans3}}{≔}\left\{{x}{}\left({t}\right){=}\frac{{-}{A}{}{\mathrm{sin}}{}\left({-}{t}{+}{b}\right){-}{B}{}{\mathrm{cos}}{}\left({-}{t}{+}{a}\right)}{{\mathrm{cos}}{}\left({a}{-}{b}\right)}{,}{y}{}\left({t}\right){=}\frac{{A}{}{\mathrm{cos}}{}\left({-}{t}{+}{b}\right){-}{B}{}{\mathrm{sin}}{}\left({-}{t}{+}{a}\right)}{{\mathrm{cos}}{}\left({a}{-}{b}\right)}\right\}$ (13)

Answers for systems of ODEs (provided that they are explicit as in this case) can also be tested using odetest

 > $\mathrm{map}\left(\mathrm{odetest},\left[\mathrm{ans1},\mathrm{ans2},\mathrm{ans3}\right],\mathrm{sys}\right)$
 $\left[\left\{{0}\right\}{,}\left\{{0}\right\}{,}\left\{{0}\right\}\right]$ (14)