  Motivated by comparing the convergence behavior of Gegenbauer projections and
best approximations, we study the optimal rate of convergence for Gegenbauer
projections in the maximum norm. We show that the rate of convergence of
Gegenbauer projections is the same as that of best approximations under
conditions of the underlying function is either analytic on and within an
ellipse and $\lambda\leq0$ or differentiable and $\lambda\leq1$, where
$\lambda$ is the parameter in Gegenbauer projections. If the underlying
function is analytic and $\lambda>0$ or differentiable and $\lambda>1$, then
the rate of convergence of Gegenbauer projections is slower than that of best
approximations by factors of $n^{\lambda}$ and $n^{\lambda-1}$, respectively.
An exceptional case is functions with endpoint singularities, for which
Gegenbauer projections and best approximations converge at the same rate for
all $\lambda>-1/2$. For functions with interior or endpoint singularities, we
provide a theoretical explanation for the error localization phenomenon of
Gegenbauer projections and for why the accuracy of Gegenbauer projections is
better than that of best approximations except in small neighborhoods of the
critical points. Our analysis provides fundamentally new insight into the power
of Gegenbauer approximations and related spectral methods.
