# How do I solve quadratic equations when the coefficients are complex and real?

I needed to solve this: $$x^2 + (2i-3)x + 2-4i = 0$$

I tried the quadratic formula but it didn't work. So how do I solve this without "guessing" roots? If I guess $x=2$ it works; then I can divide the polynomial and find the other root; but I can't "guess" a root.

$b^2-4ac=4i-3$, now I have to work with $\sqrt{4-3i}$ which I don't know how. Apparently $4i-3$ is equal to $(1+2i)^2$, but I don't know how to get to this answer, so I am stuck.

• Why didn't the quadratic formula work? – carmichael561 Dec 22 '16 at 1:11
• How so "didn't work" :? Can you show us the work ? – user399481 Dec 22 '16 at 1:13
• when you get to the expression $\sqrt {b^2 - 4 a c},$ but the thing under the square root sign is a complex number, there are, indeed, two complex numbers, $u$ and $-u,$ such that $u^2 = b^2 - 4ac.$ You need to find them – Will Jagy Dec 22 '16 at 1:15
• @WillJagy the $\pm$ covers it already. – Simply Beautiful Art Dec 22 '16 at 1:59
• It seems to me the question is not "How do I solve quadratic equations when the coefficients are complex and real?" but rather "How do I simplify the square root of a complex number?" For that, see math.stackexchange.com/questions/44406/…. – mweiss Dec 26 '16 at 2:05

The thing that seems to be problematic is solving $$(x + iy)^2 = u + iv$$ for given real numbers $u,v,$ and $v \neq 0.$

The equations for real numbers that we get to use are $$\color{red}{x^2 - y^2 = u},$$ $$\color{red}{2xy = v},$$ $$\color{red}{x^2 + y^2 = \sqrt {u^2 + v^2}}.$$ The third one is about the magnitude of complex numbers. So $$2 x^2 = \sqrt {u^2 + v^2} + u,$$ $$2 y^2 = \sqrt {u^2 + v^2} - u,$$ while we need to be careful about $\pm$ signs because we need $2xy = v.$

Define real number $$w = \sqrt {u^2 + v^2},$$ so that $$w > |u| \geq 0.$$ Note that both $$w + u > 0,$$ $$w - u > 0.$$

Here I have made the choice to present the solution with $x > 0.$ There is a second solution, negate both $x,y.$ One solution is, when $v > 0,$ $$\color{blue}{ x = \sqrt { \frac{w + u}{2} }, \; \; \; y = \sqrt { \frac{w - u}{2} }}$$

when $v < 0,$ $$\color{blue}{ x = \sqrt { \frac{w + u}{2} }, \; \; \; y = - \sqrt { \frac{w - u}{2} }}$$

We can combine the two expressions if we include the signum function, https://en.wikipedia.org/wiki/Sign_function
$$\color{magenta}{ x = \sqrt { \frac{w + u}{2} }, \; \; \; y = \left( \operatorname{sgn} v \right) \sqrt { \frac{w - u}{2} }}$$

For your problem, $$u + iv = -3 + 4i,$$ so $u = -3,$ $v = 4,$ and $v > 0.$ Then $w = \sqrt {4^2 + 3^2} = 5.$

when $v > 0,$ $$\color{blue}{ x = \sqrt { \frac{5 + (-3)}{2} }, \; \; \; y = \sqrt { \frac{5 - (-3)}{2} }},$$ $$x = \sqrt 1, \; \; \; y = \sqrt 4$$

• I personally prefer this over taking the polar route, at least for something as simple as a quadratic. – J. M. isn't a mathematician Dec 22 '16 at 12:51
• You mention in your comment above worrying about the case $v = 0$, but in fact it's not a problem: in that case $w \in \{\pm u\}$, so $x$ or $y$ will come out to be $0$, and you can use either of your formulæ. (That is, the alternatives $v > 0$ and $v < 0$ can be replaced by the alternatives $v \ge 0$ and $v \le 0$, with intentional overlap.) Of course some statements, like $w > u$, now fail. – LSpice Dec 22 '16 at 17:28
• By the time you have equation $2x^2 = u+\sqrt{u^2 + v^2},$ you can plug in the known values of $u$ and $v$ and then easily solve for $x.$ Then plug this into $2xy=v$ and solve for $y.$ In the question, $u=-3$ and $v=4,$ so $2x^2=5-3=2$ and $x=\pm1$; for the case $x=1$ we have $2y=4$ and so $y=2.$ That's not as tidy as two equations whose left-hand sides are $x$ and $y,$ but those equations don't save enough effort to convince me to memorize them. – David K Dec 22 '16 at 19:52
• @DavidK, sure. However, I would say that pretty much everything I wrote above is beyond the strength of the OP, don't you think? Perhaps the idea that three explicit equations crop up might remain in memory, for a few students who see this; this might include the OP, who has wandered off. – Will Jagy Dec 22 '16 at 20:15
• You are probably right. And it occurs to me that the break-even point for memorizing a solved formula vs. remembering the first few steps depends on how often one faces that sort of problem, just as it does with the tradeoff between having some idea about completing the square and remembering the standard formula to solve a quadratic equation. In any case, I have no complaint about seeing the general formulas worked all the way through to the end (and I had already voted for the answer before commenting). – David K Dec 22 '16 at 20:37

