Skip to main content

RK-2: y' = 4e^(0.8x) - 0.5y

Short answer

Using RK2 (Heun) with h=0.5 for y'=4e^(0.8x)-0.5y, y(0)=2: y(0.5)≈3.8043, y(1.0)≈6.3165.

Solve y' = 4e^(0.8x) - 0.5y; subject to initial condition y(0) = 2, for y(0.5) and y(1.0) using Runge-Kutta 2nd order method.

Given y' = 4e^(0.8x) − 0.5y, y(0) = 2. Since y is needed at x = 0.5 and 1.0, take 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, 2.0000) = 1.5000
k₂ = h·f(x₀+h, y₀+k₁) = 0.5·f(0.5000, 3.5000) = 2.1086
y₁ = y₀ + (k₁+k₂)/2 = 2.0000 + (1.5000 + 2.1086)/2 = 3.8043

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.00002.00001.50002.10863.8043
10.50003.80432.03262.99196.3165

Answer: y(0.5) ≈ 3.8043, y(1) ≈ 6.3165

For comparison, the exact solution y = (4/1.3)(e^(0.8x) − e^(−0.5x)) + 2e^(−0.5x) gives y(0.5) = 3.7515, y(1.0) = 6.1946.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 6 questions →