← 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 d 2 y d x 2 + a 2 y = sec a x \dfrac{d^2y}{dx^2} + a^2 y = \sec ax d x 2 d 2 y + a 2 y = sec a x by the method of variation of parameters.
Technique
Variation of parameters on a constant-coefficient equation whose RHS (sec a x \sec ax sec a x ) is outside the reach of undetermined coefficients. Write the complementary function y c = c 1 cos a x + c 2 sin a x y_c = c_1\cos ax + c_2\sin ax y c = c 1 cos a x + c 2 sin a x , form the Wronskian W = a W = a W = a , and apply
y p = − y 1 ∫ y 2 R W d x + y 2 ∫ y 1 R W d x . y_p = -y_1\!\int\!\frac{y_2 R}{W}\,dx \;+\; y_2\!\int\!\frac{y_1 R}{W}\,dx . y p = − y 1 ∫ W y 2 R d x + y 2 ∫ W y 1 R d x .
The two integrals collapse to ∫ tan a x d x \int\tan ax\,dx ∫ tan a x d x and ∫ d x \int dx ∫ d x — this is exactly why the method is prescribed.
Solution
Step 1 — Complementary function
The homogeneous equation is y ′ ′ + a 2 y = 0 y'' + a^2 y = 0 y ′′ + a 2 y = 0 , with auxiliary equation
m 2 + a 2 = 0 ⟹ m = ± i a . m^2 + a^2 = 0 \quad\Longrightarrow\quad m = \pm ia . m 2 + a 2 = 0 ⟹ m = ± ia .
Hence
y c = c 1 cos a x + c 2 sin a x , y 1 = cos a x , y 2 = sin a x . y_c = c_1\cos ax + c_2\sin ax,\qquad y_1 = \cos ax,\quad y_2 = \sin ax . y c = c 1 cos a x + c 2 sin a x , y 1 = cos a x , y 2 = sin a x .
Step 2 — Wronskian
W = ∣ y 1 y 2 y 1 ′ y 2 ′ ∣ = ∣ cos a x sin a x − a sin a x a cos a x ∣ = a cos 2 a x + a sin 2 a x = 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 . W = y 1 y 1 ′ y 2 y 2 ′ = cos a x − a sin a x sin a x a cos a x = a cos 2 a x + a sin 2 a x = a .
Since W = a ≠ 0 W = a \neq 0 W = a = 0 , y 1 , y 2 y_1,y_2 y 1 , y 2 are independent and the method applies. The equation is already in the standard form y ′ ′ + P y ′ + Q y = R y'' + Py' + Qy = R y ′′ + P y ′ + Q y = R (the coefficient of y ′ ′ y'' y ′′ is 1 1 1 ), so
R = sec a x . R = \sec ax . R = sec a x .
Step 3 — Set up variation of parameters
Seek y p = u 1 ( x ) y 1 + u 2 ( x ) y 2 y_p = u_1(x)\,y_1 + u_2(x)\,y_2 y p = u 1 ( x ) y 1 + u 2 ( x ) y 2 with the usual constraint u 1 ′ y 1 + u 2 ′ y 2 = 0 u_1'y_1 + u_2'y_2 = 0 u 1 ′ y 1 + u 2 ′ y 2 = 0 . The pair of equations
u 1 ′ y 1 + u 2 ′ y 2 = 0 , u 1 ′ y 1 ′ + u 2 ′ y 2 ′ = R u_1'y_1 + u_2'y_2 = 0,\qquad u_1'y_1' + u_2'y_2' = R u 1 ′ y 1 + u 2 ′ y 2 = 0 , u 1 ′ y 1 ′ + u 2 ′ y 2 ′ = R
solves by Cramer’s rule to
u 1 ′ = − y 2 R W = − sin a x sec a x a = − tan a x a , u 2 ′ = y 1 R W = cos a x sec a x a = 1 a . 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}. u 1 ′ = − W y 2 R = − a sin a x sec a x = − a tan a x , u 2 ′ = W y 1 R = a cos a x sec a x = a 1 .
Note how the sec a x \sec ax sec a x is consumed in both slots — this is the whole point of the method here.
Step 4 — The two integrations
u 1 = − 1 a ∫ tan a x d x = − 1 a ⋅ ( − 1 a log ∣ cos a x ∣ ) = 1 a 2 log ∣ cos a x ∣ , 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| , u 1 = − a 1 ∫ tan a x d x = − a 1 ⋅ ( − a 1 log ∣ cos a x ∣ ) = a 2 1 log ∣ cos a x ∣ ,
using ∫ tan a x d x = − 1 a log ∣ cos a x ∣ \displaystyle\int\tan ax\,dx = -\tfrac1a\log|\cos ax| ∫ tan a x d x = − a 1 log ∣ cos a x ∣ .
u 2 = 1 a ∫ d x = x a . u_2 = \frac{1}{a}\int dx = \frac{x}{a}. u 2 = a 1 ∫ d x = a x .
(Arbitrary constants of integration are omitted here; they merely reproduce y c y_c y c .)
Step 5 — Particular integral
y p = u 1 y 1 + u 2 y 2 = 1 a 2 cos a x log ∣ cos a x ∣ + x a sin a x . y_p = u_1 y_1 + u_2 y_2 = \frac{1}{a^2}\cos ax\,\log|\cos ax| + \frac{x}{a}\sin ax . y p = u 1 y 1 + u 2 y 2 = a 2 1 cos a x log ∣ cos a x ∣ + a x sin a x .
Direct check of Step 5. With u = 1 a 2 cos a x L u = \frac{1}{a^2}\cos ax\,L u = a 2 1 cos a x L , L = log ∣ cos a x ∣ L=\log|\cos ax| L = log ∣ cos a x ∣ , L ′ = − a tan a x L' = -a\tan ax L ′ = − a tan a x :
u ′ = − 1 a sin a x L − 1 a sin a x , u ′ ′ = − cos a x L + sin 2 a x cos a x − cos a x , 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, u ′ = − a 1 sin a x L − a 1 sin a x , u ′′ = − cos a x L + cos a x sin 2 a x − cos a x ,
so u ′ ′ + a 2 u = sin 2 a x − cos 2 a x cos a x u'' + a^2u = \dfrac{\sin^2 ax - \cos^2 ax}{\cos ax} u ′′ + a 2 u = cos a x sin 2 a x − cos 2 a x . With v = x a sin a x v = \frac{x}{a}\sin ax v = a x sin a x : v ′ ′ + a 2 v = 2 cos a x v'' + a^2 v = 2\cos ax v ′′ + a 2 v = 2 cos a x . Adding,
y p ′ ′ + a 2 y p = sin 2 a x − cos 2 a x + 2 cos 2 a x cos a x = 1 cos a x = sec a x . ✓ 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 y p ′′ + a 2 y p = cos a x sin 2 a x − cos 2 a x + 2 cos 2 a x = cos a x 1 = sec a x . ✓
Step 6 — Complete solution and domain
y = c 1 cos a x + c 2 sin a x + 1 a 2 cos a x log ∣ cos a x ∣ + x a sin a x . y = c_1\cos ax + c_2\sin ax + \frac{1}{a^2}\cos ax\,\log|\cos ax| + \frac{x}{a}\sin ax . y = c 1 cos a x + c 2 sin a x + a 2 1 cos a x log ∣ cos a x ∣ + a x sin a x .
The RHS sec a x \sec ax sec a x is undefined where cos a x = 0 \cos ax = 0 cos a x = 0 , so the solution is valid on any interval free of the points a x = ( 2 k + 1 ) π 2 ax = (2k+1)\tfrac{\pi}{2} a x = ( 2 k + 1 ) 2 π , i.e. x ≠ ( 2 k + 1 ) π 2 a x \neq \dfrac{(2k+1)\pi}{2a} x = 2 a ( 2 k + 1 ) π , k ∈ Z k\in\mathbb{Z} k ∈ Z . On such an interval ∣ cos a x ∣ |\cos ax| ∣ cos a x ∣ has one sign and the logarithm is well defined.
Answer
y = c 1 cos a x + c 2 sin a x + 1 a 2 cos a x log ∣ cos a x ∣ + x a sin a x , cos a x ≠ 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.\;} y = c 1 cos a x + c 2 sin a x + a 2 1 cos a x log ∣ cos a x ∣ + a x sin a x , cos a x = 0.