Briefly discuss the following methods for solving the initial value problem:
$$ y' = f(x, y), \quad y(0) = y_0 $$
- Taylor Series Method
- Explicit Euler Method
Hence, solve for \( y(0.2) \), correct to 5 decimal places, in:
$$ y' = x - y, \quad y(0) = 1 $$
using the methods above.
Taylor's Series
Recall:
\( y(x) = a_0 + a_1 x + a_2 x^2 + a_3 x^3 + a_4 x^4 + \dots \)
\( y'(x) = a_1 + 2a_2 x + 3a_3 x^2 + 4a_4 x^3 + \dots \)
\( y'(0) = a_1 \Rightarrow a_1 = y'(0) \)
\( y''(x) = 2a_2 + 6a_3 x + 12a_4 x^2 + \dots \)
\( y''(0) = 2a_2 \Rightarrow a_2 = \frac{y''(0)}{2!} \)
\( y^{(3)}(x) = 6a_3 + 24a_4 x + \dots \)
\( y^{(3)}(0) = 6a_3 \Rightarrow a_3 = \frac{y^{(3)}(0)}{3!} \)
\( y^{(4)}(0) = 24a_4 \Rightarrow a_4 = \frac{y^{(4)}(0)}{4!} \)
Generalized: \( a_n = \frac{y^{(n)}(0)}{n!} \)
Since \( x \geq 0 \), then:
\( y(x) = y(0) + y'(0)x + \frac{y''(0)}{2!}x^2 + \frac{y^{(3)}(0)}{3!}x^3 + \frac{y^{(4)}(0)}{4!}x^4 + \dots \)
\( y(x) = 1 + (-1)x + \frac{2}{2!}x^2 + \frac{-2}{3!}x^3 + \frac{1}{4!}x^4 + \dots \)
\( y(x) = 1 - x + x^2 - \frac{1}{3}x^3 + \frac{1}{12}x^4 + \dots \)
Taylor Series Expansion of a Differential Equation
Given:
\( y' = x - y \)
Compute the higher-order derivatives:
\( y'' = \frac{d}{dx}(x - y) = 1 - y' \)
\( y''' = -y'' \)
\( y^{(4)} = -y''' \)
\( y^{(5)} = -y^{(4)} \)
Initial conditions:
\( y(0) = 1, \quad y'(0) = -1, \quad x = 0 \)
Evaluate derivatives at \( x = 0 \):
\( y''(0) = 2 \)
\( y'''(0) = -2 \)
\( y^{(4)}(0) = 2 \)
\( y^{(5)}(0) = -2 \)
Taylor series expansion at \( x = 0 \):
\( y(x) = y(0) + y'(0)x + \frac{y''(0)}{2!}x^2 + \frac{y^{(3)}(0)}{3!}x^3 + \frac{y^{(4)}(0)}{4!}x^4 + \dots \)
\( y(x) = 1 - x + x^2 - \frac{1}{3}x^3 + \frac{1}{12}x^4 + \dots \)
Euler's Method (5 Iterations with \( h = 0.1 \))
Given: \( y' = x - y,\quad y(0) = 1,\quad h = 0.1 \)
Formula: \( y_{n+1} = y_n + h \cdot (x_n - y_n) \)
Iteration Steps
Step 1:
\( f(x_0, y_0) = 0 - 1 = -1 \)
\( y_1 = 1 + 0.1 \cdot (-1) = 0.9 \)
Step 2:
\( f(x_1, y_1) = 0.1 - 0.9 = -0.8 \)
\( y_2 = 0.9 + 0.1 \cdot (-0.8) = 0.82 \)
Step 3:
\( f(x_2, y_2) = 0.2 - 0.82 = -0.62 \)
\( y_3 = 0.82 + 0.1 \cdot (-0.62) = 0.758 \)
Step 4:
\( f(x_3, y_3) = 0.3 - 0.758 = -0.458 \)
\( y_4 = 0.758 + 0.1 \cdot (-0.458) = 0.7122 \)
Step 5:
\( f(x_4, y_4) = 0.4 - 0.7122 = -0.3122 \)
\( y_5 = 0.7122 + 0.1 \cdot (-0.3122) = 0.6810 \)
Final Approximation: \( \boxed{y(0.5) \approx 0.6810} \)