MapleDEfirstOrder.mws

First Order Equations

Solutions ToWeb Site Examples

Here are some Maple solutions to web site Exam I examples 1-9.

Example 1

>    ode1:=diff(y(x),x)=y(x)*cos(x);

ode1 := diff(y(x),x) = y(x)*cos(x)

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

y(x) = _C1*exp(sin(x))

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

y(x) = exp(sin(x))

Example 2

>    ode2:=diff(y(x),x)=-x/y(x);

ode2 := diff(y(x),x) = -x/y(x)

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

y(x) = (-x^2+_C1)^(1/2), y(x) = -(-x^2+_C1)^(1/2)

>    dsolve({ode2,y(0)=r},{y(x)});

y(x) = (-x^2+r^2)^(1/2), y(x) = -(-x^2+r^2)^(1/2)

Example 3

>    ode3:=diff(y(x),x)=0.01*y(x)*(100-y(x));

ode3 := diff(y(x),x) = .1e-1*y(x)*(100-y(x))

>    dsolve(ode3,{y(x)});

y(x) = 100/(1+100*exp(-x)*_C1)

>    dsolve({ode3,y(0)=10},{y(x)});

y(x) = 100/(1+9*exp(-x))

>    f:=rhs(%);

f := 100/(1+9*exp(-x))

>    with(plots):

Warning, the name changecoords has been redefined

>    plot(f,x=0..20,y=-10..110);

[Maple Plot]

Example 4

>    ode4:=diff(y(x),x)=(y(x)-1)^2-0.01;

ode4 := diff(y(x),x) = (y(x)-1)^2-.1e-1

>    dsolve(ode4,{y(x)});

y(x) = (-11/10+9/10*exp(1/5*x)*_C1)/(exp(1/5*x)*_C1-1)

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

y(x) = (-11/10-9/10*exp(1/5*x))/(-exp(1/5*x)-1)

Example 5

>   

>    ode5:=diff(y(x),x)=y(x)*x*sin(x);

ode5 := diff(y(x),x) = y(x)*x*sin(x)

>    dsolve(ode5,{y(x)});

y(x) = _C1*exp(sin(x)-x*cos(x))

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

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

>    dsolve({ode5,y(0)=-1},{y(x)});

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

>    f:=rhs(%);

f := -exp(sin(x)-x*cos(x))

>    plot(f,x=0..10,y=-25..10);

[Maple Plot]

Example 6

>    ode6:=diff(y(x),x)=y(x)/x+(y(x)/x)^2;

ode6 := diff(y(x),x) = y(x)/x+y(x)^2/x^2

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

y(x) = -x/(ln(x)-_C1)

>    dsolve({ode6,y(1)=2},{y(x)});

y(x) = -x/(ln(x)-1/2)

>    dsolve({ode6,y(1)=1},{y(x)});

y(x) = -x/(ln(x)-1)

>    f:=rhs(%);

f := -x/(ln(x)-1)

>    plot(f,x=1..13,y=-25..25);

[Maple Plot]

Example 7

>    ode7:=diff(y(x),x)=(y(x)*exp(-x)-sin(x))/(exp(-x)+2*y(x));

ode7 := diff(y(x),x) = (y(x)*exp(-x)-sin(x))/(exp(-x)+2*y(x))

>    dsolve(ode7,{y(x)});

y(x) = 1/2*1/exp(x)*(-1+(1+4*cos(x)*exp(x)^2-4*_C1*exp(x)^2)^(1/2)), y(x) = 1/2*1/exp(x)*(-1-(1+4*cos(x)*exp(x)^2-4*_C1*exp(x)^2)^(1/2))

>    dsolve({ode7,y(0)=-1},{y(x)});

y(x) = 1/2*1/exp(x)*(-1-(1+4*cos(x)*exp(x)^2-4*exp(x)^2)^(1/2))

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

y(x) = 1/2*1/exp(x)*(-1+(1+4*cos(x)*exp(x)^2+4*exp(x)^2)^(1/2))

>    f:=rhs(%);

f := 1/2*1/exp(x)*(-1+(1+4*cos(x)*exp(x)^2+4*exp(x)^2)^(1/2))

>    plot(f,x=0..20,y=-1..2);

[Maple Plot]

>    dsolve({ode7,y(0)=-1/2},{y(x)});

y(x) = 1/2*1/exp(x)*(-1+(1+4*cos(x)*exp(x)^2-5*exp(x)^2)^(1/2)), y(x) = 1/2*1/exp(x)*(-1-(1+4*cos(x)*exp(x)^2-5*exp(x)^2)^(1/2))

Example 8

>    ode8:=diff(y(x),x)=(2*y(x)*sin(x)-3)/cos(x);

ode8 := diff(y(x),x) = (2*y(x)*sin(x)-3)/cos(x)

>    dsolve(ode8,{y(x)});

y(x) = (-6*sin(x)+2*_C1)/(cos(2*x)+1)

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

y(x) = (-6*sin(x)+2)/(cos(2*x)+1)

>    dsolve({ode8,y(0)=3},{y(x)});

y(x) = (-6*sin(x)+6)/(cos(2*x)+1)

>    f:=rhs(%);

f := (-6*sin(x)+6)/(cos(2*x)+1)

>    plot(f,x=0..4*Pi,y=-2..10);

[Maple Plot]

>    dsolve({ode8,y(0)=-3},{y(x)});

y(x) = (-6*sin(x)-6)/(cos(2*x)+1)

>    f:=rhs(%);

>    plot(f,x=0..4*Pi,y=-10..2);

f := (-6*sin(x)-6)/(cos(2*x)+1)

[Maple Plot]

Example 9

>    ode9:=diff(y(x),x)=2*y(x)/x+(x^2)*sin(3*x);

ode9 := diff(y(x),x) = 2*y(x)/x+x^2*sin(3*x)

>    dsolve(ode9,{y(x)});

y(x) = -1/3*x^2*cos(3*x)+x^2*_C1

>    dsolve({ode9,y(Pi/2)=2},{y(x)});

y(x) = -1/3*x^2*cos(3*x)+8*x^2/Pi^2

>    f:=rhs(%);

f := -1/3*x^2*cos(3*x)+8*x^2/Pi^2

>    soln2:=plot(f,x=Pi/2..8,y=-10..70,color=red):

>    dsolve({ode9,y(Pi/2)=1},{y(x)});

y(x) = -1/3*x^2*cos(3*x)+4*x^2/Pi^2

>    g:=rhs(%);

g := -1/3*x^2*cos(3*x)+4*x^2/Pi^2

>    soln1:=plot(g,x=Pi/2..8,y=-10..70,color=blue):

>    display(soln1,soln2);

[Maple Plot]

>