dsolve
solve ordinary differential equations (ODEs)
Calling Sequence
Parameters
Description
Examples
Details
dsolve(ODE)
dsolve(ODE, y(x), options)
dsolve({ODE, ICs}, y(x), options)
ODE
-
ordinary differential equation, or a set or list of ODEs
y(x)
any indeterminate function of one variable, or a set or list of them, representing the unknowns of the ODE problem
ICs
initial conditions of the form y(a)=b, D(y)(c)=d, ..., where {a, b, c, d} are constants with respect to the independent variable
options
(optional) depends on the type of ODE problem and method used, for example, series or method=laplace. (See the Examples section.)
As a general ODE solver, dsolve handles different types of ODE problems. These include the following.
- Computing closed form solutions for a single ODE (see dsolve/ODE) or a system of ODEs, possibly including anti-commutative variables (see dsolve/system).
- Solving ODEs or a system of them with given initial conditions (boundary value problems). See dsolve/ICs.
- Computing formal power series solutions for a linear ODE with polynomial coefficients. See dsolve/formal_series.
- Computing formal solution for a linear ODE with polynomial coefficients. See dsolve/formal_solution.
- Computing solutions using integral transforms (Laplace and Fourier). See dsolve/integral_transform.
- Computing numerical (see dsolve/numeric) or series solutions (see dsolve/series) for ODEs or systems of ODEs.
The ODE Analyzer Assistant is a point-and-click interface to the ODE solver routines. Using the assistant, you can compute numeric and exact solutions and plot the solutions. For more information, see dsolve[interactive] and worksheet/interactive/dsolve.
To define a derivative, use the diff command or one of the notations explained in Derivative Notation.
Solving an ODE
Define a simple ODE.
ode≔diff⁡y⁡x,x,x=2⁢y⁡x+1
ode≔ⅆ2ⅆx2y⁡x=2⁢y⁡x+1
Solve the ODE, ode.
dsolve⁡ode
y⁡x=ⅇ2⁢x⁢c__2+ⅇ−2⁢x⁢c__1−12
Define initial conditions.
ics≔y⁡0=1,D⁡y⁡0=0
Solve ode subject to the initial conditions ics.
dsolve⁡ics,ode
y⁡x=3⁢ⅇ2⁢x4+3⁢ⅇ−2⁢x4−12
Laplace Transform Method
Compute the solution using the Laplace transform method.
sol≔dsolve⁡ics,ode,y⁡x,method=laplace
sol≔y⁡x=−12+3⁢cosh⁡2⁢x2
Test whether the ODE solution satisfies the ODE and the initial conditions (see odetest).
odetest⁡sol,ode,ics
0,0,0
Computing a Series Solution
Find a series solution for the same problem.
series_sol≔dsolve⁡ics,ode,y⁡x,series
series_sol≔y⁡x=1+32⁢x2+14⁢x4+O⁡x6
odetest⁡series_sol,ode,ics,series
Solving an ODE System
Define a system of ODEs.
sys_ode≔diff⁡y⁡t,t=x⁡t,diff⁡x⁡t,t=−x⁡t
sys_ode≔ⅆⅆty⁡t=x⁡t,ⅆⅆtx⁡t=−x⁡t
If the unknowns are not specified, all differentiated indeterminate functions in the system are treated as the unknowns of the problem.
dsolve⁡sys_ode
x⁡t=c__2⁢ⅇ−t,y⁡t=−c__2⁢ⅇ−t+c__1
ics≔x⁡0=1,y⁡1=0
Solve the system of ODEs subject to the initial conditions ics.
dsolve⁡sys_ode,ics
x⁡t=ⅇ−t,y⁡t=−ⅇ−t+ⅇ−1
For detailed information on the dsolve command, see dsolve/details.
See Also
DEtools
diff
dsolve/algorithms
dsolve/details
dsolve/education
dsolve/formal_series
dsolve/formal_solution
dsolve/hypergeometric
dsolve/ICs
dsolve/integrating_factors
dsolve/integrating_factors_for_LODEs
dsolve/inttrans
dsolve/Lie
dsolve/linear
dsolve/numeric
dsolve/piecewise
dsolve/references
dsolve/series
dsolve/system
ODE Analyzer Assistant
odeadvisor
odeadvisor/types
PDEtools
pdsolve
Download Help Document