You are a guest. Restricted access. Read more

# Differential Equations

ode(expression,y,x) solves the linear first-order differential equation $y'=f(x)\cdot y + g(x)$. expression is the complete right-hand-side of the equation, x and y are symbolic variables. Free constants in the solution are marked C.

Let's give an example; $y'= x y$.

syms x,y,C
a=ode(x,y,x)
printf('%f',a)

Another example: $y'= -k y$.

syms x,y,k,C
a=ode(-k*y,y,x)
printf('%f',a)

or $y'= y \tan(x)+\cos(x)$.

syms x,y,k
a=ode(y*tan(x)+cos(x),y,x)
printf('%f',a)