Example 7
Slope Fields Around (0,-1/2)
> | with(DEtools): |
> | with(plots): |
> | DirField1:=dfieldplot(diff(y(x),x)=(y(x)*exp(-x)-sin(x))/(exp(-x)+2*y(x)),y(x),x=-0.05..0.05,y=-0.6..-0.4,color=BLUE,arrows=MEDIUM,axes=BOXED): |
> | display(DirField1); |
> | f1:=(-exp(-x)+sqrt(exp(-2*x)+4*cos(x)-5))/2: |
> | f2:=(-exp(-x)-sqrt(exp(-2*x)+4*cos(x)-5))/2: |
> | f1graph:=plot(f1,x=-0.05..0.05,y=-0.6..-0.4,thickness=2,color=red): |
> | f2graph:=plot(f2,x=-0.05..0.05,y=-0.6..-0.4,thickness=2,color=green): |
> | display(DirField1,f1graph,f2graph); |
> | DirField2:=dfieldplot(diff(y(x),x)=(y(x)*exp(-x)-sin(x))/(exp(-x)+2*y(x)),y(x),x=-2..2,y=-2..2,color=BLUE,arrows=MEDIUM,axes=BOXED): |
> | f1graph2:=plot(f1,x=-2..2,y=-2..2,thickness=2,color=red): |
> | f2graph2:=plot(f2,x=-2..2.05,y=-2..2,thickness=2,color=green): |
> | display(DirField2,f1graph2,f2graph2); |
> |