Answer
$$y(x)=\frac{1}{m+n} e^{m x}+C e^{-n x} ,\ \ \ n\neq -m$$
$$y= xe^{-nx}+Ce^{-nx},\ \ \ \ n=-m $$
Work Step by Step
Given$$y^{\prime}+n y=e^{mx}$$
This is a linear equation with $p(x) =n, \ \ q(x) =e^{mx} $, so
\begin{align*}
\mu(x)&=e^{\int p(x)dx}\\
&=e^{\int nd x}\\
&=e^{nx}
\end{align*}
Then
\begin{align*}
y\mu(x) &=\int \mu(x)q(x)dx\\
e^{nx} y &=\int e^{nx}e^{mx}dx\\
&=\int e^{(n+m)x}dx\\
&=\frac{1}{n+m}e^{(n+m)x}+C
\end{align*}
Then if $n\neq-m$ $$y(x)=\frac{1}{m+n} e^{m x}+C e^{-n x} $$
If $n=-m $
$$ e^{nx} y = x+C\ \ \ \to \ \ y= xe^{-nx}+Ce^{-nx} $$