Maple ODE Examples
Here's a basic ODE:
> deq := diff(y(x),x) + y(x) = 0: deq;
![[Typeset Math Expression]](de.1.gif)
Here's the basic form of the command for solving differential equations:
> soln := dsolve( deq, y(x) );
![[Typeset Math Expression]](de.2.gif)
We can add initial conditions, to determine the "integration constant" _C1:
> subs(x=0, y(0)=y0, soln); solve(", _C1): subs(_C1=", soln);
![[Typeset Math Expression]](de.3.gif)
![[Typeset Math Expression]](de.4.gif)
This could be done in one step:
> dsolve( {diff(y(x),x) + y(x) = 0, y(0)=y0}, y(x) );
![[Typeset Math Expression]](de.5.gif)
> dsolve({diff(y(x),x$2) + y(x) = x*cos(x), y(0) = y0, D(y)(0) = v0}, y(x));
> sys := diff(y(x),x)=z(x), diff(z(x),x)=y(x): sys;
inits := y(0)=0, z(0)=1: inits;
fcns := {y(x), z(x)}:
inits := y(0)=0, z(0)=1: inits;
fcns := {y(x), z(x)}:
![[Typeset Math Expression]](de.7.gif)
![[Typeset Math Expression]](de.8.gif)
> dsolve({sys} union {inits}, fcns);
![[Typeset Math Expression]](de.9.gif)
> dsolve({sys, y(0)=0, z(0)=1}, fcns, type=series);
![[Typeset Math Expression]](de.10.gif)
This next example (the pendulum equation) is not solvable in terms of elementary functions. Maple obtains a "reduction to quadratures" for the inverse functions.
> dsolve({diff(y(x),x$2) + sin(y(x)) = 0}, y(x));
![[Typeset Math Expression]](de.11.gif)



