Direction Fields
> with(plots):with(DEtools):
It can happen (very easily) that we cannot readily find a formula for the antiderivative of a function. For example, at this point in the course we don't know how to find the antiderivative of f(x) = ln(x). Recall: the antiderivative of f is a function F satisfying F'(x) = f(x). This means that the values of f give the slopes of the tangent lines for F. For instance, at x = 0.025 we have that f(0.025) = F'(0.025) ~ -3.7 so at x = 0.025 we draw a whole lot of small tangent lines with slope -3.7 (see below). At x = 1, the slopes are F'(1) = f(1) = 0 so we draw a whole bunch of horizontal tangent lines at x = 1 and so on. There is a special command in Maple that will do this for us and produce what is called a direction field for the differential equation F'(x) = ln(x). (The command is dfieldplot but you don't have to worry about it or how it is used.)
> P1:=dfieldplot(diff(y(x),x)=ln(x),y(x),x=-1..6,y=-2..2,arrows=medium,title=`Direction field for F'(x) = ln(x)`):
> P1;
Once you have a direction field for F'(x) = f(x). You can sketch various antiderivatives of f by choosing a starting point and drawing a graph the follows the directions specified by the appropriate tangent lines. Suppose that we wanted a picture of the antiderivative that satisfied F(1) = -1. In that case we would get a picture like that below. (It is actually a picture of
which you can check is an antiderivative of
that satisfies F(1) = -1.)
> h:=int(ln(x),x):
> P2:=plot(h,x=-1..4,y=-1..2,colour=black,thickness=2):
> display([P1,P2],title=`Direction Field for F'(x) together with a particular F(x)`);