ode(expression,y,x)
solves the linear first-order differential equation
expression
is the complete right-hand-side of the
equation, x
and y
are symbolic variables.
Free constants in the solution are marked C
.
>> ode(x,y,x) ans = 0.5*x^2+C >> syms k >> ode(-k*y,y,x) ans = C*exp(-k*x) >> ode(y*tan(x)+cos(x),y,x) ans = (0.5*cos(x)*sin(x)+(0.5*x+C))/cos(x)