Answer
$$\int (r^2+r+1)e^rdr=e^r(r^2-r+2)+C$$
Work Step by Step
$$A=\int (r^2+r+1)e^rdr$$
Set $u=r^2+r+1$ and $dv=e^rdr$
Then we have $du=(2r+1)dr$ and $v=e^r$
Using the formula $\int udv= uv-\int vdu$:
$$A=(r^2+r+1)e^r-\int(2r+1)e^rdr$$
Set $u=2r+1$ and $dv=e^rdr$
Then we have $du=2dr$ and $v=e^r$
Using the formula $\int udv= uv-\int vdu$:
$$A=(r^2+r+1)e^r-\Big((2r+1)e^r-2\int e^rdr\Big)$$ $$A=(r^2+r+1)e^r-(2r+1)e^r+2e^r+C$$ $$A=e^r(r^2+r+1-2r-1+2)+C$$ $$A=e^r(r^2-r+2)+C$$