<s>[INST] maximum, complex quadratic function, Is my solutions correct? I'm trying to compute $\max_{|z| \le 1} |(z+2)(z-1)|$.
Here's how I do it:
$\{z \in \mathbb{C} \ | \ |z| \le 1 \}$ is compact and $f(z) = (z+2)(z-1)$ is continuous, so it suffices to look for $\max_{|z| = 1} |(z+2)(z-1)|$.
Let $z = \cos \phi + i \sin \phi, \ \ 0 \le \phi \le 2 \pi$
Now, $|(z+2)(z-1)| = \sqrt{sin^2 \phi + (\cos \phi -1)^2} \sqrt{\sin^2 \phi + (\cos \phi +2)^2} = \sqrt{1+ 2 \cos \phi} \cdot 2 \sqrt{cos \phi +1} = 2 \sqrt{-2 cos^2 \phi - \cos \phi +1}$.
So we are left with a quadratic function with real coefficients and the leading coefficient is negative, so we can compute the vertex of the parabola $f(\cos \phi) = -2 cos^2 \phi - \cos \phi +1$ and $q =-\frac{ \Delta }{4a} = - \frac{9}{8}$ and $p = - \frac{b}{2a} = - \frac{1}{4}$.
So we have maximum value equal to $- \frac{9}{8}$ for $\cos \phi = - \frac{1}{4}$ (then $\sin \phi = \sqrt{1 - \frac{1}{16}} = - \frac{1}{4} \sqrt{15}$)
So it seems that $\max_{|z| \le 1} |(z+2)(z-1)| = \frac{9}{8}$ for $z = - \frac{1}{4} + i - \frac{1}{4} \sqrt{15}$.
Is it correct?
 [/INST] The maximum will appear on the circle since your function is analytic on the domain.
$|(z+2)(z-1)| = \sqrt{sin^2 \phi + (\cos \phi -1)^2} \sqrt{\sin^2 \phi + (\cos \phi +2)^2} = \sqrt{2- 2 \cos \phi} \sqrt{4cos \phi +5} = \sqrt{-8 cos^2 \phi - 2\cos \phi +10}$.
So we are left with a quadratic function with real coefficients and the leading coefficient is negative, so we can compute the vertex of the parabola $f(\cos \phi) = -8 cos^2 \phi - 2\cos \phi +10$ and  $p = - \frac{b}{2a} = - \frac{1}{8}$.
</s>