If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Solving quadratic equations: complex roots

Solving quadratic equations can lead to complex solutions. Listen to Sal break down the process using the quadratic formula and standard form. Then, learn how to verify these complex solutions, ensuring you've got the right answer. It's all about turning tricky problems into solvable equations! Created by Sal Khan and Monterey Institute for Technology and Education.

Want to join the conversation?

  • piceratops ultimate style avatar for user Ari Mendelson
    If you graph a quadratic equation that has only complex roots, you will get a parabola that never crosses the X axis. Is there a type of representation or graph on which you can graph such an equation that will show at which points the equation crosses the X axis if, instead of a one-dimensional axis, you represent the horizontal as the complex plane?
    (94 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Romuald GYŐRGY
      I think a way to do that is to make a 3D chart that has the complex coordinates on the horizontal axis. You would put the absolute value of the result on the z-axis; when x is real (complex part is 0) the absolute value is equal to the value of the polynomial at that point.
      The absolute value is always non-negative, and the solutions to the polynomial are located at the points where the absolute value of the result is 0. You could make two representations, one for the real value of the result and one for the imaginary value of the result, but you would have to search for the point(s) where those 2 are both 0.

      I came up with the following piece of code written in MATLAB:
      numberOfPointsOnTheAxis = 101;
      p = [1 -6 10]; % 1*x*x -6*x +10 ; the coefficients of the polynomial

      % the real part goes from 1 to 4
      realPart = linspace(1,4,numberOfPointsOnTheAxis);
      % the imaginary part goes from -2 to 2
      imaginaryPart = linspace(-2,2,numberOfPointsOnTheAxis);

      x = ones(numberOfPointsOnTheAxis,1) * realPart(:)' + ...
      imaginaryPart(:) * ones(1,numberOfPointsOnTheAxis) * 1i;

      y = p(1)*x.^2 + p(2)*x + p(3);

      close all
      surf(realPart, imaginaryPart, abs(y))
      hold on
      plot3(realPart, zeros(1,numberOfPointsOnTheAxis), ...
      p(1)*realPart.^2 + p(2)*realPart + p(3), 'r-', 'LineWidth',3)
      colorbar

      xlabel('real part')
      ylabel('imaginary part')
      zlabel('absolute value of result')


      The red line is the parabola that you normally get when using only real coordinates
      (16 votes)
  • orange juice squid orange style avatar for user Cameron Jaillet
    -i^2 = -1?
    I understand that +i^2=-1 as i = sqrt-1, can someone show me how -i^2=-1 please?
    Anyone? (I think its similar to the reason you have 2 answers in quadratics but I still dont know what value n should be)
    (35 votes)
    Default Khan Academy avatar avatar for user
  • mr pants green style avatar for user John Smith
    Can someone explain to me what Sal is doing at onwards?
    (24 votes)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user Patrick Stetz
      Sal is using the same FOIL technique except now there are complex numbers.

      ((3 + i) / 2)^2 can also be written as ((3 + i) * (3 + i)) / (2 * 2).

      By using FOIL the numerator will become:
      F: 3 * 3 = 9
      O: 3 * i = 3i
      I: 3 * i = 3i
      L: i * i = -1

      (3 + i) * (3 + i)
      --> 9 + 3i + 3i - 1
      --> 8 + 6i

      Hopefully from here, the path forward is becoming clear. We know what (3 + i)^2 equals so lets's plug it into 2 * [(3 * i)^2 / (2^2)].

      2 * [(3 * i)^2 / (2^2)]
      --> 2 * [(8 + 6i) / 4]
      --> 4 * (4 + 3i) / 4
      --> 4 + 3i

      I hope this helps!
      (62 votes)
  • aqualine ultimate style avatar for user SD
    At , Sal says that (-i)^2 is -1. Why is this the case?

    I understand the definition of i^2 = - 1, but not quite this part.
    (8 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Amit Sravan
    Is there any video lessons on De Moivre's theorem?
    And how to find out the value of log(i) ? Can it be done by Euler's formula?
    (15 votes)
    Default Khan Academy avatar avatar for user
    • hopper happy style avatar for user Ekoyta
      I can't seem to find any videos on de Moivre's theorem, either, but I do know that the idea that (cos x + i*sin x)^n = cos(nx) + i*sin(nx) can be derived from Euler's formula. <https://www.khanacademy.org/math/ap-calculus-bc/bc-series-new/bc-10-14/v/euler-s-formula-and-euler-s-identity>
      I don't know if this is how you've seen it, but the version of de Moivre's theorem in my textbook is r^(1/n)*(cos((x + 2pi*k)/n) + i*sin((x + 2pi*k)/n)). Clearly a very different formula, but that doesn't mean it can't be derived from that first expression.
      Technically (cos x + i*sin x)^n = (r*(cos x + i*sin x))^n, but the r is omitted because we're usually talking about the unit circle (r=1). Keeping that in mind, let's arbitrarily substitute n for 1/n. (In that first case, n represents any old number, but with 1/n, n is the number of roots)
      Now we have r^(1/n)*(cos(x/n) + i*sin(x/n)).
      ...so what about the +2pi*k? Well, substitute x with x+2pi*k and voila!
      r^(1/n)*(cos((x + 2pi*k)/n) + i*sin((x + 2pi*k)/n))
      Note: x+2pi*k just refers to any angle coterminal with x, so they are equivalent
      (4 votes)
  • blobby green style avatar for user s102543
    Where did the 6i come from?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • piceratops tree style avatar for user Maddie
    Why do we need imaginary numbers anyway...
    (6 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user Ben Lou (hai!)
    What if on a quadratic equation with no real solutions, I add an "i" in front of the "x^2" and then graph it? If I then found the roots to that quadratic equation, how would these roots be related to the roots of the first equation?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam blue style avatar for user Niema Moshiri
      think about it! So if you have some quadratic equation Ax^2 + Bx + C = 0, and you multiply each "x" term by i, you'd get iAx^2 + iBx C = 0. Now, let's try dividing the whole equation by "i": even though it's imaginary, it's still a number, right? iAx^2 becomes Ax^2, iBx becomes Bx, C becomes (C/i), and 0 becomes 0 (0 divided by ANY number, even imaginary ones, is always equal to 0). Put it together and we get Ax^2 + Bx + (C/i) = 0. Our equation looks the same as the original, except C is now different. Using the quadratic equation:
      x = (-B +- sqrt(B^2 - 4A(C/i)^2))/2A. (C/i)^2 = C^2 / i^2, which equals C^2 / -1. Plug it in:
      x = (-B +- sqrt(B^2 + 4AC))/2A (remember, minus -C^2 is the same as plus C^2)

      Compare this to the solution of our original equation:
      x = (-B +- sqrt(B^2 - 4AC))/2A

      As long as A, B, and C are not zero (you're dealing with an actual quadratic equation), you can see that x is different.

      Long story short: the roots will NOT be the same as the first equation! Hope that helped!
      (8 votes)
  • blobby green style avatar for user bareerah hamid
    at , why is ONLY the principal square root of 4 taken. shouldnt BOTH +2 & -2 be taken as the square root of 4??
    (2 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Scott Winegarden
      You ask a good question and you are right in your thinking. By definition, the Principal root of a number is the same sign as the real number. For example, both -4 and +4 are the square roots of 16. So, to talk about just the principal root of 16 means we discuss the "n"th root of 16 that has the "same sign" as the number in question. Since 16 is positive, the principal square root is +4 (even though -4 is also a square root)

      The concept of principal root of a number means we only have to talk about one possible answer, instead of working through both the positive answer and the negative answer, if both can exist.

      So by Sal discussing the principal square root of 4, I think he is trying to simplify the discussion.
      (11 votes)
  • male robot hal style avatar for user johnnyman242
    At , Sal changes 3±i/2 into 3/2+(1/2)i OR 3/2-(1/2)i. I understand the 3±i/2 and I understand the OR (it's because of the plus OR minus), but I don't understand how he changed it into 3/2±(1/2)i. Thank you.
    (3 votes)
    Default Khan Academy avatar avatar for user

Video transcript

We're asked to solve 2x squared plus 5 is equal to 6x. And so we have a quadratic equation here. But just to put it into a form that we're more familiar with, let's try to put it into standard form. And standard form, of course, is the form ax squared plus bx plus c is equal to 0. And to do that, we essentially have to take the 6x and get rid of it from the right hand side. So we just have a 0 on the right hand side. And to do that, let's just subtract 6x from both sides of this equation. And so our left hand side becomes 2x squared minus 6x plus 5 is equal to-- and then on our right hand side, these two characters cancel out, and we just are left with 0. And there's many ways to solve this. We could try to factor it. And if I was trying to factor it, I would divide both sides by 2. If I divide both sides by 2, I would get integer coefficients on the x squared in the x term, but I would get 5/2 for the constant. So it's not one of these easy things to factor. We could complete the square, or we could apply the quadratic formula, which is really just a formula derived from completing the square. So let's do that in this scenario. And the quadratic formula tells us that if we have something in standard form like this, that the roots of it are going to be negative b plus or minus-- so that gives us two roots right over there-- plus or minus square root of b squared minus 4ac over 2a. So let's apply that to this situation. Negative b-- this right here is b. So negative b is negative negative 6. So that's going to be positive 6, plus or minus the square root of b squared. Negative 6 squared is 36, minus 4 times a-- which is 2-- times 2 times c, which is 5. Times 5. All of that over 2 times a. a is 2. So 2 times 2 is 4. So this is going to be equal to 6 plus or minus the square root of 36-- so let me just figure this out. 36 minus-- so this is 4 times 2 times 5. This is 40 over here. So 36 minus 40. And you already might be wondering what's going to happen here. All of that over 4. Or this is equal to 6 plus or minus the square root of negative 4. 36 minus 40 is negative 4 over 4. And you might say, hey, wait Sal. Negative 4, if I take a square root, I'm going to get an imaginary number. And you would be right. The only two roots of this quadratic equation right here are going to turn out to be complex, because when we evaluate this, we're going to get an imaginary number. So we're essentially going to get two complex numbers when we take the positive and negative version of this root. So let's do that. So the square root of negative 4, that is the same thing as 2i. And we know that's the same thing as 2i, or if you want to think of it this way. Square root of negative 4 is the same thing as the square root of negative 1 times the square root of 4, which is the same. I could even do it one step-- that's the same thing as negative 1 times 4 under the radical, which is the same thing as the square root of negative 1 times the square root of 4. And the principal square root of negative 1 is i times the principal square root of 4 is 2. So this is 2i, or i times 2. So this right over here is going to be 2i. So we are left with x is equal to 6 plus or minus 2i over 4. And if we were to simplify it, we could divide the numerator and the denominator by 2. And so that would be the same thing as 3 plus or minus i over 2. Or if you want to write them as two distinct complex numbers, you could write this as 3 plus i over 2, or 3/2 plus 1/2i. That's if I take the positive version of the i there. Or we could view this as 3/2 minus 1/2i. This and these two guys right here are equivalent. Those are the two roots. Now what I want to do is a verify that these work. Verify these two roots. So this one I can rewrite as 3 plus i over 2. These are equivalent. All I did-- you can see that this is just dividing both of these by 2. Or if you were to essentially factor out the 1/2, you could go either way on this expression. And this one over here is going to be 3 minus i over 2. Or you could go directly from this. This is 3 plus or minus i over 2. So 3 plus i over 2. Or 3 minus i over 2. This and this or this and this, or this. These are all equal representations of both of the roots. But let's see if they work. So I'm first going to try this character right over here. It's going to get a little bit hairy, because we're going to have to square it and all the rest. But let's see if we can do it. So what we want to do is we want to take 2 times this quantity squared. So 2 times 3 plus i over 2 squared plus 5. And we want to verify that that's the same thing as 6 times this quantity, as 6 times 3 plus i over 2. So what is 3 plus i squared? So this is 2 times-- let me just square this. So 3 plus i, that's going to be 3 squared, which is 9, plus 2 times the product of three and i. So 3 times i is 3i, times 2 is 6i. So plus 6i. And if that doesn't make sense to you, I encourage you to kind of multiply it out either with the distributive property or FOIL it out, and you'll get the middle term. You'll get 3i twice. When you add them, you get 6i. I And then plus i squared, and i squared is negative 1. Minus 1. All of that over 4, plus 5, is equal to-- well, if you divide the numerator and the denominator by 2, you get a 3 here and you get a 1 here. And 3 distributed on 3 plus i is equal to 9 plus 3i. And what we have over here, we can simplify it just to save some screen real estate. 9 minus 1 is 8. So if I get rid of this, this is just 8 plus 6i. We can divide the numerator and the denominator right here by 2. So the numerator would become 4 plus 3i, if we divided it by 2, and the denominator here is just going to be 2. This 2 and this 2 are going to cancel out. So on the left hand side, we're left with 4 plus 3i plus 5. And this needs to be equal to 9 plus 3i. Well, you can see we have a 3i on both sides of this equation. And we have a 4 plus 5, which is exactly equal to 9. So this solution, 3 plus i, definitely works. Now let's try 3 minus i. So once again, just looking at the original equation, 2x squared plus 5 is equal to 6x. Let me write it down over here. Let me rewrite the original equation. We have 2x squared plus 5 is equal to 6x. And now we're going to try this root, verify that it works. So we have 2 times 3 minus i over 2 squared plus 5 needs to be equal to 6 times this business. 6 times 3 minus i over 2. Once again, a little hairy. But as long as we do everything, we put our head down and focus on it, we should be able to get the right result. So 3 minus i squared. 3 minus i times 3 minus i, which is-- and you could get practice taking squares of two termed expressions, or complex numbers in this case actually-- it's going to be 9, that's 3 squared, and then 3 times negative i is negative 3i. And then you're going to have two of those. So negative 6i. So negative i squared is also negative 1. That's negative 1 times negative 1 times i times i. So that's also negative 1. Negative i squared is also equal to negative 1. Negative i is also another square root. Not the principal square root, but one of the square roots of negative 1. So now we're going to have a plus 1, because-- oh, sorry, we're going to have a minus 1. Because this is negative i squared, which is negative 1. And all of that over 4. All of that over-- that's 2 squared is 4. Times 2 over here, plus 5, needs to be equal to-- well, before I even multiply it out, we could divide the numerator and the denominator by 2. So 6 divided by 2 is 3. 2 divided by 2 is 1. So 3 times 3 is 9. 3 times negative i is negative 3i. And if we simplify it a little bit more, 9 minus 1 is going to be-- I'll do this in blue. 9 minus 1 is going to be 8. We have 8 minus 6i. And then if we divide 8 minus 6i by 2 and 4 by 2, in the numerator, we're going to get 4 minus 3i. And in the denominator over here, we're going to get a 2. We divided the numerator and the denominator by 2. Then we have a 2 out here. And we have a 2 in the denominator. Those two characters will cancel out. And so this expression right over here cancels or simplifies to 4 minus 3i. Then we have a plus 5 needs to be equal to 9 minus 3i. I We have a negative 3i on the left, a negative 3i on the right. We have a 4 plus 5. We could evaluate it. This left hand side is 9 minus 3i, which is the exact same complex number as we have on the right hand side, 9 minus 3i. So it also checks out. It is also a root. So we verified that both of these complex roots, satisfy this quadratic equation.