<s>[INST] Help with hard complex numbers We had the topic of complex numbers for my senior math team meet this week, and I wasn't able to solve two of the problems.        
1.) $z=i^{\displaystyle \left(i^{\displaystyle \left(i^{(2)}\right)}\right)}$ and $a$ is the real part of $z$, find the lowest positive value of $\ln(a)$
[ I know it comes to $i-i$ but I don't know why that is e^(pi/2)] 
2.) $$\left[\cos \left(\frac{2\pi}{7}\right) + \cos \left(\frac{4\pi}{7}\right) + \cos \left(\frac{8\pi}{7}\right)\right]^2$$
[I think I can use de moivre's forumla, but I dont know how here]
It's non calculator and the answers are $\frac{\pi}{2}$ and \frac{1}{4}$ respectively. I just want to know how to solve them, thanks.
 [/INST] Okay, the second one took me some time but I solved it, sorry if I do not know how to write math in this program.
I will use 2 pieces of data, the first:
$(e^x)^i = cos(x)+i*sin(x)$ [Euler's identity]
The second [I don know the name, but is easy to prove]:
if you add the n nth roots of 1 you get 0.
$1+(-1) = 0$
$1+e^{\frac{2\pi i}{3}}+e^{\frac{-2\pi i}{3}}=0$
$1+i-1-i=0$
etc...
Now: $0=e^{\pi i \frac{0}{7}}+e^{\pi i \frac{2}{7}}+e^{\pi i \frac{4}{7}}+e^{\pi i \frac{6}{7}}+e^{\pi i \frac{8}{7}}+e^{\pi i \frac{10}{7}}+e^{\pi i \frac{12}{7}}$
(The 7 roots of 1 added up equal 0)
$S=\cos(\frac{2\pi}{7})+\cos(\frac{4\pi}{7})+\cos(\frac{6\pi}{7})=\cos(\frac{8\pi}{7})+\cos(\frac{10\pi}{7})+\cos(\frac{12\pi}{7})$
$S=\frac{1}{2}\big[\cos(\frac{2\pi}{7})+\cos(\frac{4\pi}{7})+\cos(\frac{6\pi}{7})=\cos(\frac{8\pi}{7})+\cos(\frac{10\pi}{7})+\cos(\frac{12\pi}{7})\big]=$
$\frac{1}{2}\big[\cos(\frac{2\pi}{7})+\cos(\frac{4\pi}{7})+\cos(\frac{6\pi}{7})=\cos(\frac{8\pi}{7})+\cos(\frac{10\pi}{7})+\cos(\frac{12\pi}{7})+\cos(0)-cos(0)\big]$
$=\frac{1}{2} Re(e^{\pi i \frac{0}{7}}+e^{\pi i \frac{2}{7}}+e^{\pi i \frac{4}{7}}+e^{\pi i \frac{6}{7}}+e^{\pi i \frac{8}{7}}+e^{\pi i \frac{10}{7}}+e^{\pi i \frac{12}{7}}+e^{\pi i \frac{0}{7}}-e^{\pi i \frac{0}{7}})$=
$Re(0-e^{\frac{0\pi}{7}})$
[sum of roots equals 0]
$S = \frac{Re(-e^0)}{2} = \frac{-1}{2}$
$S^2 = \frac{1}{4}$
So your answer is $\frac{1}{4}$, the problem is hard but solvable
</s>