desolve( equation, variable [ , options ] )

The solution in SageMath of differential equation for dependent variable. The dependent variable must be declared as a function of the independent variable.

Equations in SageMath need to be defined with double equal (==) signs to avoid syntax errors.

Available options are:

ics=[initial_conditions]
ivar=independent_variable
show_method=True|False
contrib_ode=True|False

Initial conditions are given for the independent variable, the dependent variable and all required derivatives of the dependent variable, in that order.

The independent variable must be specified if the equation contains more than one independent variable.

Setting contrib_ode=True solves additional equation types but may take a long time.

Solutions returned by Maxima can contain the three constants _C, _K1 and _K2, where the underscore distinguishes them from symbolic variables. They must be referenced in this form when substituting values or converting them to symbolic constants.

Examples:

y = function('y')(x)
desolve( diff(y,x,2) == 0, y )
y = function('y')(x)
desolve( diff(y,x,2) + y == 0, y )
y = function('y')(x)
desolve( diff(y,x,2) + y == 0, y, ics=[0,1,1] )

Related operations:   desolve_rk4

Operation category: solution operations sagemath-docs