Direction Fields

Notes and a template for direction fields.  Edit and replace comments with your own. Annotate your work.

Modified from Abel & Braselton Differential Equations with Mathematica p 60-6  and updated for Mathematica 7.0.

Clear[p1,p2,p3,t1,x,y]

p1=VectorPlot[{1,(E^(-x))-2 y},{x,-1,2},{y,-1,2},Axes->True]

Notes you'll need to make changes for other problems.

Also note that long term behavior can't be determined by the independent variable only going to 2!

The above graph is the direction field associated with the differential equation 
dy/dx = Exp[-x] - 2 y .
Note the syntax is 
p1 = VectorPlot[
      {1, whatever y' is equal to in terms of x},
      {x,  xmin, xmax},{y, ymin, ymax}].

Now we can use the built-in DEsolver, list and graph a few representative solution curves.

DSolve[y'[x]+2 y[x]==(E^(-x)),y[x],x]

I copied and pasted the solution part in below, replacing the "C[1]" with "a".

t1=Table[(E^(-x))+(E^(-2 x)) a,{a,-2,2,.5}]

I copied and pasted the resulting list into the Plot command below.  Again, long term behavior cannot usually be determined by an x value of 2.

p2=Plot[t1,{x,-2,2}]

Show[{p1,p2}]

another view.

p3=VectorPlot[{1,(E^(-x))-2 y},{x,-2,2},{y,-4,4}];
Show[{p3,p2},Axes->True]