solves a differential equation for the function u, with independent variable x.


solves a differential equation for x between xmin and xmax.


solves a list of differential equations.


solves a partial differential equation.


solves the partial differential equation eqn over the region Ω.

Details and Options

  • DSolve can solve ordinary differential equations (ODEs), partial differential equations (PDEs), differential algebraic equations (DAEs), delay differential equations (DDEs), integral equations, integro-differential equations, and hybrid differential equations.
  • The output from DSolve is controlled by the form of the dependent function u or u[x]:
  • DSolve[eqn,u,x]{{uf},}where f is a pure function
    DSolve[eqn,u[x],x]{{u[x]f[x]},}where f[x] is an expression in x
  • With a pure function output, eqn/.{{uf},} can be used to verify the solution.  »
  • DSolve can give implicit solutions in terms of Solve.  »
  • DSolve can give solutions that include Inactive sums and integrals that cannot be carried out explicitly. Variables K[1], K[2], are used in such cases.
  • Different classes of equations solvable by DSolve include:
  • u'[x]f[x,u[x]]ordinary differential equation
    a xu[x,y]+b yu[x,y]fpartial differential equation
    f[u'[x],u[x],x]0differential algebraic equation
    u'[x]f[x,u[x-x1]]delay differential equation
    u'[x]+k[x,t]u[t]tfintegro-differential equation
    {,WhenEvent[cond,u[x]g]}hybrid differential equation
  • Boundary conditions for ODEs and DAEs can be specified by giving equations at specific points such as u[x1]a, u'[x2]b, etc.
  • Boundary conditions for PDEs can be given as equations u[x,y1]a, Derivative[1,0][u][x,y1]b, etc. or as DirichletCondition[u[x,y]g[x,y],cond].
  • Initial conditions for DDEs can be given as a history function g[x] in the form u[x/;x<x0]g[x].
  • WhenEvent[event,action] may be included in the equations eqn to specify an action that occurs when event becomes True.
  • The region Ω can be anything for which RegionQ[Ω] is True.
  • N[DSolve[]] calls NDSolve or ParametricNDSolve for differential equations that cannot be solved symbolically.
  • The following options can be given:
  • Assumptions$Assumptionsassumptions on parameters
    DiscreteVariables{}discrete variables for hybrid equations
    GeneratedParametersChow to name generated parameters
    MethodAutomaticwhat method to use
  • GeneratedParameters controls the form of generated parameters; for ODEs and DAEs these are by default constants C[n] and for PDEs they are arbitrary functions C[n][].  »


open all close all

Basic Examples  (2)

Solve a differential equation:

Click for copyable input

Include a boundary condition:

Click for copyable input

Get a "pure function" solution for y:

Click for copyable input

Substitute the solution into an expression:

Click for copyable input

Scope  (102)

Generalizations & Extensions  (1)

Options  (6)

Applications  (31)

Properties & Relations  (9)

Possible Issues  (4)

Neat Examples  (2)

Introduced in 1991
Updated in 2019