For \(y^{\prime}=\mathrm{f}(x,y)\), start from \((x_0,y_0)\) and use the current point’s slope for a straight step of constant length \(h\).
\(x_{n+1}=x_n+h,\qquad y_{n+1}=y_n+h\mathrm{f}(x_n,y_n)\).
Example
For \(y^{\prime}=x+y\), \(y(0)=1\) and \(h=0.1\):
| \(n\) | \(x_n\) | \(y_n\) | \(x_n+y_n\) |
|---|---|---|---|
| \(0\) | \(0\) | \(1\) | \(1\) |
| \(1\) | \(0.1\) | \(1.1\) | \(1.2\) |
| \(2\) | \(0.2\) | \(1.22\) | — |
Thus \(y(0.2)\approx1.22\). Keep unrounded intermediate values. This is an approximation; a smaller step often improves accuracy over a fixed interval, but is not a guarantee for every problem.
Create a free account to practise similar questions.
Need help? Join our JC Math tuition classes.
Learn more