Skip to main content

RK-2: y'' = y - x y'

Short answer

Reduce to the system y'=z, z'=y-xz and apply second-order Runge-Kutta (Heun) with h=0.1. Two steps give y(0.2) approximately 1.0199 and y'(0.2) approximately 0.1980.

Using the Runge-Kutta method of second order, obtain a solution of the equation y'' = y - xy' with the initial condition y(0) = 1, y'(0) = 0 to find y(0.2) and y'(0.2). (Take h = 0.1)

Put z = y'. The equation becomes the system

dy/dx = z             = f(x, y, z)
dz/dx = y − x·z       = g(x, y, z)
x₀ = 0, y₀ = 1, z₀ = 0, h = 0.1

RK-2 (Heun) for the system:

k₁ = h·f(x, y, z)                 l₁ = h·g(x, y, z)
k₂ = h·f(x+h, y+k₁, z+l₁)         l₂ = h·g(x+h, y+k₁, z+l₁)
yₙ₊₁ = yₙ + (k₁+k₂)/2             zₙ₊₁ = zₙ + (l₁+l₂)/2

Step 1 (x = 0 → 0.1)

k₁ = 0.1(0)                           = 0.0000
l₁ = 0.1(1 − 0·0)                     = 0.1000
k₂ = 0.1(0 + 0.1)                     = 0.0100
l₂ = 0.1[(y+k₁) − (x+h)(z+l₁)] = 0.1[1 − 0.1(0.1)] = 0.0990
y(0.1) = 1 + (0 + 0.01)/2             = 1.0050
z(0.1) = 0 + (0.1 + 0.099)/2          = 0.0995

Step 2 (x = 0.1 → 0.2)

k₁ = 0.1(z) = 0.1(0.0995)                    = 0.0100
l₁ = 0.1[1.0050 − 0.1(0.0995)]             = 0.0995
k₂ = 0.1(z + l₁)                      = 0.0199
l₂ = 0.1[(y+k₁) − 0.2(z+l₁)]          = 0.0975
y(0.2) = 1.0050 + (0.0100 + 0.0199)/2 = 1.0199
z(0.2) = 0.0995 + (0.0995 + 0.0975)/2 = 0.1980

Table

stepxyz=y'k₁l₁k₂l₂yₙ₊₁zₙ₊₁
00.00001.00000.00000.00000.10000.01000.09901.00500.0995
10.10001.00500.09950.01000.09950.01990.09751.01990.1980

Answer: y(0.2) ≈ 1.0199, y'(0.2) ≈ 0.1980

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 6 questions →