Answer
\begin{aligned}
\int( r^2+r+1) e^{r} d x= e^{r}(r^2-r+2)+C
\end{aligned}
Work Step by Step
Given $$\int( r^{2}+r+1) e^{r}d r $$
So, we have
\begin{array}{|c c c c|}\hline & Differentiation && {Integration} \\
\hline
+ \quad \rightarrow&r^2+r+1 & & e^{r} \\
&&\searrow&\\ \hline
- \quad \rightarrow& 2r+1 & &e^{r} \\
&&\searrow&\\ \hline
+ \quad \rightarrow&2& &e^{r} \\
&&\searrow&\\ \hline
&0 & &e^{r} \\
&&\\ \hline
\end{array}
Therefore
\begin{aligned}
I&=\int( r^2+r+1) e^{r} d x\\
&=( r^2+r+1)e^{r}-( 2r +1)e^{r}+2e^{r}\\
&= e^{r}(r^2-r+2)+C
\end{aligned}