← 2019 Paper 2

UPSC 2019 Maths Optional Paper 2 Q5d — Step-by-Step Solution

10 marks · Section B

Runge-Kutta methods (RK2/RK4) · Numerical Analysis · asked 4× in 13 yrs · Read the full method →

Question

Using Runge-Kutta method of fourth order, solve dydx=y2x2y2+x2\dfrac{dy}{dx}=\dfrac{y^2-x^2}{y^2+x^2} with y(0)=1y(0)=1 at x=0.2x=0.2. Use four decimal places for calculation and step length 0.20.2.

Technique

Single fourth-order Runge–Kutta step.

Solution

Setup. f(x,y)=y2x2y2+x2f(x,y)=\dfrac{y^2-x^2}{y^2+x^2}, x0=0x_0=0, y0=1y_0=1, h=0.2h=0.2. One RK4 step reaches x=0.2x=0.2.

RK4:

k1=hf(x0,y0),k2=hf ⁣(x0+h2,y0+k12),k3=hf ⁣(x0+h2,y0+k22),k4=hf(x0+h,y0+k3),k_1=h f(x_0,y_0),\quad k_2=h f\!\Big(x_0+\tfrac h2,y_0+\tfrac{k_1}2\Big),\quad k_3=h f\!\Big(x_0+\tfrac h2,y_0+\tfrac{k_2}2\Big),\quad k_4=h f(x_0+h,y_0+k_3), y1=y0+16(k1+2k2+2k3+k4).y_1=y_0+\tfrac16(k_1+2k_2+2k_3+k_4).

Step 1 — k1k_1

f(0,1)=101+0=1f(0,1)=\dfrac{1-0}{1+0}=1.

k1=0.2(1)=0.2000.k_1=0.2(1)=0.2000.

Step 2 — k2k_2 at (0.1,1+0.1=1.1)(0.1,\,1+0.1=1.1)

f(0.1,1.1)=1.210.011.21+0.01=1.201.22=0.983607f(0.1,1.1)=\dfrac{1.21-0.01}{1.21+0.01}=\dfrac{1.20}{1.22}=0.983607.

k2=0.2(0.983607)=0.1967210.1967.k_2=0.2(0.983607)=0.196721\approx0.1967.

Step 3 — k3k_3 at (0.1,1+0.098361=1.098361)(0.1,\,1+0.098361=1.098361)

f(0.1,1.098361)=1.2063970.011.206397+0.01=1.1963971.216397=0.983559f(0.1,1.098361)=\dfrac{1.206397-0.01}{1.206397+0.01}=\dfrac{1.196397}{1.216397}=0.983559.

k3=0.2(0.983559)=0.1967120.1967.k_3=0.2(0.983559)=0.196712\approx0.1967.

Step 4 — k4k_4 at (0.2,1+0.196712=1.196712)(0.2,\,1+0.196712=1.196712)

f(0.2,1.196712)=1.4321190.041.432119+0.04=1.3921191.472119=0.945656f(0.2,1.196712)=\dfrac{1.432119-0.04}{1.432119+0.04}=\dfrac{1.392119}{1.472119}=0.945656.

k4=0.2(0.945656)=0.1891310.1891.k_4=0.2(0.945656)=0.189131\approx0.1891.

Step 5 — Combine

y1=1+16(0.2000+2(0.1967)+2(0.1967)+0.1891)=1+16(1.1759)=1+0.195983.y_1=1+\frac{1}{6}\big(0.2000+2(0.1967)+2(0.1967)+0.1891\big)=1+\frac{1}{6}(1.1759)=1+0.195983.

Answer

  y(0.2)1.1960.  \boxed{\;y(0.2)\approx 1.1960.\;}
We post more of this — worked solutions, CSAT trap breakdowns, guide chapters — a few times a week on Telegram. Free, no sign-in. Join

This solution is part of the Maths Coverage Map — 13 years, mapped. Get the take-away PDF free.