# Math for Non-Geeks/Exercises: Complex numbers
## Real and imaginary part

Exercise (Determining imaginary and real part)
Determine the real part and the imaginary part of the following complex numbers:
* $z_{1}=\left(1-{\tfrac {1}{2}}\mathrm {i} \right)(2+3\mathrm {i} )$
* $z_{2}={\frac {1+\mathrm {i} }{1-\mathrm {i} }}$
* $z_{3}={\frac {(4+2\mathrm {i} )(3-\mathrm {i} )}{\mathrm {i} (1+\mathrm {i} )}}$
Solution (Determining imaginary and real part)
Solution sub-exercise 1:
There is
${\begin{aligned}z_{1}&=\left(1-{\frac {1}{2}}\mathrm {i} \right)(2+3\mathrm {i} )=2-\mathrm {i} +3\mathrm {i} -{\tfrac {3}{2}}\cdot \underbrace {\mathrm {i} ^{2}} _{=-1}\\&=2-\mathrm {i} +3\mathrm {i} +{\tfrac {3}{2}}={\tfrac {7}{2}}+2\mathrm {i} \end{aligned}}$
So ${\text{Re}}(z_{1})={\tfrac {7}{2}}$ and ${\text{Im}}(z_{1})=2$.
Solution sub-exercise 2:
There is
${\begin{aligned}z_{2}={\frac {1+\mathrm {i} }{1-\mathrm {i} }}={\frac {(1+\mathrm {i} )^{2}}{(1+\mathrm {i} )(1-\mathrm {i} )}}={\frac {1+2\mathrm {i} +\mathrm {i} ^{2}}{1-\mathrm {i} ^{2}}}={\frac {2\mathrm {i} }{2}}=\mathrm {i} \end{aligned}}$
So ${\text{Re}}(z_{2})=0$ and ${\text{Im}}(z_{2})=1$.
Solution sub-exercise 3:
There is
${\begin{aligned}z_{3}&={\frac {(4+2\mathrm {i} )(3-\mathrm {i} )}{\mathrm {i} (1+\mathrm {i} )}}={\frac {12+6\mathrm {i} -4\mathrm {i} -2\mathrm {i} ^{2}}{\mathrm {i} +\mathrm {i} ^{2}}}={\frac {14+2\mathrm {i} }{\mathrm {i} -1}}\\[0.5em]&={\frac {(14+2\mathrm {i} )(\mathrm {i} +1)}{(\mathrm {i} -1)(\mathrm {i} +1)}}={\frac {14+14\mathrm {i} +2\mathrm {i} +2\mathrm {i} ^{2}}{\mathrm {i} ^{2}-1}}\\[0.5em]&={\frac {12+16\mathrm {i} }{-2}}=-6-8\mathrm {i} \end{aligned}}$
So ${\text{Re}}(z_{3})=-6$ and ${\text{Im}}(z_{3})=-8$.

## Plane of complex numbers

Exercise
Sketch the following sets on the plane of complex numbers:
* $M_{1}=\{z\in \mathbb {C} :\;|z-\mathrm {i} |\leq 2\}$
* $M_{2}=\{z\in \mathbb {C} :\;1\leq |z|\leq 3\}$
* $M_{3}=\{z\in \mathbb {C} :\;|z|\leq 2\}\cap \{z\in \mathbb {C} :\;\operatorname {Re} (z)>\operatorname {Im} (z)\}$
Solution
Solution sub-exercise 1:
The set $M_{1}$ describes all complex numbers which fulfil the condition $|z-\mathrm {i} |\leq 2$. In the complex plane this corresponds exactly to the numbers $z\in \mathbb {C}$, whose distance from the number $\mathrm {i}$ is at most $2$. So $M_{1}$ describes a circle around $\mathrm {i}$ with radius $2$. The boundary of the circle is included in the set:
Solution sub-exercise 2:
For all elements of the set $M_{2}$, $1\leq |z|\leq 3$ should apply. So their distance from the origin should be at least $1$, but at most $3$. Thus the set $M_{2}$ describes a circular ring between the circles with the radii $1$ and $3$, including the boundary lines:
Solution sub-exercise 3:
The set $\{z\in \mathbb {C} :\;|z|\leq 2\}$ describes a circle around the origin with radius $2$:
The second part $\{z\in \mathbb {C} :\;{\text{Re}}(z)>{\text{Im}}(z)\}$ of the set $M_{3}$ describes all complex numbers whose real part is larger than their imaginary part. On the bisector of the first and third quadrant ("diagonal line") we have are all numbers whose real and imaginary part are equal. To the right of this line, there are all complex numbers with a real part greater than the imaginary part:
The intersection of both sets yields:
With this you can sketch the set $M_{3}$. Note that one of the boundary lines is only dashed. That means, the numbers directly on the origin line do not belong to the set $M_{3}$, since the real part of each element must be strictly bigger than its imaginary part:

