## Functions of Complex Numbers

Once we have mastered using i as an exponent, we can advance to functions of complex numbers.  Exponential functions, of course, are simply functions which use $i$ as an exponent.

### Logarithm functions

Since a complex number can be written in exponential form as   $re^{iP}$,   a logarithm is almost immediate.  We get   $\ln re^{iP} = \ln r + \ln e^{iP} = \ln r + iP$,   which gives the principal value of the natural logarithm.  But the angle $P$ is not unique, as it can vary by multiples of $2\pi$.   Therefore, the formula for the natural logarithm of a complex number is   $\ln re^{iP} = \ln r + iP + 2k\pi i$.

For example, we can find the natural logarithm of $i$.  Its principal value is   $\ln i = \ln \left(1e^{\frac{i\pi}{2}}\right) = \dfrac{\pi}{2} i$.

Another interesting example is the natural logarithm of negative one.  Its principal value is   $\ln (-1) = \ln \left(1e^{i\pi}\right) = \pi i$.   (And you thought you couldn't take logarithms of negative numbers!  You can, but the answers are not real numbers.)

We can use the change-of-base formula to find other base logarithms (including complex bases).  For example,   $\log_i{e} = \dfrac{\ln e}{\ln i} = \dfrac{1}{\frac{\pi}{2}i} = \dfrac{-2}{\pi} i$.

### Trigonometric Functions

Because of the formula   $e^{ix}=\cos x+i\sin x$,   we can immediately obtain some formulas for the sine and cosine functions, in terms of complex exponentials.  These formulas are often used as definitions of the trigonometric functions for complex numbers.

\begin{equation*} \cos{x} = \frac{e^{ix}+e^{-ix}}{2}, \qquad \sin{x} = \frac{e^{ix}-e^{-ix}}{2i} \end{equation*}

Substituting the quantity $ix$ in place of the variable $x$, we can produce formulas for pure imaginary numbers.  Notice that the results are related to the hyperbolic functions.

\begin{equation*} \cos{ix} = \frac{e^x+e^{-x}}{2} = \cosh x, \qquad \sin{ix} = \frac{e^{-x}-e^{x}}{2i} = i\sinh x \end{equation*}

Then, using the formulas for the sine and cosine of the sum of two angles, we can obtain formulas for the sine and cosine of complex numbers.

\begin{equation*} \cos(a+bi) = \cos a \cosh b - i\sin a \sinh b \end{equation*} \begin{equation*} \sin(a+bi) = \sin a \cosh b + i\cos a \sinh b \end{equation*}

As an example, consider the cosine of $i$.  We get   $\cos i = \cos 0 \cosh 1 - i\sin 0 \sinh 1 = \cosh 1 = \frac{e^1+e^{-1}}{2} \approx 1.5431$.

### Hyperbolic Functions

Using the connection between hyperbolic functions and trigonometric functions, the results for hyperbolic functions are almost immediate.

\begin{equation*} \cosh(a+bi) = \cosh a \cos b + i\sinh a \sin b \end{equation*} \begin{equation*} \sinh(a+bi) = \sinh a \cos b + i\cosh a \sin b \end{equation*}

As an example, consider the hyperbolic cosine of $i$.  We get   $\cosh i = \cosh 0 \cos 1 + i\sinh 0 \sin 1 = \cos 1 \approx 0.5403$.

### Inverse Trigonometric Functions

Since   $\cos x = \dfrac{e^{ix}+e^{-ix}}{2}$,   we can find the inverse by replacing the function with the variable $y$, swapping $x$ and $y$, then solving for $y$.  After the variable swap, we have   $x = \dfrac{e^{iy}+e^{-iy}}{2}$.   Multiplying both sides by   $2e^{iy}$   gives the equation   $0 = e^{2iy} - 2xe^{iy} + 1$.   This can be solved using the quadratic formula, to get   $e^{iy} = \dfrac{2x \pm \sqrt{4x^2-4}}{2}$.   After simplifying, we can take the natural logarithm of both sides and divide by $i$.   Then, the result is

\begin{equation*} \cos^{-1} x = -i\ln\left[x\pm i\sqrt{1-x^2}\right] \end{equation*}

(A factor of $i$ typically appears as the coefficient of the square root so that the similarities between the inverse cosine and inverse sine formulas are more apparent.)

By similar arguments, the inverse sine formula is found to be

\begin{equation*} \sin^{-1} x = -i\ln\left[ix\pm \sqrt{1-x^2}\right] \end{equation*}

and the inverse tangent formula is

\begin{equation*} \tan^{-1} x = \frac{i}{2} \ln\frac{i+x}{i-x} \end{equation*}

As an example, consider the inverse cosine of $i$. We shall find only one of its many values, by using the plus sign in the formula.  We get:   $\cos^{-1} i = -i\ln\left[i+i\sqrt{1-i^2}\right] = -i\ln\left[(1+\sqrt{2})i\right]$. Then we use the logarithm formula to continue:   $-i\ln\left[(1+\sqrt{2})i\right] = -i\ln\left[(1+\sqrt{2})e^{\frac{i\pi}{2}}\right] = -i\left[\ln(1+\sqrt{2}) +\dfrac{\pi}{2}i \right]$.   This can be simplified, and we get   $-i\left[\ln(1+\sqrt{2}) +\dfrac{\pi}{2}i \right] = \dfrac{\pi}{2} -i\ln(1+\sqrt{2}) \approx 1.57-0.88i$.

### Inverse Hyperbolic Functions

The formulas are identical to those previously found for inverse hyperbolic functions:

\begin{equation*} \cosh^{-1} x = \ln\left[x\pm \sqrt{x^2-1}\right] \end{equation*} \begin{equation*} \sinh^{-1} x = \ln\left[x\pm \sqrt{x^2+1}\right] \end{equation*}

For example, one of the values of the inverse hyperbolic cosine of $i$ (using the plus sign in the formula) is:   $\cosh^{-1} x = \ln\left[i+ \sqrt{i^2-1}\right] = \ln\left[(1+\sqrt{2})i\right]$.   Then using the logarithm formula, we get:   $\ln\left[(1+\sqrt{2})i\right] =\ln(1+\sqrt{2})+\dfrac{\pi}{2}i \approx 0.88+1.57i$.