10

Given that $a,b,c,d\in\mathbb{R}$ and that $c$ and $d$ are not both $0$, show that

$$\int_0^\pi\arctan\left(\frac{a\cos x+b\sin x}{c\cos x+d\sin x}\right)\mathrm dx=\pi\arctan\left(\frac{ac+bd}{|bc-ad|+c^2+d^2}\right).$$

I was trying to answer a question and ended up with this integral. I don't think it helped me answer that other question, but I thought this integral is interesting by itself.

I teased out the RHS expression by first noticing that $\tan \left(\frac{1}{\pi}\int_0^\pi\arctan\left(\frac{a\cos x+b\sin x}{c\cos x+d\sin x}\right)\mathrm dx\right)$ seemed to be always rational when $a,b,c,d\in \mathbb{Z}$, then setting two of $a,b,c,d$ equal to $1$ and then looking for patterns in the value of the integral in terms of the other two. That's all the progress I've made so far.

Quanto
  • 97,352
Dan
  • 22,158

2 Answers2

10

Here is a complete derivation:

With the variable shift $y=x +\tan^{-1} \frac cd$, along with the shorthands $p= \frac{ac+bd}{c^2+d^2}$ and $q= \frac{ad-bc}{c^2+d^2}$ $$\frac{a\cos x+b\sin x}{c\cos x+d\sin x} = \frac{(ac+bd)+(ad-bc)\cot y}{(c^2+d^2)} = p+q\cot y $$ which is $\pi$-periodic, albeit discontinuous. Thus \begin{align} &\int_0^\pi\tan^{-1}\frac{a\cos x+b\sin x}{c\cos x+d\sin x}\ dx\\ =& \int_0^\pi\tan^{-1} (p+q \cot y)\ dy =\Im \int_0^\pi\ln (1+ip+i|q|\cot y)\ dy \\ =&\ \pi \ \Im\ln(1+|q|+ip) =\pi\tan^{-1}\frac p{1+|q|}\\ = &\ \pi\tan^{-1}\frac{ac+bd}{|bc-ad|+c^2+d^2} \end{align} where the integral \begin{align} &\int_0^\pi \ln(t+s \cot y)dy =\int_0^\pi\bigg(\ln t +\int_0^{s/t} \frac{\cot y}{1+u \cot y}du\bigg)dy\\ &\>\>\>\>\>=\pi \ln t+ \int_0^{s/t} \frac1{1+u^2}\bigg( uy -\ln \frac{\csc y}{1+u\cot y}\bigg)\bigg|_0^{\pi}\ du \\ &\>\>\>\>\> =\pi \ln t+\int_0^{s/t} \frac\pi{u+i}du=\pi \ln\left(t+\frac si\right) \end{align} is used in above derivation.

Quanto
  • 97,352
6

This is not a $100\%$ complete answer, but if no mistakes have been made, then the calculus problem can be boiled down to an algebraic one, after taking an elaborate detour into the complex world.

Shift the integration range down by $\dfrac\pi2$, then substitute $x=\arctan y=\arctan\dfrac{b-dz}{a-cz}$:

$$\begin{align*} I &= \int_0^\pi \arctan \left(\frac{a \cos x + b \sin x}{c \cos x + d \sin x}\right) \, dx \\ &= \int_{-\tfrac\pi2}^\tfrac\pi2 \arctan \left(\frac{a\tan x-b}{c\tan x-d}\right) \, dx \\ &= \int_{-\infty}^\infty \frac{\arctan \left(\frac{ay-b}{cy-d}\right)}{1+y^2} \, dy \\ &= \int_{-\infty}^\infty \frac{(bc-ad) \arctan z}{a^2+b^2 - 2(ac+bd) z + \left(c^2+d^2\right) z^2} \, dz \tag{$*$} \end{align*}$$

See Zacky's comment for the fine print of changing variables to $z$ in $(*)$. Provided the discriminant of the denominator $p(z)$ is negative, i.e.

$$4(ab+cd)^2 - 4(a^2+c^2)(b^2+d^2) = -4(bc-ad)^2 < 0$$