## Polar representation

Exercise (Transform to polar representation)
Compute the complex numbers and convert them into polar representation:
* $z_{1}=\mathrm {i}$
* $z_{2}=1-\mathrm {i}$
* $z_{3}=2+2\mathrm {i}$
* $z_{4}=(4+4\mathrm {i} )\cdot (2+5\mathrm {i} )$
* $z_{5}=(9-{\sqrt {19}}\mathrm {i} )\cdot (2+{\sqrt {5}}\mathrm {i} )\cdot (3+4\mathrm {i} )$
* $z_{6}=(37+{\sqrt {395}}\mathrm {i} )^{123}$
Solution (Transform to polar representation)
Solution sub-exercise 1:
The absolute value is $|z_{1}|={\sqrt {0^{2}+1^{2}}}=1$. Since $\operatorname {Re} (z_{1})=0$ and $\operatorname {Im} (z_{1})>0$ there is $\varphi ={\tfrac {\pi }{2}}$. Thus $z_{1}=\mathrm {i} =e^{{\frac {\pi }{2}}\mathrm {i} }$. This formula appears frequently, so you might want to learn it by heart.
Solution sub-exercise 2:
We have the absolute value $|z_{2}|={\sqrt {1^{2}+(-1)^{2}}}={\sqrt {2}}$. With $\operatorname {Re} (z_{2})>0$ and $\operatorname {Im} (z_{2})<0$ the number lies in the fourth quadrant. The formula for this is $\varphi ={\text{arctan}}\left({\tfrac {-1}{1}}\right)=-45^{\circ }=-{\tfrac {\pi }{4}}$. So there is $z_{2}={\sqrt {2}}\cdot e^{-{\frac {\pi }{4}}\mathrm {i} }$.
Solution sub-exercise 3:
You get the polar representation of $z_{3}$ by first complexly conjugating the polar representation of $z_{2}$ and then multiplying it by $2$. There is:
$z_{3}=2+2\mathrm {i} =2(1+\mathrm {i} )=2\cdot {\overline {(1-\mathrm {i} )}}=2{\overline {z_{2}}}$
Under complex conjugation, $\mathrm {i}$ is replaced by $-\mathrm {i}$ in the exponent in the polar representation. Thus $z_{3}=2{\sqrt {2}}\cdot e^{{\frac {\pi }{4}}\mathrm {i} }$.
Solution sub-exercise 4:
By multiplying it out, we get $z_{4}=(8-20)+(8+20)\cdot \mathrm {i} =-12+28\cdot \mathrm {i}$. So $|z_{4}|={\sqrt {(-12)^{2}+(28)^{2}}}=4{\sqrt {58}}$. With $\operatorname {Re} (z_{4})<0$ and $\operatorname {Im} (z_{4})>0$ the number lies in the second quadrant. For the angle $\varphi$ there is $\varphi =\pi -\arctan \left({\tfrac {28}{12}}\right)\approx 1.976$. This corresponds in degrees to an angle of $\varphi \approx 113.2^{\circ }$. Altogether we get the result $z_{4}=4{\sqrt {58}}\cdot e^{\left(\pi -\arctan \left({\frac {7}{3}}\right)\right)\cdot \mathrm {i} }\approx 30,46\cdot e^{1,976\mathrm {\cdot } \mathrm {i} }$.
Solution sub-exercise 5:
First, we determine the polar representation of the three factors of $z_{5}$:
${\begin{aligned}w_{1}&=9-{\sqrt {19}}\cdot \mathrm {i} ={\sqrt {9^{2}+{\sqrt {19}}^{2}}}\cdot e^{\arctan \left({\frac {-{\sqrt {19}}}{9}}\right)\cdot \mathrm {i} }\\&=10\cdot e^{\arctan \left({\frac {-{\sqrt {19}}}{9}}\right)\cdot \mathrm {i} }\approx 10\cdot e^{-0.451\cdot \mathrm {i} }\\[0.5em]w_{2}&=2+{\sqrt {5}}\cdot \mathrm {i} ={\sqrt {2^{2}+{\sqrt {5}}^{2}}}\cdot e^{\arctan \left({\frac {\sqrt {5}}{2}}\right)\cdot \mathrm {i} }\\&=3\cdot e^{\arctan \left({\frac {\sqrt {5}}{2}}\right)\cdot \mathrm {i} }\approx 3\cdot e^{0,841\cdot \mathrm {i} }\\[0.5em]w_{3}&=3+4\cdot \mathrm {i} ={\sqrt {3^{2}+4^{2}}}\cdot e^{\arctan \left({\frac {4}{3}}\right)\cdot \mathrm {i} }\\&=5\cdot e^{\arctan \left({\frac {4}{3}}\right)\cdot \mathrm {i} }\approx 5\cdot e^{0,927\cdot \mathrm {i} }\end{aligned}}$
Then, there is
${\begin{aligned}z_{5}&=w_{1}\cdot w_{2}\cdot w_{3}=\left(10\cdot e^{\arctan \left({\frac {-{\sqrt {19}}}{9}}\right)\cdot \mathrm {i} }\right)\cdot \left(3\cdot e^{\arctan \left({\frac {\sqrt {5}}{2}}\right)\cdot \mathrm {i} }\right)\cdot \left(5\cdot e^{\arctan \left({\frac {4}{3}}\right)\cdot \mathrm {i} }\right)\\[0.5em]&\approx \left(10\cdot e^{-0,451\cdot \mathrm {i} }\right)\cdot \left(3\cdot e^{0,841\cdot \mathrm {i} }\right)\cdot \left(5\cdot e^{0,927\cdot \mathrm {i} }\right)\\[0.5em]&\approx 150\cdot e^{(-0,451+0,841+0,927)\cdot \mathrm {i} }\approx 150\cdot e^{1,317\cdot \mathrm {i} }\end{aligned}}$
Solution sub-exercise 6:
First we determine the absolute value and the angle of $w=37+{\sqrt {395}}\mathrm {i}$. There is $|w|={\sqrt {37^{2}+{\sqrt {395}}^{2}}}=42$ and $\varphi =\operatorname {Arg} (w)=\arctan \left({\tfrac {\sqrt {395}}{37}}\right)\approx 0{,}493\ldots$. Now we can determine the polar representation of $z_{6}$:
${\begin{aligned}z_{6}&=(37+{\sqrt {395}}\mathrm {i} )^{123}=\left(42\cdot e^{\varphi \cdot \mathrm {i} }\right)^{123}=42^{123}\cdot e^{\varphi \cdot \mathrm {i} \cdot 123}\\[0.3em]&{\color {OliveGreen}\left\downarrow \ \varphi \approx 0{,}493\right.}\\[0.3em]&\approx 42^{123}\cdot e^{60{,}639\cdot \mathrm {i} }\underbrace {=} _{{\text{modulo }}2\pi }42^{123}\cdot e^{4{,}090\cdot \mathrm {i} }\end{aligned}}$