1. ## indefinite integral #2

Challenge Problem:

$\int \frac{x+x^{2}}{(1+x+e^{x})^{2}} \ dx$

Moderator approved CB

2. $\int \frac{x^2+x}{(1+x+e^x)^2} ~dx$

Sub. $u = 1+e^{-x}(1+x)$

$du = e^{-x}(1 - 1 - x ) dx = - xe^{-x} dx$

The integral

$= - \int \frac{e^{-x}(1+x)}{(1+e^{-x}(1+x) )^2} ( -xe^{-x}~dx)$

$= - \int \frac{ u-1}{u^2}~du$

$= - \ln|u| - \frac{1}{u} + C$

$= - \ln| 1+e^{-x}(1+x)| - \frac{e^x }{1+x+e^x} + C$

$= x - \ln|1+x+e^x| - \frac{e^x}{1+x+e^x} + C$

EDIT: Surely , they differ by a constant $\frac{x+1}{1+x+e^x} - ( - \frac{e^x}{1+x+e^x} ) = \frac{1+x+e^x}{1+x+e^x} = 1$

3. Unless $\frac{x+1}{1+x+e^{x}}$ and $-\frac{e^{x}}{1+x+e^{x}}$ differ by a constant, something is wrong with your solution. Perhaps the way you rewrote the integrand.

4. Originally Posted by Random Variable
Unless $\frac{x+1}{1+x+e^{x}}$ and $-\frac{e^{x}}{1+x+e^{x}}$ differ by a constant, something is wrong with your solution. Perhaps the way you rewrote the integrand.
$\displaystyle \left(\frac{x+1}{1+x+e^{x}}\right)' = -\frac{xe^x}{(x+e^x+1)^2} = \left(-\frac{e^{x}}{1+x+e^{x}}\right)'$, so they do differ by a constant.