To follow up, what I presented implies:
[MATH]x\frac{dy}{dx}=\frac{dy}{dt}[/MATH]
[MATH]x^2\frac{d^2y}{dx^2}=\frac{d^2y}{dt^2}-\frac{dy}{dt}[/MATH]
Making all the substitutions, our ODE becomes:
[MATH]\frac{d^2y}{dt^2}+2\frac{dy}{dt}+5y=e^t\cos(t)[/MATH]
The roots of the auxiliary equation are:
[MATH]r=-1\pm2i[/MATH]
And so the homogeneous solution is:
[MATH]y_h(t)=e^{-t}(c_1\cos(2t)+c_2\sin(2t))[/MATH]
The particular solution will take the form:
[MATH]y_p(t)=e^{t}(A\cos(t)+B\sin(t))[/MATH]
Hence:
[MATH]y_p'(t)=e^t((A+B)\cos(t)+(B-A)\sin(t))[/MATH]
[MATH]y_p''(t)=e^t(2B\cos(t)-2A\sin(t))[/MATH]
Putting these into our ODE we get:
[MATH]e^t(2B\cos(t)-2A\sin(t))+2e^t((A+B)\cos(t)+(B-A)\sin(t))+5e^{t}(A\cos(t)+B\sin(t))=e^t\cos(t)[/MATH]
[MATH](4B+7A)\cos(t)+(7B-4A)\sin(t)=1\cdot\cos(t)+0\cdot\sin(t)[/MATH]
Equating like coefficients, we obtain:
[MATH]4B+7A=1[/MATH]
[MATH]7B-4A=0[/MATH]
Solving this system, we get:
[MATH](A,B)=\left(\frac{7}{65},\frac{4}{65}\right)[/MATH]
And so our particular solution is:
[MATH]y_p(t)=\frac{e^{t}}{65}(7\cos(t)+4\sin(t))[/MATH]
And so by the principle of superposition, we get the general solution:
[MATH]y(t)=y_h(t)+y_p(t)=e^{-t}(c_1\cos(2t)+c_2\sin(2t))+\frac{e^{t}}{65}(7\cos(t)+4\sin(t))[/MATH]
Back-substituting, we obtain the solution to the original ODE:
[MATH]y(x)=\frac{1}{x}(c_1\cos(2\log(x))+c_2\sin(2\log(x)))+\frac{x}{65}(7\cos(\log(x))+4\sin(\log(x)))[/MATH]