# What is f(x) = int xe^(2-x) + 3x^2 dx if f(0 ) = 1 ?

Jul 7, 2016

$- x {e}^{2 - x} - {e}^{2 - x} + {x}^{3} + 1 + {e}^{2}$

#### Explanation:

Begin by using the sum rule for integrals and splitting these into two separate integrals:
$\int x {e}^{2 - x} \mathrm{dx} + \int 3 {x}^{2} \mathrm{dx}$

The first of these mini-integrals is solved using integration by parts:
Let $u = x \to \frac{\mathrm{du}}{\mathrm{dx}} = 1 \to \mathrm{du} = \mathrm{dx}$
$\mathrm{dv} = {e}^{2 - x} \mathrm{dx} \to \int \mathrm{dv} = \int {e}^{2 - x} \mathrm{dx} \to v = - {e}^{2 - x}$

Now using the integration by parts formula $\int u \mathrm{dv} = u v - \int v \mathrm{du}$, we have:
$\int x {e}^{2 - x} \mathrm{dx} = \left(x\right) \left(- {e}^{2 - x}\right) - \int \left(- {e}^{2 - x}\right) \mathrm{dx}$
$= - x {e}^{2 - x} + \int {e}^{2 - x} \mathrm{dx}$
$= - x {e}^{2 - x} - {e}^{2 - x}$

The second of these is a case of the reverse power rule, which states:
$\int {x}^{n} \mathrm{dx} = \frac{{x}^{n + 1}}{n + 1}$

So $\int 3 {x}^{2} \mathrm{dx} = 3 \left(\frac{{x}^{2 + 1}}{2 + 1}\right) = 3 \left({x}^{3} / 3\right) = {x}^{3}$

Therefore, $\int x {e}^{2 - x} + 3 {x}^{2} \mathrm{dx} = - x {e}^{2 - x} - {e}^{2 - x} + {x}^{3} + C$ (remember to add the constant of integration!)

We are given the initial condition $f \left(0\right) = 1$, so:
$1 = - \left(0\right) {e}^{2 - \left(0\right)} - {e}^{2 - \left(0\right)} + {\left(0\right)}^{3} + C$
$1 = - {e}^{2} + C$
$C = 1 + {e}^{2}$

Making this final substitution, we obtain our final solution:
$\int x {e}^{2 - x} + 3 {x}^{2} \mathrm{dx} = - x {e}^{2 - x} - {e}^{2 - x} + {x}^{3} + 1 + {e}^{2}$