9

How do I evaluate this integral ? I am a student who just studied calculus 1 and recently definite integral.

$$ \int_{-\infty}^{+\infty} \frac{\ln(1+x^{4})}{1+x^{2}} dx $$

I substituted both $x = \tan t$ and $x = \frac1{t}$ but could not proceed further.

Travis Willse
  • 99,363
SavageTomato
  • 311
  • 7

7 Answers7

10

A polynomial of the form $1+x^{2n}$ can always be written as the product of $n$ quadratic factors of the form $1-2x\cos\theta + x^2$. So that suggests we consider the integral $$ I(\theta) = \int_{-\infty}^\infty \frac{\ln(1-2x\cos\theta+x^2)}{1+x^2}dx. $$ Now, if we differentiate this with respect to $\theta$, we'll get a rational function of $x$, and the integral can then be evaluated through partial fractions: \begin{eqnarray} I'(\theta) &=& \int_{-\infty}^\infty \frac{2x\sin\theta}{(1-2x\cos\theta+x^2)(1+x^2)}dx \\&=&\tan\theta\int_{-\infty}^\infty\left(\frac{1}{1-2x\cos\theta+x^2}- \frac{1}{1+x^2}\right)dx \\ &=& \pi\frac{1-\sin\theta}{\cos\theta}=\pi\frac{\cos\theta}{1+\sin\theta} = \pi\frac{d}{d\theta}\ln(1+\sin\theta). \end{eqnarray} This gives us the $\theta$ dependence of $I$, but we need the value of $I$ at a particular $\theta$ to set the constant of integtration. We can evaluate the case $\theta = \pi/2$ with clever use of trigonometric identities and variable substitutions: \begin{eqnarray} I\left(\frac{\pi}{2}\right)& = &\int_{-\infty}^\infty \frac{\ln(1+x^2)}{1+x^2} = -4\int_{0}^{\pi/2}\ln(\cos\phi)d\phi = -4\int_{0}^{\pi/2}\ln(\sin\phi)d\phi \\ &=& -2\int_0^{\pi}\ln(\sin\phi)d\phi =-4\int_0^{\pi/2}\ln(\sin 2\psi)d\psi = -4\int_0^{\pi/2}\ln(2\sin\psi\cos\psi)d\psi \\ &=& -2\pi\ln 2-4\int_{0}^{\pi/2}\ln(\cos\psi)d\psi-4\int_{0}^{\pi/2}\ln(\sin\psi)d\psi \\ &=& -2\pi\ln 2 + 2I\left(\frac{\pi}{2}\right) \end{eqnarray} Thus $I(\pi/2) = 2\pi \ln2$, and we have $$ I(\theta) = \pi\ln[2(1+\sin\theta)]. $$ From here it's easy to show $$ \int_{-\infty}^\infty \frac{\ln(1+x^4)}{1+x^2}dx = I\left(\frac{\pi}{4}\right) + I\left(\frac{3\pi}{4}\right) = 2\pi\ln(2+\sqrt{2}) $$

eyeballfrog
  • 22,485
  • 1
    @SavageTomato Notice that $\log(1 + x^4) = \log[(x^2 + \sqrt2 x + 1)(x^2 - \sqrt2 x + 1)] = \log (x^2 + \sqrt2 x + 1) + \log (x^2 - \sqrt2 x + 1)$. – Travis Willse Jun 07 '23 at 06:47
9

Factorize $1+x^4= (1+i x^2)(1-ix^2)$ and then utilize the integral $$\int_{-\infty}^\infty \frac{\ln(1+ax^2)}{1+x^2}dx= 2\pi\ln(1+a^{\frac12}) $$ to obtain

\begin{align} \int_{-\infty}^{\infty}\frac{\ln (1+x^{4})}{1+x^2}dx &=\int_{-\infty}^{\infty}\frac{\ln (1+i x^{2})}{1+x^{2}}+\frac{\ln (1-i x^{2})}{1+x^{2}}\ dx\\ &=2\pi \ln\left[(1+i^{\frac12})(1+(-i)^{\frac12})\right]=2\pi\ln (2+\sqrt2) \end{align}

