Answer
\begin{equation}
y=\ c e^{-t}+1+ \frac{t^{2}}{2} e^{-t}
\end{equation}
Work Step by Step
\begin{equation}
y^{\prime}+y=t e^{-t}+1
\end{equation}
we solve this equation by the integrating factor method, finding the integrating factor-
\begin{equation}
\begin{array}{l}
p(t)=1 \\
\mu(t)=e^{\int p(t) d t} \\
\mu(t)=e^{\int 1 d t} \\
\mu(t)=e^{t}
\end{array}
\end{equation}
multiplying integrating factor on both sides
\begin{equation}
\begin{array}{l}
e^{t}\left(y^{\prime}+y\right)=e^{t}\left(t e^{-t}+1\right) \\
e^{t} y^{\prime}+e^{t} y=t e^{t-t}+e^{t} \\
\left(e^{t} y\right)^{\prime}=t+e^{t}
\end{array}
\end{equation}
integrating on both sides
\begin{equation}
\int\left(e^{t} \cdot y\right)^{\prime}=\int\left(t+e^{t}\right) d t
\end{equation} here c is the integration constant
\begin{equation}
\begin{aligned}
e^{t} y &=\frac{t^{2}}{2}+e^{t}+c \\
y &=\frac{t^{2}}{2} e^{-t}+1+c e^{-t}
\end{aligned}
\end{equation}
the above line is the answer