# The Complex Exponential

Tags:
1. Mar 25, 2016

### Puglife

In my electrical engineering textbook, they have an entire chapter devoted to the complex Exponential. I dont really understand it, nor do I understand its importance.

I know it is extremely important, and need to understand why, and what exactly it is, and the wording of the online resources I checked is somewhat confusing, because I have absolutely no idea what it is.

So I was wondering if someone could explain to me what it is, why it is important, and how to determine it?

2. Mar 25, 2016

### Geofleur

A complex exponential is a function of the form $e^{i\theta}$. Euler showed that $e^{i\theta} = \cos \theta + i \sin \theta$. One easy way to prove it is to do a Taylor expansion of $e^{i\theta}$, group all terms that are multiplied by an $i$, and then compare that with the Taylor expansion of $\cos \theta + i \sin \theta$. Hence complex exponentials give a tidy way to write trigonometric functions. But there is much more! For example, when we take the derivative of $\sin \theta$ with respect to $\theta$, we get $\cos \theta$, a different function. However, if we take the derivative of $e^{i\theta}$, we get $i e^{i\theta}$, the function we started with back again, only multiplied by $i$. When an operator (like the differential operator) acts on something and gives that something back again, times a constant, something special and important is happening.

For example, we can exploit this feature to solve differential equations. Take, for example, the wave equation in 1D (say, for example, $y$ stands for the vertical displacement at a position $x$ along a vibrating guitar string at time $t$):

$\frac{1}{v^2}\frac{\partial^2 y}{\partial t^2} = \frac{\partial^2 y}{\partial x^2}$.

Let's look for a solution of the form $y = e^{i(kx-\omega t)}$. Since $e^{i(kx-\omega t)} = \cos(kx-\omega t) + i\sin(kx-\omega t)$, we are really looking for a wave solution, with wave number $k$ and angular frequency $\omega$. You may be thinking, "What sense does it make to have a complex number for the displacement of a guitar string?". No worries, if a complex function satisfies the wave equation, then so does its real part. In other words, we can just throw away the part with the $i$ in it afterward. Now, in order to substitute the wave solution into the differential equation, we calculate derivatives

$\frac{\partial}{\partial t} e^{i(kx-\omega t)} = -i\omega e^{i(kx-\omega t)}$,
$\frac{\partial^2}{\partial t^2} e^{i(kx-\omega t)} = (-i\omega)^2 e^{i(kx-\omega t)} = -\omega^2 e^{i(kx-\omega t)}$,
$\frac{\partial}{\partial x} e^{i(kx-\omega t)} = ik e^{i(kx-\omega t)}$,
$\frac{\partial^2}{\partial x^2} e^{i(kx-\omega t)} = (ik)^2 e^{i(kx-\omega t)} = -k^2 e^{i(kx-\omega t)}$.

Putting these expressions into the differential equation results in

$-\frac{1}{v^2}\omega^2 e^{i(kx-\omega t)} = -k^2 e^{i(kx-\omega t)}$.

Dividing out $-e^{i(kx-\omega t)}$ from both sides gives $\frac{\omega^2}{v^2} = k^2$ or $\omega = kv$. So our solution will satisfy the equation as long as $k$ and $\omega$ are related in just this way. $\omega = kv$ is an example of a dispersion relation, and information about how wave forms propagate along the string can be deduced from it. For example, just from the fact that $\omega$ is proportional to $k$ and not some higher power, we can deduce that a waveform can travel down the string without distortion (that is, until it hits the end of the string).

There are a huge number of other applications of complex exponentials. They can be used to find solutions to many differential equations, even sets of coupled differential equations. They are an integral part of quantum mechanics. They are used as part of an extremely powerful tool known as the Fourier transform.

There is a good book all about the formula $e^{i\theta} = \cos\theta + i \sin\theta$. It's by Paul Nahin and it's called Dr. Euler's Fabulous Formula. By the way, I think Nahin is a retired electrical engineer, so he might have some insights more tuned in to what you are searching for.

3. Mar 25, 2016

### Puglife

