Symbolic Math Toolbox
  Go to function:
    Search    Help Desk 
dsolve    Examples   See Also

Symbolic solution of ordinary differential equations.



dsolve('eq1,eq2,...', 'cond1,cond2,...', 'v') symbolically solves the ordinary differential equation(s) specified by eq1, eq2,... using v as the independent variable and the boundary and/or initial condition(s) specified by cond1,cond2,....

The default independent variable is t.

The letter D denotes differentiation with respect to the independent variable; with the primary default, this is d/dx. A D followed by a digit denotes repeated differentiation. For example, D2 is d2/dx2. Any character immediately following a differentiation operator is a dependent variable. For example, D3y denotes the third derivative of y(x) or y(t).

Initial/boundary conditions are specified with equations like y(a) = b or
Dy(a) = b, where y is a dependent variable and a and b are constants. If the number of initial conditions specified is less than the number of dependent variables, the resulting solutions will contain the arbitrary constants C1, C2,....

You can also input each equation and/or initial condition as a separate symbolic equation. dsolve accepts up to 12 input arguments.

With no output arguments, dsolve returns a list of solutions.

dsolve returns a warning message, if it cannot find an analytic solution for an equation. In such a case, you can find a numeric solution, using MATLAB's ode23 or ode45 function.


dsolve('Dy = a*y') returns

dsolve('Df = f + sin(t)') returns

dsolve('(Dy)^2 + y^2 = 1','s') returns

dsolve('Dy = a*y', 'y(0) = b') returns

dsolve('D2y = -a^2*y', 'y(0) = 1', 'Dy(pi/a) = 0') returns

dsolve('Dx = y', 'Dy = -x') returns


If dsolve cannot find an analytic solution for an equation, it prints the warning

and return an empty sym object.

See Also


If the expression you get is lengthy, you may simplify it by using the command simple(ans).
[ Previous | Help Desk | Next ]