← 2015 Paper 1

UPSC 2015 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

Solve the differential equation:

xcosxdydx+y(xsinx+cosx)=1.x\cos x\,\dfrac{dy}{dx}+y(x\sin x+\cos x)=1.

Technique

Linear first-order ODE; integrating factor μ=exp(Pdx)=xsecx\mu=\exp(\int P\,dx)=x\sec x; after multiplying, the RHS simplifies to sec2x\sec^2 x, integrable by inspection.

Solution

Strategy. Divide by xcosxx\cos x to get standard linear form y+P(x)y=Q(x)y'+P(x)y=Q(x), find integrating factor. Watch for a clever rearrangement — the coefficient xsinx+cosxx\sin x+\cos x is exactly ddx(xsinx)\dfrac{d}{dx}(x\sin x)… let’s check.

Step 1 — Recognise exact form

Note ddx(xsinx)=sinx+xcosx\dfrac{d}{dx}(x\sin x)=\sin x+x\cos x. That’s not quite xsinx+cosxx\sin x+\cos x. But ddx(something involving xsecx)\dfrac{d}{dx}(\text{something involving }x\sec x)? Let’s compute ddx(yxsecx)=xsecxy+y(secx+xsecxtanx)\dfrac{d}{dx}(y\cdot x\sec x)=x\sec x\cdot y'+y(\sec x+x\sec x\tan x). Multiply through by cosx\cos x: not matching directly.

Try the standard approach.

Step 2 — Standard form

Divide by xcosxx\cos x (assuming xcosx0x\cos x\ne 0):

dydx+xsinx+cosxxcosxy=1xcosx.\dfrac{dy}{dx}+\dfrac{x\sin x+\cos x}{x\cos x}\,y=\dfrac{1}{x\cos x}. dydx+(tanx+1x)y=secxx.\dfrac{dy}{dx}+\bigl(\tan x+\tfrac{1}{x}\bigr)y=\dfrac{\sec x}{x}.

So P(x)=tanx+1/xP(x)=\tan x+1/x, Q(x)=secx/xQ(x)=\sec x/x.

Step 3 — Integrating factor

μ(x)=exp ⁣Pdx=exp(tanxdx+1xdx)=exp(lncosx+lnx)=xcosx.\mu(x)=\exp\!\int P\,dx=\exp\bigl(\int\tan x\,dx+\int\tfrac{1}{x}\,dx\bigr)=\exp(-\ln|\cos x|+\ln|x|)=\dfrac{|x|}{|\cos x|}.

Drop absolute values: μ=xcosx=xsecx\mu=\dfrac{x}{\cos x}=x\sec x.

Step 4 — Multiply and integrate

ddx(μy)=μQ=xsecxsecxx=sec2x.\dfrac{d}{dx}(\mu y)=\mu Q=x\sec x\cdot\dfrac{\sec x}{x}=\sec^2 x.

Therefore

μy=sec2xdx=tanx+C.\mu y=\int\sec^2 x\,dx=\tan x+C. xsecxy=tanx+C.x\sec x\cdot y=\tan x+C.

Step 5 — Solve for yy

y=tanx+Cxsecx=cosx(tanx+C)x=sinx+Ccosxx.y=\dfrac{\tan x+C}{x\sec x}=\dfrac{\cos x(\tan x+C)}{x}=\dfrac{\sin x+C\cos x}{x}.

Answer

  y=sinx+Ccosxx.  \boxed{\;y=\dfrac{\sin x+C\cos x}{x}.\;}
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.