Recall the geometric sum,
![\displaystyle \sum_(k=0)^(n-1) x^k = (1-x^k)/(1-x)](https://img.qammunity.org/2023/formulas/mathematics/college/4kbt7t55ppf8ap7l2blofqebu8h038qgtk.png)
It follows that
![1 - x + x^2 - x^3 + \cdots + x^(2020) = (1 + x^(2021))/(1 + x)](https://img.qammunity.org/2023/formulas/mathematics/college/g5psm8zu77p45spjevt5yn4vuk6gm99y4v.png)
So, we can rewrite the integral as
![\displaystyle \int_0^\infty (x^2 + 1)/(x^4 + x^2 + 1) (\ln(1 + x^(2021)) - \ln(1 + x))/(\ln(x)) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/u0jso7il00dnq4eyl00s7cwscp9pn5bm1y.png)
Split up the integral at x = 1, and consider the latter integral,
![\displaystyle \int_1^\infty (x^2 + 1)/(x^4 + x^2 + 1) (\ln(1 + x^(2021)) - \ln(1 + x))/(\ln(x)) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/oifu0klbtj27xql3744ag2h4ck1mb4wgkt.png)
Substitute
to get
![\displaystyle \int_0^1 \frac{\frac1{x^2} + 1}{\frac1{x^4} + \frac1{x^2} + 1} \frac{\ln\left(1 + \frac1{x^(2021)}\right) - \ln\left(1 + \frac1x\right)}{\ln\left(\frac1x\right)} \, (dx)/(x^2)](https://img.qammunity.org/2023/formulas/mathematics/college/w5np664pefax0jwy6sdodzgsc9v0gen54q.png)
Rewrite the logarithms to expand the integral as
![\displaystyle - \int_0^1 (1+x^2)/(1+x^2+x^4) (\ln(x^(2021)+1) - \ln(x^(2021)) - \ln(x+1) + \ln(x))/(\ln(x)) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/3i55tl9ill2ggkieac7mnmsmejbqxz7ut6.png)
Grouping together terms in the numerator, we can write
![\displaystyle -\int_0^1 (1+x^2)/(1+x^2+x^4) (\ln(x^(2020)+1)-\ln(x+1))/(\ln(x)) \, dx + 2020 \int_0^1 (1+x^2)/(1+x^2+x^4) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/hknudn83o43hx8ey8rx1s9kqnxl6lfxyhf.png)
and the first term here will vanish with the other integral from the earlier split. So the original integral reduces to
![\displaystyle \int_0^\infty (1+x^2)/(1+x^2+x^4) (\ln(1-x+\cdots+x^(2020)))/(\ln(x)) \, dx = 2020 \int_0^1 (1+x^2)/(1+x^2+x^4) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/opb5xyuvfxu51uitfkl347tj5y01esizmk.png)
Substituting
again shows this integral is the same over (0, 1) as it is over (1, ∞), and since the integrand is even, we ultimately have
![\displaystyle \int_0^\infty (1+x^2)/(1+x^2+x^4) (\ln(1-x+\cdots+x^(2020)))/(\ln(x)) \, dx = 2020 \int_0^1 (1+x^2)/(1+x^2+x^4) \, dx \\\\ = 1010 \int_0^\infty (1+x^2)/(1+x^2+x^4) \, dx \\\\ = 505 \int_(-\infty)^\infty (1+x^2)/(1+x^2+x^4) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/jljvqmc0d5smwgn619tqi7o3sz4ub23hxe.png)
We can neatly handle the remaining integral with complex residues. Consider the contour integral
![\displaystyle \int_\gamma (1+z^2)/(1+z^2+z^4) \, dz](https://img.qammunity.org/2023/formulas/mathematics/college/b6queb7g0pcxgxre8p1rui60wbojdmcv8p.png)
where γ is a semicircle with radius R centered at the origin, such that Im(z) ≥ 0, and the diameter corresponds to the interval [-R, R]. It's easy to show the integral over the semicircular arc vanishes as R → ∞. By the residue theorem,
![\displaystyle \int_(-\infty)^\infty (1+x^2)/(1+x^2+x^4)\, dx = 2\pi i \sum_\zeta \mathrm{Res}\left((1+z^2)/(1+z^2+z^4), z=\zeta\right)](https://img.qammunity.org/2023/formulas/mathematics/college/jgq9jz3eyv71kyhwr96trccu8r5nigo6k6.png)
where
denotes the roots of
that lie in the interior of γ; these are
. Compute the residues there, and we find
![\displaystyle \int_(-\infty)^\infty (1+x^2)/(1+x^2+x^4) \, dx = (2\pi)/(\sqrt3)](https://img.qammunity.org/2023/formulas/mathematics/college/v0sjlhcjz7mhjgqcqxbqcoiiq3ephsepfg.png)
and so the original integral's value is
![505 * (2\pi)/(\sqrt3) = \boxed{(1010\pi)/(\sqrt3)}](https://img.qammunity.org/2023/formulas/mathematics/college/5igeytkljtp1u8jj9xil306rqf96g8uqko.png)