Improved Euler (Heun's) Method Calculator

The calculator will find the approximate solution of the first-order differential equation using the Improved Euler (Heun's) method, with steps shown.

Enter a function: $$$y'=f(x,y)$$$ or $$$y'=f(t,y)=$$$

Enter the :

Enter the initial condition: $$$y$$$()$$$=$$$

Find $$$y$$$()

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please write it in the comments below.

Solution

Your input: find $$$y\left(1 \right)$$$ for $$$y'=3 x + y$$$, when $$$y\left(0 \right)=7$$$, $$$h=\frac{1}{5}$$$ using the Improved Euler's method.

The Improved Euler method states that $$$y_{n+1}=y_n+ \frac{h}{2} \left( f \left(x_n, y_n \right) + f \left(x_{n+1}, \tilde{y}_{n+1} \right)\right)$$$, where $$$\tilde{y}_{n+1}=y_n+h \cdot f \left(x_n, y_n \right)$$$ and $$$x_{n+1}=x_n + h$$$.

We have that $$$h=\frac{1}{5}$$$, $$$x_0=0$$$, $$$y_0=7$$$, $$$f(x,y)=3 x + y$$$

Step 1.

$$$x_{1}=x_{0}+h=0+\frac{1}{5}=\frac{1}{5}$$$

$$$\tilde{y}_{1}=y_{0}+h \cdot f \left(x_{0}, y_{0} \right)=7+h \cdot f \left(0, 7 \right)=$$$

$$$=\left(7 \right)+\frac{1}{5} \cdot \left(7 \right)=\frac{42}{5}$$$

$$$y_{1}=y_{0}+\frac{h}{2} \left( f (x_{0}, y_{0}) + f\left(x_{1}, \tilde{y}_{1}\right)\right)=$$$

$$$=7+\frac{h}{2} \left(f \left(0, 7 \right) + f \left(\frac{1}{5}, \frac{42}{5} \right)\right)=$$$

$$$=7+\frac{\frac{1}{5}}{2} \left(7 + \left( 9 \right) \right)=8.6$$$

Step 2.

$$$x_{2}=x_{1}+h=\frac{1}{5}+\frac{1}{5}=\frac{2}{5}$$$

$$$\tilde{y}_{2}=y_{1}+h \cdot f \left(x_{1}, y_{1} \right)=8.6+h \cdot f \left(\frac{1}{5}, 8.6 \right)=$$$

$$$=\left(8.6 \right)+\frac{1}{5} \cdot \left(9.2 \right)=10.44$$$

$$$y_{2}=y_{1}+\frac{h}{2} \left( f (x_{1}, y_{1}) + f\left(x_{2}, \tilde{y}_{2}\right)\right)=$$$

$$$=8.6+\frac{h}{2} \left(f \left(\frac{1}{5}, 8.6 \right) + f \left(\frac{2}{5}, 10.44 \right)\right)=$$$

$$$=8.6+\frac{\frac{1}{5}}{2} \left(9.2 + \left( 11.64 \right) \right)=10.684$$$

Step 3.

$$$x_{3}=x_{2}+h=\frac{2}{5}+\frac{1}{5}=\frac{3}{5}$$$

$$$\tilde{y}_{3}=y_{2}+h \cdot f \left(x_{2}, y_{2} \right)=10.684+h \cdot f \left(\frac{2}{5}, 10.684 \right)=$$$

$$$=\left(10.684 \right)+\frac{1}{5} \cdot \left(11.884 \right)=13.0608$$$

$$$y_{3}=y_{2}+\frac{h}{2} \left( f (x_{2}, y_{2}) + f\left(x_{3}, \tilde{y}_{3}\right)\right)=$$$

$$$=10.684+\frac{h}{2} \left(f \left(\frac{2}{5}, 10.684 \right) + f \left(\frac{3}{5}, 13.0608 \right)\right)=$$$

$$$=10.684+\frac{\frac{1}{5}}{2} \left(11.884 + \left( 14.8608 \right) \right)=13.35848$$$

Step 4.

$$$x_{4}=x_{3}+h=\frac{3}{5}+\frac{1}{5}=\frac{4}{5}$$$

$$$\tilde{y}_{4}=y_{3}+h \cdot f \left(x_{3}, y_{3} \right)=13.35848+h \cdot f \left(\frac{3}{5}, 13.35848 \right)=$$$

$$$=\left(13.35848 \right)+\frac{1}{5} \cdot \left(15.15848 \right)=16.390176$$$

$$$y_{4}=y_{3}+\frac{h}{2} \left( f (x_{3}, y_{3}) + f\left(x_{4}, \tilde{y}_{4}\right)\right)=$$$

$$$=13.35848+\frac{h}{2} \left(f \left(\frac{3}{5}, 13.35848 \right) + f \left(\frac{4}{5}, 16.390176 \right)\right)=$$$

$$$=13.35848+\frac{\frac{1}{5}}{2} \left(15.15848 + \left( 18.790176 \right) \right)=16.7533456$$$

Step 5.

$$$x_{5}=x_{4}+h=\frac{4}{5}+\frac{1}{5}=1$$$

$$$\tilde{y}_{5}=y_{4}+h \cdot f \left(x_{4}, y_{4} \right)=16.7533456+h \cdot f \left(\frac{4}{5}, 16.7533456 \right)=$$$

$$$=\left(16.7533456 \right)+\frac{1}{5} \cdot \left(19.1533456 \right)=20.58401472$$$

$$$y_{5}=y_{4}+\frac{h}{2} \left( f (x_{4}, y_{4}) + f\left(x_{5}, \tilde{y}_{5}\right)\right)=$$$

$$$=16.7533456+\frac{h}{2} \left(f \left(\frac{4}{5}, 16.7533456 \right) + f \left(1, 20.58401472 \right)\right)=$$$

$$$=16.7533456+\frac{\frac{1}{5}}{2} \left(19.1533456 + \left( 23.58401472 \right) \right)=21.027081632$$$

Answer: $$$y\left(1\right)=21.027081632$$$