GATE 2016 EC (EC3) – Question 15
Consider $y\prime=y+2x-x^2$, $y(0)=1$, for $0\le x<\infty$, with exact solution $y(x)=x^2+e^x$. At x=0.1, the percentage difference between the exact solution and one iteration of the second-order Runge–Kutta method with step h=0.1 is ________.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 0.060 to 0.063
Explanation
Use the two-slope endpoint RK2 (Heun) formula underlying the official range. With $f(x,y)=y+2x-x^2$, $k_1=hf(0,1)=0.1$. The predictor is 1.1, giving $k_2=hf(0.1,1.1)=0.129$.
Thus $y_1=1+(k_1+k_2)/2=1.1145$. The exact value is $0.01+e^{0.1}=1.115170186$.
The relative percentage difference is $100(1.115170186-1.1145)/1.115170186=$ **0.06010%**. “Second-order RK” is a family; this result uses the endpoint-average variant intended by the key.