So why dont we just use the sin or cos function, it seems like it is just an added complexity. What exactly does using the complex exponential make easier, in terms of electrical engineering?

4. Mar 25, 2016

### Puglife

Also, can it only be used to represent sinusoids, or can it be used for other things?

5. Mar 25, 2016

### Geofleur

Some differential equations involve, not just second derivatives, but first order derivatives and/or the function by itself with no differentiation. Trying to use sine or cosine in this situation will not work, because then you can't just divide out sine or cosine in the end. The complex exponential, on the other hand, will still often work. The idea is useful for solving ordinary differential equations too, not just partial.

It turns out that any reasonably well-behaved function can be written as a sum or an integral of sines and cosines. The Fourier transform technique involves writing a function as an integral involving a complex exponential, which is essentially a sum of sines and cosines, but much easier to deal with. The Fourier transform technique can be used to find more general solutions to differential equations, ones that don't have to look sinusoidal.

6. Mar 25, 2016

### Puglife

is their any way you can give me a specific example of when we need to have it be in the complex exponential, that includes both numbers, and the scenario its self.

7. Mar 25, 2016

### Geofleur

Suppose we have an RC circuit powered by an AC voltage source. We can apply Kirchhoff's voltage drop law to the circuit. The drop in voltage across the resistor is IR, by Ohm's law; that across the capacitor is q / C, where q is excess charge; and these must balance the AC source. Let's suppose the AC source is $V_0 \cos(\omega t)$. Then Kirchhoff's law gives

$IR + \frac{q}{C} = V_0 \cos(\omega t)$.

Any current flowing causes a buildup of excess charge on the capacitor, so $I = \frac{dq}{dt}$. Therefore,

$R\frac{dq}{dt}+\frac{q}{C} = V_0 \cos(\omega t)$.

Let us tidy up this equation a bit by writing it as

$\frac{dq}{dt}+aq = b\cos(\omega t)$,

where $a = \frac{1}{RC}$ and $b = \frac{V_0}{R}$. I will just show how to find one particular solution, not the most general one, to give an idea of how the complex exponential is useful. If we think of q as a complex number, say $q = q_1 + i q_2$, and if we replace $\cos(\omega t)$ with $e^{i\omega t}$, we will get the equation

$\frac{dq_1}{dt}+aq_1 + i\frac{dq_2}{dt}+i aq_2 = be^{i\omega t} = b\cos(\omega t) + ib\sin(\omega t)$.

Taking the real part of this equation gives us

$\frac{dq_1}{dt} +aq_1 = b\cos(\omega t)$,

which is the equation we started with, only now, instead of being written in terms of a real solution $q$, we have it in terms of the real part, $q_1$, of a complex solution $q$. The upshot is that we can replace $\cos(\omega t)$ with $e^{i\omega t}$, treat $q$ as complex, and take the real part of $q$ in the end to find our real answer. So we want to find a complex $q$ that solves the equation

$\frac{dq}{dt}+aq = be^{i\omega t}$.

We try the solution $q = A e^{i\omega t}$. Calculating the derivatives and putting this into the equation gives

$i\omega Ae^{i\omega t} + aAe^{i\omega t} = be^{i\omega t}$.

Dividing out $e^{i\omega t}$ and solving for $A$ gives $A = \frac{b}{a+i\omega}$, so that our particular solution is $q = \frac{b}{a+i\omega}e^{i\omega t}$. We need to get this into the form $q_1 + i q_2$ so that we can take the real part of it. We multiple by one in disguise:

$q = \frac{a-i\omega}{a-i\omega}\frac{b}{a+i\omega}e^{i\omega t} = \frac{b(a-i\omega)}{a^2+\omega^2}e^{i\omega t}$.

Now if we use $e^{i\omega t} = \cos \omega t + i\sin \omega t$, multiply out $(a-i\omega)(\cos \omega t + i\sin \omega t)$, and take the real part of the result, we get

$q_1 = \frac{b}{a^2+\omega^2}\left[ a\cos(\omega t)+\omega\sin(\omega t) \right]$,

which is real and actually satisfies the differential equation!

