Solving First Order Differential Equation 𝑦 ′ = 𝑥 − 𝑦 Using Taylor and Euler Methods

ODE Question

Briefly discuss the following methods for solving the initial value problem:

$$ y' = f(x, y), \quad y(0) = y_0 $$

  1. Taylor Series Method
  2. 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 \)

Post a Comment

Previous Post Next Post