Integrate $\int_{-\infty}^{\infty} \frac{e^{2020x}-e^{x}}{x\left(e^{2020x}+1\right)\left(e^x+1\right)} \mathop{dx}$ A challenge problem says integrate $$\int_{-\infty}^{\infty} \frac{e^{2020x}-e^{x}}{x\left(e^{2020x}+1\right)\left(e^x+1\right)} \mathop{dx}$$
I thought $u=-x$ helps but I get $I$ so it is even.  I also try partial fraction to $$\int_{-\infty}^{\infty} -\frac{1}{x\left(e^{2020x}+1\right)} + \frac{1}{x\left(e^{x}+1\right)} \mathop{dx}$$
Now what?  Help please thanks
 A: Let $f(x) =\frac1{e^x+1}$. Then
\begin{align}
&\int_{-\infty}^{\infty} \frac{e^{2020x}-e^{x}}{x\left(e^{2020x}+1\right)\left(e^x+1\right)} \mathop{dx}\\
= & \>2\int_{0}^{\infty} \frac{e^{2020x}-e^{x}} {x\left(e^{2020x}+1\right)\left(e^x+1\right)} \mathop{dx} \\
= & \>2\int_{0}^{\infty} \frac{f(x)-f(2020x)}x dx \\
= & \>2[f(0)-f(\infty)] \ln \frac{2020}1\\
=&\> \ln 2020
\end{align}
where the Frullani integral is applied.
A: Instead of trying to use partial fraction decomposition, how about try to introduce a parameter, $a$, inside the integral?  Sometimes when there are integrals with strange numbers, like $2020$ in this case, the integral can be generalized.
$$I(a)=\int_{-\infty}^{\infty} \frac{e^{ax}-e^x}{x\left(e^{ax}+1\right) \left(e^x+1\right)} \; \mathrm{d}x$$
Now, factor out the terms independent of $a$, and differentiate both sides with respect to $a$:
\begin{align*}
I'(a)&=\int_{-\infty}^{\infty} \frac{1}{x \left(e^x+1\right)} \cdot \frac{x e^{ax}\left(e^{ax}+1\right)-xe^{ax}\left(e^{ax}-e^x\right)}{{\left(e^{ax}+1\right)}^2} \; \mathrm{d}x \\
&=\int_{-\infty}^{\infty} \frac{e^{ax}}{{\left(e^{ax}+1\right)}^2} \; \mathrm{d}x \\
&=-\frac{1}{a\left(e^{ax}+1\right)} \bigg \rvert_{-\infty}^{\infty} \\
&=\frac{1}{a}\\
\end{align*}
Integrate both sides with respect to $a$:
$$I(a)=\ln{a}+C$$
Notice that  $I(1)=0$.
$$0=\ln{1}+C \implies C=0$$
Therefore, the integral you posted evaluates to:
$$I(2020)=\boxed{\ln{2020}}$$
