Untitled (1)

Plotting Direction Fields using Maple

First, enter the special packages that are needed.

>    with(DEtools):

Enter the differential equation

>    de := diff(y(t),t) = 2*t - y(t);

de := diff(y(t),t) = 2*t-y(t)

The command below produces the direction field with solutions through particular initial conditions (y(0) = -5, 5, 10). The command has 4 essential fields and a number of options. 1. Enter the differential equation 2. List the dependent variable 3. Give the range of the independent variable 4. Give the range of the dependent variable. The most common optional field is the listing of initial conditions to plot specific trajectories.

>    DEplot(de,y(t),t=0..10,[[y(0)=-5],[y(0)=5],[y(0)=10]],y=-5..20,linecolour=blue);

[Maple Plot]

Below is the exact solution of this differential equation.

>    dsolve({de, y(0)=5}, y(t));

y(t) = 2*t-2+7*exp(-t)