2

How to solve this integral: $$\int_{0}^{1} \ln(1+x^n)\,dx. $$ The problem doesn't say anything about $n$ so I assume $n\in N$.

Source of the question.

robjohn
  • 345,667
Flo
  • 113
  • 2
    From where is this problem? – Zacky Sep 03 '19 at 18:51
  • It is from an older analysis exam, all it says it's solve this integral. – Flo Sep 03 '19 at 18:53
  • 3
    $u = \ln(1+x^n), dv = dx, du = \frac{nx^{n-1}}{1+x^n}dx, v = x$, integrate by parts gives $\ln(2)-n\int_0^1 \frac{nx^n}{x^n+1}dx$. Do $\int_0^1 \frac{nx^n}{x^n+1}dx = \int_0^1 \frac{nx^n+n-n}{x^n+1}dx = n-n\int_0^1 \frac{1}{x^n+1}dx$. So all you need to do is $\int_0^1 \frac{1}{x^n+1}dx$. – mathworker21 Sep 03 '19 at 18:53
  • 1
    Mathematica yields the incredibly ugly $$-\Phi(-1,1,1+1/n)+\ln(2), $$ if $\operatorname{Re}[(-1)^{1/n}]\ge 1$ or $\operatorname{Re}[(-1)^{1/n}]\le 0$ or $(-1)^{1/n}\not\in\mathbb{R}.$ Also, $n>0.$ Here $\Phi$ is the Hurwitz-Lerch transcendent function. – Adrian Keister Sep 03 '19 at 18:56
  • 1
    I would bet that there should have been a limit in front of that integral. – Zacky Sep 03 '19 at 19:05
  • 1
    @mathworker21: The remaining integral there is highly non-trivial, involving the PolyGamma function. – Adrian Keister Sep 03 '19 at 19:05
  • 1
    $$\int_0^1\sum_{k=1}^\infty(-1)^{k+1}\frac{(x^n)^k}{k}dx=\sum_{k=1}^\infty(-1)^{k+1}\frac{1}{k}\int_0^1x^{nk}dx=\sum_{k=1}^\infty(-1)^{k+1}\frac{1}{k(1+kn)}=\log (2)-\Phi \left(-1,1,1+\frac{1}{n}\right),$$ the last part via partial fractions. – pshmath0 Sep 03 '19 at 19:11
  • @Zacky Well... I double checked, there isn't. – Flo Sep 03 '19 at 19:17
  • @Adrian Keister I've used the gamma and theta functions before but only for simple stuff. I will try to get that to gamma form tomorrow, thank you all for the answers. – Flo Sep 03 '19 at 19:20
  • 1
    @Florin1335 but do you have the original problem? Maybe a photo with it? // Things like: $\lim\limits _{n\to \infty} \int_0^1 \ln(1+x+x^n)dx$ and so on are quite standard for exams I would say. – Zacky Sep 03 '19 at 19:21
  • @Zacky link What can I say half of the exam is theory and then he comes up with stuff like this. – Flo Sep 03 '19 at 19:30
  • 2
    @Florin1335 thanks for the photo! Well, I still believe there's just a typo and the teacher forgot to add the limit. There is no way one would ever mark this integral the same points as for proving that $\ln(1+x)\le x$. In particular I think that inequality was given in order to show (followed by squeezing the limit): $$\int_0^1 \ln(1+x^n)dx\le \int_0^1 x^n dx=\frac{1}{n+1}$$ – Zacky Sep 03 '19 at 19:36
  • 1
    @Zacky You are probably right, thank you. Now I think I should remove this question... – Flo Sep 03 '19 at 19:44
  • In the integrand, replace $x$ with $1-x$, then expand $(1-x)^n$ using binomial theorem. The property here is that $\int_0^a f(x)dx=\int_0^a f(a-x)dx$. – Hussain-Alqatari Sep 03 '19 at 21:46
  • 1
    @Zacky: I have provided more of an answer than I would normally (due to scarcity of context), but since the source is given and the question shown there is possibly out of the scope of the other problems, I think it is safe to answer this question fully, if only to show the complexity of the answer to the stated question. – robjohn Sep 03 '19 at 21:55
  • @robjohn was the ping meant for OP instead of me? // In my opinion I think it's a good thing what you did. OP in particular provided the source and colaborated in comments a lot. He didn't show what he tried, but given the problem one can easily understand why. – Zacky Sep 04 '19 at 14:06
  • It was meant as a comment on the question, but some was for the OP. I didn't think I had addressed it to anyone; sorry for the confusion. – robjohn Sep 04 '19 at 14:17

2 Answers2

5

Prelude with Harmonic Numbers $$ \begin{align} H(x)&=\sum_{k=1}^\infty\left(\frac1k-\frac1{k+x}\right)\tag1\\ \frac12H\!\left(\frac x2\right)&=\sum_{k=1}^\infty\left(\frac1{2k}-\frac1{2k+x}\right)\tag2\\ H(x)-H\!\left(\frac x2\right)&=\sum_{k=1}^\infty(-1)^{k-1}\left(\frac1k-\frac1{k+x}\right)\tag3 \end{align} $$ Explanation:
$(1)$: extension of the Harmonic Numbers to $\mathbb{C}$
$(2)$: compute the series for even indices
$(3)$: compute the alternating series

The Harmonic numbers are related to the Digamma function by $H(x)=\gamma+\psi(1+x)$, where $\gamma$ is the Euler-Mascheroni constant.


The Integral $$ \begin{align} \int_0^1\log\left(1+x^n\right)\,\mathrm{d}x &=\sum_{k=1}^\infty\int_0^1\frac{(-1)^{k-1}x^{nk}}k\,\mathrm{d}x\tag4\\ &=\sum_{k=1}^\infty\frac{(-1)^{k-1}}{k(nk+1)}\tag5\\ &=\sum_{k=1}^\infty(-1)^{k-1}\left(\frac1k-\frac1{k+1/n}\right)\tag6\\[3pt] &=H\!\left(\frac1n\right)-H\!\left(\frac1{2n}\right)\tag7\\[6pt] &=\psi\!\left(1+\frac1n\right)-\psi\!\left(1+\frac1{2n}\right)\tag8 \end{align} $$ Explanation:
$(4)$: apply the Taylor series for $\log(1+x)$
$(5)$: evaluate the integrals
$(6)$: partial fractions
$(7)$: apply $(3)$
$(8)$: give $(7)$ in terms of the Digamma function

Note that using $(7)$ from this answer, we can compute $(7)$ as a finite sum in terms of logs, sines, and cosines.

robjohn
  • 345,667
0

Integrating by parts as suggested by mathworker21 gives

\begin{align}\int\ln(1+x^n)~\mathrm dx&=x\ln(1+x^n)-n\int\frac{x^n}{1+x^n}~\mathrm dx\\&=x\ln(1+x^n)-n\int\frac{1+x^n-1}{1+x^n}~\mathrm dx\\&=x\ln(1+x^n)-nx+\int\frac n{1+x^n}~\mathrm dx\end{align}

where the last bit is given in this answer as a combination of logarithms and arctangents, provided $n\in\mathbb Z$. In a similar manner, rational $n$ can be handled as well. In the case of irrational $n$, one requires special functions, such as the digamma function.