TITLE: All Roots to be on unit circle
QUESTION [5 upvotes]: Suppose $p(z)=1+a(z+z^2+\cdots+z^{n-1})+z^n, a\in{\bf R}, n\geq 2.$ Then  the necessary and sufficient conditions for $p(z)$ to have all its roots on the unit circle are $-2/(n-1)\le a\le2n/(n-1)$ for odd $n$ and $-2/(n-1)\le a\le2$ for even $n$.

REPLY [5 votes]: Since
$$\begin{align}p(z)&=1+z^n+a\sum_{k=1}^{n-1}z^k=1+z^n+a\left(\frac{z^n-z}{z-1}\right)\\
&=z^{n/2}\left(z^{n/2}+z^{-n/2}\right)+a\left(\frac{z^{(n+1)/2}\left(z^{(n-1)/2}-z^{(1-n)/2}\right)}{z^{1/2}\left(z^{1/2}-z^{-1/2}\right)}\right)\\
&=z^{n/2}\left(2\cos\left(\frac n2\theta\right)+a\left(\frac{\sin\left(\frac{n-1}2\theta\right)}{\sin\left(\frac12\theta\right)}\right)\right)=0\end{align}$$
Where $z=e^{i\theta}$ lies on the unit circle. We have
$$a=-\frac{2\cos\left(\frac n2\theta\right)\sin\left(\frac12\theta\right)}{\sin\left(\frac{n-1}2\theta\right)}=\frac{\sin\left(\frac{n-1}2\theta\right)-\sin\left(\frac{n+1}2\theta\right)}{\sin\left(\frac{n-1}2\theta\right)}=1-\frac{\sin\left(\frac{n+1}2\theta\right)}{\sin\left(\frac{n-1}2\theta\right)}$$
We need to have that ratio take on the same value $n$ times. Let's plot it for odd and even $n$:
% Circle.m

n = input('Enter a positive integer:> ');
npts = 500;
theta1 = linspace(0,pi,npts+2);
theta = theta1(2:end-1);
num = sin((n+1)/2*theta);
den = sin((n-1)/2*theta);
for k = 2:length(den),
    if den(k)*den(k-1) <= 0,
        den(k-1) = NaN;
    end
end
plot(theta,num./den);
ylabel(['$\frac{\sin\left(\frac{n' ...
    '+1}2\theta\right)}{\sin\left(\frac{n' ...
    '-1}2\theta\right)}$'],'Interpreter','latex');
xlabel('\theta');
title(['Critical function for n = ' num2str(n)]);
axis([0 pi -2 2]);
tol = 0.01;
a = -2/(n-1)+tol;
P = [1 a*ones(1,n-1) 1];
roots(P)
abs(roots(P))-1
if mod(n,2) == 0,
    a = 2-tol;
else
    a = 2*n/(n-1)-tol;
end
P = [1 a*ones(1,n-1) 1];
roots(P)
abs(roots(P))-1