8. Mar 26, 2016

### the_emi_guy

You are right and wrong. We probably *can* abandon the complex exponential and deal only with sin and cosine of real numbers, at least in typical electrical engineering problems (on the other hand there is no way to eliminate the imaginary number in Schrodinger equation). However, use of the complex exponential does not add complexity, it removes complexity.

Let me offer an analogy:
Would you consider use of negative numbers an unnecessary complexity? Couldn't we just abandon the concept of negative numbers and keep things simple?
At one point in the history of mathematics, negative numbers were not yet embraced. At the time that they were introduced there were mathematicians that viewed them in the same way that you view complex exponentials.

In A.D. 1759, Francis Maseres, an English mathematician, wrote that negative numbers "darken the very whole doctrines of the equations and make dark of the things which are in their nature excessively obvious and simple". He came to the conclusion that negative numbers were nonsensical (see Wikipedia under negative numbers).

Here is my mostly non-mathematical description of how they help us:
1 - Engineering problems almost universally involve sinusoidal signals. It has been shown that arbitrary signals can be constructed from sums of sinusoidal. So it is imperative that we find a way to deal with sinusoidal signals as easily as possible.
2 - When a sinusoidal is input into a LTI system, the output is also a sinusoid at the same frequency, but with different phase and amplitude.
3- Thus we can consider a sinusoidal to have two independent components, phase and amplitude (polar coordinates), or equivalently I & Q (rectangular coordinates).
For example if network input is 4cos(ωt+0) and network output might be 2cos(ωt+π/4)
Then, as a form of shorthand, we can consider the input and output to be ordered pairs:
input = (4,0) output (2,π/4) where the ordered pair is (amplitude, phase)

Or the previous example in rectangular coordinates:
network input is [4cos(ωt) + 0sin(ωt)] and network output is [(2/√2)cos(ωt) + (2/√2)sin(ωt)]
and the ordered pairs:
input = (4,0) output ((2/√2),(2/√2)) where the ordered pair is (I,Q)

If we stop here, then all problems will involve solving for two unknowns given two inputs. So we need to form two equations to solve for the two unknowns.

Here is where the beauty of complex numbers enters:
I can consider each ordered pair to be a single complex number. My input is a single number (complex). If I know the transfer function of the network as a single number (complex) then to find the output we just multiply.

Input: 4ej0
Transfer function: 0.5ejπ/2
Output: 2ejπ/2

Last edited: Mar 26, 2016
9. Mar 26, 2016

### Puglife

When you say

"Here is where the beauty of complex numbers enters:
I can consider each ordered pair to be a single complex number. My input is a single number (complex). If I know the transfer function of the network as a single number (complex) then to find the output we just multiply.

Input: 4ej0
Transfer function: 0.5ejπ/2
Output: 2ejπ/2 "

What exactly do you mean? I don't really get what you are trying to say. Also, how exactly did e start getting used, as well as the complex numbers. How exactly are both of them used, and how did mathematicians derive that.

10. Mar 26, 2016

### the_emi_guy

Ok, so let's first consider a transfer function that does not involve complex numbers. Lets say I am designing an instrument that measures temperature that uses a thermocouple. At any given temperature there will be a certain voltage generated on the thermocouple. Furthermore, lets assume that the transfer function is linear. To obtain temperature I measure thermocouple voltage then multiply by the transfer function.
For example if I measure 2 volts and the thermocouple transfer function is 12 degrees/volt, then temperature is (2 volts)(12deg/volt) = 24 degrees.

Now back to the complex number example above:
Assuming that we have determined that the transfer function of our network is 0.5ejπ/2
If our network input is 4ej0
Then the output is simply (4ej0)(0.5ejπ/2) = 2ejπ/2

Just as in the thermocouple case, I simply multiply the input times transfer function to obtain output.
In the complex case this simple procedure simultaneously resolves both magnitude and phase at output.

(sorry for using π/4 earlier then π/2 later in original post, hope this did not confuse)

Without the complex exponential we would have to have written out and solved two simultaneous equations for the two unknowns (sine components, cosine component).

