Modified Euler 141Fe8
1. **Problem statement:** Solve the initial value problem $y' = 1 - y$, with $y(0) = 0$, using the modified Euler's method (also called Heun's method) to find $y$ at $x = 0.1, 0.2, 0.3$.
2. **Formula and method:** The modified Euler's method updates the solution using:
$$
\begin{aligned}
k_1 &= f(x_n, y_n) \\
k_2 &= f\left(x_n + h, y_n + h k_1\right) \\
y_{n+1} &= y_n + \frac{h}{2}(k_1 + k_2)
\end{aligned}
$$
where $f(x,y) = 1 - y$ and $h$ is the step size.
3. **Initial values:**
- $x_0 = 0$, $y_0 = 0$
- Step size $h = 0.1$
4. **Step 1: Compute $y_1$ at $x_1 = 0.1$**
- $k_1 = f(0,0) = 1 - 0 = 1$
- $k_2 = f(0.1, 0 + 0.1 \times 1) = f(0.1, 0.1) = 1 - 0.1 = 0.9$
- $y_1 = 0 + \frac{0.1}{2}(1 + 0.9) = 0.1 \times 0.95 = 0.095$
5. **Step 2: Compute $y_2$ at $x_2 = 0.2$**
- $k_1 = f(0.1, 0.095) = 1 - 0.095 = 0.905$
- $k_2 = f(0.2, 0.095 + 0.1 \times 0.905) = f(0.2, 0.1855) = 1 - 0.1855 = 0.8145$
- $y_2 = 0.095 + \frac{0.1}{2}(0.905 + 0.8145) = 0.095 + 0.1 \times 0.85975 = 0.180975$
6. **Step 3: Compute $y_3$ at $x_3 = 0.3$**
- $k_1 = f(0.2, 0.180975) = 1 - 0.180975 = 0.819025$
- $k_2 = f(0.3, 0.180975 + 0.1 \times 0.819025) = f(0.3, 0.2628775) = 1 - 0.2628775 = 0.7371225$
- $y_3 = 0.180975 + \frac{0.1}{2}(0.819025 + 0.7371225) = 0.180975 + 0.1 \times 0.77807375 = 0.258782375$
**Final answers:**
$$
y(0.1) \approx 0.095, \quad y(0.2) \approx 0.181, \quad y(0.3) \approx 0.259
$$