What is f(x) = int xe^x-x dx if f(-1) = 1 ?

Jul 30, 2018

$f \left(x\right) = \frac{2}{e} + {e}^{x} \left(x - 1\right) + \frac{3 - {x}^{2}}{2}$

Explanation:

$f \left(x\right) = 1 + {\int}_{- 1}^{x} \left(t {e}^{t} - t\right) \mathrm{dt}$

as the integral is linear:

$f \left(x\right) = 1 + {\int}_{- 1}^{x} t {e}^{t} \mathrm{dt} - {\int}_{- 1}^{x} t \mathrm{dt}$

Solve the two integrals separately:

${\int}_{- 1}^{x} t \mathrm{dt} = {\left[{t}^{2} / 2\right]}_{- 1}^{x}$

${\int}_{- 1}^{x} t \mathrm{dt} = {x}^{2} / 2 - \frac{1}{2}$

and:

${\int}_{- 1}^{x} t {e}^{t} \mathrm{dt} = {\int}_{- 1}^{x} t \frac{d}{\mathrm{dt}} \left({e}^{t}\right) \mathrm{dt}$

integrating by parts:

${\int}_{- 1}^{x} t {e}^{t} \mathrm{dt} = - {\int}_{- 1}^{x} {e}^{t} \mathrm{dt} + {\left[t {e}^{t}\right]}_{- 1}^{x}$

${\int}_{- 1}^{x} t {e}^{t} \mathrm{dt} = - {\left[{e}^{t}\right]}_{- 1}^{x} + x {e}^{x} + \frac{1}{e}$

${\int}_{- 1}^{x} t {e}^{t} \mathrm{dt} = - {e}^{x} + \frac{1}{e} + x {e}^{x} + \frac{1}{e}$

${\int}_{- 1}^{x} t {e}^{t} \mathrm{dt} = {e}^{x} \left(x - 1\right) + \frac{2}{e}$

Putting together the partial results:

$f \left(x\right) = 1 + {e}^{x} \left(x - 1\right) + \frac{2}{e} - {x}^{2} / 2 + \frac{1}{2}$

$f \left(x\right) = \frac{2}{e} + {e}^{x} \left(x - 1\right) + \frac{3 - {x}^{2}}{2}$