In both cases
$$\lim_{\theta\rightarrow0^+}\frac{\sin\left(\frac{n+1}2\theta\right)}{\sin\left(\frac{n-1}2\theta\right)}=\frac{n+1}{n-1}$$
For odd $n$,
$$\lim_{\theta\rightarrow\pi^-}\frac{\sin\left(\frac{n+1}2\theta\right)}{\sin\left(\frac{n-1}2\theta\right)}=\left(\frac{n+1}{n-1}\right)\lim_{\theta\rightarrow\pi^-}\frac{\cos\left(\frac{n+1}2\theta\right)}{\cos\left(\frac{n-1}2\theta\right)}=-\left(\frac{n+1}{n-1}\right)$$
For even $n$,
$$\lim_{\theta\rightarrow\pi^-}\frac{\sin\left(\frac{n+1}2\theta\right)}{\sin\left(\frac{n-1}2\theta\right)}=-1$$
So for odd $n$ we get $\frac{n-1}2$ roots for $\theta\in(0,\pi)$ and their additive inverses and one for $\theta=\pi$ when $z=-1$ for a total of $n$ roots, provided
$$-\frac2{n-1}<a<\frac{2n}{n-1}$$
For even $n$ we get $\frac n2$ roots for $\theta\in(0,\pi)$ and their additive inverses for a total of $n$ roots, provided
$$-\frac2{n-1}<a<2$$
As for what happens at the endpoints of these intervals, it's getting too late here to work that out. Maybe tomorrow.  
EDIT: I'm back and the first order of business is to prove that
$$f(\theta)=\frac{\sin\left(\frac{n+1}2\theta\right)}{\sin\left(\frac{n-1}2\theta\right)}$$
Is a decreasing function of $\theta$.
$$\begin{align}f^{\prime}(\theta)&=\frac{\frac{n+1}2\cos\left(\frac{n+1}2\theta\right)\sin\left(\frac{n-1}2\theta\right)-\frac{n-1}2\sin\left(\frac{n+1}2\theta\right)\cos\left(\frac{n-1}2\theta\right)}{\sin^2\left(\frac{n-1}2\theta\right)}\\
&=\frac{\frac12\sin n\theta-\frac n2\sin\theta}{\sin^2\left(\frac{n-1}2\theta\right)}\end{align}$$
So that relies on us proving that the numerator $g(\theta)=\frac12\left(\sin n\theta-n\sin\theta\right)<0$ for $\theta\in(0,\pi)$. $g(0)=0$ and $g^{\prime}(\theta)=\frac n2\left(\cos n\theta-\cos\theta\right)<0$ for $0<\theta<\frac{\pi}{2n}$ because $\cos\theta$ takes $n$ times as long to decrease to any given positive value as $\cos n\theta$ does. A function that starts out at zero and has a negative first derivative is inherently negative for positive values of its argument. At $\theta=\frac{\pi}{2n}$ this means that already $n\sin\theta>1$. At the other end of the interval, for odd $n$ $\sin n(\pi-\theta)=\sin n\theta$ just as $\sin(\pi-\theta)=\sin\theta$ so $g(\pi-\theta)=g(\theta)$ which means that our analysis that showed $g(\theta)<0$ for $0<\theta\le\frac{\pi}2$ also shows $g(\theta)<0$ for $\frac{\pi}2<\theta<\pi$. For even $n$, $\sin n(\pi-\theta)=-\sin\theta$ so clearly $g(\theta)<0$ for $\pi-\frac{\pi}{2n}le\theta<\pi$ so for $\frac{\pi}2<\theta<\pi-\frac{\pi}{2n}$ recall the $n\sin\theta>1$ so in this case as well $g(\theta)<0$ for $\frac{pi}2<\theta<\pi$.  
Having proved that $f^{\prime}(\theta)$ is decreasing we observe that the zeros of its denominator happen when $\theta=\frac{2\pi k}{n-1}$ for integer $k$. For $0\le\theta\le\frac{\pi}2$ this implies that $0\le k\le\lfloor\frac{n-1}2\rfloor$. For odd $k$ this happens for $k=0$, $k=(n-1)/2$, and for $(n-3)/2$ points in between for a total of $(n-1)/2$ intervals where $f(\theta$ is continuous and decreasing. So for real there can be $2(n-1)/2$ solutions to $f(\theta)=1-a$ counting both positive and negative values of $\theta$ not to mention that $p(-1)=0$ for odd $n$, so that's all $n$ zeros of $p(z)$. For even $n$, $k=0$, $k=(n-2)/2$, and for $(n-4)/2$ points in between for $(n-2)/2$ intervals but also the interval $\pi-\frac{\pi}{n-1}<\theta<\pi$ where $f(\theta)$ is continuous and decreasing. Thus there can be $2n/2=n$ solutions to $f(\theta)=1-a$ in this case as well.  
A lot of hard work to prove what we could see just by looking at the pictures -- shows that a picture is worth a thousand equations. But now on to the endpoints. At the left endpoint if $a=-2/(n-1)$, then
$$p(1)=2-\frac2{n-1}(n-1)=0$$
and
$$p^{\prime}(1)=n-\frac2{n-1}\sum_{k=1}^{n-1}k=n-\frac2{n-1}\cdot\frac12n(n-1)=0$$
So we do indeed get a double root at $z=1$ and so still $n$ roots, though not all distinct, when $a=-2/(n-1)$. At the right endpoint for even $n$, when $a=2$
$$p(-1)=2+2\left(\frac{(-1)^n-(-1)}{(-1)-1}\right)=2-2=0$$
And
$$p^{\prime}(z)=nz^{n-1}+2\frac{(n-1)z^n-nz^{n-1}+1}{(z-1)^2}$$
So $p^{\prime}(-1)=-n+2\frac{2n}4=0$ so again a double root at $z=-1$. For odd $n$,
$$p(-1)=0+\frac{2n}{n-1}\frac{(-1)^n-(-1)}{(-1)-1}=0$$
And $p^{\prime}(-1)=n+\frac{2n}{n-1}\frac{2(1-n)}4=0$ and
$$p^{\prime\prime}(z)=n(n-1)z^{n-2}+\frac{2n}{n-1}\frac{(n-2)(n-1)z^n-2n(n-2)z^{n-1}+n(n-1)z^{n-2}-2}{(z-1)^3}$$
So $p^{\prime\prime}(-1)=-n(n-1)+\frac{2n}{n-1}\frac{-4(n-1)^2}{(-8)}=0$ for a triple root at $z=-1$ In both cases, then, all $n$ roots lie on the unit circle even though not all distinct.  
Thus the condition that all roots lie on the unit circle is $-2/(n-1)\le a\le2n/(n-1)$ for odd $n$ and $-2/(n-1)\le a\le2$ for even $n$. If $n=1$ there is always only one root $z=-1$ so all roots lie on the unit circle for any $a\in\mathbb{R}$ in that case.