Direction Fields

We will use the command PlotVectorField to plot direction fields.  
The equation y' = f(t,y) tells us that at the point (t,y) we want to 
plot a short line with slope f(t,y).  The vector (1,f(t,y)) has slope 
f(t,y), so we simply plot the vector field (1,f(t,y)), (or i + f(t,y)j),

Needs["Graphics`PlotField`"]

Example 1. y' = y + t

\(\(PlotVectorField[{1, y + t}, {t, \(-3\), 5}, {y, \(-3\), 3}, \ 
      Axes -> \ True, 
	ScaleFunction -> \((1&)\), Ticks -> None, 
      Frame -> True, AspectRatio -> 1, \ PlotPoints\  -> \ 15]; 
    \)\)

It appears that  y=-1-t is a solution to this Differential equation.  
Moreover, solutions  y(t) that start above the line y = -1 - t 
tend to infinity as t increases, and solutions that start below the
line tend to -infinity as t increases.  As t decreases, we see that 
all solutions are asymptotic to the line y=-1-t.  In particular,
all solutions tend to infinity as t decreases.
		
There is a way to find the solution of y'=y+t explicitly.  
Mathematica will do this for us if we use the command `DSolve'.

DSolve[y'[t] == y[t] + t, y[t],  t]

\(That\ is, \ 
      the\ general\ solution\ of\ the\ equation\ is\ y\  = \ 
        \(-1\) - t + Ce\^t, 

      where\ C\ is\ a\ constant\ that\ can\ be\ determined\ by\ specifying\ 
        the\)value of y at some particular t .   We could now use this 
        formula fory to verify our above conclusions about the behavior of y as
         t goesto plus or minus infinity .   However,  
      since my goal is to show offthe capabilities of Mathematica,  
          I plot y (t) for C  =  -3,  -2,  -1,  0,  1,  2,  
      3  instead .

\(Plot[
      Evaluate[Table\ [\ \(-1\) - t\  + \ C\ \ Exp[t]\ , {C, \(-3\), 3, 1}]], 
      
		{t, \(-3\), 5}, \ AspectRatio -> 1, \ 
      PlotRange\  -> \ {\(-3\), 3}]\)

Here are some other examples to try.  Use the above example as a model.

Example 2.  y' = y + 2

Example 3.   y'  =  (e^(-t)) +  y

Example 4.  y' = -y(3-y)

Example 5.  y' = t/y

Caution:  If you execute a PlotVectorField command before you do the Needs command, either restart or execute the following commands.

Remove[PlotVectorField, ScaleFunction]Needs["Graphics`PlotField`"]