← 2026 Paper 1

UPSC 2026 Maths Optional Paper 1 Q8a — Step-by-Step Solution

15 marks · Section B

Method of variation of parameters · ODEs · asked 12× in 14 yrs · Read the full method →

Question

Solve d2ydx2+a2y=sec⁡ax\dfrac{d^2y}{dx^2} + a^2 y = \sec ax by the method of variation of parameters.

Technique

Variation of parameters on a constant-coefficient equation whose RHS (sec⁡ax\sec ax) is outside the reach of undetermined coefficients. Write the complementary function yc=c1cos⁡ax+c2sin⁡axy_c = c_1\cos ax + c_2\sin ax, form the Wronskian W=aW = a, and apply

yp=−y1 ⁣∫ ⁣y2RW dx  +  y2 ⁣∫ ⁣y1RW dx.y_p = -y_1\!\int\!\frac{y_2 R}{W}\,dx \;+\; y_2\!\int\!\frac{y_1 R}{W}\,dx .

The two integrals collapse to ∫tan⁡ax dx\int\tan ax\,dx and ∫dx\int dx — this is exactly why the method is prescribed.

Solution

Step 1 — Complementary function

The homogeneous equation is y′′+a2y=0y'' + a^2 y = 0, with auxiliary equation

m2+a2=0⟹m=±ia.m^2 + a^2 = 0 \quad\Longrightarrow\quad m = \pm ia .

Hence

yc=c1cos⁡ax+c2sin⁡ax,y1=cos⁡ax,y2=sin⁡ax.y_c = c_1\cos ax + c_2\sin ax,\qquad y_1 = \cos ax,\quad y_2 = \sin ax .

Step 2 — Wronskian

W=∣y1y2y1′y2′∣=∣cos⁡axsin⁡ax−asin⁡axacos⁡ax∣=acos⁡2ax+asin⁡2ax=a.W = \begin{vmatrix} y_1 & y_2 \\ y_1' & y_2'\end{vmatrix} = \begin{vmatrix} \cos ax & \sin ax \\ -a\sin ax & a\cos ax\end{vmatrix} = a\cos^2 ax + a\sin^2 ax = a .

Since W=a≠0W = a \neq 0, y1,y2y_1,y_2 are independent and the method applies. The equation is already in the standard form y′′+Py′+Qy=Ry'' + Py' + Qy = R (the coefficient of y′′y'' is 11), so

R=sec⁡ax.R = \sec ax .

Step 3 — Set up variation of parameters

Seek yp=u1(x) y1+u2(x) y2y_p = u_1(x)\,y_1 + u_2(x)\,y_2 with the usual constraint u1′y1+u2′y2=0u_1'y_1 + u_2'y_2 = 0. The pair of equations

u1′y1+u2′y2=0,u1′y1′+u2′y2′=Ru_1'y_1 + u_2'y_2 = 0,\qquad u_1'y_1' + u_2'y_2' = R

solves by Cramer’s rule to

u1′=−y2RW=−sin⁡ax sec⁡axa=−tan⁡axa,u2′=y1RW=cos⁡ax sec⁡axa=1a.u_1' = -\frac{y_2 R}{W} = -\frac{\sin ax\,\sec ax}{a} = -\frac{\tan ax}{a}, \qquad u_2' = \frac{y_1 R}{W} = \frac{\cos ax\,\sec ax}{a} = \frac{1}{a}.

Note how the sec⁡ax\sec ax is consumed in both slots — this is the whole point of the method here.

Step 4 — The two integrations

u1=−1a∫tan⁡ax dx=−1a⋅(−1alog⁡∣cos⁡ax∣)=1a2log⁡∣cos⁡ax∣,u_1 = -\frac{1}{a}\int \tan ax\,dx = -\frac{1}{a}\cdot\left(-\frac{1}{a}\log|\cos ax|\right) = \frac{1}{a^2}\log|\cos ax| ,

using ∫tan⁡ax dx=−1alog⁡∣cos⁡ax∣\displaystyle\int\tan ax\,dx = -\tfrac1a\log|\cos ax|.

u2=1a∫dx=xa.u_2 = \frac{1}{a}\int dx = \frac{x}{a}.

(Arbitrary constants of integration are omitted here; they merely reproduce ycy_c.)

Step 5 — Particular integral

yp=u1y1+u2y2=1a2cos⁡ax log⁡∣cos⁡ax∣+xasin⁡ax.y_p = u_1 y_1 + u_2 y_2 = \frac{1}{a^2}\cos ax\,\log|\cos ax| + \frac{x}{a}\sin ax .

Direct check of Step 5. With u=1a2cos⁡ax Lu = \frac{1}{a^2}\cos ax\,L, L=log⁡∣cos⁡ax∣L=\log|\cos ax|, L′=−atan⁡axL' = -a\tan ax:

u′=−1asin⁡ax L−1asin⁡ax,u′′=−cos⁡ax L+sin⁡2axcos⁡ax−cos⁡ax,u' = -\frac{1}{a}\sin ax\,L - \frac{1}{a}\sin ax,\qquad u'' = -\cos ax\,L + \frac{\sin^2 ax}{\cos ax} - \cos ax,

so u′′+a2u=sin⁡2ax−cos⁡2axcos⁡axu'' + a^2u = \dfrac{\sin^2 ax - \cos^2 ax}{\cos ax}. With v=xasin⁡axv = \frac{x}{a}\sin ax: v′′+a2v=2cos⁡axv'' + a^2 v = 2\cos ax. Adding,

yp′′+a2yp=sin⁡2ax−cos⁡2ax+2cos⁡2axcos⁡ax=1cos⁡ax=sec⁡ax.✓y_p'' + a^2 y_p = \frac{\sin^2 ax - \cos^2 ax + 2\cos^2 ax}{\cos ax} = \frac{1}{\cos ax} = \sec ax. \checkmark

Step 6 — Complete solution and domain

y=c1cos⁡ax+c2sin⁡ax+1a2cos⁡ax log⁡∣cos⁡ax∣+xasin⁡ax.y = c_1\cos ax + c_2\sin ax + \frac{1}{a^2}\cos ax\,\log|\cos ax| + \frac{x}{a}\sin ax .

The RHS sec⁡ax\sec ax is undefined where cos⁡ax=0\cos ax = 0, so the solution is valid on any interval free of the points ax=(2k+1)π2ax = (2k+1)\tfrac{\pi}{2}, i.e. x≠(2k+1)π2ax \neq \dfrac{(2k+1)\pi}{2a}, k∈Zk\in\mathbb{Z}. On such an interval ∣cos⁡ax∣|\cos ax| has one sign and the logarithm is well defined.

Answer

  y=c1cos⁡ax+c2sin⁡ax+1a2cos⁡ax log⁡∣cos⁡ax∣+xasin⁡ax,cos⁡ax≠0.  \boxed{\;y = c_1\cos ax + c_2\sin ax + \frac{1}{a^{2}}\cos ax\,\log\lvert\cos ax\rvert + \frac{x}{a}\sin ax,\qquad \cos ax \neq 0.\;}
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 — 14 years, mapped. Get the take-away PDF free.