how could I evaluate this integral $$\int\frac{\sin^2{x}}{1+e^x}\,dx$$
First, I break the integral apart then get:
$$\int\frac{1-\cos^2{x}}{1+e^x}\,dx$$
I know how to calculate $$\int\frac{1}{1+e^x}\,dx$$ but not $$\int\frac{\cos^2{x}}{1+e^x}\,dx$$
can anyone give me a hint to do it?
Thanks.
 A: There is no elementary antiderivative. The best you can do is to write it in terms of hypergeometric functions.  See Wolfram Alpha.
A: As Robert Israel answered, there is no way to get something simple (remember that hypergoemtric functions corresponds to infinite sums).
If you need to compute the integral, you can perform a Taylor expansion of the integrand and integrate each term; this would give for example $$\int\frac{\sin^2{x}}{1+e^x}\,dx=\frac{x^3}{6}-\frac{x^4}{16}-\frac{x^5}{30}+\frac{5
   x^6}{288}+\frac{x^7}{315}-\frac{29 x^8}{11520}-\frac{x^9}{5670}+\frac{127
   x^{10}}{483840}+\frac{x^{11}}{155925}-\frac{691
   x^{12}}{29030400}-\frac{x^{13}}{6081075}+O\left(x^{14}\right)$$ Suppose that the integration has to be done $0$ and $1$; the exact value is close to $0.08892217$ while the above expansion yields to $0.08892025$.
A: 
How could I evaluate this integral ?

You can't. Even its definite equivalent does not possess a particularly interesting closed form:
$$\int_0^\infty\frac{\sin^2x}{1+e^x}dx=\frac{\ln2}2+\frac{\psi_0\bigg(\dfrac12+i\bigg)+\psi_0\bigg(\dfrac12-i\bigg)}8-\frac{\psi_0\big(1+i\big)+\psi_0\big(1-i\big)}8$$
If there would have been a minus sign in each of the two numerators above, we could have easily applied the reflection formula for the digamma function, but, as it stands, our hands are tied. The above expression was obtained by using Euler's formula along with the simple substitution $u=e^x$ to rewrite the integral in terms of generalized harmonic numbers, and then employing the relation between the latter and the afore-mentioned polygamma function.
A: $\int\dfrac{\sin^2x}{1+e^x}dx$
$=\int\dfrac{1-\cos2x}{2(1+e^x)}dx$
$=\int\dfrac{1}{2(1+e^x)}dx-\int\dfrac{\cos2x}{2(1+e^x)}dx$
Case $1$: $x\leq0$
Then $\int\dfrac{1}{2(1+e^x)}dx-\int\dfrac{\cos2x}{2(1+e^x)}dx$
$=\int\dfrac{e^{-x}}{2(e^{-x}+1)}dx-\int\sum\limits_{n=0}^\infty\dfrac{(-1)^ne^{nx}\cos2x}{2}dx$
$=-\int\dfrac{d(e^{-x}+1)}{2(e^{-x}+1)}-\int\sum\limits_{n=0}^\infty\dfrac{(-1)^ne^{nx}\cos2x}{2}dx$
$=-\dfrac{\ln(e^{-x}+1)}{2}-\sum\limits_{n=0}^\infty\dfrac{(-1)^ne^{nx}(2\sin2x+n\cos2x)}{2(n^2+4)}+C$ (can be obtained from http://en.wikipedia.org/wiki/List_of_integrals_of_exponential_functions)
Case $2$: $x\geq0$
Then $\int\dfrac{1}{2(1+e^x)}dx-\int\dfrac{\cos2x}{2(1+e^x)}dx$
$=\int\dfrac{e^{-x}}{2(e^{-x}+1)}dx-\int\dfrac{e^{-x}\cos2x}{2(e^{-x}+1)}dx$
$=-\int\dfrac{d(e^{-x}+1)}{2(e^{-x}+1)}-\int\sum\limits_{n=0}^\infty\dfrac{(-1)^ne^{-(n+1)x}\cos2x}{2}dx$
$=-\dfrac{\ln(e^{-x}+1)}{2}-\sum\limits_{n=0}^\infty\dfrac{(-1)^ne^{-(n+1)x}(2\sin2x-(n+1)\cos2x)}{2((n+1)^2+4)}+C$ (can be obtained from http://en.wikipedia.org/wiki/List_of_integrals_of_exponential_functions)
