Answer
$y=c_1\cos x+c_2 \sin x+(\sin x) \ln (\sec x+\tan x) -1$
Work Step by Step
We are given that $y''+y=\sec^2 x$
The Auxiliary equation is: $r^2+1=0 \implies r=\pm i$
When the roots are imaginary so the complimentary solution is:
$y_c= c_1\cos x+c_2 \sin x$
The particular solution is:
$y_p=u_1\cos x+u_2 \sin x; y'_p=-u_1 \sin x+u_2 \cos x; y_p=(-u'_1\sin x+u'_2 \cos x)+(-u_1\cos x-u_2 \sin x)$
So, we have $u_1=-\sec x; u_2=\ln (\sec x+\tan x) $
Hence, $y=y_c+y_p$
or, $y= c_1\cos x+c_2 \sin x+(\sin x) \ln (\sec x+\tan x) -1$