Direction fields and solution curves · Mathematics… | StemPy Lab
Course 13.1·Lesson 3 of 3
Direction fields and solution curves
A first-order equation dxdy=f(x,y)
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
find the slope that an equation gives at a point, and draw a short segment;
read a direction field and find where the slope is zero or equal;
take a short step along the field and compare it with the exact solution.
A map of slopes
Suppose dxdy=x−y. At the point (2,1) the slope is 2−1=1. At (1,3) the slope is 1−3=−2. At every point of the plane the equation names a slope. We do not need a solution to know it.
A direction field (also called a slope field) is a picture of these slopes. At each point of a grid we draw a short segment with the slope the equation gives. A solution curve is a curve that touches the segments as it goes, like a boat carried by a current. The curve through a point is the solution that starts there.
A direction field for dy/dx = x - y: many short grey line segments, each showing the slope at its point. The segments are flat along the dashed red line y = x, slope upwards below that line and slope downwards above it. Four solution curves are drawn on top, in blue, green and orange. All of them approach the straight line y = x - 1 as x grows. The orange curve starts at the marked point (0, 1).
Reading the field
Where the segments are flat, the slope is zero. For dxdy=x−y this happens along the line y=x.
Below that line x−y is positive, so the segments rise. Above it they fall.
A solution curve cannot cross another one. At a crossing point the two curves would give two different slopes, but the equation gives only one.
All the curves approach the line y=x−1 as x grows. You can see this in the picture, and you can check that y=x−1 solves the equation: its slope is 1, and x−y=x−(x−1)=1.
Isoclines
An isocline is a curve along which the slope has the same value. For dxdy=x−y the isocline for slope m is the line x−y=m, that is, y=x−m. On it every segment is parallel. If you draw a few isoclines, you can sketch the whole field. Slide m in the simulation and watch the dashed line move.
An exact solution to compare
The equation dxdy=x−y is linear, and you will solve it in the next course. Its solutions are y=x−1+Ke−x. The curve through (0,1) has 1=−1+K, so K=2, and the curve is y=x−1+2e−x. Differentiate to check: y′=1−2e−x, and x−y=1−2e−x. They agree.
Walking along the field
Start at (0,1). The slope there is 0−1=−1. Move 0.5 to the right along that slope. The height changes by −1×0.5, so the new point is (0.5,0.5). Repeat from there. This is the idea of Euler's method: new height equals old height plus slope times step.
ynew=yold+h×f(xold,yold).
A short step stays close to the true curve. A long step drifts away. The course on modelling uses the method on real problems.
Practise with new numbers
Try it in Python
The program walks along the field of dxdy=x−y from (0,1) in four steps of 0.5. Next to each stop it prints the exact value from y=x−1+2e−x.
Common mistakes
Using the slope as the height. The equation gives the slope. It does not give y.
Drawing a field with crossing solutions. Two solution curves never cross, because one point has one slope.
A step that is too long. A long step along a bending curve leaves the curve.
Mixing up the axes. At the point (x,y) the slope x−y uses the first number as x.
Remember these
The equation dxdy=f(x,y) gives a slope at every point. A direction field draws them.
A solution curve follows the segments. Curves do not cross.
An isocline is a curve of equal slope.
A step along the field is ynew=yold+h×f(xold,yold).
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
For dxdy=x2−y, find the slope at (2,1).
For dxdy=x−y, what is the slope along the line y=x−2?
For dxdy=y(2−y), which horizontal lines are solutions?
For dxdy=x+y with the curve through (0,1), take one step of h=0.1.
Why can two solution curves of dxdy=f(x,y) not cross?
References
OpenStax, Calculus Volume 2, Chapter 4, section 4.2 Direction Fields and Numerical Methods.
NCERT, Mathematics Part II for Class XII, Chapter 9, the introduction and the section on solutions of a differential equation.
Enroll free in Differential Equations: Order, Degree and Solutions
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.
tells you the slope at every point of the plane. Draw a short segment of that slope at many points and you have a direction field. A solution curve follows the segments. You can read the shape of the solutions from the field before you solve anything, and you can walk along it step by step.
about 25 min1 simulation1 practice question1 Python program5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.