- Euler’s method builds an approximate solution to a differential equation by taking small straight-line steps along the slope the equation gives you.
- The update rule is \(y_{n+1} = y_n + h\,f(x_n, y_n)\): new value = old value + step size × slope.
- A slope field draws those slopes as short segments, so you can see the shape of every solution before you solve anything.
- In our case, a drug infused at 20 mg per hour and cleared at 25% per hour gives about 54.7 mg after 4 hours with Euler (step 1 hour); the exact answer is 50.6 mg.
- Exam point: show a table of \(x_n\), \(y_n\) and the slope at each step, and say whether your estimate is too high or too low using concavity.
The case: how much drug is in the bloodstream after four hours?
A patient is given a drug through an intravenous drip. The drip delivers the drug at a steady 20 milligrams per hour. At the same time, the body clears the drug: the liver and kidneys remove about 25% of whatever is in the blood each hour. If \(A\) is the amount of drug in the bloodstream, in milligrams, after \(t\) hours, then
The first term is the inflow from the drip. The second term is the outflow, which grows as the amount grows. (The figures are illustrative; real dosing is set by clinicians using measured data for each drug.)
The nurse wants to know roughly how much drug is in the blood after 4 hours. A doctor also wants to know the level the drug is heading towards if the drip runs all day. This differential equation can be solved exactly, but many equations cannot. So we will first answer the question with a method that works for any first-order equation, Euler’s method, and then use the exact answer to judge how good the approximation is.
A different situation, a savings balance that earns interest while the saver adds a fixed sum each year, follows the same kind of equation. We will use it as a second worked example.
The concept: follow the slope, one small step at a time
A first-order differential equation \(\frac{dy}{dx} = f(x, y)\) tells you the gradient of the solution curve at every point. It does not tell you the curve directly. But if you know one point on the curve, you know the gradient there, and the tangent line at that point is a good guide to where the curve goes next, at least for a short distance.
Euler’s method uses exactly this idea. Start at the known point \((x_0, y_0)\). Move a small horizontal distance \(h\) along the tangent line. That gives a new point, which is close to the curve. Work out the slope again at the new point and take another step. Repeat until you reach the \(x\)-value you need.[3]
A slope field (also called a direction field) is the picture behind this. At a grid of points you draw a short segment with the gradient \(f(x, y)\). Solution curves must run along these segments, so the field shows the shape of every possible solution at once. Euler’s method is like walking across the slope field, always heading in the direction of the nearest segment.
Here \(x_n\) and \(y_n\) are the coordinates after \(n\) steps, \(h\) is the step size, and \(f(x_n, y_n)\) is the slope given by the differential equation at the current point. The term \(h\,f(x_n, y_n)\) is the rise along the tangent line: run times gradient. For the drug model, \(x\) is time \(t\), \(y\) is the amount \(A\) and \(f(t, A) = 20 – 0.25A\).
Why this method fits the case
The drug question has the two things Euler’s method needs: a differential equation that gives the rate of change, and a starting value, \(A(0) = 0\). The nurse needs a number, not a formula, and Euler’s method delivers numbers directly. Each step is a single line of arithmetic, which you can do by hand, in a spreadsheet or on a calculator.
Euler’s method also works when no exact method exists. Equations such as \(\frac{dy}{dx} = x^2 – y^2\) or \(\frac{dy}{dx} = \sin(xy)\) cannot be solved with the separation of variables or integrating factors you learn at school. Numerical methods are the only way to get answers, and Euler’s method is the simplest of them. Because our drug equation can be solved exactly, it is a perfect test case: we can measure the error.
Euler’s method is not the right tool when you need high accuracy with few steps. Its error shrinks only in proportion to \(h\), so halving the step roughly halves the error. Professional software uses better methods, such as Runge–Kutta, that are far more accurate for the same effort. It is also a poor tool for very long time spans with a large step, where small errors can pile up. And when an exact solution is easy to find, as with a simple separable equation, use it.
Setting it up
Here are the quantities in the drug model.
| Quantity | Symbol | Value | Meaning |
|---|---|---|---|
| Time | \(t\) | hours from the start of the drip | Independent variable |
| Amount of drug | \(A\) | mg in the bloodstream | Dependent variable |
| Infusion rate | \(r\) | 20 mg per hour | Constant inflow |
| Elimination rate | \(k\) | 0.25 per hour | Fraction cleared each hour |
| Slope function | \(f(t, A)\) | \(20 – 0.25A\) | Gradient at any point |
| Start | \((t_0, A_0)\) | \((0, 0)\) | No drug at the start |
| Step size | \(h\) | 1 hour (then 0.5) | Width of each step |
Before doing any arithmetic, read the slope field. When \(A = 80\), the slope is \(20 – 0.25(80) = 0\), so the segments are flat. Below 80 the slopes are positive; above 80 they are negative. Every solution is drawn towards \(A = 80\) mg. That is the steady level the doctor asked about: the point where inflow equals outflow.
Solving it
Use Euler’s method with step size \(h = 1\) to estimate the amount of drug after 4 hours.
Euler’s method with \(h = 1\) estimates about 54.7 mg after 4 hours.
It is good practice to lay the working out as a table. Exam mark schemes reward this layout because each line can be checked.
| \(n\) | \(t_n\) | \(A_n\) | Slope \(20 – 0.25A_n\) | \(A_{n+1} = A_n + h \times \text{slope}\) |
|---|---|---|---|---|
| 0 | 0 | 0 | 20 | 20 |
| 1 | 1 | 20 | 15 | 35 |
| 2 | 2 | 35 | 11.25 | 46.25 |
| 3 | 3 | 46.25 | 8.4375 | 54.6875 |
Solve the equation exactly, find \(A(4)\), and compare it with Euler estimates using \(h = 1\), \(h = 0.5\) and \(h = 0.25\).
Each halving of the step roughly halves the error, and every Euler estimate is too high.
Savings balance. A saver has $5,000. The account pays 4% a year, compounded continuously, and the saver adds $1,200 a year in small regular amounts, so \(\frac{dB}{dt} = 0.04B + 1200\) with \(B(0) = 5000\). Use Euler’s method with \(h = 1\) year to estimate the balance after 3 years.
Euler estimates about $9,370, which is $92 too low. Here the curve bends upwards, so the tangent lines fall below it.
What the answer tells us
After 4 hours of the drip, the patient has roughly 50 to 55 mg of the drug in the blood. Euler’s method with one-hour steps says 54.7 mg; the exact solution says 50.6 mg. For a quick estimate, the method did its job. For a clinical decision, you would use a smaller step or the exact formula.
Figure 1 shows the slope field for \(\frac{dA}{dt} = 20 – 0.25A\), the exact solution curve, and the Euler points with \(h = 1\). The segments flatten as they approach the dashed line at 80 mg, and the Euler points sit above the true curve.
Why Euler overshoots here. The exact curve is concave down: its gradient falls as \(A\) rises. A tangent line to a concave-down curve lies above the curve, so every Euler step lands a little too high. In the savings example the curve is concave up, so the tangent lines lie below and Euler underestimates. You can check concavity from the equation itself: for the drug, \(\frac{d^2A}{dt^2} = -0.25\frac{dA}{dt}\), which is negative while \(A\) is rising.
Reasonableness check. In the first hour the drip adds 20 mg, and clearance takes away less than 5 mg, because there is less than 20 mg in the blood. So \(A(1)\) should lie between 15 and 20 mg. The exact value is 17.7 mg, and the Euler value of 20 mg is at the top of that range, as expected for one big step that ignores clearance.
Sensitivity. The steady level is \(\frac{r}{k} = \frac{20}{0.25} = 80\) mg. Doubling the drip rate doubles it to 160 mg. If the patient’s kidneys work less well, so the elimination rate falls to 0.2 per hour, the steady level rises to 100 mg and it takes longer to get there. The time to reach 75% of the steady level is \(\frac{\ln 4}{k}\), which is about 5.5 hours when \(k = 0.25\). Slope fields make this kind of “what if” reasoning visual, which is why AP Calculus teaches slope fields (with Euler’s method in BC) and IB Mathematics: analysis and approaches HL teaches both, while Cambridge 9709 focuses on solving separable equations exactly.[1][2][4]
For a full chapter on slope fields, Euler’s method and separable equations, with graphs like the one above, see the Mathematics Made Simple textbook. To build speed with Euler tables and concavity arguments, use the Mathematics Made Simple Practice Questions book.
Practice questions
Work each one by hand, then open the worked answer to check.
EasyQ1. Given \(\frac{dy}{dx} = y\) and \(y(0) = 1\), use Euler’s method with \(h = 0.25\) to estimate \(y(1)\). Show worked answer
\(y_1 = 1.25\), \(y_2 = 1.5625\), \(y_3 = 1.953125\), \(y_4 = 2.44140625\).
Estimate: \(y(1) \approx 2.441\). The exact value is \(e \approx 2.718\), so Euler underestimates (the curve is concave up).
EasyQ2. For \(\frac{dy}{dx} = x + y\), \(y(0) = 1\), use \(h = 0.1\) to estimate \(y(0.3)\). Show worked answer
\(x_1 = 0.1\): slope 1.2, \(y_2 = 1.22\).
\(x_2 = 0.2\): slope 1.42, \(y_3 = 1.362\).
Estimate: \(y(0.3) \approx 1.362\). (Exact: \(2e^{0.3} – 1.3 \approx 1.400\).)
MediumQ3. For \(\frac{dy}{dx} = xy\), \(y(0) = 2\), use Euler’s method with \(h = 0.5\) to estimate \(y(1)\). Compare with the exact solution. Show worked answer
\(x_1 = 0.5\): slope \(0.5 \times 2 = 1\), so \(y_2 = 2 + 0.5 = 2.5\).
Exact: separating gives \(y = 2e^{x^2/2}\), so \(y(1) = 2e^{0.5} \approx 3.297\).
Euler’s 2.5 is well below, because the slope grows fast and two big steps miss the upward bend.
MediumQ4. A slope field is drawn for \(\frac{dy}{dx} = y(3 – y)\). (a) Find the equilibrium solutions. (b) Describe the solution through \((0, 1)\). Show worked answer
(b) At \(y = 1\) the slope is \(1 \times 2 = 2 > 0\), so the curve rises. Slopes stay positive for \(0 < y < 3\), so it increases towards \(y = 3\) but never crosses it.
It is steepest at \(y = 1.5\), where the slope is \(2.25\).
ExamQ5. The function \(y = f(x)\) satisfies \(\frac{dy}{dx} = x^2 – y\) with \(f(0) = 1\). (a) Use Euler’s method with two steps of equal size to estimate \(f(0.4)\). (b) Find \(\frac{d^2y}{dx^2}\) at \((0, 1)\) and hence say whether the estimate is likely to be an overestimate or an underestimate near \(x = 0\). [5 marks] Show worked answer
At \((0.2, 0.8)\): slope \(= 0.04 – 0.8 = -0.76\), so \(y_2 = 0.8 – 0.152 = 0.648\). [M1 A1]
(b) \(\frac{d^2y}{dx^2} = 2x – \frac{dy}{dx} = 2x – x^2 + y\). At \((0, 1)\): \(0 – 0 + 1 = 1 > 0\). [B1]
Concave up, so tangent lines lie below the curve and Euler underestimates. [A1] (The exact value is \(f(0.4) \approx 0.690\), confirming this.)
Frequently asked questions
How small should the step size be?
Small enough that halving it again barely changes the answer. In exams the step size is given. In practice, run the method with \(h\) and then \(h/2\); if the two answers agree to the accuracy you need, stop. For Euler’s method the error is roughly proportional to \(h\), so halving the step roughly halves the error, as the drug example showed.
What is the difference between a slope field and a solution curve?
A slope field shows the gradient at many points, for every possible solution at once. A solution curve is one particular solution, fixed by an initial condition such as \(A(0) = 0\). Through each point there is exactly one solution curve (for the well-behaved equations you meet at school), and it follows the segments of the field.
Can Euler’s method be used for second-order equations?
Yes, by turning one second-order equation into two first-order equations. For example, position and velocity are stepped forward together, each using its own derivative. This is how simple physics simulations in games and engineering work, although they normally use more accurate methods.
Why learn Euler’s method if computers do it better?
Because every better method is built on the same idea: use the slope to predict the next point. Understanding Euler’s method, and why it overshoots or undershoots, explains what numerical software is doing and when to trust it. It also links calculus to linearisation, since each step is a tangent-line approximation.
References
- College Board. AP Calculus AB and BC Course and Exam Description. New York: College Board.
- International Baccalaureate Organization (2019). Mathematics: analysis and approaches guide. Cardiff: IBO.
- Strang, G. & Herman, E. (2016). Calculus Volume 2. Houston, TX: OpenStax. openstax.org
- Cambridge Assessment International Education. Cambridge International AS & A Level Mathematics 9709: Syllabus for examination in 2026 and 2027. cambridgeinternational.org

