Skip to main content

R-K2: y' = y/(x²+y²)

Short answer

Using Heun's RK2 method with h=0.5: k1 = h f(x,y), k2 = h f(x+h, y+k1), y_{n+1}=y_n+(k1+k2)/2. Results: y(0.5) ≈ 1.4000, y(1.0) ≈ 1.6671.

Solve y' = y/(x² + y²), y(0) = 1 using R-K2 method in the range 0, 0.5, 1.

Given y' = y/(x² + y²), y(0) = 1, range 0 to 1 in steps of 0.5, so h = 0.5 (two steps).

The second-order Runge–Kutta (Heun / modified Euler) formulas are:

k₁ = h·f(xₙ, yₙ)
k₂ = h·f(xₙ + h, yₙ + k₁)
yₙ₊₁ = yₙ + ½(k₁ + k₂)

First step

k₁ = h·f(x₀, y₀) = 0.5·f(0.0000, 1.0000) = 0.5000
k₂ = h·f(x₀+h, y₀+k₁) = 0.5·f(0.5000, 1.5000) = 0.3000
y₁ = y₀ + (k₁+k₂)/2 = 1.0000 + (0.5000 + 0.3000)/2 = 1.4000

All steps (h = 0.5)

stepxₙyₙk₁ = h·f(xₙ,yₙ)k₂ = h·f(xₙ+h, yₙ+k₁)yₙ₊₁ = yₙ + (k₁+k₂)/2
00.00001.00000.50000.30001.4000
10.50001.40000.31670.21751.6671

Answer: y(0.5) ≈ 1.4000, y(1) ≈ 1.6671

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 6 questions →