The complementary solution is yc= c1cosx +c2sinx.
Let the particular solution be of the form
yp = u1 y1+ u2 y2 where y1= cosx and y2= sinx
Then solving the system
u1' y1 + u2' y2 = 0
u1' y1'+ u2' y2' = secx cscx
we get u2' =− ( cscx) ⇒ u2= - ln |cscx +cotx |
and u1' = −secx ⇒ u1 = −ln| secx + tanx |
Then the final solution is y = yc +yp = c1cosx +c2sinx − cosx ln| secx + tanx | − sinx ln |cscx +cotx |