Hi! I grant you ... this is a complicated problem! Bear with me... we'll need to use both u-substitution and partial fractions to get this done! If you want to talk in person, I can explain how I knew to do this ... what I saw in the problem that led me down this path. In the meantime,
First, set u = 1+xe^x
Then, du = e^x * (1+x) dx
xe^x = u-1
In your original problem, multiply top and bottom by e^x to set it up to match your differential. Now, substitute your u expressions to get: Integral of 1 / [(u-1)*u^2] du
To take that integral, you'll need to separate the expression into a sum of terms using partial fractions. (We can talk in depth about how to do that, but this is already getting long, so I'm going to cut it short here. It's much easier to talk than to type!) Once you separate your fractions, you should get that 1 / [(u-1)*u^2] is equivalent to 1/(u-1) - 1/u^2 - 1/u, which we can of course write as 1/(u-1) - u^(-2) - u^(-1) if you'd prefer.
The Integral of [1/(u-1) - u^(-2) - u^(-1)] du is equivalent to Integral of [1/(u-1)] du + Integral of [- u^(-2)] du + Integral of [- u^(-1)] du.
In turn, that equals ln|u-1| + u^(-1) - ln|u| + C
Substitute back in for the u's to get: ln|xe^x| + 1/(1+xe^x) - ln|1+xe^x| + C.
If you want to talk in person, I'd be happy to walk you through a quick way to check yourself on your calculator. :-)
Hope that helps! Catherine