As to the second part of your question regarding the history of complex numbers a good place to start is Wikipedia under "complex numbers"

11. Mar 26, 2016

### FactChecker

Phase shifts are very important in feedback systems, since feeding back a frequency with the wrong phase shift can turn a stable system into an unstable one. Complex numbers can represent phase shifts as simple complex multiplication. So the cumulative signal in a feedback system becomes related to an infinite power series in the complex plane. The complex exponential function is the best way to represent cyclic behavior, frequencies, and phase shifts.

12. Mar 27, 2016

### Puglife

ok, so how was that equation derived?

13. Mar 27, 2016

### Puglife

how is it the best way to model them? I still really dont see why we dont just use a sine wave, that is shifted with the appropriate phase wave? Isnt converting it, and using the complex exponential form of a wave, adding more steps that could go wrong? People could simply just enter anything into a wolf ram alpha type calculator, so complexity of solving it isnt much of an issue, because their is no real world example that I can think of where you would not be able to use a calculator to solve these.

14. Mar 27, 2016

### the_emi_guy

I have never heard of a sine wave shifted by a phase wave.

No, using complex exponential simplifys the math, as I showed in earlier post. Less math = less chance for error.

You have a point that there are certain skills that we have learned in the past that are now mostly obsolete given the computational tools we have at our disposal. For example, all of the rules we used to learn about how to estimate the peaking in the response of a Bode plot has been replaced by simply graphing the transfer function with Mathcad or equivalent.

However, complex exponentials are nowhere near this category. Complex exponentials are part of the common language that electrical engineers use to communicate ideas with each other. If you fail to embrace this you will find that you will be unable to follow a lecture or an application note etc.
It would be like deciding to skip calculus because you figure you can just depend on Wolfram, then getting lost when someone tries to convey an idea because you don't recognize an integral sign.

By the way, to the point of depending on Wolfram Alpha, go there and click on:
Engineering, control systems, transfer function.
I don't see any sine waves in there. To even use this Wolfram tool you need to know how to work in the frequency domain.

15. Mar 27, 2016

### FactChecker

Send a simple input signal, I, through a negative feedback loop with a gain of r and phase shift of Θ. Let z = r*e. Tracing the signal through and accumulating all the infinite loops gives an output of
O = I* (1 - z + z2 - z3 + ... ) = I * (1/(1+z)).
That gives the phase shift and gain of the feedback system. That would be tedious to calculate using an infinite sum of sines and cosines, all at different phases.

16. Mar 27, 2016

### Puglife

Ok, thanks, and phase wave was a total typo, i was meaning to shift a sine wave on the x axis accordingly, so that it could be the same as a cosine wave or anything in between. And the only actual application I have seen for the complex exponential was to avoid the use of differential equations, when modeling capacitors and inductors, which can be used with wolf ram alpha instead.

What other uses are their of the complex exponential aside from avoiding differential equations of capacitors and inductors? Also, can it be used for other things aside from modeling waves? ( I have no clue what, but am asking any way)

Thanks man

17. Mar 27, 2016

### Puglife

Could you do it with some sort of online calculator like wolfe ram alpha?

18. Mar 27, 2016

### FactChecker

I don't even know if you could type that problem in using trig functions. If you could, it would take longer than it would to do the complex version by hand. The complex variable approach is so much easier that it allows some profound insight into the problem. It's not just the way to solve many problems; it is the way to think about those problems. You might even know the answer intuitively, without doing calculations.

19. Mar 27, 2016

### Puglife

So the complex exponiential is just another way to right a sinusoidal wave, that uses euliers equivalence to model a sinusoidal wave as a e to the complex number, so that we can better do math, and conceptualize problems.

If all of that is correct, then how exactly does modeling them as an e to the complex number simplify the way things are conceptualized, this seems to be a really important part of ee, and I really need to understand it.

Also, what math, or things can I directly search up that can help me with fully understanding this, and its uses.

20. Mar 28, 2016

### FactChecker

