Showing posts with label Complex Numbers. Show all posts
Showing posts with label Complex Numbers. Show all posts

Friday, February 10, 2012

Simplifying trigonometric products into trigonometric sums

It can be hard to differentiate products of trigonometric functions like this one: \[ \cos{y}\sin{y} \] It is easier when the functions are separated like this: \[ \cos{y}+\sin{y} \] for example. Therefore I will here describe how to transform equations of the first form into equations of the second form using the Euler's formula.

Euler's formula lets us transform the $\sin$ and $\cos$ parts into this: \[ \begin{aligned} \DeclareMathOperator{\e}{e} \cos(y) &= \frac{\e^{iy} + \e^{-iy}}{2} \\ \sin(y) &= \frac{\e^{iy} - \e^{-iy}}{2i} \end{aligned} \]

By doing this we can make use of the rules for products of $\e$, which are preserved for complex numbers: \[ \e^{z_1}\;\e^{z_2} = \e^{z_1+z_2} \] and magically doing this will end up with some parts that can be put back on the regular trigonometric form be reversing Euler's formula.

Worked example

I will now rewrite trigonometric products like this: \[ \sin{3x}\cos{5x} = \frac{1}{2} (\sin{8x} - \sin{2x}). \]

First, I will rewrite the left side using Euler's formula: \[ \left( \frac{\e^{3xi} - \e^{-3xi}}{2i} \right) \left( \frac{\e^{5xi} + \e^{-5xi}}{2} \right). \]

I pull the denominator out in front, and use the product rules of $\e$: \[ \begin{aligned} &\frac{1}{4i} (\e^{3xi + 5xi} + \e^{-3xi + 5xi} - \e^{-3xi + 5xi} - \e{-3xi - 5xi}) \\ = &\frac{1}{4i}(\e^{8xi} + \e^{-2xi} - \e{2xi} - \e^{-8xi}) \end{aligned} \]

I break it up in two parts: \[ \frac{1}{4i} (\e^{8xi} - \e^{-8xi}) + \frac{1}{4i} (\e^{-2xi} - \e^{2xi}) \]

Now what we are trying to do is to get it on the form defined by Euler's formula. Because there is a minus between the $\e$-s in both the first and the second part, we assume that we want to go back to sinus in both cases. Sinus was defined as: \[ \sin(y) = \frac{\e^{iy} - \e^{-iy}}{2i} \] and therefore part of the denominator of $\frac{1}{4i}$, is “pulled” into the equation like this: \[ \frac{1}{2} \left(\frac{\e^{8xi} - \e^{-8xi}}{2i}\right) + \frac{1}{2} \left(\frac{\e^{-2xi} - \e^{2xi}}{2i}\right) \]

Now the “equation” is on the Euler's form, and can be put back as an ordinary trigonometric function. Taking the signing into condition, it ends up like this: \[ \frac{1}{2} (\sin{8x} - \sin{2x}) \] and thereby the first statement is proved.

Solving roots in binomial complex equations

In this post I will describe how to solve binomial complex equations of the form \[ z^n = a + bi. \]

This is done by first putting the right side on polar form using the following: \[ \begin{aligned} R &= \sqrt{a^2 + b^2} \\ \theta &= \left\{ \begin{aligned} &\tan^{-1}\frac{b}{a} &\text{if}\; a > 0 \\ &\tan^{-1}\frac{b}{a} + \pi &\text{if}\; a < 0 \\ &\frac{\pi}{2} &\text{if}\; a = 0, b > 0 \\ &-\frac{\pi}{2} &\text{if}\; a = 0, b < 0 \\ &\text{random} &\text{if}\; a = 0, b = 0 \end{aligned} \right. . \end{aligned} \]

The roots are now found using the following: \[ z = \left( \sqrt[n]{R} \right)_{\frac{a}{n} + p\frac{2\pi}{n}} \qquad p = 0, 1, \ldots, n-1 \] where p is altered from $0$ to $n-1$, to find all roots.

Worked example

Given: \[ z^4 = 3+4i \]

Finding $R$: \[ \begin{aligned} R &= \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5 \\ R &= 5 \end{aligned} \]

Finding $\theta$ (note: $a = 3 \Leftrightarrow a > 0$): \[ \theta = \tan^{-1}\frac{4}{3} \]

The roots are therefore: \[ \begin{aligned} z_0 &= \left( \sqrt[4]{5} \right)_{\frac{3}{4}} \approx 1.495_{0.75}\\ z_1 &= \left( \sqrt[4]{5} \right)_{\frac{3}{4} + 1\frac{2\pi}{4}} \approx 1.495_{2.32}\\ z_2 &= \left( \sqrt[4]{5} \right)_{\frac{3}{4} + 2\frac{2\pi}{4}} \approx 1.495_{3.89}\\ z_4 &= \left( \sqrt[4]{5} \right)_{\frac{3}{4} + 3\frac{2\pi}{4}} \approx 1.495_{5.46} \end{aligned} \] in polar coordinates. To reverse to regular coordinates, just use the following: \[ \begin{aligned} a &= R\cos{\theta} \\ b &= R\sin{\theta} \end{aligned} \]

Looking at the complex plane the roots are distributed as follows:

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} \]