(agreeing with the conjectured condition), we can rewrite $I$ in terms of $J(a,b,c)$ as defined in this answer using residue calculus.

Split up the remaining integral in $(*)$ at $z=0$, substitute $z\to-z$ and recombine terms:

$$\begin{align*} I &= \left\{\int_{-\infty}^0 + \int_0^\infty\right\} \frac{(bc-ad) \arctan z}{p(z)} \, dz \\ &= (bc-ad) \int_0^\infty \left(\frac1{p_-(z)}-\frac1{p_+(z)}\right) \arctan z \, dz \\ &= 4 (bc-ad) (ac+bd) J(r,s,t) \end{align*}$$

where the $\star$ in $p_\star(z)$ denotes the sign of the coefficient $z^1$ in $p(z)$, and

$$\begin{cases} r=\left(a^2+b^2\right)^2 \\ s= -2 (a (c+d) - b (c-d)) (a (c-d) + b (c+d)) \\ t = \left(c^2+d^2\right)^2 \end{cases}$$

Let $\mathcal A$ be the monstrous argument to $\arctan$ in $J(r,s,t)$ (see spoiler below). With Mathematica's help in factorizing some polynomials in $a,b,c,d$, I've managed to symbolically simplify some pieces, starting with

$$J(r,s,t) = \frac\pi{8 \left\lvert (ac+bd)(ad-bc) \right\rvert} \arctan \mathcal A$$

so that (at least up to sign) it would appear that

$$I = \frac\pi2 \arctan \mathcal A = \pi \arctan \frac{\mathcal A}{1 + \sqrt{1+\mathcal A^2}}$$

It remains to be shown that the arguments to the latter and titular $\arctan$s are a match.

$$\begin{align*} \mathcal A &= \frac{-2\alpha\delta + \beta\left(\sqrt{\gamma+2\alpha i} + \sqrt{\gamma-2\alpha i}\right)}{\beta\delta + 2\alpha\left(\sqrt{\gamma+2\alpha i} + \sqrt{\gamma-2\alpha i}\right)} \\[2ex] \alpha &= \left\lvert(ad-bc)(ad+bc)\right\rvert \\ \beta &= \left(a^2-b^2\right) \left(c^2-d^2\right)+\left(a^2+b^2\right)^2+4 a b c d \\ \gamma &= (a c - b c + a d + b d) (a c + b c - a d + b d) \\ \delta &= a^2+b^2-c^2-d^2 \end{align*}$$

user170231
  • 19,334
  • 1
    I edited the question: instead of requiring $bc\ge ad$, I put modulus signs around $bc-ad$ in the RHS. – Dan Mar 13 '24 at 23:05
  • 1
    @Zacky $\dfrac{ax-b}{cx-d}\to\dfrac ac$ as $x\to\pm\infty$, how are the limits preserved in the latter integral? – user170231 Mar 14 '24 at 21:56
  • 1
    @user170231 originally I just assumed the limits to be $\pm \infty$ and since numerically it matched, I didn't check in detail. More elaborated: $$\int_{-\frac{\pi}{2}}^\frac{\pi}{2} \arctan \frac{a\tan x-b}{c\tan x-d}dx\overset{\tan x\to x}=\int_{-\infty}^\infty \frac{\arctan \frac{ax-b}{cx-d}}{1+x^2}dx$$ $$=\int_{-\infty}^{\frac{d}{c}} +\int_\frac{d}{c}^{\infty}\overset{\large \frac{ax-b}{cx-d}\to x}=\int_\frac{a}{c}^\infty+\int_{-\infty}^\frac{a}{c} $$ $$=(bd-ac)\int_{-\infty}^\infty \frac{\arctan x}{a^2+b^2-2(ac+bd)x+(c^2+d^2)x^2}dx$$ – Zacky Mar 15 '24 at 00:55
  • 1
    @Zacky Ah good catch, I'd missed the discontinuity at $\frac dc$ – user170231 Mar 15 '24 at 00:58