Quanto
  • 97,352
  • 2
    How do you choose the branch cut? –  Jun 06 '23 at 17:00
  • 2
    @GGplay The stated identity holds for real positive $a$ and it carries over by analytic continuation and the only choices of logarithm that make the analytic continuation valid (with regards to the square root) are logarithms which assign the principal arguments to $i$, $-i$. But that's all worth a note in the answer, I agree – FShrike Jun 06 '23 at 17:01
  • How u evaluate the final/last step integral ? – SavageTomato Jun 06 '23 at 17:03
  • 2
    Before applying the referenced formula, you need to demonstrate the analytic continuation, which is much far away beyond the OP's requirement. –  Jun 06 '23 at 17:05
  • 2
    The identity $$ \int_{-\infty}^{+\infty} \dfrac{\ln(1 + ax^2)}{1 + x^2}dx = 2\pi\ln(1 + a^{1/2}) $$ raises more questions than answer imo – Thành Nguyễn Jun 06 '23 at 17:11
  • @ThànhNguyễn To be fair, it can be justified, under a suitable interpretation of $()^{1/2}$ – FShrike Jun 06 '23 at 17:28
  • @SavageTomato -$$\ln\left[(1+i^{\frac12})(1+(-i)^{\frac12})\right] = \ln(2+e^{i\frac\pi 4}+ e^{-i\frac\pi 4})\ =\ln(2+2\cos\frac\pi4)= \ln (2+\sqrt2) $$ – Quanto Jun 06 '23 at 17:31
  • @Quanto no the step before that – SavageTomato Jun 06 '23 at 17:38
  • 1
    @SavageTomato $\int_{-\infty}^{\infty}\frac{\ln (1+i x^{2})}{1+x^{2}}dx=2\pi \ln(1+i^{1/2}) $, $\int_{-\infty}^{\infty}\frac{\ln (1-i x^{2})}{1+x^{2}}dx=2\pi \ln(1+(-i)^{1/2}) $ – Quanto Jun 06 '23 at 18:02
  • 1
    @Quanto thanks for the help. – SavageTomato Jun 06 '23 at 18:09
9

Hint: Under $x=\tan t$, you have \begin{eqnarray} &&\int_{-\infty}^{+\infty} \frac{\ln(1+x^{4})}{1+x^{2}} dx\\ &=&\int_{-\frac\pi2}^{\frac\pi2}\ln(1+\tan^4t)dt\\ &=&\int_{-\frac\pi2}^{\frac\pi2}\ln(\cos^4+\sin^4t)dt-4\int_{-\frac\pi2}^{\frac\pi2}\ln(\cos t)dt\\ &=&\int_{-\frac\pi2}^{\frac\pi2}\ln\bigg(\frac34+\frac14\cos(4t)\bigg)dt-4\int_{-\frac\pi2}^{\frac\pi2}\ln(\cos t)dt\\ &=&\int_{-\frac\pi2}^{\frac\pi2}\ln\bigg(3+\cos(4t)\bigg)dt+2\pi\ln2\\ &=&2\int_{-\pi}^{\pi}\ln(3+\cos t)dt+2\pi\ln2\\ \end{eqnarray} Here $$\int_{-\frac\pi2}^{\frac\pi2}\ln(\cos t)dt=-\pi\ln2 $$ is used. For the first term, you can define $$ I(a)=\int_{-\pi}^{\pi}\ln(a+\cos t)dt, a\ge 1 $$ and then use Feyman's trick to get it. I omit the detail. (Evaluating $\int_{0}^{\pi}\ln (1+\cos x)\, dx$, Evaluate $\int_0^{{\pi}/{2}} \log(1+\cos x)\, dx$)

xpaul
  • 44,000
7

I don't see how to evaluate this integral using the techniques from a typical first integral calculus course.

We'll use two standard techniques: Differentiating under the integral sign, and applying the Residue Theorem to an appropriate contour.

Consider the family $I(a)$ of integrals defined by the $$I(a) = \int_{-\infty}^\infty \frac{\log[1 + (a x)^4]\,dx}{1 + x^2}$$ Our integral is $I(1)$.

Differentiating $I(a)$ with respect to $a$ and rearranging gives $$I'(a) = 4 a^3 \int_{-\infty}^\infty \frac{x^4 \,dx}{(1 + a x^4) (1 + x^2)} = \frac{4 a^3}{1 + a^4} \left[\int_{-\infty}^\infty \frac{dx}{1 + x^2} + \int_{-\infty}^{\infty} \frac{x^2 - 1}{1 + a^4 x^4}\,dx\right]$$

