What is #f(x) = int (x-x^2)e^x dx# if #f(0)=-2 #?

2 Answers
May 7, 2017

#f(x)=e^x(3x-x^2-3)+1#

Explanation:

enter image source here

N.B. Ignore the black writing at the top, I was just doing chem work xD

EDIT: I thought the final line was equated to '0' in my head

C=1

Solution:

First line was just integration by parts. You can see the substitutions in the box labelled (1).

Second line still contained an integrand with a product in it, so you must integrate by parts again (ONLY blue section was integrated by parts). Substitutions in box (2).

3rd through to 6th lines were just simplifying

Final line was plugging in 0, to ascertain the value of the constant that satisfies f(0)=-2

Hope this helped my dude.

Alex

May 7, 2017

#f(x)=e^x(-x^2+3x-3)+1#

Explanation:

I began drafting this answer, left, and returned in the time the other answer was posted. The other solution is correct up until the point when #C# is solved for. The following is another presentation of the same information, with a correct value of #C#:

#f(x)=int(x-x^2)e^xdx#

Use integration by parts. Let:

#{(u=x-x^2,=>,du=(1-2x)dx),(dv=e^xdx,=>,v=e^x):}#

Then:

#f(x)=(x-x^2)e^x-int(1-2x)e^xdx#

#=(x-x^2)e^x+int(2x-1)e^xdx#

Perform integration by parts again, this time letting:

#{(u=2x-1,=>,du=2color(white).dx),(dv=e^xdx,=>,v=e^x):}#

So:

#f(x)=(x-x^2)e^x+(2x-1)e^x-int2e^xdx#

#=(x-x^2)e^x+(2x-1)e^x-2e^x+C#

#=e^x(x-x^2+2x-1-2)+C#

#=e^x(-x^2+3x-3)+C#

Use the initial condition #f(0)=-2#:

#-2=e^0(-3)+C#

#-2=-3+C#

#C=1#

So:

#f(x)=e^x(-x^2+3x-3)+1#