# Integral $\int_{0}^{\pi}\arctan\left(\cot\left(mt\right)\right)\arctan\left(\cot\left(nt\right)\right)dt$

$$\int_{0}^{\pi}\arctan\left(\cot\left(mt\right)\right)\arctan\left(\cot\left(nt\right)\right)dt\stackrel{?}{=}\frac{\pi^{3}}{12}\cdot\frac{\gcd^2\left(m,n\right)}{mn}$$

Using the techniques mentioned in this post: An Astounding Identity $$\int_0^{\pi/2}\ln\lvert\sin(mx)\rvert\cdot \ln\lvert\sin(nx)\rvert\, dx$$

I was able to arrive at the above identity, it does work for smaller values, though needs more confirmation.

Using these techniques we can probably get a whole lot of other identities based on $$\gcd$$.

Can someone prove or disprove the Identity given.
How would we go about solving these without knowing how they were made?

• Can't we write $\arctan(\cot(mt)) = \frac{\pi}{2} - \arctan(\tan(mt)) \, ?$ Aug 25, 2023 at 7:09
• @LuckyChouhan They are indeed equal for some part of the domain but not fully. Aug 25, 2023 at 7:12
• There is an antiderivative Aug 25, 2023 at 7:25
• Maybe writing it in terms of the fractional part or rounding functions will help. Aug 25, 2023 at 12:29

I believe that your conjecture is indeed true, by utilizing similar technique in the linked integral.
To begin with, we have $$\mathrm{arctan} \left( \cot \left( \theta x \right) \right) =\pi \left( \left\{ -\frac{\theta x}{\pi} \right\} -\frac{1}{2} \right)$$ Now, by using the fourier expansion of the fractional part from $$\left[-\pi,\pi\right]$$. We may exclude the points that would be problematic for this expansion ($$\left\{ x\in \mathbb{R} \mid \theta x\in \pi \mathbb{Z} \right\}$$), since it's a measure-zero set and will not affect the evaluation of the integral. So $$\pi \left( \left\{ -\frac{\theta x}{\pi} \right\} -\frac{1}{2} \right) =\pi \left( \frac{1}{2}+\frac{1}{\pi}\sum_{k=1}^{\infty}{\frac{\sin \left( 2\theta kx \right)}{k}}-\frac{1}{2} \right) =\sum_{k=1}^{\infty}{\frac{\sin \left( 2\theta kx \right)}{k}}$$ Pulgging this into the intergal, we have \begin{align*} &\int_0^{\pi}{\mathrm{arctan} \left( \cot \left( mx \right) \right) \mathrm{arctan} \left( \cot \left( nx \right) \right)}\mathrm{d}x \\ =&\int_0^{\pi}{\sum_{i=1}^{\infty}{\frac{\sin \left( 2mix \right)}{i}}\sum_{j=1}^{\infty}{\frac{\sin \left( 2njx \right)}{j}}}\mathrm{d}x \\ =&\sum_{i=1}^{\infty}{\sum_{j=1}^{\infty}{\frac{1}{ij}}}\int_0^{\pi}{\sin \left( 2mix \right) \sin \left( 2njx \right)}\mathrm{d}x \\ =&\frac{\pi}{2}\sum_{i=1}^{\infty}{\sum_{j=1}^{\infty}{\frac{1}{ij}}}\delta _{mi,nj} \end{align*} You would encounter the exact same sum when you try the same method on that linked integral. Let's evaluate it. first, we have $$\forall i,j\in \mathbb{N} , a=ni=mj\Rightarrow \left[ m,n \right] |a\Rightarrow \frac{1}{i}=\frac{n}{a}, \frac{1}{j}=\frac{m}{a}$$ So, we can rewrite the sum in terms of $$\left[ m,n \right]$$. $$\frac{\pi}{2}\sum_{i=1}^{\infty}{\sum_{j=1}^{\infty}{\begin{array}{c} \frac{1}{ij}\delta _{ni,mj}\\ \end{array}}}=\frac{\pi}{2}\sum_{k=1}^{\infty}{\frac{nm}{k^2\left[ m,n \right] ^2}}=\frac{\pi \left( m,n \right)}{2\left[ m,n \right]}\sum_{k=1}^{\infty}{\frac{1}{k^2}}=\frac{\pi ^3\left( m,n \right)}{12\left[ m,n \right]}$$ Which is your claim. At the end, we have $$I\left( n,m \right) =\int_0^{\pi}{\mathrm{arctan} \left( \cot \left( mx \right) \right) \mathrm{arctan} \left( \cot \left( nx \right) \right)}\mathrm{d}x=\frac{\pi ^3\left( m,n \right)}{12\left[ m,n \right]}$$

• Amazing Answer! Thank you. Though I wonder has anyone done any generalization in this particular area, maybe with three numbers, etc. There is a lot of Integrals you can milk with these techniques. Aug 25, 2023 at 16:44
• @BlackEmperor I took a look in to something like $$\int_0^{\frac{\pi}{2}}{\sin \left( ix \right) \sin \left( jx \right) \sin \left( kx \right)}\mathrm{d}x$$ and the result is quite complicated... Aug 25, 2023 at 16:52
• I believe this works, $$\int_{0}^{\pi}\cos\left(at\right)\cos\left(bt\right)\cos\left(ct\right)dt=\bigg(\delta_{a,b+c}+\delta_{b,a+c}+\delta_{c,a+b}+\delta_{a+b+c,0}\bigg)\frac{\pi}{4}$$ for the whole number line, gets a bit simplified when reduced to natural numbers... Aug 26, 2023 at 8:06
• Then sum it three times? that would be quite interesting! Aug 26, 2023 at 8:44