This solution demonstrates calculating an approximate ODE value using the Runge-Kutta method of fourth order (RK4).
Find the approximate value of $y$ at $x=0.2$ for the differential equation:
\frac{dy}{dx} = \frac{y^{2}-x^{2}}{y^{2}+x^{2}}
Given the initial condition $y(0)=1$. The step size is $h = 0.2 - 0 = 0.2$.
The RK4 formulas are:
Where $f(x, y) = \frac{y^{2}-x^{2}}{y^{2}+x^{2}}$. Here, $x_0 = 0$ and $y_0 = 1$.
$k_1 = 0.2 \cdot f(0, 1) = 0.2 \cdot \frac{1^{2}-0^{2}}{1^{2}+0^{2}} = 0.2 \cdot 1 = 0.2$
$k_2 = 0.2 \cdot f(0 + \frac{0.2}{2}, 1 + \frac{0.2}{2}) = 0.2 \cdot f(0.1, 1.1)$
$k_2 = 0.2 \cdot \frac{(1.1)^{2}-(0.1)^{2}}{(1.1)^{2}+(0.1)^{2}} = 0.2 \cdot \frac{1.20}{1.22} \approx 0.1967$
$k_3 = 0.2 \cdot f(0 + \frac{0.2}{2}, 1 + \frac{0.1967}{2}) = 0.2 \cdot f(0.1, 1.09835)$
$k_3 \approx 0.2 \cdot \frac{(1.09835)^{2}-(0.1)^{2}}{(1.09835)^{2}+(0.1)^{2}} \approx 0.1967$
$k_4 = 0.2 \cdot f(0 + 0.2, 1 + 0.1967) = 0.2 \cdot f(0.2, 1.1967)$
$k_4 \approx 0.2 \cdot \frac{(1.1967)^{2}-(0.2)^{2}}{(1.1967)^{2}+(0.2)^{2}} \approx 0.1891$
$y(0.2) \approx y_0 + \frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4)$
$y(0.2) \approx 1 + \frac{1}{6}(0.2 + 2(0.1967) + 2(0.1967) + 0.1891)$
$y(0.2) \approx 1 + \frac{1}{6}(1.1760) \approx 1.1960$
The approximate value of $y$ at $x=0.2$ using the RK4 method is 1.196.