Find the homogeneous linear DE with constant coefficients of least order that has $y = 1 + 2e^{-2x}\cos x$ as a solution. Find the homogeneous linear DE with constant coefficients of least order that
has
$$y = 1 + 2e^{-2x}\cos x$$ 

as a solution.
Your solution function has terms for the eigenvalues $0,-2\pm i$ without polynomial factors for multiplicities, so that your DE can be read off as
$$
(D-0)(D+2+i)(D+2-i)y=0
$$
The general solution of a first order homogeneous DE of the form 
$$ y'(x) + p(x)y = q(x)\tag{1}$$
is given by 
$$ y(x) = \frac{1}{\mu (x)}\int \mu(x) q(x)\tag{2},$$
where $\mu(x) = e^{\int p(x) \ dx}$ is the integrating factor.
\begin{align}
1+2e^{-2x} \cos(x) &amp;= \mu^{-1} (x) \int \mu(x) (0) \ dx = \frac{C}{\mu(x)} \\ \implies&amp; \mu(x) = \frac{C}{1+2e^{-2x}\cos(x)}.
\end{align}
Therefore, 
\begin{align}
 \mu(x) = e^{\int p(x) \ dx} \implies \frac{C}{1+2e^{-2x}\cos(x)} &amp;= e^{\int p(x) \ dx}\\
 \ln\biggl |\frac{C}{1+2e^{-2x}\cos(x)} \biggr| &amp;= \int p(x) \ dx\\
\frac{d}{dt}\ln\biggl |\frac{C}{1+2e^{-2x}\cos(x)} \biggr| &amp;= p(x) \\
\therefore \frac{2\sin(x)+4\cos(x)}{e^{2x}+2\cos(x)} &amp;= p(x).
\end{align}
Finally , using $(1)$, the initial differential equation is 
$$y' + \left(\frac{2\sin(x)+4\cos(x)}{e^{2x}+2\cos(x)} \right)y = 0$$