Answer
$$\int (x^2-5x)e^xdx=e^x(x^2-7x+7)+C$$
Work Step by Step
$$A=\int (x^2-5x)e^xdx$$
Set $u=x^2-5x$ and $dv=e^xdx$
Then we have $du=(2x-5)dx$ and $v=e^x$
Using the formula $\int udv= uv-\int vdu$:
$$A=(x^2-5x)e^x-\int(2x-5)e^xdx$$
Set $u=2x-5$ and $dv=e^xdx$
Then we have $du=2dx$ and $v=e^x$
Using the formula $\int udv= uv-\int vdu$:
$$A=(x^2-5x)e^x-\Big((2x-5)e^x-2\int e^xdx\Big)$$ $$A=(x^2-5x)e^x-(2x-5)e^x+2e^x+C$$ $$A=e^x(x^2-5x-2x+5+2)+C$$ $$A=e^x(x^2-7x+7)+C$$