For the homogeneous equation,
r² + 1 = 0
r = i or −i
So, the complementary solution is y = C1cost + C2sint
W[y1,y2] =y1y2' − y1'y2 = cos²t + sin²t = 1
u1(x)=−∫(y2(x)g(x)/W)dx
= −∫(sint tant) dt
= sint − ln(tant+sect)
u2(x)=∫(y1(x)g(x)/W)dx
= ∫(cost tant)dt
= ∫sint dt
= −cos t
So, a particualr solution is
y = u1y1+u2y2
=[sint - ln(tant+sect)]cost − costsint
=−ln(tant+sect)cost
So,the general solution is
y = C1cost + C2sint −ln(tant+sect)cost