Real part of $ \quad 1- \frac{2}{\pi} \arctan(r^{\rho}e^{i\rho\theta}).$ To solve the Dirichlet problem  using mellin transform, i needed to find the real part of $ \quad 1- \displaystyle\frac{2}{\pi} \arctan(r^{\rho}e^{i\rho\theta}).$
I already know the result will be
\begin{cases}
\quad 1- \displaystyle \frac{1}{\pi}\arctan(\frac{2r^{\rho}\cos(\rho \theta)}{1-r^{2\rho}}) & \text{ si } r\in [0, 1]\\ \quad \\
\quad  \displaystyle \frac{1}{\pi}\arctan(\frac{2r^{\rho}\cos(\rho \theta)}{r^{2\rho}-1}) & \text{ si } r\in ]1,+\infty[.\\
\end{cases}
I find it in "Dautray R., Lions J.L.,  Mathematical analysis and numerical calculation for science and technology."
I want to know how they found it ?
 A: For a complex number $z \ne \pm \mathrm{i}$, we have
$$\arctan z = \frac{1}{2\mathrm{i}}\ln \frac{\mathrm{i} - z}{\mathrm{i} + z}$$
where $\ln u$ is the principal branch of complex logarithm ($u\ne 0$)
$$\ln u = \ln |u| + \mathrm{i}\arg u, \quad -\pi < \arg u \le \pi.$$
(See, e.g. http://scipp.ucsc.edu/~haber/archives/physics116A10/arc_10.pdf)
Also, if $c, d$ are real numbers with $c^2 + d^2 \ne 0$, we have
$$\arg (c + d\mathrm{i}) = 
\left\{\begin{array}{ll}
 \arctan \frac{d}{c} & c > 0 \\[5pt]
 \arctan \frac{d}{c} + \pi & c < 0, d \ge 0 \\[5pt]
 \arctan \frac{d}{c} - \pi & c < 0, d < 0\\[5pt]
 \frac{\pi}{2} & c = 0, d > 0\\[5pt]
 -\frac{\pi}{2} & c = 0, d < 0
\end{array}
\right.$$
See, e.g. How to figure out the Argument of complex number?
$\phantom{2}$
Consider the case when $r > 0$ and $\rho > 0$.
Let $a = r^\rho \cos \rho\theta$
and $b = r^\rho \sin \rho\theta$.
Then $a^2 + b^2 = r^{2\rho}$.
(1) If $0 < r < 1$, we have
$$\mathrm{Re} [\arctan (a + b\mathrm{i})]
= \mathrm{Re} \left(\frac{1}{2\mathrm{i}}\ln \frac{1 - a^2 - b^2 + 2a \mathrm{i}}{a^2 + (1 + b)^2}\right) = \frac12 \arctan \frac{2a}{1 - a^2 - b^2}.$$
Thus, we have
$$\mathrm{Re}\left(1- \frac{2}{\pi} \arctan(r^{\rho}e^{i\rho\theta})\right)
= 1 - \frac{1}{\pi}\arctan \frac{2r^\rho \cos \rho\theta}{1 - r^{2\rho}}.$$
(2) If $r > 1$ and $a \ge 0$, we have
$$\mathrm{Re} [\arctan (a + b\mathrm{i})]
= \mathrm{Re} \left(\frac{1}{2\mathrm{i}}\ln \frac{1 - a^2 - b^2 + 2a \mathrm{i}}{a^2 + (1 + b)^2} \right) = \frac{\pi}{2} - \frac12 \arctan \frac{2a}{a^2 + b^2 - 1}.$$
Thus, we have
$$\mathrm{Re}\left(1- \frac{2}{\pi} \arctan(r^{\rho}e^{i\rho\theta})\right)
= \frac{1}{\pi}\arctan \frac{2r^\rho \cos \rho\theta}{r^{2\rho} - 1}.$$
(3) If $r > 1$ and $a < 0$, we have
$$\mathrm{Re} [\arctan (a + b\mathrm{i})]
= \mathrm{Re} \left(\frac{1}{2\mathrm{i}}\ln \frac{1 - a^2 - b^2 + 2a \mathrm{i}}{a^2 + (1 + b)^2} \right) = \frac12 \arctan \frac{2a}{1 - a^2 - b^2} - \frac{\pi}{2}.$$
Thus, we have
$$\mathrm{Re}\left(1- \frac{2}{\pi} \arctan(r^{\rho}e^{i\rho\theta})\right)
= 2 - \frac{1}{\pi}\arctan \frac{ - 2 r^\rho \cos \rho\theta}{r^{2\rho} - 1}.$$
(4) If $r = 1$ and $a > 0$, we have
$$\mathrm{Re} [\arctan (a + b\mathrm{i})]
= \mathrm{Re} \left(\frac{1}{2\mathrm{i}}\ln \frac{2a \mathrm{i}}{a^2 + (1 + b)^2}\right) = \frac{\pi}{4}.$$
Thus, we have
$$\mathrm{Re}\left(1- \frac{2}{\pi} \arctan(r^{\rho}e^{i\rho\theta})\right)
= \frac12.$$
(5) If $r = 1$ and $a < 0$, we have
$$\mathrm{Re} [\arctan (a + b\mathrm{i})]
= \mathrm{Re} \left(\frac{1}{2\mathrm{i}}\ln \frac{2a \mathrm{i}}{a^2 + (1 + b)^2}\right) = -\frac{\pi}{4}.$$
Thus, we have
$$\mathrm{Re}\left(1- \frac{2}{\pi} \arctan(r^{\rho}e^{i\rho\theta})\right)
= \frac32.$$
We are done.
