Integration – Evaluating a Complex Double Integral

conjecturesdefinite integralsexpected valuegeometryintegration

In the diagram, $\alpha$ and $\beta$ are independent uniformly random real numbers in $\left(0,\frac{\pi}{2}\right)$.

enter image description here

What is $\mathbb{E}(h)$?

Superimposing a cartesian coordinate system, the equations of the lines are $y=(\tan\alpha)x$ and $y=(-\tan\beta)(x-1)$, so the $y$-coordinate of their intersection is $\frac{(\tan\alpha)(\tan\beta)}{\tan\alpha+\tan\beta}$. So we have

$$\mathbb{E}(h)=\frac{4}{\pi^2}\int_0^{\pi/2}\int_0^{\pi/2}\frac{(\tan\alpha)(\tan\beta)}{\tan\alpha+\tan\beta} d\alpha d\beta$$

Desmos says $I=\int_0^{\pi/2}\int_0^{\pi/2}\frac{(\tan\alpha)(\tan\beta)}{\tan\alpha+\tan\beta} d\alpha d\beta$ is $(0.9999999913…)(\frac{\pi}{2})$. Is that a computer error, and the result is exactly $\frac{\pi}{2}$? I don't know how to evaluate the integral. Wolfram evaluates the inside integral but doesn't evaluate both integrals.

If Desmos is not very reliable, then maybe my earlier weird conjecture is actually true.

(This question was inspired by a question about random points in a square.)

Edit: In the comments, @G.Gare notes that Mathematica says the integral $I$ is exactly $\pi/2$. Can we prove it? Maybe an intuitive geometrical argument?

Edit2: I seek to generalize this result here.

Best Answer

$$I=\int_0^{\pi/2}\int_0^{\pi/2}\frac{(\tan\alpha)(\tan\beta)}{\tan\alpha+\tan\beta} d\alpha d\beta\overset{\binom{\alpha=\arctan x}{\beta=\arctan y}}{=}\int_0^\infty\int_0^\infty\frac{xy}{(1+x^2)(1+y^2)(x+y)}dxdy$$ $$=\int_0^\infty\int_0^\infty\left(\frac1{1+x^2}-\frac1{1+y^2}\right)\frac{xy}{x+y}\frac{dxdy}{y^2-x^2}$$ $$=2\int_0^\infty\int_0^\infty\frac1{1+x^2}\frac{xy}{x+y}\frac{dxdy}{y^2-x^2}\overset{x=ty}{=}2\int_0^\infty dy\int_0^\infty\frac{t\,dt}{(1+t^2y^2)(1-t)(1+t)^2}$$ $$=2\int_0^\infty\frac{t\,dt}{(1-t)(1+t)^2}\int_0^\infty\frac{dy}{1+t^2y^2}$$ $$=\pi\int_0^\infty\frac{dt}{(1-t)(1+t)^2}\overset{x=\frac1t}{=}-\pi\int_0^\infty\frac{x\,dx}{(1-x)(1+x)^2}$$ $$\Rightarrow\,\,2I=\pi\int_0^\infty\frac{dx}{(1+x)^2}\,\,\Rightarrow\,\,I=\frac\pi2$$