Answer
$$\int (x^2-2x+1)e^{2x}dx=\frac{e^{2x}}{4}(2x^2-6x+5)+C$$
Work Step by Step
$$A=\int (x^2-2x+1)e^{2x}dx$$
Set $u=x^2-2x+1$ and $dv=e^{2x}dx$
Then we would have $du=(2x-2)dx=2(x-1)dx$ and $v=\frac{1}{2}e^{2x}$
Using the formula $\int udv= uv-\int vdu$:
$$A=\frac{1}{2}e^{2x}(x^2-2x+1)-\int\Big(\frac{1}{2}e^{2x}\times2(x-1)dx\Big)$$ $$A=\frac{e^{2x}(x-1)^2}{2}-\int(x-1)e^{2x}dx$$
Set $u=x-1$ and $dv=e^{2x}dx$
Then we would have $du=dx$ and $v=\frac{1}{2}e^{2x}$
Using the formula $\int udv= uv-\int vdu$:
$$A=\frac{e^{2x}(x-1)^2}{2}-\Big(\frac{1}{2}e^{2x}(x-1)-\frac{1}{2}\int e^{2x}dx\Big)$$ $$A=\frac{e^{2x}(x^2-2x+1)}{2}-\Big(\frac{e^{2x}(x-1)}{2}-\frac{e^{2x}}{4}\Big)+C$$ $$A=\frac{e^{2x}(x^2-2x+1)}{2}-\frac{e^{2x}(x-1)}{2}+\frac{e^{2x}}{4}+C$$ $$A=\frac{e^{2x}}{4}(2x^2-4x+2-2x+2+1)+C$$ $$A=\frac{e^{2x}}{4}(2x^2-6x+5)+C$$