← 2023 Paper 2

UPSC 2023 Maths Optional Paper 2 Q5b — Step-by-Step Solution

10 marks · Section B

Euler's method (and modified Euler) · Numerical Analysis · asked 2× in 13 yrs · Read the full method →

Question

Given dydx=y2xy2+x\dfrac{dy}{dx}=\dfrac{y^2-x}{y^2+x} with initial condition y=1y=1 at x=0x=0. Find the value of yy for x=0.4x=0.4 by Euler’s method, correct to 4 decimal places, taking step length h=0.1h=0.1.

Technique

Euler’s method (forward, first-order). Four steps of h=0.1h=0.1 from x=0x=0 to x=0.4x=0.4.

Solution

Euler’s recurrence. With f(x,y)=y2xy2+xf(x,y)=\dfrac{y^{2}-x}{y^{2}+x} and h=0.1h=0.1, the iteration is

xn+1=xn+h,yn+1=yn+hf(xn,yn).x_{n+1}=x_n+h,\qquad y_{n+1}=y_n+h\,f(x_n,y_n).

Starting from (x0,y0)=(0,1)(x_0,y_0)=(0,1), perform four steps to reach x=0.4x=0.4.

Step 1 — From (0,1)(0,1) to (0.1,y1)(0.1,y_1)

f(0,1)=101+0=1.0000.f(0,1)=\dfrac{1-0}{1+0}=1.0000. y1=1+0.1(1.0000)=1.1000.y_1=1+0.1(1.0000)=1.1000.

Step 2 — From (0.1,1.1000)(0.1,1.1000) to (0.2,y2)(0.2,y_2)

y12=1.2100y_1^{2}=1.2100. f(0.1,1.1)=1.21000.11.2100+0.1=1.11001.3100=0.84733.f(0.1,1.1)=\dfrac{1.2100-0.1}{1.2100+0.1}=\dfrac{1.1100}{1.3100}=0.84733. y2=1.1000+0.1(0.84733)=1.1847.y_2=1.1000+0.1(0.84733)=1.1847.

Step 3 — From (0.2,1.1847)(0.2,1.1847) to (0.3,y3)(0.3,y_3)

y22=1.4035y_2^{2}=1.4035 (since 1.18472=1.403521.1847^{2}=1.40352\ldots). f(0.2,1.1847)=1.40350.21.4035+0.2=1.20351.6035=0.75055.f(0.2,1.1847)=\dfrac{1.4035-0.2}{1.4035+0.2}=\dfrac{1.2035}{1.6035}=0.75055. y3=1.1847+0.1(0.75055)=1.2598.y_3=1.1847+0.1(0.75055)=1.2598.

Step 4 — From (0.3,1.2598)(0.3,1.2598) to (0.4,y4)(0.4,y_4)

y32=1.5871y_3^{2}=1.5871 (since 1.25982=1.587081.2598^{2}=1.58708\ldots). f(0.3,1.2598)=1.58710.31.5871+0.3=1.28711.8871=0.68205.f(0.3,1.2598)=\dfrac{1.5871-0.3}{1.5871+0.3}=\dfrac{1.2871}{1.8871}=0.68205. y4=1.2598+0.1(0.68205)=1.3280.y_4=1.2598+0.1(0.68205)=1.3280.

Summary table

nnxnx_nyny_nf(xn,yn)f(x_n,y_n)hfh\cdot f
00.01.00001.000000.10000
10.11.10000.847330.08473
20.21.18470.750550.07506
30.31.25980.682050.06821
40.41.3280

Answer

  y(0.4)1.3280.  \boxed{\;y(0.4)\approx 1.3280.\;}
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.