<s>[INST] Prove two similiar integral equalities I am looking to show that
$$ \begin{align*}
I_1 & = \int_{ma}^{na} \frac{ \log(x - a) }{x^2 + a^2 } 
      = \frac{\log (2a^2)}{2a} \bigl[ \arctan n + \arctan m\bigr] \\ 
I_2 & = \int_{a/m}^{a/n} \frac{\log(x + a) }{ x^2 + a^2 } 
      = \frac{\log (2a^2)}{2a}\bigl[ \arctan \frac{1}{m} + \arctan \frac{1}{n} \bigr]
\end{align*} $$
Given that $nm = n + m + 1$. Now here the substitutions suggested to solve the integrals are given as 
$$ I_1 \, \text{let} \, x = \frac{at + a^2}{t - a} 
  \quad \text{and} \quad
  I_2 \, \text{let} \, x = \frac{-at + a^2}{t + a}  
$$
but even after using these substitutions I am not closer to a solution. 
Can anyone give some hints on evaluating the integrals? (I already have proved the equality using the method in the first post, but I was intrigued by the integrals in the second post. 
Even more so by the fact that the poster seems to trivialize these integrals, and that they stumpled all of my CAS tools. Are there any clever, and smart ways to attack these integrals? 
 [/INST] Hint:
Integrate by parts:
$$\dfrac{1}{a}\int{\ln{(x-a)}\arctan{\left(\dfrac{x}{a} \right)}\ dx}$$
and
$$\dfrac{1}{a}\int{\ln{(x+a)}\arctan{\left(\dfrac{x}{a} \right)}\ dx}.$$
Addition
For example, in the second integral we put
$u=\arctan{\left(\dfrac{x}{a} \right)}, \;\;dv=\ln{(x+a)}\ dx.$ Then
$$\dfrac{1}{a}\int{\ln{(x+a)}\arctan{\left(\dfrac{x}{a} \right)}\ dx}= \\
=
\dfrac{1}{a}\arctan{\left(\dfrac{x}{a} \right)} \int{\ln{(x+a)}\ dx} - \int\ln{(x+a)} \cdot \dfrac{1}{a^2} \cdot \dfrac{1}{1+\frac{x^2}{a^2}}\ dx= \\
=\dfrac{1}{a}\arctan{\left(\dfrac{x}{a} \right)} \int{\ln{(x+a)}\ dx} - \int\ln{(x+a)}  \dfrac{1}{x^2+{a^2}}\ dx$$
</s>