1. ## Integration

I did this integral:

integral(e^x / (1+e^x)^2, x,0,1)

I approached it by expanding denominator and then simplifying. How comes that gives erroneous error.

Ive got e^x / (1+e^x)^2 = e^x + 1/2x - e^-x

then upon integration, taking limits, ive got

e-1/e+1/2

2. You can solve this with a $u$ substitution.

Let $u = 1 + e^x$ so that $\frac{du}{dx} = e^x$.

Then $\int{\frac{e^x}{(1 + e^x)^2}\,dx} = \int{\frac{1}{u^2}\,\frac{du}{dx}\,dx}$

$= \int{u^{-2}\,du}$

$= \frac{u^{-1}}{-1} + C$

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

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