\(\int e^x\left(2-x\right)dx\)
\(\left\{{}\begin{matrix}u=2-x\\dv=e^xdx\end{matrix}\right.\Rightarrow\left\{{}\begin{matrix}du=-dx\\v=e^x\end{matrix}\right.\)
\(\Rightarrow\int e^x\left(2-x\right)dx=e^x\left(2-x\right)+\int e^xdx=e^x\left(2-x\right)+e^x\)