Maximum of absolute value of complex function I have some problem in solving this exercise:
Find the maximum value of $|z^2-iz+1|$ for $|z|=1$.
I am quite sure that the maximum is $\sqrt{5}$  ($z=+/-1$)  but the only thing i have in mind is to compute the derivative, it is a very tedious calculation and i don't know if it works.
Is there any other way of reasoning?
 A: Write $z$ in polar coordinates: $z = re^{i\theta}$. Then
$$|z^2 - iz + 1| = |r^2 e^{2i\theta} - ire^{i\theta} + 1|$$
Since we are constraining $r = 1$, this reduces to
$$|e^{2i\theta} - ie^{i\theta} + 1|$$
We can simplify this by working with the square, which is
$$\begin{aligned}
|e^{2i\theta} - ie^{i\theta} + 1|^2 &= (e^{2i\theta} - ie^{i\theta} + 1)(e^{-2i\theta} + ie^{-i\theta} + 1) \\
&= 1 + ie^{i\theta} + e^{2i\theta} -i e^{-i\theta} + 1 - ie^{i\theta} + e^{-2i\theta} + ie^{-i\theta} + 1 \\
&= 3 + 2\cos(2\theta) \\
\end{aligned}
$$
and therefore
$$|e^{2i\theta} - ie^{i\theta} + 1| = \sqrt{3 + 2\cos(2\theta)}$$
From this it's clear that the maximum is $\sqrt{5}$, which occurs at $\theta = 0$ and $\theta = \pi$, corresponding to $z=\pm 1$.
A: Using the formula
$$
 |z+w|^2 = (z+w)(\overline z + \overline w) = |z|^2 + 2\operatorname{Re}(\overline z w) + |w|^2
$$
one gets for $|z|^2 = z \overline z =1$:
$$
|z^2-iz+1|^2 = 3 - 2 \operatorname{Re}(\overline z^2 iz) +2 \operatorname{Re}(\overline z^2) - 2 \operatorname{Re}(-i\overline z) \\
= 3 +2 \operatorname{Re}(z^2) \le 5
$$
with equality if $\operatorname{Re}(z^2) = 1$, that is for $z=\pm 1$.
A: Let $a = \vert z^2 - iz+1 \vert$ and $z = c + is$ where $c,s \in \mathbb R$.
Usually it is more convenient to analyze the squared absolute value:
$a^2 = c^4 + 2 c^2 s^2 - 6 c^2 s + 11 c^2 + s^4 - 6 s^3 + 7 s^2 + 6 s + 1$
Since we're interested in $|z|=1$ we can write it as $z = e^{it}$ so $c = \cos(t), s=\sin(t)$ and get
$$a^2 =  2 (\cos^2(t)-\sin^2(t)) + 11$$
From here it should be straightforward to find the maximum.
