dsolve
Solve ODE problems with given initial conditions
Calling Sequence
Parameters
Description
Examples
dsolve({ODE, ICs}, y(x))
dsolve({ODE, ICs}, y(x), extra_args)
dsolve({sysODE, ICs}, {funcs})
dsolve({sysODE, ICs}, {funcs}, extra_args)
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'
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 D⁡y⁡0=1, D⁡y⁡A+B=C). Alternately, standard math syntax may be used in 2-D math (for example y'⁡0=1 is equivalent to the first example above, and y2x is equivalent to D⁡D⁡y⁡x or D2⁡y⁡x. If the evaluation points are of type symbol, diff will also work (for example, ⅆⅆay⁡a=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.
ode≔diff⁡y⁡t,t,t+diff⁡y⁡t,t2=0
ode≔ⅆ2ⅆt2y⁡t+ⅆⅆty⁡t2=0
ans41≔dsolve⁡ode,y⁡0=3,y⁡t
ans41≔y⁡t=ln⁡c__1⁢t+ⅇ3
ans42≔dsolve⁡ode,y⁡0=3,D⁡y⁡0=0,y⁡t
ans42≔y⁡t=3
ans43≔dsolve⁡ode,diff⁡y⁡a,a,a=A,y⁡t
ans43≔y⁡t=ln⁡c__1⁢t−a⁢−A−1⁢c__1−A,y⁡t=ln⁡c__1⁢t−a⁢−A+1⁢c__1−A
ans44≔dsolve⁡ode,D2⁡y⁡a−y⁡b=A,exp⁡y⁡b=B,y⁡t
ans44≔y⁡t=ln⁡t⁢RootOf⁡A⁢a2−2⁢A⁢a⁢b+A⁢b2+a2⁢ln⁡B−2⁢a⁢b⁢ln⁡B+b2⁢ln⁡B+1⁢_Z2+ln⁡B+A+2⁢A⁢a−2⁢A⁢b+2⁢ln⁡B⁢a−2⁢ln⁡B⁢b⁢_Z⁢B−b⁢RootOf⁡A⁢a2−2⁢A⁢a⁢b+A⁢b2+a2⁢ln⁡B−2⁢a⁢b⁢ln⁡B+b2⁢ln⁡B+1⁢_Z2+ln⁡B+A+2⁢A⁢a−2⁢A⁢b+2⁢ln⁡B⁢a−2⁢ln⁡B⁢b⁢_Z⁢B+B
Explicit or implicit answers can be tested, in principle, using odetest:
map⁡odetest,ans41,ans42,ans43,ans44,ode
0,0,0,0,0
sys≔diff⁡x⁡t,t=y⁡t,diff⁡y⁡t,t=−x⁡t
sys≔ⅆⅆtx⁡t=y⁡t,ⅆⅆty⁡t=−x⁡t
IC_1≔x⁡a=A,y⁡b=B
ans1≔combine⁡dsolve⁡sysunionIC_1,x⁡t,y⁡t,trig
ans1≔x⁡t=A⁢cos⁡b−t−B⁢sin⁡a−tcos⁡a−b,y⁡t=A⁢sin⁡b−t+B⁢cos⁡a−tcos⁡a−b
IC_2≔diff⁡x⁡a,a=B,x⁡a=A
IC_2≔ⅆⅆax⁡a=B,x⁡a=A
ans2≔combine⁡dsolve⁡sysunionIC_2,x⁡t,y⁡t,trig
ans2≔x⁡t=A⁢cos⁡a−t−B⁢sin⁡a−t,y⁡t=A⁢sin⁡a−t+B⁢cos⁡a−t
IC_3≔diff⁡x⁡a,a=A,diff⁡y⁡b,b=B
IC_3≔ⅆⅆax⁡a=A,ⅆⅆby⁡b=B
ans3≔combine⁡dsolve⁡sysunionIC_3,x⁡t,y⁡t,trig
ans3≔x⁡t=−A⁢sin⁡b−t+B⁢cos⁡a−tcos⁡a−b,y⁡t=A⁢cos⁡b−t−B⁢sin⁡a−tcos⁡a−b
Answers for systems of ODEs (provided that they are explicit as in this case) can also be tested using odetest
map⁡odetest,ans1,ans2,ans3,sys
0,0,0
See Also
DEtools
dsolve,inttrans
dsolve,Lie
dsolve,numeric
dsolve,series
dsolve,system
plots[odeplot]
solve
Download Help Document