Maple Tutorial 6:
Solving Differential Equations

M.M. Yovanovich

TUTORIAL6.MWS

Solving differential equations. Initial value problems.

> restart:

> eq1:= diff(x(t),t) + alpha*x(t) = 0;

[Maple Math]

> sol1:= dsolve({eq1, x(0) = x0}, x(t));

[Maple Math]

> simplify(subs(sol1,eq1));

[Maple Math]

> eq2:= diff(y(t),t,t) + omega^2*y(t) = 0;

[Maple Math]

> sol2:= dsolve({eq2, y(0) = y0, D(y)(0) = v0}, y(t));

[Maple Math]

> simplify(subs(sol2, eq2));

[Maple Math]

> deq:= diff(y(x),x$2) = 9*y(x) + 2*x;

[Maple Math]

> invals:= y(0) = 1, D(y)(0) = 0;

[Maple Math]

> solde:= dsolve({deq, invals}, y(x));

[Maple Math]

Nonlinear second-order ODE.

> eq3:= diff(y(t),t,t) + sin(y(t)) = 0;

[Maple Math]

> sol3:= dsolve({eq3, y(0) = 1, D(y)(0) = 0}, y(t), numeric);

[Maple Math]

Maple has returned a numerical solution based on the Runge-Kutta method. We can get the solution for values of t. For example:

> sol3(0.5);

[Maple Math]

> rhs(sol3(0.5)[2]); rhs(sol3(0.5)[3]);

[Maple Math]

[Maple Math]

Series solution.

> eqn1:= diff(y(x),x$2) - x*diff(y(x),x) - y(x) = 0;

[Maple Math]

> soln1:= dsolve({eqn1, y(0) = 2, D(y)(0) = 1}, y(x), type = series);

[Maple Math]

> soln11:= convert(rhs(soln1), polynom);

[Maple Math]

> Order:= 11;
soln1:= dsolve({eqn1, y(0) = 2, D(y)(0) = 1}, y(x), type = series);

[Maple Math]

[Maple Math]
[Maple Math]