\(\frac{d^2y}{d\mathrm x^2}+y=\tan \mathrm x\)
Its auxiliary equation is
m2 + 1 = 0
⇒ m = \(\pm\)i.
Thus, complementary function of given differential equation is
yh = C1cos x + C2 sin x
let y1 = cos x, y2 = sin x
W(y1, y2) \(=\begin{vmatrix}y_1 & y_2\\y_1' & y_2'\end{vmatrix}\)
\(=\begin{vmatrix}\cos \mathrm x & \sin \mathrm x\\-\sin \mathrm x & \cos \mathrm x\end{vmatrix}\)
\(=\cos^2\mathrm x\mathrm +\sin^2\mathrm x\)
= 1
Now, u1 \(=-\int \frac{y_2\tan \mathrm x}{W(y_1, y_2)}\)
\(=-\int \frac{\sin \mathrm x\tan \mathrm x}{1}d\mathrm x\)
\(=-\int \frac{\sin^2\mathrm x}{\cos\mathrm x}d\mathrm x\)
\(=-\int \frac{1-\cos^2\mathrm x}{\cos\mathrm x}d\mathrm x\)
\(=-\int (\sec\mathrm x-\cos\mathrm x) d\mathrm x\)
\(=-\log (\sec\mathrm x+\tan \mathrm x) +\sin \mathrm x\)
u2 \(=\int \frac{y_1\tan \mathrm x}{W(y_1, y_2)}\)
\(=\int \frac{\cos \mathrm x\frac{\sin \mathrm x}{\cos\mathrm x}}{1}\)
\(=\int \sin \mathrm x\)
\(=-\cos\mathrm x\)
Thus, particular integral is yp = u1y1 + u2y2
= (–log(sec x + tan x) + sin x)cos x + (–cos x)sin x
= –log(sec x + tan x)cos x + sin x + cos x – sin xcos x
= –log(sec x + tan x)cos x
Thus, complete solution is y = yp + yh.
⇒ y = C1cos x + C2sin x – log(sec x + tan x)cos x