Evaluate $\int_0^{\pi/2} \frac{\ln\left(e^{2x} + 1\right)}{1 + \sin2x}\mathrm dx$

Here's my Xmas gift to all of you! I just encountered a very tough integral. $$\int_{0}^{\pi/2} \frac{\ln\left(e^{2x} + 1\right)}{1 + \sin2x}\mathrm dx$$

I have tried for a few hours. This task is just daunting.

I've been using by-parts bcause that's the only tool I know how to use in this situation. Please educate me on how this integral can be evaluated.

santa Thank you :D


The OP asked for an answer using numerical analysis. Let me first say that even Mathematica and MAPLE do not give exactly the same answers for this integral. MAPLE gives:

F(x) := ln(exp(2*x)+1)/(1+sin(2*x));
evalf(int(F(x),x=0..Pi/2),16);
                                              1.830481056481415
As compared with the value in the comment by Iuʇǝƃɹɐʇoɹ : $1.830481056481482$ .
Then OK, here is a very brute force (and therefore a piece of cake) program:

program numeric;
function F(x : double) : double; begin F := ln(exp(2*x)+1)/(1+sin(2*x)); end;
function lower(N : integer) : double; var k : integer; x,dx,sum : double; begin sum := 0; dx := (Pi/2)/N; for k := 0 to N-1 do begin x := (Pi/2)*k/N+dx/2; { Midpoint rule } sum := sum + F(x)*dx; end; lower := sum; end;
function upper(N : integer) : double; var k : integer; x1,x2,dx,sum : double; begin sum := 0; dx := (Pi/2)/N; x2 := 0; for k := 1 to N do begin x1 := x2; x2 := (Pi/2)*k/N; { Trapezium rule } sum := sum + (F(x1)+F(x2))/2*dx; end; upper := sum; end;
begin Writeln(lower(1000000)); Writeln(upper(1000000)); end.
Output:
 1.83048105648054E+0000
 1.83048105648321E+0000
It helps to make a little sketch of the function $F(x) = \ln(e^{2x}+1)/(1+\sin(2x))$ :

enter image description here

Due to this function behaviour, the Midpoint rule give a lower bound, while the Trapezium rule gives an upper bound for the integral. Thus we find with certainty that: $$ 1.830481056480 < \int_{0}^{\pi/2} \frac{\ln\left(e^{2x} + 1\right)}{1 + \sin2x}\mathrm dx < 1.830481056484 $$ The results with Mathematica and MAPLE are well within these bounds.


Just a method for estimating the integral $$I=\int_{0}^{\pi/2}\frac{\ln(1+e^{2x})}{1+\sin 2x}dx=-\frac{\ln(1+e^{2x})}{1+\tan x}\big|_{0}^{\pi/2}+\int_{0}^{\pi/2}\frac{2e^{2x}}{(1+e^{2x})(1+\tan x)}dx\\=\ln 2+J$$ Now, an estimation of $J$ can be found as below. Note that $\forall x\ge 0,\ e^x/(1+e^x)\le x/4+1/2$. Hence $$J<\int_{0}^{\pi/2}\frac{(x+1)dx}{1+\tan x}=\pi/4+\int_{0}^{\pi/2}\frac{x}{1+\tan x}dx$$ The latter integral is found to be $\approx 0.431066$ from Wolfram alpha. Hence $I<1.90961$.

For a lower bound note that due to concavity for $x>0,\ e^{2x}/(1+e^{2x})>1/2+(2e^\pi/(1+e^\pi)-1)x/\pi \ \forall x\in [0,\pi/2]$. Hence $$J>\int_{0}^{\pi/2}\frac{1+2x(2\dfrac{e^\pi}{1+e^\pi}-1)/\pi}{1+\tan x}dx=\pi/4+2(2\frac{e^\pi}{1+e^\pi}-1)/\pi\times 0.431066$$ Hence $I>1.7302$.

EDIT To defend the "purity" of my answer as demanded by Mr.G, I am giving a solution to the integral $\int_{0}^{\pi/2}\frac{x}{1+\tan x}dx$. This can be evaluated as below $$L=\int_{0}^{\pi/2}\frac{x}{1+\tan x}dx\\=x(x/2+1/2\ln(\sin x +\cos x))\big|_0^{\pi/2}-1/2\int_{0}^{\pi/2}\left[x+\ln(\sin x +\cos x)\right]dx\\ =\pi^2/16-\pi/8\ln 2+\int_{0}^{\pi/4}\ln \sec x dx$$ Now, $$\int_0^{\pi/4}\ln \sec^2 x dx=x\ln (\sec^2 x)\big|_{0}^{\pi/4}-2\int_{0}^{\pi/4}x\tan x dx$$ Let $J=\int_{0}^{\pi/4}x\tan x dx$ and introduce a new integral $K=\int_{0}^{\pi/2} \frac{x}{\tan x}dx$. We can then see after some manipulations that $$2J+K/2=\int_{0}^{\pi/4}\frac{x\sec^2 x}{\tan x} dx\\=\int_{0}^{1}\frac{\tan^{-1}x}{x}dx\\=\sum_{k\ge 0}\frac{(-1)^k}{(2k+1)^2}=:C$$ where $C$ is the Catalan's constant. We will evaluate $K$ using differentiation under integration trick. Define $$K_a=\int_{0}^{\pi/2}\frac{\tan^{-1}(a \tan x)}{\tan x}dx\\\Rightarrow \frac{dK_a}{da}=\int_{0}^{\pi/2}\frac{dx}{(a\tan x)^2+1}\\=\int_{0}^{\infty}\frac{dz}{(1+z^2)(1+a^2z^2)}dz=\frac{\pi}{2(a+1)}\\ \Rightarrow K_a=\frac{\pi}{2}\ln(a+1)$$using $K_0=0$. Then $K=K_1=\frac{\pi}{2}\ln 2$. Hence $$J=C/2-\pi/8\ln 2$$ So, we have $$L=\pi^2/16+\pi/8\ln 2-C/2\approx 0.431066$$