The first integral in brackets is $\arctan x \vert_{-\infty}^\infty = \frac\pi2$. To evaluate the second integral, we could use the method of partial fractions to decompose the integral and the Fundamental Theorem of Calculus, but the antiderivative is messy. So we instead apply the Residue Theorem to a standard semicircular contour $\Gamma_R$. The residues of $f(z) := \frac{z^2 - 1}{1 + a^4 z^4}$ inside $\Gamma_R$ (for large enough $R$) are at $\exp \frac{\pi i}4, \exp \frac{3\pi i}4$: \begin{align} \operatorname{Res}\left(f(z), \frac{\exp\frac{\pi i}{4}}{a}\right) &= \frac{1}{2 \sqrt 2 a^3} \left[(1 + a^2) - (1 - a^2) i\right] \\ \operatorname{Res}\left(f(z), \frac{\exp\frac{3\pi i}{4}}{a}\right) &= \frac{1}{2 \sqrt 2 a^3} \left[-(1 + a^2) - (1 - a^2) i\right] \end{align} So, $$\int_{-\infty}^\infty \frac{x^2 - 1}{1 + a^4 x^4} \,dx = 2 \pi i \sum_{z_i} \operatorname{Res}\left(f(z), z_i\right) = \frac{\pi (1 - a^2)}{\sqrt 2 a^3}.$$ enter image description here

Assembling the above ingredients gives $$I'(a) = 2 \pi \frac{\sqrt 2 + 2 a}{1 + \sqrt 2 a + a^2} ,$$ so our integral has value \begin{multline}\require{cancel} I(1) = I(1) - \cancelto{0}{I(0)} = \int_0^1 I'(a) \,da = 2 \pi \int_0^1 \frac{\sqrt 2 + 2 a}{1 + \sqrt 2 a + a^2} \,da \\ = 2 \pi \log(1 + \sqrt 2 a + a^2)\vert_0^1 = \boxed{2 \pi \log(2 + \sqrt 2)} .\end{multline}

Travis Willse
  • 99,363
3

Using the identity $\ln \left(x^2+y^2\right)=2 \Re(\ln (x+y i))$ to reduce the power $4$ of $x$ in the numerator makes the life easier. $$ \begin{aligned} \int_0^{\infty} \frac{\ln \left(1+x^4\right)}{1+x^2} d x = & \frac{1}{2} \int_{-\infty}^{\infty} \frac{\ln \left(1+x^4\right)}{1+x^2} d x \\ = & \Re\left(\int_{-\infty}^{\infty} \frac{\ln \left(x^2+i\right)}{1+x^2}\right)\\=&\Re \int_{-\infty}^{\infty} \frac{\ln \left(x^2+\left(\frac{1+i}{\sqrt{2}}\right)^2\right)}{1+x^2} \end{aligned} $$ Using the particular case $\int_{-\infty}^{\infty} \frac{\ln \left(x^2+a^2\right)}{1+x^2} d x=2 \pi \ln (1+a)$ in the post, we have $$ \begin{aligned} \int_0^{\infty} \frac{\ln \left(1+x^4\right)}{1+x^2} d x & =\Re\left[2 \pi \ln \left(1+\frac{1+i}{\sqrt{2}}\right)\right] \\ & =2 \pi \Re\left[\ln \left(1+\frac{1}{\sqrt{2}}+\frac{i}{\sqrt{2}}\right)\right]\\ & =\pi \ln \left(1+\frac{1}{2}+\sqrt{2}+\frac{1}{2}\right) \\ & =\pi \ln (2+\sqrt{2}) \end{aligned} $$

Lai
  • 20,421
3

