I was recently asked about how to spot which direction field corresponds to which differential equation. I hope that by working through a few examples here we will get a reasonable intuition as to how to do this.

Remember that a direction field is a method for getting the general behaviour of a first order differential equation. Given an equation of the form:

$\frac{dy}{dx}=f(x,y)$

For any function of x and y, the solution to this differential equation must be some function (or indeed family of functions) where the gradient of the function satisfies the above relationship.

The first such equation that we looked at was the equation:

$\frac{dy(x)}{dx}=x+y(x)$.

We are trying to find some function, or indeed family of functions y(x) which satisfy this equation. We need to find a function whose derivative (y'(x)) at each point x is equal to the value of the function (ie. y(x)), plus that value of x. ie. at the point x=5, we must have that the gradient of the function (y'(5) is equal to 5 plus the value of the function (y(5)). Because we have not specified the initial, or boundary condition for the equation, there will be an infinite number of solutions which satisfy the differential equation alone, and we can imagine that so long as f(x,y) is not singular at some point (x,y), there will be a solution to the equation which passes through that point. The only constraint on the solution is that the gradient of the function, as it passes through that point is equal to x+y(x). Indeed we can even put in a direction field when f(x,y) is singular, but really we know that the function is not defined at that point. The direction field will simply correspond to a vertical line.

Rather than finding the solution in its entirety we can simply ask, for a sample of points, what, roughly, will the lines passing through the points look like? From the equation, we only have a constraint on the first derivative, and so we will simply put a short, straight line through all of our sample points in the (x,y) plane, such the gradient of that short straight line satisfies the differential equation above.

In the following two plots we use two different sets of sample points. In the plot on the left, we have chosen to sample at half integer positions in x and y. In the right plot we have quarter integer samples. Note importantly that each line has a very special property: Its gradient is equal to the x value plus the y value of the middle of the line. ie. the line passing through the point (1,1) has gradient 2, and that passing through (1,-1) has gradient 0.

This is all we ever have to check when seeing if indeed a given direction field plot satisfies our differential equation. Let’s look at another example. This time we are looking at the differential equation:

$\frac{dy(x)}{dx}=\frac{x}{y(x)}$

Can we see that this is correct? Well, we see a couple of clear features in the plot. The first is that the gradient along the line y=x always seems to be the same: 1. Indeed at the points along the line y=x, we expect that the value of x/y will be 1 (ie. at the point (2,2), the value of x/y=2/2=1). Along the line y=-x, we see another set of lines, each of which have the same gradient: -1. Again, this makes sense because when y=-x, y/x=-1.

Another feature that we see is that close to the x-axis (ie. the points for which y=0), the gradient of the lines seem to be getting larger and larger, as we would expect for x/y as y gets small (unless $x\le y$). And close to the y-axis, (ie. the points for which x=0), the gradient of the lines seem to be getting smaller and smaller (ie. they are flatter and flatter). Again, this is in line with these lines corresponding to the differential equation above.

Let’s look at a less trivial example:

$\frac{dy(x)}{dx}=\frac{\sqrt{x+2}}{\tan(y(x))}$

The direction field is as follows:

Again, let’s look for the most obvious features:

The first is that all of the lines for which x=-2 seem to be horizontal. See the lines in the red box here:

Indeed this makes sense because $\frac{\sqrt{-2+2}}{\tan(y)}=0$ and so we expect these to be flat – ie. their gradients to be 0.

Along the y-axis we have vertical lines. See the lines in the red box here:

This also makes sense because when $y=0, tan(y)=0$, and so the gradient at these points will be infinite (in fact this really means that the solution is ill defined at this point).

We also see that there are a set of lines around points with y values of 1.6 an -1.6 for which the lines seem to be close to flat. See the lines in the red boxes here:

This is because 1.6 is close to $\frac{\pi}{2}$ and at values close to this, tan(y) becomes very large (large and positive, or large and negative, depending on which side of $\frac{\pi}{2}$), so $\frac{\sqrt{x+2}}{\tan(y)}$ will get small when tan(y) is large. We can also see that the lines below and above the y=1.6 lines change in gradient from being positive gradient to being negative. This is because tan(y) is changing sign either side of y=1.6, so we expect that the gradients will change sign.

Anyway, I hope that with these examples it gives a few things to look out for when checking that a direction field does indeed satisfy a given differential equation. Simply make sure that the lines in the direction field satisfy the relationship between the gradient and the x and y values of the equation.

 How clear is this post?