The quadratic formula is perfectly valid here for the same reason for which it is valid when working only with real numbers: $$\frac{-b\pm\sqrt{b^2 - 4ac}} 2 = \frac{-(2i-3) \pm\sqrt{-3+4i}} 2.$$ The question now is how to find $\pm\sqrt{-3+4i}.$

In polar form, you have $-3+4i = \sqrt{3^3+4^2} \cdot(\cos\alpha+i\sin\alpha) = 5(\cos\alpha+i\sin\alpha)$ where $\cos\alpha = -3/5$ and $\sin\alpha = 4/5,$ so $\tan\alpha = -4/3.$ We then have $$\sqrt{5(\cos\alpha+i\sin\alpha)} = \sqrt 5 \cdot\left( \cos\frac\alpha 2 + i\sin\frac\alpha 2 \right).$$

Now recall from trigonometry that $\tan\dfrac\alpha 2 = \dfrac{\sin\alpha}{1+\cos\alpha} = \dfrac{4/5}{1+(-3/5)} = 2.$

Since $\tan=\dfrac{\text{opposite}}{\text{adjacent}}$, we want $\tan\dfrac\alpha 2 = \dfrac 2 1.$ Since $\tan={\sin}/{\cos},$ the fact that $\tan=2$ means that $\sin = 2\cos.$ Thus we have $$\sqrt 5 \cdot \left( \cos\frac\alpha 2 + i\sin\frac\alpha 2 \right) = \sqrt 5 \left( f + i (2f) \right)$$ where $f^2 + (2f)^2 = \cos^2 + \sin^2 = 1,$ so $f=\dfrac 1 {\sqrt 5},$ and we then have $$\sqrt 5\left(\cos\frac\alpha 2 + i\sin\frac \alpha 2\right) = \sqrt 5\left( \frac 1 {\sqrt 5} + i \frac 2 {\sqrt 5} \right) = 1 + 2i.$$ Thus $\pm\sqrt{-3+4i} = \pm(1+2i).$

The quadratic equation works for real and imaginary coefficients (but maybe without as much geometric intuitiveness when there are imaginary coefficients). You can "check" this by trying to use the quadratic equation and then substituting back in your answers to see if we get $0$. We have $a=1$, $b=2i-3$, $c=2-4i$: $$x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}=\dfrac{-2i+3\pm\sqrt{(2i-3)^2-4(2-4i)}}{2}$$ $$= \dfrac{-2i+3\pm\sqrt{-4+9-12i-8+16i}}{2}=\dfrac{-2i+3\pm\sqrt{4i-3}}{2}$$ Not pretty, but a quick check in your equation of $x^2+(2i-3)x+2-4i$ with $x=\dfrac{-2i+3+\sqrt{4i-3}}{2}$ gives: $$\left(\dfrac{-2i+3+\sqrt{4i-3}}{2}\right)^2+(2i-3)\cdot\left(\dfrac{-2i+3+\sqrt{4i-3}}{2}\right)+2-4i$$ $$= \dfrac{(-2i+3)^2+4i-3+2(-2i+3)\sqrt{4i-3}}{4}+\dfrac{-(-2i+3)^2+(2i-3)\sqrt{4i-3}}{2}+2-4i$$ $$=\frac{-(-4+9-12i)+4i-3-2(2i-3)\sqrt{10i-3}+2(2i-3)\sqrt{10i-3}}{4}+2-4i$$ $$=\dfrac{-8+16i}{4}+2-4i=0\qquad\checkmark$$ and the other root should (hopefully) follow the same arithmetic, but still work just the same.

The square root is not a well defined function on complex numbers. If you want to find out the possible values, the easiest way is probably to go with "Polar form", that is, converting your number into the form

$$r(\cos(\theta) + i \sin(\theta))$$ and then taking root of it,

where $r$ is the modulus of the complex number and $\theta$ is the angle with positive direction of $x$-axis or you could find it using $|\frac{y}{x}|$

