What is #f(x) = int xe^x-xdx# if #f(0)=-2 #?

2 Answers
Apr 13, 2018

# f(x)=xe^x-e^x-x^2/2-1#.

Explanation:

#f(x)=int(xe^x-x)dx=intx(e^x-1)dx#.

Using the Rule of Integration by Parts (IBP) :

#"IBP :" intuv'dx=uv-intu'vdx#.

We take, #u=x, and, v'=e^x-1#.

#:. u'=1, and, v=intv'dx=int(e^x-1)dx=e^x-x#.

#:. f(x)=x(e^x-x)-int(e^x-x)dx#.

# rArr f(x)=x(e^x-x)-(e^x-x^2/2)+c, or, #

# f(x)=xe^x-e^x-x^2/2+c#.

To determine #c#, we use the condition that, #f(0)=-2#.

#:. 0e^0-e^0-0^2/2+c=-2#.

# :. c=-1#.

# rArr f(x)=xe^x-e^x-x^2/2-1#.

Apr 13, 2018

#=>f(x) = e^x(x-1)-1/2x^2 -1#

Explanation:

#f(x) = int (x e^x - x)dx#

#=>f(x) = int xe^xdx - int x dx#

#=>f(x) = int x e^x dx - 1/2 x^2 + C_2#

where #C_2# is an arbitrary constant of integration.

To solve the first integral, we will employ integration by parts. Let #u equiv x# and #dv equiv e^xdx#.

#int x e^x dx = uv - int v du#

#=>int x e^x dx = xe^x - int e^x dx + C_1#

#=>int xe^x dx = xe^x - e^x + C_1#

#=>int xe^x dx = color(blue)(e^x(x - 1) + C_1)#

where #C_1# is an arbitrary constant of integration.

We can now substitute this result back into our #f(x)#.

#f(x) = color(blue)(e^x(x - 1) + C_1) - 1/2x^2 + C_2#

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

where #C# is an arbitrary constant of integration (#C_1# and #C_2# were arbitrary, so they were combined into a single constant term).

Assessing at #f(0)#:

#f(0) = -2 = e^0(0-1)-1/2(0)^2+C#

#=>-2 = -1 +C#

#=>C = -1#

Hence, the final result is:

#=>color(green)(f(x) = e^x(x-1)-1/2x^2 -1)#