What are the necessary and sufficient conditions for a real square matrix (not necessarily invertible) to have a strictly real arctangent?

I'm doing some kind of research, and the multidimensional version of what I'm doing involves taking the $$\arctan$$ function of a strictly real square matrix. The matrix is not guaranteed to be invertible, and if the $$\arctan$$ is complex the matter becomes much more complicated. I checked Wikipedia but could not find any necessary and sufficient conditions. So, I'm asking here.

The matrix I'm trying to apply $$\arctan$$ to is one with arbitrary elements, and it would be good if the $$\arctan$$ I'm looking for is continuous w.r.t. the parameters (at least when they're real), so I'm asking it here too - is there a branch of $$\arctan$$, of a square matrix whose elements are in the reals, that is continuous w.r.t. the elements (or differentiable/smooth etc if any)?

P.S. I've done some calculations by myself- from Sylvester's formula, it seems that a strictly real square matrix has a strictly real arctan if (but not necessarily only if) none of its eigenvalues are $$i$$ or $$-i$$. A real matrix always has conjugate eigenvalues, so what I'm wondering here is actually just this- even if the given matrix has $$\pm i$$ as eigenvalues, the infinity of arctan at eigenvalue +i and the infinity of arctan at eigenvalue $$-i$$ could maybe cancel out, leaving only a real, finite number behind.

EDIT: I have found out a way to circumvent it during research, but thank you for the answers!

• To the OP. On this website it is customary to accept an answer that satisfies you (give the green chevron). If not, say why you are not satisfied with this answer. – user91684 Sep 28 '19 at 9:41

a priori, we can define $$\arctan(z)$$ for every $$z\in U=\mathbb{C}\setminus\{-i,i\}$$; roughly speaking, it suffices to put $$\arctan(z)=\dfrac{1}{2i}\log(\dfrac{z-i}{z+i})+constant$$. Yet, we must work on one or several determinations of the $$\log$$ function. Note also that $$U$$ is not simply connected.

If we do not impose continuity to $$\arctan$$, then we can do like Maple: but the obtained function is not continuous (for example) on $$\{ib;b>1\}$$. Otherwise, we have to restrict the definition domain to a simply connected set; for example

$$V=\mathbb{C}\setminus\{ib;|b|\geq 1\}$$.

Then we can define an holomorphic function $$\arctan$$ on $$V$$ (with unicity if we put $$\arctan(1)=\pi/4$$).

The extension to the $$n\times n$$ complex matrices with spectrum included in $$V$$ is standard (use complex Jordan form); moreover, the $$\arctan$$ of a real matrix is real (use real Jordan form).

• As a function of scalars, arctan is continuous (even smooth) on the reals, but not necessarily on the complex domain. Does the same hold for arctan of real matrices too, with respect to the (strictly real) elements? – Just A Young Artist Sep 20 '19 at 15:44
• Locally, $f(z)=\arctan(z)=1/2i(\log(z-i)-\log(z+i))+constant$ with a correct choice of the determinations of the $2$ $\log$. Then, $f'(z)=1/(1+z^2)$ and $f$ is locally a holomorphic function. When $z$ goes through $V$ (an open star-shaped set), we can construct a continuous function, then a holomorphic function on $V$. Finally, over the complex matrices, $f$ is a holomorphic function and over the real matrices, its restriction is a real analytic function. – user91684 Sep 20 '19 at 19:41
• "Its restriction is a real analytic function"... does it include real matrices with an eigenvalue of +-i? – Just A Young Artist Sep 21 '19 at 0:07
• Do the two eigenvalues +i and -i cancel out, that is? – Just A Young Artist Sep 21 '19 at 0:18
• Of course, the considered complex or real matrices implicitly have a spectrum included in $V$. – user91684 Sep 21 '19 at 0:32