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

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 $$


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.