Say $f(t) = c_1 + c_2t + c_3t^2$
the given general solution is $$x(t) = fe^t$$
Since you have $3$ arbitrary constants, the required DE must be of order $3$. So you need to differentiate exactly 3 times :
$$\begin{align} x' &= (f'+f)e^t \\ x''&=(f''+2f'+f)e^t \\x'''&=(f''' + 3f''+3f'+f)e^t\end{align}$$
Its trivial to eyeball the required DE : $x'''-3x''+3x'-x=f'''e^t = 0$
$$y'' − 2y' + 5y = e^x \cos(2x)\implies
(D^2-2D+5)y=e^x \cos(2x)\qquad \text{where}\quad D\equiv \frac{d}{dx}$$
For particular integral (P.I.),
P.I.$~=\frac{1}{D^2-2D+5}~e^x \cos(2x)$
$~~~~~~~= ~e^x~\frac{1}{(D+1)^2-2(D+1)+5}~\cos(2x)$
$~~~~~~~= ~e^x~\frac{1}{D^2+4}~\cos(2x)$
$~~~~~~~=~\frac{x}{4}~e^x~\sin(2x)$
So the general solution is $$y(x)= e^x[ C_1\sin(2x)+ C_2\cos(2x) ]~+~\frac{x}{4}~e^x~\sin(2x)\qquad \text{where}\quad C_1,~C_2~\text{are constants.}$$
Note$~ 1:$
For the Particular Integral (i.e., P.I.) there are some general rules
$1.$ $\frac{1}{D + a} \phi (x) = e^{-ax}\int e^{ax}\phi(x)$
$2.$ $\frac{1}{f(D)} e^{ax} \phi(x) = e^{ax}\frac{1}{f(D+a)} \phi(x)$
$3.$ $\frac{1}{f(D)} x^{n} \sin ax = $Imaginary part of $e^{iax}\frac{1}{f(D+ia)} x^n$
$4.$ $\frac{1}{f(D)} x^{n} \cos ax = $Real part of $e^{iax}\frac{1}{f(D+ia)} x^n$
$5.$ $\frac{1}{f(D)} x^{n} (\cos ax + i\sin ax) = \frac{1}{f(D)} x^n e^{iax}=e^{iax}\frac{1}{f(D+ia)} x^n$
Note$~ 2:$
For the Particular Integral (i.e., P.I.) of trigonometric functions you have to follow the following rules:
If $f(D)$ can be expressed as $\phi(D^2)$ and $\phi(-a^2)\neq 0$, then
$1.$ $\frac{1}{f(D)} \sin ax=\frac{1}{\phi(D^2)} \sin ax = \frac{1}{\phi(-a^2)} \sin ax$
$2.$ $\frac{1}{f(D)} \cos ax=\frac{1}{\phi(D^2)} \cos ax = \frac{1}{\phi(-a^2)} \cos ax$
Note: If $f(D)$ can be expressed as $\phi(D^2)=D^2+a^2$, then $\phi(-a^2)= 0$.
$1.$ $\frac{1}{f(D)} \sin ax =\frac{1}{\phi(D^2)} \sin ax=x\frac{1}{\phi'(D^2)} \sin ax= x \frac{1}{2D} \sin ax= -\frac{x}{2a} \cos ax$.
$2.$ $\frac{1}{f(D)} \cos ax =\frac{1}{\phi(D^2)} \cos ax=x\frac{1}{\phi'(D^2)} \cos ax= x \frac{1}{2D} \cos ax= \frac{x}{2a} \sin ax$.
where $\phi'(D^2)\equiv\frac{d}{dD}\phi(D^2)$
Best Answer
$$y=\frac{1}{c_1 \cos x+c_2 \sin x}$$ $$\dfrac 1 y={c_1 \cos x+c_2 \sin x}$$ Substitute $u=1/y$: $$u={c_1 \cos x+c_2 \sin x}$$ $$u''+u=0$$ It's easier now..