# Determining complex $c$ for which $\tan^{-1}(e^{\pi/c})+\cot^{-1}(e^{\pi /c})$ yields $\frac\pi2$ or $-\frac\pi2$

This expression $$\tan^{-1}\left(e^{\pi/c}\right)+\cot^{-1}\left(e^{\pi /c}\right)$$ is equal to $$\frac{\pi}{2}$$ for real $$c$$.

But when $$c\in\mathbb C$$, it gives either $$\frac{\pi}{2}$$ or $$-\frac{\pi}{2}$$.

For an example, for $$c=\frac{1}{2}-\frac{i}{2}$$, it gives $$- \frac{\pi}{2}$$; and for $$c=1-i$$, it gives $$\frac{\pi}{2}$$.

I am trying to find the ranges for values that give two of these answers. How do I find that?

• As pointed out in the link given by @TheSimpliFire the result strongly depends on the definition of $\arctan(z)$ and $\operatorname{arccot}(z)$.
– user
May 17 '21 at 7:34

This really is quite an interesting problem. MATLAB has a pretty good plotting feature that can plot complex numbers. I used the following MATLAB script to produce 100,000 random complex numbers where both the real and imaginary parts have magnitude $$\le 2.5$$ (complex numbers with either magnitude exceeding $$2.5$$ produce $$\pi/2$$, as you will see in a second).

close all
clear all

%Number of randomly generated points
N = 100000;
%Produce a random matrix with 2N values; the first N will be the real part of z,
%while the last N will contribute to the imaginary part of z
randmat = -2.5 + (2.5+2.5).*rand(2*N,1);

%Initializations
j=1;
k=1;
num=zeros(N,1);
z=zeros(N,1);
negnums = zeros(N,1);
posnums = zeros(N,1);

for n=1:N
%Generate a random complex number
z(n) = randmat(n,1) + randmat(N+n,1)*1i;

num(n) = atan(exp(pi/z(n))) + acot(exp(pi/z(n)));
num(n) = real(num(n));
if num(n)>0
posnums(j) = z(n);
j=j+1;
else
negnums(k) = z(n);
k=k+1;
end
end

negnums = nonzeros(negnums);
posnums = nonzeros(posnums);
plot(posnums,'og')
hold on
plot(negnums,'*b')
legend('Produce pi/2','Produce -pi/2')


I then plot each complex number and colored it green if it produced $$\pi/2$$ and blue if it produced $$-\pi/2$$. That graphic is as follows:

When zooming in, our picture becomes even more fascinating:

I don't have the slightest clue why this is happening, but perhaps you can use this as a stepping stone to investigate further.

• Are those circles in your first image (in blue)? They look pretty close May 16 '21 at 5:06
• I believe so. They appear to have radii of 1. May 16 '21 at 8:56
• I've provided closed forms for these equations. May 16 '21 at 10:21

Claim. Let $$k\in[1/(4r-1),1/(4r+1)]$$ and $$\ell\in[1/(4r+1),1/(4r+3)]$$ where $$r\in\Bbb Z$$. Then\begin{align}\arctan e^{\pi/c}+\operatorname{arccot}e^{\pi/c}=\begin{cases}\pi/2,&\quad|c-ik|=k\\-\pi/2,&\quad|c-i\ell|=\ell\end{cases}.\end{align}

Proof. It is easy to show that for principal values, \begin{align}\arctan z+\operatorname{arccot}z=\begin{cases}\pi/2,&\quad\Re z\ge0\\-\pi/2,&\quad\Re z<0\end{cases}.\end{align} Let $$c=x+iy$$. Then $$\arctan e^{\pi/c}+\operatorname{arccot}e^{\pi/c}=\pi/2$$ if and only if $$\Re\exp\left(\frac{\pi(x-iy)}{x^2+y^2}\right)=\exp\left(\frac{\pi x}{x^2+y^2}\right)\cos\frac{\pi y}{x^2+y^2}\ge0.$$ Let $$r\in\Bbb Z$$ so the inequality is equivalent to $$\frac y{x^2+y^2}\in2r+\left[-\frac12,\frac12\right].$$ Writing $$y=n(x^2+y^2)$$ where $$n\in2r+[-1/2,1/2]$$, we see that this is the equation of a circle $$x^2+(y-k)^2=k^2$$ centred at $$(0,k)$$ of radius $$k$$ where $$k=1/(2n)\in[1/(4r-1),1/(4r+1)]$$.

Similarly, $$\arctan e^{\pi/c}+\operatorname{arccot}e^{\pi/c}=-\pi/2$$ if and only if $$x^2+(y-\ell)^2=\ell^2$$ where $$\ell\in(1/(4r+1),1/(4r+3)).$$