Monday, February 6, 2012

Complex numbers: Roots in polynomials of degree two

Here is how to solve the roots in polynomials of degree two with complex numbers. After explaining the approach I will go through an example.

We have a polynomial of the form: \[ p(z) = az^2 + bz + c \] To find the roots of this, we need to know the discriminant $D$, to know if the roots are complex. This is the case if $D < 0$. \[ D = b^2 -4ac \] If $D \geq 0$ the root(s) are real, and may be found using the formula: \[ x = \frac{-b\pm \sqrt{D}}{2a} \] If the discriminant is negative or complex, we need replace $\sqrt{D}$ with $w$, which is the solution to the equation $z^2-D = 0$. This is found by using the formula: \[ w = \pm\left( \sqrt{\frac{r+\alpha}{2}} + i\,\text{sgn}(\beta)\sqrt{\frac{r-\alpha}{2}} \right) \] Where the discriminant is given as $D = \alpha + \beta i$ and $r = \sqrt{\alpha^2 + \beta^2}$. $\text{sgn}$ is $+1$ or $-1$ depending on the value of $\beta$: \[ \text{sgn}(\beta) = \left\{ \begin{aligned}1,\qquad \text{if}\; \beta \geq 0, \\ -1,\qquad \text{if}\; \beta < 0. \end{aligned} \right. \] Now the roots may be found using the formula: \[ z = \frac{-b \pm w}{2a} \] Using $a$, $b$, and $c$ from the original polynomial and $w$ just found.

Worked example

Here's a worked example with the polynomial \[ z^2 + 2z - (2+4i) = 0 \] First we find the discriminant: \[ D = b^2 - 4ac = 2^2 - 4\cdot 1\cdot (-(2+4i)) = 12 +16i \] As this is a complex determinant, we now need to find $w$. With the discriminant $D = 12 + 16i$, $r = \sqrt{12^2 + 16^2} = \sqrt{400} = 20$ and $\text{sqn}(\beta)=1$. \[ w = \pm\left( \sqrt{\frac{20+12}{2}} + i\cdot 1\cdot \sqrt{\frac{20-12}{2}} \right) = \pm \left( \sqrt{16} +i\sqrt{4} \right) = \pm (4-2i) \] This enables us to find the roots for the original polynomial: \[ \begin{align} z &= \frac{-b\pm w}{2a} = \frac{-2 \pm (4-2i)}{2\cdot 1} = \frac{-2}{2} \pm \frac{4-2i}{2} \\ z_1 &= -1 + 2-i = 1-i &\qquad\text{Using} + \\ z_2 &= -1 -2+i = -3+i &\qquad\text{Using} - \\ \end{align} \]

No comments:

Post a Comment