My approach using Wronskian : \(\displaystyle dW(y,e^x )=-dx \; \) ; \(\displaystyle \; W(y,e^x )=C_1 -x \; \) ; \(\displaystyle \; y'e^x -e^{x} y=C_1 -x\).

\(\displaystyle y'-y=C_1 e^{-x} - xe^{-x} \; \) ; \(\displaystyle \; (ye^{-x} )'=C_1 e^{-2x} -xe^{-2x} \; \) ; \(\displaystyle \; ye^{-x} = C_2 -\dfrac{C_1 }{2} e^{-2x}+

\dfrac{\left(2x+1\right)\mathrm{e}^{-2x}}{4}

\).

\(\displaystyle y=C_2 e^{x} -\dfrac{C_1 }{2}e^{-x} +

\dfrac{\left(2x+1\right)\mathrm{e}^{-x}}{4}

\).