I am now trying a direct approach to solving my question about $$\int_0^\infty\frac{\arctan a_1x\arctan a_2x\dots\arctan a_nx}{1+x^2}\,dx$$ where the $a_i$ are all positive. Note that the $\arctan$s can be broken up into logarithms and that the denominator is $(1+ix)(1-ix)$. Now this answer claims at the end
Any integral of the form $\int\frac{\ln(ax+b)\ln(cx+d)}{px+q}\,dx$ can be systematically reduced to trilogarithms, dilogarithms, and elementary functions.
Extrapolating, I am led to believe that any integral of the form $$\int\frac{\log(a_1x+b_1)\cdots\log(a_nx+b_n)}{px+q}\,dx$$ can be systematically reduced to elementary functions and polylogarithms of order up to $n+1$. This would (theoretically) solve my problem.
Is my statement true and if so how would I write an algorithm to perform the polylog reduction?