Pratidin
2026 · Mathematics Optional Paper II · 15 marksMainsQuestion 8b

Consider the initial value problem :
dy/dx = 1 + y/x, y(1) = 1, h = 1 (Step-size)
(i) Apply the classical fourth order Runge-Kutta method to approximate the solution y(2).
(ii) Use Euler's method to find y(2) and y(3).

15 marks · directive: Apply and find

Answer

The core of a good answer

One RK4 step gives k₁ = 2, k₂ = 7/3, k₃ = 22/9, k₄ = 49/18 and y(2) ≈ 365/108 = 3.3796; Euler's method gives y(2) = 3 and y(3) = 5.5 (exact values 3.3863 and 6.2958 from y = x ln x + x).

An outline written by upsc.help, not an official UPSC answer; every fact checked by a separate review. How we work

What the question asks

A routine numerical ODE question: carry out one step of classical RK4 and two steps of Euler with h = 1, showing each slope. A good answer also compares with the exact solution, which is easy here because the equation is linear.

Answer outline

Introduction

f(x, y) = 1 + y/x, x₀ = 1, y₀ = 1, h = 1. RK4: k₁ = hf(x₀, y₀), k₂ = hf(x₀ + h/2, y₀ + k₁/2), k₃ = hf(x₀ + h/2, y₀ + k₂/2), k₄ = hf(x₀ + h, y₀ + k₃), y₁ = y₀ + (k₁ + 2k₂ + 2k₃ + k₄)/6.

Step 1: RK4 slopes

Step 2: RK4 result

Step 3: Euler's method

Step 4: Check against the exact solution

Conclusion

RK4 gives y(2) ≈ 3.3796; Euler gives y(2) = 3 and y(3) = 5.5. Even with the large step h = 1, RK4 is accurate to about 0.2 per cent while Euler is off by over 11 per cent. All values were recomputed in Python with exact fractions.

Examples and data to cite

Facts

Facts to remember

Sources used for the explanation

Write a timed answer in the app