ENGI 3424 Chapter 2 –
Demonstration of Maple for the solution of some
second order linear ordinary differential equations with constant coefficients,
using examples from the lecture notes.
Below are the commands from the Maple worksheet.
Open the worksheet in Maple to see the resulting expressions.
The output is shown here for the final command only.
> with(DEtools):
(this package must be open in order for Maple to understand the other
commands)
Example 2.2.1
> ode := diff(y(x),x,x) + 2*diff(y(x),x) - 3*y(x) = x^2 + exp(2*x);
> dsolve(ode, y(x));
Example 2.2.2
> ode := diff(y(x),x,x) + y(x) = tan(x);
> dsolve(ode, y(x));
Note: (1 + sin(x)) / cos(x) =
sec(x) + tan(x),
so that the answer from this command is consistent with the solution
in the lecture notes.
Example 2.2.3
> ode := diff(y(x),x,x) -2*diff(y(x),x) + y(x) = exp(x);
> ics := y(0)=0, D(y)(0)=1;
> dsolve({ode,ics}, y(x));
Example 2.2.4 - an ODE with non-constant coefficients
> ode := x^2*diff(y(x),x,x) -5*x*diff(y(x),x) + 8*y(x) = 3*x;
> dsolve(ode, y(x));
Example 2.4.1 - higher order ODE
> ode := diff(y(x),x$5) + 2*diff(y(x),x$4) - 3*diff(y(x),x$3)
- 4*diff(y(x),x,x) + 4*diff(y(x),x) = 8*x;
> dsolve(ode, y(x));
Example 2.4.2 - higher order ODE
> ode := EI*diff(y(x),x$4) = W;
> ics := y(0)=0, D(y)(0)=0, D(D(y))(L)=0, D(D(D(y)))(L)=0;
> dsolve({ode,ics}, y(x));