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

1 Answer
Aug 12, 2018

I=int(xe^(2-x)-2x^2+2)dx

=intxe^(2-x)dx-2intx^2dx+2int1dx

=intxe^(2-x)dx-2/3x^3+2x

Let X=2-x

x=2-X

dx=-1dX

So:

I=-int(2-X)e^Xdx-2/3x^3+2x

Using integration by parts:
f(X)=(2-X), f'(X)=-1, g'(X)=e^X, g(X)=e^X

So:

I=-(2-X)e^X+int-e^XdX-2/3x^3+2x

I=(X-2)e^X-e^X-2/3x^3+2x

I=-xe^(2-x)-e^(2-x)-2/3x^3+2x+c, c in RR

And knowing that f(0)=2,

c-e^2=2

So:

I=-(x+1)e^(2-x)-2/3x^3+2x+2+e^2