Is $\ln(-1)$ equal to $\pi i$, undefined, or both? Calculating $\ln(-1)$ with ...

*

*My calculator: Error (maybe "undefined")

*Advanced calculator: $\pi i$
 A: answer
It's a bit more complex:
Actually, all complex solutions are $\ln\left( -1 \right) = \pi \cdot \mathrm{i} + 2 \cdot k \cdot \pi \cdot \mathrm{i} =  \left( \pi + 2 \cdot k \cdot \pi \right)\cdot \mathrm{i}$ with $k \in \mathbb{Z}$ aka there are infinitely many complex solutions in complex.
"Advanced calculators" like Wolfram|Alpha know this sometimes and show this general solution.
reason
This is because of zheRelationship between exponential functions and trigonometric functions $\exp\left( x \cdot \mathrm{i} \right) = \cos\left( x \right) + \sin\left( x \right) \cdot \mathrm{i}$ (see Euler's formula) and the periodicity of the $\operatorname{cis}\left( x \right)$ function or of the $\sin\left( x \right)$ function and $\cos\left( x \right)$ function to $2 \cdot \pi$:
$$
\begin{align*}
\ln\left( -1 \right) &= x \cdot \mathrm{i}\\
 x  \cdot \mathrm{i} &= \ln\left( -1 \right) \quad\mid\quad \exp\left( ~~ \right)\\
\exp\left( x \cdot \mathrm{i} \right) &= \exp\left(\ln\left( -1 \right)\right)\\
\operatorname{cis}\left( x \right) &= -1\\
\cos\left( x \right) + \sin\left( x \right) \cdot \mathrm{i} &= -1 \quad\mid\quad \text{Since } -1 \text{ is not imaginary, the } \sin(x) = 0 \text{.}\\
\cos\left( x \right) + 0 \cdot \mathrm{i} &= -1\\
\cos\left( x \right) + 0 &= -1\\
\cos\left( x \right) &= -1 \quad\mid\quad \arccos\left( ~~ \right)\\
\arccos\left(\cos\left( x \right)\right) &= \arccos\left( -1 \right) + 2 \cdot k \cdot \pi\\
x &= \arccos\left( -1 \right) + 2 \cdot k \cdot \pi\\
x &= \pi + 2 \cdot k \cdot \pi\\
\\
\Rightarrow \ln\left( -1 \right) &= \left( \pi + 2 \cdot k \cdot \pi \right) \cdot \mathrm{i} = \pi \cdot \mathrm{i} + 2 \cdot k \cdot \pi \cdot \mathrm{i}\\
\end{align*}
$$
You can write the genral $\ln\left( z \right)$ as
$\ln\left( z \right) = \ln\left( |z| \cdot e^{\left( \arg(z) + 2 \cdot k \cdot \pi \right) \cdot \mathrm{i}} \right) = \ln\left( |z| \right) + \ln\left( e^{\left( \arg(z) + 2 \cdot k \cdot \pi \right) \cdot \mathrm{i}} \right) = \ln\left( |z| \right) + \left( \arg(z) + 2 \cdot k \cdot \pi \right) \cdot \mathrm{i}$.
but it's a bit more complex
Since the complex numbers $\mathbb{C}$ are not the only hypercomplex numbers $\mathbb{C}^{*}$ that can have an imaginary unit $\mathrm{i}$ with $\mathrm{i}^{2} = -1$, but also an infinite number of other hypercomplex numbers, e.g. the quaternions $\mathbb{H}$ (imaginary units $\mathrm{i}$, $\mathrm{j}$ and $\mathrm{k}$ with $\mathrm{i}^{2} = \mathrm{j}^{2} = \mathrm{k}^{2} = \mathrm{i} \cdot \mathrm{j} \cdot \mathrm{k} = -1$), the octonions $\mathbb{O}$, sedenions $\mathbb{S}$, ..., and you can apply Euler's formula to any hypercomplex number with an imaginary unit $\mathrm{i}_{k}$ with $\mathrm{i}_{k}^{2} = -1$, which means that there are again an infinite number of solutions.
