← 2022 Paper 2
UPSC 2022 Maths Optional Paper 2 Q8b — Step-by-Step Solution
15 marks · Section B
Runge-Kutta methods (RK2/RK4) · Numerical Analysis · asked 4× in 13 yrs · Read the full method →
Question
Using RK4, solve dy/dx=x+y2 with y(0)=1, at x=0.2. Use 4 decimal places, step length 0.1.
Technique
Standard RK4 with h=0.1, two steps.
Solution
Setup. f(x,y)=x+y2. x0=0,y0=1. h=0.1. Two RK4 steps.
Step 1 — RK4 step 1: x=0→x=0.1
k1=hf(x0,y0)=0.1⋅(0+12)=0.1.
k2=hf(x0+h/2,y0+k1/2)=0.1⋅f(0.05,1.05)=0.1(0.05+1.052)=0.1(0.05+1.1025)=0.1⋅1.1525=0.11525.
k3=hf(x0+h/2,y0+k2/2)=0.1⋅f(0.05,1.057625)=0.1(0.05+1.0576252).
1.0576252=1.118571. So k3=0.1(0.05+1.118571)=0.1⋅1.168571=0.116857.
k4=hf(x0+h,y0+k3)=0.1⋅f(0.1,1.116857)=0.1(0.1+1.1168572).
1.1168572=1.247370. So k4=0.1(0.1+1.247370)=0.1⋅1.347370=0.134737.
y1=y0+61(k1+2k2+2k3+k4)=1+61(0.1+0.23050+0.23371+0.13474)
=1+61(0.69895)=1+0.11649=1.11649.
Round to 4 decimals: y1=1.1165.
Step 2 — RK4 step 2: x=0.1→x=0.2
k1=0.1⋅f(0.1,1.1165)=0.1(0.1+1.11652).
1.11652=1.24657. k1=0.1(0.1+1.24657)=0.1⋅1.34657=0.13466.
k2=0.1⋅f(0.15,1.1165+0.13466/2)=0.1⋅f(0.15,1.1839).
1.18392=1.4016. k2=0.1(0.15+1.4016)=0.1⋅1.5516=0.15516.
k3=0.1⋅f(0.15,1.1165+0.15516/2)=0.1⋅f(0.15,1.1941).
1.19412=1.4259. k3=0.1(0.15+1.4259)=0.1⋅1.5759=0.15759.
k4=0.1⋅f(0.2,1.1165+0.15759)=0.1⋅f(0.2,1.2741).
1.27412=1.6233. k4=0.1(0.2+1.6233)=0.1⋅1.8233=0.18233.
y2=1.1165+61(0.13466+0.31032+0.31518+0.18233)
=1.1165+61(0.94249)
=1.1165+0.15708
=1.2736.
Answer
y(0.2)≈1.2736.