9

I was doing a problem and I encountered two integrals which have the same value and would like to know if this is pure coincidence or if there is a reason for this:

$1)$ $$\int_0^{\pi/4}\ln(1+\tan x)\mathrm dx$$

$2)$ $$\int_0^{\pi/4}\frac{x}{\cos x(\cos x+\sin x)}\mathrm dx$$

I am aware that the solution for the second integral is $\ln(1+\tan x)$ from $0$ to $\frac\pi4$; so, is it the case that the first integral’s solution is the same as the the function evaluated between the limits for a geometric reason or something else?

Integreek
  • 9,507
  • Welcome to MSE. Please use MathJax to write maths in your post rather than using images. – Robin May 01 '25 at 20:56
  • The second integral is not $\ln(1+\tan x)$. – azif00 May 01 '25 at 20:58
  • @azif00 the solution is if you use the f(a-x)=f(x) rule for the integral then sum the two integrals – Nicholas Mootoo May 01 '25 at 21:23
  • 2
    Both integrals are equal to $(\pi/8)\ln(2)$. This is not the same as $\ln(1+\tan x)$ evaluated from $0$ to $\pi/4$. Or I misunderstood your question? – azif00 May 01 '25 at 23:01
  • oh yes my bad i was just wondering why they gave the same value my apologies – Nicholas Mootoo May 02 '25 at 01:13
  • You mean the product of $\frac\pi4$ and $\ln(1+\tan x)$ evaluated from $0$ to $\frac\pi4$? Because applying the property $\int_a^bf(x)\mathrm dx=\int_a^bf(a+b-x)\mathrm dx$ to the second integral gives $$\frac\pi4\int_0^{\pi/4}\frac{\mathrm dx}{\cos x(\cos x+\sin x)}=\frac\pi4\int_0^{\pi/4}\mathrm d\left(\ln(1+\tan x)\right)$$ – Integreek May 02 '25 at 14:04

3 Answers3

16

In the first integral, substitute $x\to\dfrac\pi4-x$:

$$\begin{align*} I = \int_0^\tfrac\pi4 \log(1+\tan x) \, dx &= \int_0^\tfrac\pi4 \log\left(1+\frac{1-\tan x}{1+\tan x}\right)\,dx \\ &= \frac\pi4 \log2 - \int_0^\tfrac\pi4 \log(1+\tan x)\,dx \end{align*}$$

Take the second integral by parts:

$$\begin{align*} J = \int_0^\tfrac\pi4 \frac x{\cos x(\cos x+\sin x)} \, dx& = \int_0^\tfrac\pi4 x \, d[\log(1+\tan x)] \\ &= \frac\pi4\log2 - \int_0^\tfrac\pi4 \log(1+\tan x) \, dx \end{align*}$$

user170231
  • 27,172
2

In general, if

$$\begin{align}\int_a^bf(x)dx&=\int_a^bxf’(x)dx\\&=xf(x)\bigg|^b_a-\int^b_af(x)dx\\\implies\int^b_af(x)dx&=\frac{bf(b)-af(a)}2\end{align}$$

which is true for $f(x)=\ln(1+\tan x)$, $a=0$ and $b=\frac\pi4$; hence the given relation.

1

Let $$\begin{align*} I &= \int_0^\tfrac\pi4 \log(1+\tan x) \, dx,\\ J &= \int_0^\tfrac\pi4 \frac x{\cos x(\cos x+\sin x)} \, dx. \end{align*}$$ Then $$\begin{align*} I-J &= \int_0^\tfrac\pi4 \bigg[\log(1+\tan x)-\frac x{\cos x(\cos x+\sin x)}\bigg] \, dx\\ & \overset{x\to\frac\pi4}= \int_0^\tfrac\pi4\bigg[\log(1+\tan (\frac\pi 4-x))-\frac{\frac\pi 4-x}{\cos(\frac\pi 4-x)(\cos(\frac\pi 4-x)+\sin(\frac\pi 4-x))}\bigg]\,dx \\ &=\int_0^\tfrac\pi4 \bigg[\log2-\log(1+\tan x)-\frac{\frac\pi 4-x} {\cos x(\cos x+\sin x)}\bigg] \, dx\\ &=\frac\pi4\log2-\frac{\pi}{4}\int_0^\tfrac\pi4\frac{1}{\cos x(\cos x+\sin x)}\,dx-(I-J)\\ &=\frac\pi4\log2-\frac{\pi}{4}\log\bigg(\frac{\cos x+\sin x}{\cos x}\bigg)\bigg|_0^{\frac\pi4}-(I-J)\\ &=-(I-J) \end{align*}$$ and hence $I=J$.

xpaul
  • 49,485