#f(x)=int(xe^(x+2)-x)dx=intxe^(x+2)dx-intxdx=I-x^2/2#, where,
#I=intxe^(x+2)dx#.
To evaluate #I#, we use the Rule of Integration by Parts :
#intuvdx=uintvdx-int[(du)/dxintvdx]dx#.
We take, #u=x rArr (du)/dx=1#, and,
#v=e^(x+2) rArr intvdx=e^(x+2)#. Hence,
#I=xe^(x+2)-inte^(x+2)dx=xe^(x+2)-e^(x+2)#
#:. f(x)=xe^(x+2)-e^(x+2)-x^2/2+C...........(1)#.
To determine #C#, we use the cond. #: f(-1)=2# in #(1)#.
#:. -e-e-1/2+C=2 rArr C=5/2+2e#. Therefore, #(1)# gives,
#f(x)=xe^(x+2)-e^(x+2)-x^2/2+5/2+2e#.
Enjoy Maths.!