4.5: Complex Functions
When deriving Euler’s formula in Section 4.3, we introduced complex functions that were defined by takingreal mathematical functions, like the exponential, and making them accept complex number inputs. Let us take a closer look at how these complex functions behave.
Complex trigonometric functions
The complex sine and cosine functions are defined using the same series expansions as the real cosine and sine functions, except that the inputs \(z\) are allowed to be complex: \[\left\{\begin{array}{l}\displaystyle\sin(z) = z - \frac{z^3}{3!} + \frac{z^5}{5!} - \frac{z^7}{7!} + \cdots\\ \displaystyle\cos(z) = 1 - \frac{z^2}{2!} + \frac{z^4}{4!} - \frac{z^6}{6!} + \cdots,\end{array}\right.\quad\quad z\in \mathbb{C}\] It is important to note that the outputs of the complex trigonometric functions are complex numbers too.
Some familiar properties of the real trigonometric functions do not apply to the complex versions. For instance, \(|\sin(z)|\) and \(|\cos(z)|\) are not bounded by 1 when \(z\) is not real.
We can also write the complex cosine and sine functions in terms of the exponential: \[\begin{align} \cos(z) &= \;\;\frac{1}{2}\left(e^{iz} + e^{-iz}\right) \label{cosz} \\ \sin(z) &= -\frac{i}{2}\left(e^{iz} - e^{-iz}\right). \label{sinz}\end{align}\] This is often a convenient step when solving integrals, as shown in the following example:
Example \(\PageIndex{1}\)
Consider the real integral \[I = \int_0^\infty dx \; e^{- x} \, \cos(x).\] One way to solve this is to use integration by parts, but another way is to use the complex expansion of the cosine function: \[\begin{align} I &= \int_0^\infty dx \; e^{- x} \,\frac{1}{2}\, \left[e^{ix} + e^{-ix}\right] \\ &= \frac{1}{2} \int_0^\infty dx \; \left[e^{(-1+i)x} + e^{(-1-i)x}\right] \\ &= \frac{1}{2} \left[ \frac{e^{(-1+i) x}}{-1+i} + \frac{e^{(-1 - i) x}}{-1 - i}\right]_0^\infty \\ &= -\frac{1}{2} \left(\frac{1}{-1+i} + \frac{1}{-1 - i}\right) \\ &= \frac{1}{2}. \end{align}\]
Complex trigonometric identities
Euler’s formula provides a convenient way to deal with trigonometric functions. Consider the addition formulas \[\begin{align} \sin(z_1 + z_2) &= \sin(z_1) \cos(z_2) + \cos(z_1)\sin(z_2) \\ \cos(z_1 + z_2) &= \cos(z_1) \cos(z_2) - \sin(z_1)\sin(z_2).\end{align}\] The standard proofs for these formulas are geometric: you draw a figure, and solve a bunch of relations between the angles and sides of the various triangles, making use of the Pythagorean formula. But using the Euler formula, we can prove these algebraically. For example, \[\begin{align} \cos(z_1)\cos(z_2) &= \frac{1}{4}\left(e^{iz_1} + e^{-iz_1}\right) \left(e^{iz_2} + e^{-iz_1}\right)\\ &= \frac{1}{4}\left[e^{i(z_1+z_2)} + e^{i(-z_1 + z_2)} + e^{i(z_1 -z_2)} + e^{-i(z_1+z_2)}\right] \\ \sin(z_1)\sin(z_2) &= -\frac{1}{4}\left(e^{iz_1} - e^{-iz_1}\right) \left(e^{iz_2} - e^{-iz_1}\right) \\ &= -\frac{1}{4}\left[e^{i(z_1+z_2)} - e^{i(-z_1 + z_2)} - e^{i(z_1 -z_2)} + e^{-i(z_1+z_2)}\right].\end{align}\] Thus, \[\cos(z_1) \cos(z_2) - \sin(z_1)\sin(z_2) = \frac{1}{2}\left[e^{i(z_1+z_2)} + e^{-i(z_1+z_2)}\right] = \cos(z_1 + z_2).\] As a bonus, these addition formulas now hold for complex inputs as well, not just real inputs.
Hyperbolic functions
Euler’s formula also provides us with a link between the trionometric and hyperbolic functions. From the definition of the hyperbolic functions from Chapter 1: \[\sinh(z) = \frac{1}{2}\left(e^{z} - e^{-z}\right), \quad\; \cosh(z) = \frac{1}{2}\left(e^{z} + e^{-z}\right)\] Comparing this to Eqs. \(\eqref{cosz}\)-\(\eqref{sinz}\), we can see that the trigonometric and hyperbolic functions are related by \[\begin{align} \sin(z) &= -i \sinh(iz), \quad \cos(z) = \cosh(iz) \\ \sinh(z) &= -i \sin(iz), \quad \cosh(z) = \cos(iz)\end{align}\] Using these relations, we can relate the addition formulas for trignometric formulas to the addition formulas for hyperbolic functions, e.g. \[\begin{align} \cosh(z_1+z_2) &= \cos(iz_1 + iz_2) \\ &= \cos(iz_1)\cos(iz_2) - \sin(iz_1)\sin(iz_2) \\ &= \cosh(z_1)\cosh(z_2) + \sinh(z_1)\sinh(z_2).\end{align}\]