Tutorials › Calculus I › Plotting the Euler Polygon on a Slope Field

Euler's Method and Numerical Solutions · Tutorial 1433 of 1495

Plotting the Euler Polygon on a Slope Field

Construct an Euler polygon from a slope field by calculating each step’s starting slope and drawing the straight segment to the updated point.

Advanced 9 min read

What You'll Learn

  • Identify the slope-field value at a given point.
  • Draw an Euler step from its starting point using the prescribed step size.
  • Calculate successive Euler nodes and connect them as a piecewise-linear path.
  • Check each segment’s rise, run, and slope.
  • Recognize and correct the error of using an endpoint slope for the current step.

From a Slope Field to an Euler Polygon

A differential equation \(y'=f(t,y)\) assigns a slope to each point \((t,y)\) in the plane. A slope field displays this information using short line segments: the segment at \((t,y)\) has slope \(f(t,y)\). The field gives a visual picture of the equation, while Euler’s method turns that local slope information into a sequence of approximate points.

Plotting the Euler polygon means more than marking those points. Starting from the initial condition, draw a straight segment over each time step, using the slope at the segment’s starting point. The resulting connected path is piecewise linear: it consists of straight pieces that generally meet at corners.

Definition: For \(y'=f(t,y)\) with initial value \(y(t_0)=y_0\), choose step sizes \(h_n=t_{n+1}-t_n>0\). The Euler nodes satisfy $$ y_{n+1}=y_n+h_n f(t_n,y_n). $$ The Euler polygon connects each \((t_n,y_n)\) to \((t_{n+1},y_{n+1})\) with a straight segment.

The node \((t_n,y_n)\) is the starting point for step \(n\), and \(h_n\) is the horizontal distance to the next node. On a uniform grid, all step sizes have the same value \(h\). On a nonuniform grid, calculate each step with its own \(h_n\).

How to Draw One Step

Suppose the current node is \((t_n,y_n)\). First read or calculate the slope \(f(t_n,y_n)\) there. Then move horizontally by \(h_n\). Over that horizontal distance, move vertically by \(h_n f(t_n,y_n)\). This gives the next node. Draw a straight line between the two nodes.

$$ \Delta t=h_n,\qquad \Delta y=h_n f(t_n,y_n),\qquad (t_{n+1},y_{n+1})=(t_n+h_n,\ y_n+h_n f(t_n,y_n)). $$

A positive starting slope makes the segment rise as time increases; a negative slope makes it fall; and a zero slope makes it horizontal. The size of the vertical change depends on both the slope and the step size. For instance, a slope of \(2\) over a step of \(0.5\) gives a vertical change of \(1\), not \(2\).

The plotted slope-field marks are often drawn as short, equal-length strokes so that the diagram remains readable. Their lengths are only visual markers. To construct an Euler step, use the numerical slope, not the length of the field stroke.

Why the Euler Segment Has This Slope

The construction follows directly from the formula for the slope of a straight line. The line through the current node and the next node has horizontal change \(t_{n+1}-t_n=h_n\) and vertical change \(y_{n+1}-y_n\). The Euler update makes that vertical change equal to \(h_n f(t_n,y_n)\). Therefore, the segment’s slope is the value of the differential equation at its starting point.

$$ \frac{y_{n+1}-y_n}{t_{n+1}-t_n} = \frac{h_n f(t_n,y_n)}{h_n} = f(t_n,y_n), \qquad h_n>0. $$

More explicitly, for \(t_n\le t\le t_{n+1}\), the straight segment is described by

$$ y_E(t)=y_n+(t-t_n)f(t_n,y_n). $$

At \(t=t_n\), this gives \(y_E(t_n)=y_n\). At \(t=t_{n+1}=t_n+h_n\), it gives \(y_E(t_{n+1})=y_n+h_n f(t_n,y_n)=y_{n+1}\). Its slope throughout that interval is \(f(t_n,y_n)\), fixed at the start of the step. The slope field may assign different slopes at other points along the segment; Euler’s method does not update the segment’s slope partway through.

Worked Example: A Time-Dependent Slope Field

Worked Example: A Time-Dependent Slope Field

Plot two Euler steps for \(y'=t+y\), starting at \((t_0,y_0)=(0,1)\), with uniform step size \(h=0.5\).

First step. The slope at the starting point is

$$ f(0,1)=0+1=1. $$

The horizontal change is \(0.5\), so the vertical change is

$$ \Delta y=0.5(1)=0.5. $$

Thus the next node is \((t_1,y_1)=(0.5,1.5)\). Draw a straight segment from \((0,1)\) to \((0.5,1.5)\). Its slope checks as

$$ \frac{1.5-1}{0.5-0}=\frac{0.5}{0.5}=1=f(0,1). $$

Second step. Evaluate the slope at the new starting node, not at the previous one:

$$ f(0.5,1.5)=0.5+1.5=2. $$

The vertical change is \(0.5(2)=1\), so

$$ (t_2,y_2)=(0.5+0.5,\ 1.5+1)=(1,2.5). $$

Draw a segment from \((0.5,1.5)\) to \((1,2.5)\). Its slope is

$$ \frac{2.5-1.5}{1-0.5}=\frac{1}{0.5}=2=f(0.5,1.5). $$

The Euler polygon consists of the two segments through \((0,1)\), \((0.5,1.5)\), and \((1,2.5)\). Each segment passes through a node and has the slope assigned by the field at that segment’s starting node.

Worked Example: Following Positive Slopes That Decrease

Worked Example: Following Positive Slopes That Decrease

Draw three Euler steps for \(y'=1-y\), beginning at \((0,0)\), with \(h=0.5\).

At \((0,0)\), the slope is \(1-0=1\). Thus \(y_1=0+0.5(1)=0.5\), and the first segment joins \((0,0)\) to \((0.5,0.5)\). Its slope check is

$$ \frac{0.5-0}{0.5-0}=1=f(0,0). $$

At \((0.5,0.5)\), the slope is \(1-0.5=0.5\). Thus \(y_2=0.5+0.5(0.5)=0.75\). The second segment joins \((0.5,0.5)\) to \((1,0.75)\), and

$$ \frac{0.75-0.5}{1-0.5}=\frac{0.25}{0.5}=0.5=f(0.5,0.5). $$

At \((1,0.75)\), the slope is \(1-0.75=0.25\). Thus \(y_3=0.75+0.5(0.25)=0.875\). The third segment joins \((1,0.75)\) to \((1.5,0.875)\), with slope

$$ \frac{0.875-0.75}{1.5-1}=\frac{0.125}{0.5}=0.25=f(1,0.75). $$

The nodes, in order, are \((0,0)\), \((0.5,0.5)\), \((1,0.75)\), and \((1.5,0.875)\). The slopes of successive pieces are positive and decrease from \(1\) to \(0.5\) to \(0.25\), just as the slope values evaluated at their starting nodes do.

Worked Example: A Segment Can Change from Falling to Rising

Worked Example: A Segment Can Change from Falling to Rising

Draw three Euler steps for \(y'=t-y\), starting at \((0,2)\), using \(h=0.5\).

At the initial node, \(f(0,2)=0-2=-2\). The first vertical change is \(0.5(-2)=-1\), so \(y_1=2-1=1\). The segment joins \((0,2)\) to \((0.5,1)\). Its slope checks as

$$ \frac{1-2}{0.5-0}=\frac{-1}{0.5}=-2=f(0,2). $$

At \((0.5,1)\), the slope is \(f(0.5,1)=0.5-1=-0.5\). The next vertical change is \(0.5(-0.5)=-0.25\), giving \(y_2=1-0.25=0.75\). The segment from \((0.5,1)\) to \((1,0.75)\) has slope

$$ \frac{0.75-1}{1-0.5}=\frac{-0.25}{0.5}=-0.5=f(0.5,1). $$

At \((1,0.75)\), the slope is \(f(1,0.75)=1-0.75=0.25\). The vertical change is \(0.5(0.25)=0.125\), so \(y_3=0.75+0.125=0.875\). The final segment joins \((1,0.75)\) to \((1.5,0.875)\), and its slope is

$$ \frac{0.875-0.75}{1.5-1}=\frac{0.125}{0.5}=0.25=f(1,0.75). $$

The first two pieces fall, while the third rises. This change is reflected by the sign change in the slope evaluated at the third starting node. The plotted path is still made by connecting successive Euler nodes with straight lines.

A Reliable Plotting Procedure

For a hand-drawn slope field and Euler polygon, keep the field and the path conceptually distinct: the field shows slopes at many points, while the polygon uses a selected sequence of those slopes. The following process makes the construction systematic.

1
Mark the initial node.
Plot the specified point \((t_0,y_0)\) on axes with labeled scales.
2
Read the starting slope.
Use the slope-field mark or calculate \(f(t_n,y_n)\) at the current node.
3
Find the next node.
Move horizontally by \(h_n\), and vertically by \(h_n f(t_n,y_n)\).
4
Connect the nodes.
Draw a straight segment between the current node and the new one.
5
Repeat from the new node.
Evaluate the slope there, then calculate and draw the next step.

Take care when interpreting the visual angle of a segment. The numerical slope is vertical change divided by horizontal change in the coordinate units. If the horizontal and vertical axes use different physical lengths per unit on the page, a segment’s apparent angle may not visually match its numerical slope. Trust the coordinate differences and calculations, rather than estimating the slope from the angle alone.

Common Mistake: Using the Endpoint Slope Too Soon

A frequent error is to evaluate the differential equation at the point where the step will end and use that value for the segment just being drawn. The Euler rule instead uses the slope at the starting point. In the first step of the example \(y'=t+y\) from \((0,1)\) with \(h=0.5\), using the endpoint slope prematurely would mean using \(f(0.5,1.5)=2\). That incorrect choice gives

$$ y_1=1+0.5(2)=2. $$

This does not match the first segment’s required starting slope. The segment from \((0,1)\) to \((0.5,2)\) has slope \((2-1)/(0.5-0)=2\), whereas the field assigns slope \(f(0,1)=1\) at its starting point. The correct calculation uses \(f(0,1)=1\), giving \(y_1=1+0.5(1)=1.5\); the segment’s slope is then \((1.5-1)/0.5=1\), as required.

Takeaway: Each Euler segment uses the slope at its left-hand, starting node. Only after reaching the next node do you evaluate the slope for the next segment.

Check Your Understanding

For each question, use the starting-node rule and check the segment slope from its endpoints.

  1. For \(y'=2t-y\), starting at \((0,1)\) with \(h=0.25\), what are the slope and next node?
  2. For \(y'=y\), starting at \((1,2)\) with \(h=0.5\), calculate the next node and the slope of the segment.
  3. In one sentence, explain why the slope along an Euler segment is fixed by the field value at its starting point.
  4. For \(y'=t-y\), starting at \((0,1)\) with \(h=1\), calculate the next node. Does the segment rise, fall, or remain horizontal?
  5. A segment runs from \((2,3)\) to \((2.5,4)\). What slope does that segment represent, and what value must \(f(2,3)\) have for it to be an Euler step?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon