Engineers work in the real world, civil engineers designed buildings and bridges. But it turns out that some of the computations that engineers do can make use of complex numbers. We'll see that in the differential equations course, that to solve certain equations, to find the real solution, the easiest path is to go through the complex number space. So, in this video I want to teach you the basics of complex numbers that you'll need say in a differential equations course. What is a imaginary number or the imaginary unit? The imaginary unit we call that i is the number that when you square it, you get minus one. So, in fact there are two numbers that when you square it, you get minus one. That's i and minus i. In a real expression, when you use complex numbers, typically, you'll end up with solutions that contain both i and minus i. Okay. So, symbolically, we just write I is equal to the square root of minus one. That just means that I squared is equal to minus one. And then we represent a complex number z as a real number i plus i times a real number y. So, x and y are real and i is our imaginary unit here. There are functions associated with complex numbers that we haven't seen before with real numbers. One of them is called the complex conjugate. We write that as z bar that's equal to x minus iy, that's called the complex conjugate. All you do is in an expression with real numbers and i. You form the complex conjugate by changing i to minus i. These two other functions, there's the real part of z that's equal to x. The part of z that doesn't have i in it. So, x is the real part of z. You see you can form x using z and z bar. You can add z and z bar and the iy cancels, and you end up with 2x. So, this is a linear combination of z and z bar is equal to z plus z bar divided by two. Okay and that's real. That's the real part of z. The other function then is called the imaginary part of z. We write that as IM for imaginary part of z. That's equal to y a piece that multiplies i. Then how do you get the imaginary part of z from z and z bar? You can say z minus z bar so the x is eliminated. So, that's z minus z bar. Then you get 2iy. So, you have to divide by 2i. Okay. z and z bar are useful in one more way if you multiply them. So, if you take z times z bar, that would be x plus iy times x minus iy. So, the cross term cancels. So, you would get x squared minus iy squared. But that's simplifies. So, when you have an expression and you have an I squared in the expression, I squared becomes minus one. So, here we have an I squared in the expression and that simplifies to x squared plus y squared which is the real part of z squared plus the imaginary part of z squared. Okay, you can add complex numbers and get a complex number. You can subtract complex numbers you can multiply complex numbers and get a complex number. In that case, you have to take care that i squared equals minus one. I cubed then would be minus i, i to the fourth would be one. So, you just use the principle that i squared equals minus one. You can also divide complex numbers. Division of complex numbers requires a trick. So, let's say you have a two complex numbers z and w. If you wanted to divide z by w. The trick you use is that you want the denominator then to become a real number. So, you multiply by w bar in the numerator and the denominator. Okay. I think there is one more point here that I should make. So, say we have two complex numbers z and w and they're equal z or z can be a function that is a function that has complex expressions in it. W can be another function with complex expressions. If you have these two objects z and w that are equal, this is a complex expression, but very nicely this is equivalent to two real expressions. So, z equals w is equivalent to the real part of z equals the real part of w and the imaginary part of z equal to the imaginary part of w. So, we'll see that when we study differential equations that we may have a differential equation that we write as a complex differential equation, a differential equation for a complex function. But, that's actually equivalent to two differential equations for two real functions. The real functions would be the real part of the complex function and the imaginary part of the complex function. Okay. These are the real fundamentals of complex numbers in terms of their algebra. We have to think about one function though that's very important in the differential equations course. That's the exponential function. So, let's look at e_i Theta. Okay. So, what is this function? So, theta is some real angle but here i is the square root of negative one. So, we have to define this exponential function in some way. The proper way to define this is through the Taylor series. The Taylor series you can show in a math course. The Taylor series is convergent for all arguments here. So, we don't have to worry in this course for engineers about convergence but we can divine that through the Taylor series. So, if you remember from your calculus course the Taylor series for the exponential function would be one plus i Theta plus i theta squared over two factorial, plus i Theta, cubed over three factorial plus i Theta_fourth over four factorial etc. So, that's basically the definition of e_i Theta through the Taylor series. Then we want to write that as a complex number. So, that means we want to write that as a real part plus i times an imaginary part. So, what is the real part here? One is real. i Theta, Theta is part of the imaginary part then. i Theta squared over two factorial, that has an i squared, i squared is minus one. So, we can because that third term then becomes minus Theta squared over two factorial. The fourth term has an i cubed, i cubed is i squared times i is minus i, as part of the imaginary term, and then the fourth term has an i to the fourth. So, i to the fourth is minus one times minus one is plus one. So, we have a plus Theta to the fourth over four factorial, et cetera. So, this series is the real part of e to the i Theta, plus i, times the imaginary part of e to the i Theta. So, we have an i times Theta. So, the first term here is Theta. We have an i cubed, which is i squared times i is minus i. Then, we have a Theta cubed over three factorial. So, we have a Theta minus Theta cubed over three factorial. Then, the next term here will be Theta to the fifth over five factorial, et cetera. Okay. Now, you have to think back to your calculus course. This is a Taylor series expansion for cosine Theta, and the second expression here, series here is a Taylor series expansion for sine Theta. So, we have the very important formula here, that e to the i Theta is equal to cosine Theta plus i sine Theta. A connection between the exponential function and the trigonometric functions. Extremely useful, and particularly in our differential equations course, we'll be using this all the time. There's a famous formula that comes from this. It's called Euler's identity. If you put Theta equal to Pi, then we have cosine Pi equals one, sine Pi equals zero. So, cosine Pi equals minus one, sine Pi equals zero. So, again, e to the i Pi equals minus one, and the famous expression which maybe you'll see on tee-shirts is I'll write it down here, e to the i Pi plus one equals zero. Okay. Euler wrote down this expression for King and this is how the story goes, and said that this proves the existence of God. Why is this such a beautiful expression? In one expression, we have one, two, three, four, five key numbers of mathematics,. The zero, the one, and the i, and then we have e and Pi, the two most important, what we say are transcendental numbers. Then, we have one addition, we have one multiplication, i times Pi, and one exponentiation, e to the i Pi. A beautiful expression. Okay. One more point I want to make about these complex numbers, we can put them in what's called the complex plane, we can draw a graph. Let me put it here. We can say the x-axis is the real part of z and the y axis is the imaginary part of z, and we can put a complex number z. So, let's put it here. So, that's our complex number z, and I can write that as x plus iy, and draw a vector from the origin to that complex number. Okay. If you remember your polar coordinates, then we have an angle here Theta, we have a length of this vector r. Okay. What are the polar coordinates of this complex number? We have x equals r cosine Theta, and we have y equals r sine Theta. Putting it together, then we have z equals x plus iy. We factor out an r, we have cosine Theta plus i sine Theta. Then, we have our wonderful expression, e to the i Theta, is cosine Theta plus i sine Theta. So, this becomes re to the i Theta. That's called the polar representation of z. So, z we can write as x plus iy, or we can write it as re to the i Theta, r is this length, Theta is the angle it makes with the x-axis. Also, very useful in computations. So, let me review. We're introducing the imaginary unit here, the number that when you square it, you get minus one. Symbolically, everyone writes i equals the square root of minus one. We have a complex number z equals a real number plus i times the imaginary number, and then I define a function which is called the complex conjugate of z, z bar is x minus iy. You just change i to minus i. We have the real part of z is x, the imaginary part of z equals y. We can get the real part of z from a linear combination of z and z bar, and we can get the imaginary part of z from a different linear combination. Remember, the real part of z and the imaginary part of z are both real numbers. If we multiply z and z bar, we also get a real number, which is x squared plus y squared, which is actually r, the length of this complex number in the complex plane. Addition, multiplication, subtraction are straightforward, if we use i squared equals minus one. Division has a trick to do, we make the denominator real by multiplying by its complex conjugate. Often, we have a complicated complex expression, z equals w. But don't despair, these are just two real equations. The real part of z equals the real part of w, and the imaginary part of z equals the imaginary part of w. Finally, we've defined what it means to be e to the i Theta through its Taylor series. When we do that, we see that e to the i Theta is cosine Theta plus i sine Theta, a very useful expression. Our first use is here, where we say that a complex number x plus iy can also be written as r times e to the i Theta. I'm Jeff Chasnov, thanks for watching, and don't be afraid of complex numbers, they are very useful.