There is too much to cover in a forum thread. In EE you will see a lot of examples in many classes. I can think of a few advantages off the top of my head:
1) Integrals and derivatives of the exponential turn into complex multiplication (no swapping sine/cosine). That helps a lot in solving differential equations. (You will see this concept repeated often. Things that are only changed by a multiplier when an operation is performed will be used to charactorize the operation.)
2) All polynomials can be completely factored. That helps a lot to see where division by zero might happen. Those points are fundamental to understanding a system.
3) The location in the complex plane of the poles of rational functions are used to study the response of a system to different frequencies.

P.S. Some mathematicians, including myself, consider Euler's formula to be the most important math equation of all.

Last edited: Mar 28, 2016
21. Mar 28, 2016

### Alpharup

Take this as axiom.....
Lim ( 1+x)^(1/x) = e
x-> 0
Here X is so small and if you compute 1.001^100, you may approximately get as 2.7

We have,
Lim e^x -1 = X
x-> 0
So,
Lim (e^x-1)/X= 1
x-> 0

With this result you can prove e^X has a derivative of e^x. Since it is differentiable, it is continuous.

Then use Wikipedia to get proof of Eulers theorem( I think others have explained before).

22. Mar 28, 2016

### Puglife

That is very interesting. Is the reason you all consider it that important is because of its use in solving complex differential equations? I would like to learn as much about it as I can, because as many have said, It is extremely important, and I dont want it to be something that I just use, I want to be able to fully be able to conceptualize it. Thank you for all of your responses, you have all been super helpful

23. Mar 28, 2016

### Puglife

Thank you, all of you have been super helpful

24. Mar 28, 2016

### Staff: Mentor

That is one of my favorite applications of complex numbers -- mapping transfer functions of systems to work with their stability. Instead of just looking at a 2-D plot of frequency response, you can see so much more in the 3-D complex plot...

http://www.crbond.com/images/filtarry.gif

EDIT -- There's a great plot at the Maxim IC website in an app note -- I'm looking to see if I can find it. The first time I saw it, I realized that I'd been missing something important...

25. Mar 28, 2016

### micromass

This is not about EE, but it might be helpful to show how complex numbers and the complex exponential can make math simpler.

Let's solve this integral: $\int e^x \sin(x)dx$.

This is an integral probably everybody encountered in their calculus class. Try to solve it again if you don't remember. There was a very dirty trick involved.

Let's solve the same integral using complex exponentials. First

$$\int e^x e^{ix} dx = \int e^{(1+i)x}dx = \frac{1}{1+i} e^{(1+i)x} + C = \frac{1-i}{2} e^x (\cos(x) + i \sin(x)) = \frac{e^x}{2} ( \cos(x) +\sin(x)) + i\frac{e^x}{2}(\sin(x)-\cos(x) ) + C$$

This means that
$$\int e^x \cos(x) dx + i \int e^x \sin(x)dx = \int e^x e^{ix} = \frac{1}{2} e^x \cos(x) + \frac{1}{2}e^x \sin(x) + \frac{i}{2} e^x \sin(x) - \frac{i}{2} e^x \cos(x) + C$$

So we get

$$\int e^x \sin(x) dx = \frac{1}{2}e^x \sin(x) - \frac{1}{2} e^x \cos(x) + C$$
and we get the integral of $\int e^x \cos(x)dx$ for free too.

So let us reflect for a bit. If you check both solutions, they're both about as long. I'd say that the solution without complex numbers is even a bit shorter. However, the solution with complex numbers did not require any ingenuity and any dirty tricks. It was a very easy straightforward computation. And this is always so with complex numbers. Everything you do with complex numbers can be done without complex numbers, but it often requires plenty more ingenuity and tricks. It often also requires special cases and uglier notation. If you work with complex numbers, you can often find solutions very routinely that you wouldn't have found so easily without complex numbers.

Maybe you think: why does it matter, I enjoy finding the tricks. Sure, you do. But you know who absolutely can't deal with tricks and ingenuities? A computer. You would have a very tough time programming a computer which is able to do all these tricks like the integral above. On the other hand, making a computer program which does it with complex numbers is pretty straightforward.