\[ y'(x)+y(x) \cos (x)-e^{2 x}=0 \] ✓ Mathematica : cpu = 0.401098 (sec), leaf count = 39
DSolve[-E^(2*x) + Cos[x]*y[x] + Derivative[1][y][x] == 0,y[x],x]
\[\left \{\left \{y(x)\to e^{-\sin (x)} \int _1^xe^{2 K[1]+\sin (K[1])}dK[1]+c_1 e^{-\sin (x)}\right \}\right \}\] ✓ Maple : cpu = 0.13 (sec), leaf count = 21
dsolve(diff(y(x),x)+y(x)*cos(x)-exp(2*x) = 0,y(x))
\[y \left (x \right ) = \left (\int {\mathrm e}^{2 x +\sin \left (x \right )}d x +c_{1}\right ) {\mathrm e}^{-\sin \left (x \right )}\]
Hand solution
\begin {equation} \frac {dy}{dx}+y\left ( x\right ) \cos \left ( x\right ) =e^{2x}\tag {1} \end {equation}
Integrating factor \(\mu =e^{\int \cos \left ( x\right ) dx}=e^{\sin \left ( x\right ) }\). Hence (1) becomes
\[ \frac {d}{dx}\left ( e^{\sin \left ( x\right ) }y\left ( x\right ) \right ) =e^{\sin \left ( x\right ) }e^{2x}\]
Integrating both sides
\begin {align*} e^{\sin \left ( x\right ) }y\left ( x\right ) & =\int e^{\sin \left ( x\right ) }e^{2x}+C\\ y\left ( x\right ) & =e^{-\sin \left ( x\right ) }\int e^{2x+\sin \left ( x\right ) }+Ce^{-\sin \left ( x\right ) } \end {align*}