\definecolor{ffqqqq}{rgb}{1,0,0}
\definecolor{qqwuqq}{rgb}{0,0.39215686274509803,0}
\definecolor{qqzzff}{rgb}{0,0.6,1}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-2,
xmax=6,
ymin=-0.2,
ymax=3,
xtick={-2,-1,...,6},
ytick={0,0.5,...,3},]
\clip(-2,-0.5) rectangle (6,3);
\draw[line width=1pt,color=qqwuqq,smooth,samples=100,domain=-2:6] plot(\x,{(\x*\x + 2*\x + 1) * exp(-\x)});
\end{axis}
\end{tikzpicture}
\end{center}