Integration for radial equations: $\int \limits _0 ^r \big( 2u-Au^2 \big) e^{-Au} du$ I have a Physics problem however I have an issue with an integration midway through my question.
I have 
$$\int \limits _0 ^r \big( 2u-Au^2 \big) e^{-Au} du .$$ 
Where A is a constant
I have tried integrating this which I thought was straight forward at first but the solution is very different to my answer 
Can someone walk me through this integration please?
 A: You have to integrate by parts twice, i.e. to use the formula
$$\int \limits _0 ^r f'(u) g(u) \Bbb d u = f(r) g(r) - f(0) g(0) - \int \limits _0 ^r f(u) g' (u) \Bbb d u .$$
The first time, take $f' = \Bbb e ^{-Au}$ (so that $f = \frac {\Bbb e ^{-Au}} {-A}$), and $g = 2u - Au^2$ to obtain
$$\int \limits _0 ^r (2u - Au^2) \Bbb e ^{-Au} \Bbb d u = (2r - Ar^2) \frac {\Bbb e ^{-Ar}} {-A} - 0 - \int \limits _0 ^r (2 - 2Au) \frac {\Bbb e ^{-Au}} {-A} \Bbb d u = \\ \frac {(Ar^2 - 2r) \Bbb e ^{-Ar}} A + \frac 2 A \int \limits _0 ^r (1 - Au) \Bbb e ^{-Au} \Bbb d u .$$
The second time, take $g = 1 - Au$ and proceed as above to obtain
$$\int \limits _0 ^r (1 - Au) \Bbb e ^{-Au} \Bbb d u = (1 - Ar) \frac {\Bbb e ^{-Ar}} {-A} - \frac 1 {-A} - \int \limits _0 ^r (-A) \frac {\Bbb e ^{-Au}} {-A} \Bbb d u = \frac {1 - (1 - Ar) \Bbb e ^{-Ar}} A - \int \limits _0 ^r \Bbb e ^{-Au} \Bbb d u = \frac {1 - (1 - Ar) \Bbb e ^{-Ar}} A - \frac {\Bbb e ^{-Au}} {-A} \bigg| _0 ^r = \frac {1 - (1 - Ar) \Bbb e ^{-Ar}} A - (\frac {\Bbb e ^{-Ar}} {-A} - \frac 1 {-A}) = \frac {1 - (1 - Ar) \Bbb e ^{-Ar} + \Bbb e ^{-Ar} - 1} A = r \Bbb e ^{-Ar} .$$
Plugging this latest result in the previous one, you get that your integral is $\color{blue} {r^2 \Bbb e ^{-Ar}}$.
