← 2023 Paper 1

UPSC 2023 Maths Optional Paper 1 Q5a — Step-by-Step Solution

10 marks · Section B

Linear first-order · ODEs · asked 5× in 13 yrs · Read the full method →

Question

Obtain the solution of the initial-value problem dydx2xy=2\dfrac{dy}{dx}-2xy=2, y(0)=1y(0)=1 in the form

y=ex2[1+πerf(x)].y=e^{x^2}\bigl[1+\sqrt\pi\,\operatorname{erf}(x)\bigr].

Technique

Linear ODE with integrating factor ex2e^{-x^2}; integrate the RHS to introduce the error function erf\operatorname{erf}.

Solution

Step 1 — Linear ODE; find integrating factor.

The ODE is y2xy=2y'-2xy=2, a first-order linear ODE.

Integrating factor: μ(x)=exp(2xdx)=ex2\mu(x)=\exp(-\int 2x\,dx)=e^{-x^2}.

Multiply through:

ex2dydx2xex2y=2ex2ddx(ex2y)=2ex2.e^{-x^2}\frac{dy}{dx}-2x e^{-x^2}y=2 e^{-x^2}\Rightarrow \frac{d}{dx}\bigl(e^{-x^2}y\bigr)=2e^{-x^2}.

Step 2 — Integrate.

ex2y=2ex2dx+C.e^{-x^2}y=\int 2 e^{-x^2}\,dx+C.

Recall erf(x)=2π0xet2dt\operatorname{erf}(x)=\dfrac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt. So 2ex2dx=πerf(x)+const\int 2e^{-x^2}\,dx=\sqrt\pi\,\operatorname{erf}(x)+\text{const}.

Therefore ex2y=πerf(x)+Ce^{-x^2}y=\sqrt\pi\,\operatorname{erf}(x)+C.

Step 3 — Apply initial condition y(0)=1y(0)=1.

At x=0x=0: e01=1=πerf(0)+C=0+Ce^0\cdot 1=1=\sqrt\pi\cdot\operatorname{erf}(0)+C=0+C, so C=1C=1.

Hence

y=ex2[πerf(x)+1]=  ex2[1+πerf(x)].  y=e^{x^2}\bigl[\sqrt\pi\,\operatorname{erf}(x)+1\bigr]=\boxed{\;e^{x^2}\bigl[1+\sqrt\pi\,\operatorname{erf}(x)\bigr].\;}
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.