Range of $f(z)=|1+z|+|1-z+z^2|$ when $ |z|=1$

Let $z=x+yi,$ where $x$ and $y$ are reals.

Thus, $x^2+y^2=1$ and $$|z+1|+|1-z+z^2|=\sqrt{(x+1)^2+y^2}+\sqrt{(1-x+x^2-y^2)^2+(-y+2xy)^2}=$$ $$=\sqrt{2+2x}+\sqrt{(2x^2-x)^2+(1-x^2)(2x-1)^2}=\sqrt{2+2x}+|2x-1|$$ and we got a function of one variable $-1\leq x\leq 1.$

Can you end it now?

I got that the maximal value it's $\frac{13}{4}$ and occures for $x=\frac{-7}{8}.$

The minimal value it's $\sqrt3$ and occurs for $x=\frac{1}{2}.$

For the minimal value there is the following.

We need to prove that: $$\sqrt{2x+2}+|2x-1|\geq\sqrt3$$ or $$|2x-1|\geq\frac{1-2x}{\sqrt3+\sqrt{2+2x}},$$ which is true because $$|2x-1|\left(\sqrt3+\sqrt{2+2x}\right)\geq|2x-1|\geq-(2x-1)=1-2x.$$ For the maximal value there is the following.

Let $x\geq\frac{1}{2}.$

Thus, $$\sqrt{2x+2}+|2x-1|=\sqrt{2x+2}+2x-1\leq\sqrt{2+2}+2-1=3<\frac{13}{4}.$$ Let $x\leq\frac{1}{2}$ and $\sqrt{2+2x}=y$.

Thus, $$\sqrt{2x+2}+|2x-1|=\sqrt{2x+2}-2x+1=\sqrt{2x+2}-2x-2+3=$$ $$=y-y^2+3=-\left(y-\frac{1}{2}\right)^2+\frac{13}{4}\leq\frac{13}{4}.$$ The equality occurs for $y=\frac{1}{2}$ or $x=-\frac{7}{8}.$


Since $|z|=1$ we substitute $z=e^{i\theta}$, to get: $$ f(\theta)=|1+e^{i\theta}|+|1-e^{i\theta}+e^{2i\theta}|\\ = \sqrt{ (1 + \cos \theta)^2 + \sin^2\theta} + \sqrt{(1 - \cos\theta+ \cos2\theta)^2 + (-\sin\theta + \sin2\theta )^2)}\\ =\sqrt{|2+2\cos\theta |}+|(1-2\cos\theta)| $$ We can denote $u=\cos\theta$ and investigate $f(u)=\sqrt{|2+2u |}+|(1-2u)|$ for $u$ between $-1$ and $1$ by simple calculus. We get $\max f=\frac{13}{4}$ for $u=-\frac{7}{8}$, and $\min f=\sqrt3$ for $u=\frac{1}{2}$. This does not agree with the answer given but I could not find any error.