Trigonometric Reduction $$ \begin{align} &\int_0^\infty\frac{\log\left(1+x^4\right)}{1+x^2}\,\mathrm{d}x\\ &=\int_0^{\pi/2}\log\left(1+\tan^4(x)\right)\,\mathrm{d}x\tag{1a}\\ &=\int_0^{\pi/2}\log\left(\cos^4(x)+\sin^4(x)\right)\,\mathrm{d}x-4\int_0^{\pi/2}\log(\cos(x))\,\mathrm{d}x\tag{1b}\\ &=\int_0^{\pi/2}\log\left(1-2\sin^2(x)\cos^2(x)\right)\,\mathrm{d}x-4\int_0^{\pi/2}\log(\cos(x))\,\mathrm{d}x\tag{1c}\\ &=\int_0^{\pi/2}\log\left(1-\frac12\sin^2(2x)\right)\,\mathrm{d}x-4\int_0^{\pi/2}\log(\cos(x))\,\mathrm{d}x\tag{1d}\\ &=\frac12\int_0^\pi\log\left(1-\frac12\sin^2(x)\right)\,\mathrm{d}x-4\int_0^{\pi/2}\log(\cos(x))\,\mathrm{d}x\tag{1e}\\ &=\int_0^{\pi/2}\log\left(1-\frac12\sin^2(x)\right)\,\mathrm{d}x-4\int_0^{\pi/2}\log(\cos(x))\,\mathrm{d}x\tag{1f}\\ &=\int_0^{\pi/2}\log\left(1-\frac12\cos^2(x)\right)\,\mathrm{d}x-4\int_0^{\pi/2}\log(\cos(x))\,\mathrm{d}x\tag{1g}\\ \end{align} $$ Explanation:
$\text{(1a):}$ substitute $x\mapsto\tan(x)$
$\text{(1b):}$ add and subtract the integral of $\log\left(\cos^4(x)\right)$
$\text{(1c):}$ $\cos^4(x)+\sin^4(x)=\left(\cos^2(x)+\sin^2(x)\right)^2-2\sin^2(x)\cos^2(x)$
$\text{(1d):}$ $\sin(2x)=2\sin(x)\cos(x)$
$\text{(1e):}$ substitute $x\mapsto x/2$ in the left integral
$\text{(1f):}$ apply the symmetry of $\sin(x)$ about $\frac\pi2$
$\text{(1g):}$ substitute $x\mapsto\frac\pi2-x$ in the left integral


Computation of the Left Integral $$ \begin{align} &\int_0^{\pi/2}\cos^{2n}(x)\,\mathrm{d}x\tag{2a}\\ &=\int_0^{\pi/2}\cos^{2n-1}(x)\,\mathrm{d}\sin(x)\tag{2b}\\ &=(2n-1)\int_0^{\pi/2}\sin^2(x)\cos^{2n-2}(x)\,\mathrm{d}x\tag{2c}\\ &=(2n-1)\int_0^{\pi/2}\cos^{2n-2}(x)\,\mathrm{d}x-(2n-1)\int_0^{\pi/2}\cos^{2n}(x)\,\mathrm{d}x\tag{2d}\\ &=\frac{2n-1}{2n}\int_0^{\pi/2}\cos^{2n-2}(x)\,\mathrm{d}x\tag{2e} \end{align} $$ Explanation:
$\text{(2b):}$ prepare to integrate by parts
$\text{(2c):}$ integrate by parts
$\text{(2d):}$ $\sin^2(x)=1-\cos^2(x)$
$\text{(2e):}$ add $\frac{2n-1}{2n}$ times $\text{(2a)}$ to $\frac1{2n}$ times $\text{(2c)}$

Apply $(2)$ inductively to obtain $$ \int_0^{\pi/2}\cos^{2n}(x)\,\mathrm{d}x=\frac{\pi/2}{4^n}\binom{2n}{n}\tag3 $$ To apply $(3)$ to the integral, we will use the series $$ \begin{align} \sum_{n=0}^\infty\binom{2n}{n}x^n&=\frac1{\sqrt{1-4x}}\tag{4a}\\ \sum_{n=1}^\infty\binom{2n}{n}x^{n-1}&=\frac4{\sqrt{1-4x}\left(1+\sqrt{1-4x}\right)}\tag{4b}\\ \sum_{n=1}^\infty\frac1n\binom{2n}{n}x^n&=2\log\left(\frac2{1+\sqrt{1-4x}}\right)\tag{4c}\\ \end{align} $$ Explanation:
$\text{(4a):}$ the Extended Binomial Theorem
$\text{(4b):}$ subtract $1$ and divide by $x$
$\text{(4c):}$ integrate using $\frac{\mathrm{d}}{\mathrm{d}x}\sqrt{1-4x}=-\frac2{\sqrt{1-4x}}$

Finally, $$ \begin{align} \int_0^{\pi/2}\log\left(1-\alpha\cos^2(x)\right)\,\mathrm{d}x &=-\sum_{n=1}^\infty\frac{\alpha^n}n\int_0^{\pi/2}\cos^{2n}(x)\,\mathrm{d}x\tag{5a}\\ &=-\sum_{n=1}^\infty\frac{\alpha^n}n\frac{\pi/2}{4^n}\binom{2n}{n}\tag{5b}\\ &=\pi\log\left(\frac{1+\sqrt{1-\alpha}}2\right)\tag{5c} \end{align} $$ Explanation:
$\text{(5a):}$ apply the series for $\log(1-x)$
$\text{(5b):}$ apply $(3)$
$\text{(5c):}$ apply $\text{(4c)}$ with $x=\frac\alpha4$


Computation of the Right Integral