For example: $$\sqrt3+i$$for this $$r=\sqrt{\sqrt3^2+1^2}$$ and $$\tan\theta=\frac{1}{\sqrt3}$$ and $$\theta = \frac{\pi}{6}$$ and the polar form is $$2(\cos(\frac{\pi}{6})+i\sin(\frac{\pi}{6}))$$ then find the square root of . which will be $$\pm\left[\sqrt2(\cos(\frac{\pi}{12}+\sin(\frac{\pi}{12}))\right]$$ $$\text{OR}$$ You can use the formula $$r(\cos(\theta)+ i \sin(\theta))^{1/2} = ±[\sqrt{r}(\cos(\theta/2) + i \sin(\theta/2)].$$

You can find real roots (or purely imaginary roots) without guessing, and in some ways it's nicer than finding square roots of complex discriminants. A real root will preserve the real and complex components, so just write down the equations along the real and imaginary axes. In this case $$x^2-3x+2=0 \quad \quad 2ix -4i = 0$$ $2$ satisfies both so is a root.

Sometimes questions have small tricks in them which allow for quick solutions. This question is one of them if the expression is rearranged and factorised.

$x^2+(2i−3)x+(2−4i) = 0$

Group the real and imaginary components: $x^2-3x+2+2ix-4i=0$

Now factorise: $(x-1)(x-2)+2i(x-2)=0$

...and factorise again: $(x-2)(x-1+2i)=0$

...and applying the null factor theorem, $x=2$ or $x=1-2i.$

I know that this is just a lucky coincidence with this question but it is a technique nonetheless to solve problems. My best advice would be to know as many techniques as possible, such as:

• factorisation (on occasion it gives elegant solutions like the one above)
• sum/product of roots (uses simultaneous equations)
• trial and error/factor theorem

and more, using simpler techniques wherever you can.

Square roots of complex numbers can either be dealt with algebraically or using the polar forms in other solutions here. Doing so algebraically can be done by using an identity with standard forms of complex numbers ($x+iy$, $a+ib$ etc.) and simultaneous equations.

let $Z = \sqrt{4i-3}$ where Z is complex.

i.e. $Z$ is of the form $Z = a + ib$, where $a$ and $b$ are REAL coefficients. (This is important later on.)

Square both sides: $Z^2 = -3+4i$

Expand the standard form of $Z^2$: $(a+ib)^2 = -3+4i$

This becomes $a^2 - b^2 + 2abi = -3+4i$

The above is an identity and so the real and imaginary parts can be equated. Hence two equations are formed:

$a^2 - b^2 = -3$................(1)

$2abi = 4i$ which becomes $ab = 2$......(2)

In (2), $b = 2/a$ so $a^2 - (2/a)^2 + 3 = 0$

i.e. $a^4 + 3a^2 - 4 = 0$ (multiplying all by $a^2$ and rearranging)

which is a quadratic-styled quartic: $(a^2 + 4)(a^2 - 1) = 0.$

Solving, $a=1, -1, 2i$ and $-2i$

BUT

since $a$ and $b$ are real, we discard $2i$ and $-2i$.

Now we simply solve for $b$ using $b = 2/a$. Hence the solutions are $a=1, b=2$ or $a=-1, b=-2$.

and so $\sqrt{4i-3} = \pm(1+2i)$ since we defined $Z = a+ib$.

Best of luck with any future questions! Hope this helped.

• Just add $around math expressions, expressed in the LaTeX formatting. – PearlSek Dec 23 '16 at 22:21 • Well that was simpler than I thought, thanks for that! – M.Diggerson Dec 26 '16 at 1:47 The crux of your problem is solving$z^2=u+vi$, the right-hand side being your discriminant with$v\ne 0$. Suppose$z=s+ti$so$s^2-t^2=u$and$2st=v$. Squaring these equations, summing and taking a square root,$s^2+t^2=\sqrt{u^2+v^2}$. You now have$s^2\pm t^2$so have$s^2,\,t^2$. There are four roots of which two are excluded by the sign of$st$. In this case we have$s^2-t^2=4,\,2st=-3$so$s^2+t^2=5,\,s^2=\frac{9}{2},\,t^2=\frac{1}{2}$. The square roots are$\pm\frac{3-i}{\sqrt{2}}$. From the quadratic formula,$x = \frac{3-2i \pm \sqrt{5 - 12i -4(2-4i)}}{2} = \frac{3-2i \pm \sqrt{4i - 3}}{2} $. Note that$i$is just a constant and not a variable, and can be treated as such. Now, from DeMoivre's theorem,$\sqrt{z} = \sqrt{r}\operatorname{cis}\left(\dfrac{\theta + 2\pi k} 2\right)$, where$z = 4i - 3$and$r = \sqrt{4^2 + (-3)^2}$,$k = 0,1$. From there you can simplify further. • It can be treated as costant, but the issue here seems to be that the person who asked the question does not know how to mechanically get that$4i-3=(1+2i)^2\$, – user228113 Dec 22 '16 at 1:21
• True, true. I left an edit setting up the use of DeMoivre's – David Bowman Dec 22 '16 at 1:26