MapleHigherOrderExamples.mws

DE Examples--Higher Order Equations

Higher order, homogeneous and nonhomogeneous, constant coefficient

Here are some Maple commands to assist you in solving higher order, constant coefficient, homogeneous and nonhomogeneous differential equations.  The example numbers correspond to the DE Example numbers in the chapter four notes and examples.

Example 1

>    ode1:=diff(y(x),x$2)+2*diff(y(x),x)+5*y(x)=0;

ode1 := diff(y(x),`$`(x,2))+2*diff(y(x),x)+5*y(x) = 0

>    dsolve(ode1,y(x));

y(x) = _C1*exp(-x)*sin(2*x)+_C2*exp(-x)*cos(2*x)

>    ic:=y(0)=0,D(y)(0)=2;

ic := y(0) = 0, D(y)(0) = 2

>    dsolve({ode1,ic},{y(x)});

y(x) = exp(-x)*sin(2*x)

>    dsolve({ode1,y(0)=0,D(y)(0)=1},y(x));

y(x) = 1/2*exp(-x)*sin(2*x)

Example 3

>    ode2:={diff(y(x),x,x)-2*diff(y(x),x)-8*y(x)=2*exp(x)-exp(-x)};

ode2 := {diff(y(x),`$`(x,2))-2*diff(y(x),x)-8*y(x) = 2*exp(x)-exp(-x)}

>    dsolve(ode2);

{y(x) = exp(-2*x)*_C2+exp(4*x)*_C1-2/9*exp(-x)*exp(2*x)+1/5*exp(-x)}

Here we put in some initial conditions.

>    ic:={y(0)=0,D(y)(0)=1};

ic := {y(0) = 0, D(y)(0) = 1}

>    dsolve(ode2 union ic,y(x));

y(x) = -2/9*exp(-2*x)+11/45*exp(4*x)-2/9*exp(-x)*exp(2*x)+1/5*exp(-x)

Here is some alternative syntax for solving the same differential equation along with initial conditions.

>    ode2:=diff(y(x),x$2)-2*diff(y(x),x)-8*y(x)=2*exp(x)-exp(-x);

ode2 := diff(y(x),`$`(x,2))-2*diff(y(x),x)-8*y(x) = 2*exp(x)-exp(-x)

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

ic2 := y(0) = 0, D(y)(0) = 1

>    dsolve({ode2,ic2},{y(x)});

y(x) = -2/9*exp(-2*x)+11/45*exp(4*x)-2/9*exp(-x)*exp(2*x)+1/5*exp(-x)

>   

Example 4

>    ode3:=diff(y(x),x,x)-2*diff(y(x),x)-8*y(x)=3*exp(x)-2*exp(-2*x);

ode3 := diff(y(x),`$`(x,2))-2*diff(y(x),x)-8*y(x) = 3*exp(x)-2*exp(-2*x)

>    dsolve(ode3,y(x));

y(x) = exp(-2*x)*_C2+exp(4*x)*_C1+1/18*exp(-2*x)*(-6*exp(3*x)+6*x+1)

Example 2

>    ode4:=diff(y(x),x$4)+3*diff(y(x),x$3)+2*diff(y(x),x$2)=0;

ode4 := diff(y(x),`$`(x,4))+3*diff(y(x),`$`(x,3))+2*diff(y(x),`$`(x,2)) = 0

>    dsolve(ode4);

y(x) = _C1+_C2*x+_C3*exp(-2*x)+_C4*exp(-x)

Example 5

>    ode5:=diff(y(x),x$3)-diff(y(x),x$2)=3*exp(x)+sin(x);

ode5 := diff(y(x),`$`(x,3))-diff(y(x),`$`(x,2)) = 3*exp(x)+sin(x)

>    dsolve(ode5);

y(x) = 3*exp(x)*x-6*exp(x)+1/2*cos(x)+1/2*sin(x)+exp(x)*_C1+_C2*x+_C3

Example 6

>    ode6:=diff(y(x),x$3)+diff(y(x),x)=3+4*exp(x);

ode6 := diff(y(x),`$`(x,3))+diff(y(x),x) = 3+4*exp(x)

>    ic6:=y(0)=4,D(y)(0)=5,D(D(y))(0)=1;

ic6 := y(0) = 4, D(y)(0) = 5, `@@`(D,2)(y)(0) = 1

>    dsolve({ode6,ic6},{y(x)});

y(x) = cos(x)+1+2*exp(x)+3*x

>    dsolve({ode6,ic6},y(x));

y(x) = cos(x)+1+2*exp(x)+3*x