Although we can use $(5)$, with $\alpha=1$, to compute the following integral, the following approach not only displays a different method, but also is more direct and simpler. $$ \begin{align} \int_0^{\pi/2}\log(\cos(x))\,\mathrm{d}x &=\int_0^{\pi/2}\log(\sin(x))\,\mathrm{d}x\tag{6a}\\ &=\frac12\int_0^{\pi/2}\log\left(\frac12\sin(2x)\right)\,\mathrm{d}x\tag{6b}\\ &=\frac12\int_0^{\pi/2}\log\left(\frac12\sin(x)\right)\,\mathrm{d}x\tag{6c}\\[3pt] &=-\frac\pi2\log(2)\tag{6d} \end{align} $$ Explanation:
$\text{(6a):}$ substitute $x\mapsto\frac\pi2-x$
$\text{(6b):}$ average the two sides of $\text{(6a)}$
$\text{(6c):}$ substitute $x\mapsto x/2$
$\phantom{\text{(6c):}}$ apply the symmetry of $\sin(x)$ about $\frac\pi2$
$\text{(6d):}$ subtract $\text{(6a)}$ from two times $\text{(6c)}$


The Complete Integral $$ \begin{align} &\int_{-\infty}^\infty\frac{\log\left(1+x^4\right)}{1+x^2}\,\mathrm{d}x\\ &=2\int_0^\infty\frac{\log\left(1+x^4\right)}{1+x^2}\,\mathrm{d}x\tag{7a}\\ &=2\int_0^{\pi/2}\log\left(1-\frac12\cos^2(x)\right)\,\mathrm{d}x-8\int_0^{\pi/2}\log(\cos(x))\,\mathrm{d}x\tag{7b}\\ &=2\pi\log\left(\frac{2+\sqrt2}4\right)-8\left(-\frac\pi2\log(2)\right)\tag{7c}\\[3pt] &=2\pi\log\left(2+\sqrt2\right)\tag{7d} \end{align} $$ Explanation:
$\text{(7a):}$ the integrand is even
$\text{(7b):}$ apply $\text{(1g)}$
$\text{(7c):}$ apply $(5)$ with $\alpha=\frac12$ and $(6)$
$\text{(7d):}$ simplify

robjohn
  • 345,667
1

$\frac{\ln(x^4+1)}{x^2+1}=\sum_{n=1}^4\frac{\ln(x-w^n)}{x^2+1}$ where $w=e^{\frac{\pi i}{4}}$. Applying the residue theorem with the closed lower semi-circle contour for $n=1,2$ and with the upper one for $n=3,4$, the answer will be $$2\pi i\left(-\sum_{n=1}^2\frac{\ln(-i-w^n)}{-2i}+ \sum_{n=3}^4\frac{\ln(i-w^n)}{2i}\right)= \pi\left(\ln(2+\sqrt2)+\ln(2+\sqrt2)\right)\\=2\pi\ln(2+\sqrt2).$$

Bob Dobbs
  • 10,988
  • I think it's worth mentioning what intervals the arguments live in. Generally, for complex numbers, you can't always split up the logarithm like $\log(ab) = \log(a) + \log(b)$ willy-nilly. And a semi-circle contour doesn't seem to work here because of the branch cuts, if I'm interpreting your answer correctly. – Accelerator Jun 14 '23 at 07:52
  • @Accelerator So do you mean that my answer is accidental? What is the value of $\int_{-\infty}^{\infty}\frac{\ln(x+a)}{x^2+1}dx$? – Bob Dobbs Jun 14 '23 at 19:35
  • I don't know if this answers your second question, but for your first question, it seems like the equality with the two sums could hold, but it depends on what you define the branches and arguments of those logarithms to be. I wouldn't say the answer is accidental but more vague than anything else. – Accelerator Jun 14 '23 at 21:32
  • 1
    After doing some brutal computations, I let $b_k = \exp{\left(i\frac{\pi}{4}(2k+1)\right)}$ where $k \in \left{0,1,2,3\right}$ and got $\operatorname{arg}(z-b_0) \in [\pi/4, 9\pi/4)$, $\operatorname{arg}(z-b_1) \in [3\pi/4, 11\pi/4)$, $\operatorname{arg}(z-b_2) \in (-11\pi/4, -3\pi/4]$, and $\operatorname{arg}(z-b_3) \in (-9\pi/4, -\pi/4]$. So with these, you should be able to add the logarithms comfortably, but then there's also the issue of making the contour deal with the branch cuts. – Accelerator Jun 14 '23 at 21:49