# Compute $\int_{0}^{\pi/4}\ln(1-\sqrt[n]{\tan x})\frac{dx}{\cos^2(x)}$

I am trying to compute this

$$\int_{0}^{\pi/4}\ln(1-\sqrt[n]{\tan x})\frac{\mathrm dx}{\cos^2(x)},\qquad (n\ge1).$$

Making a transformation of $I$ to utilise a sub of $u=1-\sqrt[n]{\tan x}$

\begin{align} I&=\int_{0}^{\pi/4}\frac{\sec^2(x)}{n\sqrt[n]{\tan x}}\cdot n\sqrt[n]{\tan x}\cdot\ln(1-\sqrt[n]{\tan x})\,\mathrm dx \\[6px] &\qquad\mathrm dx=-\frac{n\sqrt[n]{\tan x}}{\sec^2(x)}\,\mathrm du \\[6px] I&=n\int_{0}^{1}(1-u)^{n-1}\ln u \,\mathrm du \end{align}

This can be easily done by integration by parts, but I seem to shruggle in somewhere in evaluating it,

$$\int(1-u)^{n-1}\ln u \,\mathrm du= n(1-u)^n\ln u-\frac{1}{n^2}\int \frac{(1-u)^n}{u}\,\mathrm du$$

Your integral is given by the negative of the $n$-th harmonic number: $$I_n \equiv n \int \limits_0^1 (1-u)^{n-1} \ln (u) \, \mathrm{d} u = - H_n = - \sum \limits_{k=1}^n \frac{1}{k} \, .$$ You can use the substitution $u = 1-t$ and then have a look at this question for a derivation. Here's an alternative route: Use the antiderivative $\frac{t^n - 1}{n}$ of $t^{n-1}$ to integrate by parts directly: \begin{align} I_n &= n \int \limits_0^1 t^{n-1} \ln (1-t) \, \mathrm{d} t = - \int \limits_0^1 \frac{1-t^n}{1-t} \, \mathrm{d} t = - \sum \limits_{k=0}^{n-1} \int \limits_0^1 t^k \, \mathrm{d} t = -\sum \limits_{k=0}^{n-1} \frac{1}{k+1} = - H_n \, . \end{align}

• Integral of $t^{n-1}$ is $\frac{t^n}{n}$.How did you compute $\frac{t^n-1}{n}$? – Dhamnekar Winod Jul 12 '18 at 13:45
• @DhamnekarWinod I just added a constant, so it is still an antiderivative/indefinitie integral. – ComplexYetTrivial Jul 12 '18 at 13:50
• ,When I integrated$n\int_0^1t^{n-1}ln(1-t)$ i got $t^n-1ln(1-t)-\int_0^1\frac{t^n-1}{1-t}$. How did you compute$-\int_0^1\frac{1-t^n}{1-t}$ – Dhamnekar Winod Jul 12 '18 at 14:44
• If you substitute the limits $0$ and $1$ into the first term, $(t^n - 1) \ln (1-t)$, you will find that it vanishes. And in the second term you should get an additional minus sign from the chain rule: $\frac{\mathrm{d}}{\mathrm{d} t} \ln(1-t) = \color{red}{-} \frac{1}{1-t}$ . – ComplexYetTrivial Jul 12 '18 at 15:04

With $u=1-\sqrt[n]{\tan x}$, we get $$\tan x=(1-u)^n$$ so $$\frac{1}{\cos^2x}\,dx=-n(1-u)^{n-1}\,du$$ Thus the integral becomes $$\int_1^0 -n(1-u)^{n-1}\ln u\,du= \int_0^1 n(1-u)^{n-1}\ln u\,du$$ Integrating by parts: $$-(1-u)^n\ln u+\int\frac{(1-u)^n}{u}\,du$$ We have $$\frac{(1-u)^n}{u}=\frac{1}{u}\sum_{k=0}^n(-1)^k\binom{n}{k}u^k$$ so that $$\int\frac{(1-u)^n}{u}\,du= \ln u+\sum_{k=1}^n(-1)^k\binom{n}{k}\frac{u^k}{k}$$ Thus an antiderivative can be written as $$(1-(1-u)^n)\ln u+\sum_{k=1}^n(-1)^k\binom{n}{k}\frac{u^k}{k}$$ The value at $1$ is $$\sum_{k=1}^n(-1)^k\binom{n}{k}\frac{1}{k}$$ The value at $0$ (actually the limit) is $0$.

Don't try and evaluate prematurely the integration by parts, because the part $-(1-u)^n\ln u$ doesn't converge at $0$.

• Shoud it be: $\int\frac{(1-u)^n}{u}\,du= \ln u+\sum_{k=1}^n(-1)^k\binom{n}{k}\frac{u^{k+1}}{k(k+1)}$? – Oldboy Jul 12 '18 at 9:07
• @Oldboy You forgot to fully divide by $u$. – egreg Jul 12 '18 at 9:08
• @egreg Sorry, you're right :) – Oldboy Jul 12 '18 at 9:09
• @ClaudeLeibovici Wolframalpha says the summation is $-\psi(n+1)-\gamma$, with $\psi$ the digamma function and $\gamma$ the Euler-Mascheroni constant. – egreg Jul 12 '18 at 9:12
• @egreg my $\frac{du}{dx}=-\frac{1}{cos^2x*-n*((tanx)^{\frac{n-1}{n}})}$ But your$\frac{du}{dx}$ is different.How is that? – Dhamnekar Winod Jul 12 '18 at 14:54