Investigating integrals of the form $\int \frac{f(x)dx}{1+e^x}$ For the past few days, I have been trying to work out, in generality the integral
$$\int \frac{f(x)dx}{1+e^x}$$ Where $f(x)$ is a general polynomial function.
The case $f(x)=1$ is trivial, but for other $f(x)$, it isn't so. Let me take an example of $f(x)=x$, and show my approach,
$$\int \frac{x dx}{1+e^x}$$
Put $x=it$, (Where $i=\sqrt{-1}$)
$$\implies \int \frac{x dx}{1+e^x}=-\int \frac{t dt}{1+e^{it}}$$
$$=-\int \frac{t dt}{2\cos{\frac{t}{2}}\cdot e^{it/2}}$$
$$=-\frac{1}{2}\int t\cdot \sec{\frac{t}{2}}\cdot e^{-it/2}dt$$
$$=-\frac{1}{2}\int tdt+\frac{i}{2}\int t\tan{\frac{t}{2}}dt$$
The first one is trivial, But the second one, that is something which has been giving me nightmares. Although I suspect that no closed form exists(?) But still could anyone help?
Also, putting $x=it$ in the original integral was the best approach that I could think of, could anyone give another way of doing this? 
P.S : Please don't tell me it can't be done in terms of elementary functions :(
 A: I do not guarantee that this is valid since I won't be justifying the interchange of summation and integration. 
You can use the expansion $\dfrac{1}{1+x}=\sum (-1)^nx^n$ to get
$$\frac{1}{1+e^x}=\frac{1}{1+e^x}\cdot \frac{e^{-x}}{e^{-x}}=\frac{e^{-x}}{1+e^{-x}}=e^{-x}\sum _{n=0}^{\infty}(-1)^ne^{-nx}=\sum _{n=1}^{\infty}(-1)^{n+1}e^{-nx}$$
This gives
$$I(x)=\int \frac{f(x)}{1+e^x}dx=\int f(x)\sum _{n=1}^{\infty}(-1)^{n+1}e^{-nx}dx=\sum _{n=1}^{\infty}(-1)^{n+1}\int f(x)e^{-nx}dx$$
If $f(x)$ is a polynomial, then $f(x)=a_kx^k+\cdots +a_0=\sum _ia_ix^i$ and the integral reduces to
$$I(x)=\sum _{n=1}^{\infty}\sum _{i=0}^ka_i(-1)^{n+1}\int x^ie^{-nx}dx$$

This would be a good initial point for calculating a definite integral over $[0,\infty )$ since
$$\int _0^{+\infty }x^ie^{-nx}dx=\frac{1}{n^{i+1}}\int _0^{+\infty }t^ie^{-t}dt=\frac{i!}{n^{i+1}},$$
and therefore
$$I=\sum _{n=1}^{\infty}\sum _{i=0}^ka_i(-1)^{n+1}\frac{i!}{n^{i+1}}=\sum _{i=0}^ka_ii!\sum _{n=1}^{\infty}\frac{(-1)^{n+1}}{n^{i+1}}=\sum _{i=0}^ki!a_i\eta (i+1),$$
where $\eta (i)$ is the alternating Riemann zeta function (sometimes called Dirichlet eta function). Using a simple relation $\eta (i)=(1-2^{1-i})\zeta (i)$ we have
$$I=\sum _{i=0}^ki!a_i(1-2^{-i})\zeta (i+1)$$

Reverting back to the indefinite case. For $f(x)=x$ we have $a_1=1$ and all other $a_i$'s zero and thus
$$I(x)=\sum _{n=1}^{\infty}(-1)^{n+1}\int xe^{-nx}dx=\sum _{n=1}^{\infty}(-1)^{n}\frac{e^{-nx} (1 + nx)}{n^2}$$
Comparing the Wolfram's solution to this one
$$
\begin{align}
F_1(x) &=\frac{x^2}{2}-x \log(1+e^x)-\mathrm{Li} _2(-e^x) \\
F_2(x) &=\sum _{n=1}^{\infty}(-1)^{n}\frac{e^{-nx} (1 + nx)}{n^2}
\end{align}
$$
it can be numerically shown that $F_1(x)$ and $F_2(x)$ differ by a constant factor and therefore $F_2(x)$ is a valid solution for $x\geq 0$ (as $F_2(x)$ diverges otherwise). $F_2(x)$ cannot be elementary since the first term in the sum reduces to $\mathrm{Li}_2$
It remains to be seen if the said integral can be expressed in elementary functions, although I highly doubt it.
