I wish to find the solution of the differential equation:
$$y''+y=\sec(x)$$
I know how to solve it using variation of parameters but I was wondering if it is possible to solve using undetermined coefficients.
Finding the homogeneous solution is easy, but is it possible to guess a private solution?
not that easy with variation of constant but direct integration is the easiest $$y''+y=\sec(x)$$ $$y''\cos(x)-y'\sin(x)+y'\sin(x)+y\cos(x)=1$$ $$y'\cos(x)+y\sin(x)=x+K$$ $$(\frac y{\cos(x)})'=\frac {x+K}{\cos^2(x)}$$ $$\left (\frac y{\cos(x)}\right )=\int \frac {x+K}{\cos^2(x)}dx$$ $$y(x)=\cos(x)\int \frac {x}{\cos^2(x)}dx+K_1\sin(x)+K_2\cos(x)$$ $$y(x)=\cos(x)(x\tan(x)+\ln(\cos(x)))+K_1\sin(x)+K_2\cos(x)$$ $$y(x)=x\sin(x)+\cos(x)\ln(\cos(x))+K_1\sin(x)+K_2\cos(x)$$
Maybe the method with variation of constant will work with a correct substitution first...