TITLE: Polynomial approximation of circle or ellipse
QUESTION [18 upvotes]: Trying again, with a somewhat simpler sounding question, since my previous one (Generalizations of equi-oscillation criterion) got zero response:
Let $F:[0,1] \to R^2$ be a parametric polynomial curve of degree $m$. I want to adjust the coefficients of $F$ to make it lie as closely as possible to the unit circle, $C$. More specifically, I want to have $F(0) = (1,0)$, and $F(1) = (0,1)$, and I want the maximum distance 
$$E_1 = \max \{dist(F(t),C): t \in [0,1]\}$$
to be minimized. 
It would be OK to minimize the following error $E_2$ instead, if it's easier:
$$ E_2 = \max \{ \big| F_x^2(t) + F_y^2(t) - 1 \big|: t \in [0,1]\}$$
What if I replace the unit circle by an ellipse (for example).
Two specific questions:
(1) Can we prove that the best approximation is equi-oscillatory, in some sense ?
(2) How can the best approximation be computed ?
This site http://spencermortensen.com/articles/bezier-circle/ has a good result for the case of a circle with ($m=3$).
You could also think of this as a question about Bezier curves of degree $m$. Clearly, it would be a good idea to set the first control point equal to $(1,0)$, and the last one equal to $(0,1)$. Then, we just need to adjust the other control points until we get an optimal fit.
A simple algebraic version of the problem: Find two polynomials $x(t)$ and $y(t)$ such that $x(0)=1$, $x(1)=0$, $y(0)=0$, $y(1)=1$, and $x(t)^2 + y(t)^2 - 1$ is small for all $t \in [0,1]$.

REPLY [8 votes]: There is a general procedure for a circle that minimizes $\max |p^2+q^2-1|$.  In what follows it is convenient to make two slight modifications to your problem:

The parameterization will be defined on an interval $[-\alpha, \alpha] \subset [-1,1]$ rather than $[0,1]$.
The approximation is for another arc of length $\tfrac{\pi}{2}$.

The first modification is only a parameter substitution and the second a rotation so solving this problem will clearly also solve the original problem.
Let $n > 0$ be some degree.  Then we want to find polynomials $p$ and $q$ of degree at most $n$ such that $\max |p^2+q^2-1|$ is minimized over the interval $[-1,1]$.  Note that $p^2+q^2-1$ will have degree at most $2n$.  It is well known that the Chebyshev polynomial of the first kind $T_{2n}$ solves the minimax problem on $[-1,1]$ among all polynomials of degree at most $2n$ with leading coefficient $2^{2n-1}$.  Therefore the best solution would be of the form
$$ p^2+q^2 = 1 + \lambda T_{2n} $$
for some parameter $\lambda \in [0,1)$ that should be as small as possible.  Such a solution can indeed be found based on the explicit factorization
$$ \begin{eqnarray}
1 + \frac{T_{2n}(x)}{\cosh(2n\,t)} &=& \frac{2^{2n-1}}{\cosh(2n\, t)} \prod_{k=1}^{2n}\left(x - \cos\left(\tfrac{(2k-1) \pi}{2n} - t\,i\right)\right) \\
&=& \frac{2^{2n-1}}{\cosh(2n\, t)} \prod_{k=1}^{2n}\left(x - \cos\left(\tfrac{(2k-1) \pi}{2n}\right)\cosh(t) - \sin\left(\tfrac{(2k-1) \pi}{2n}\right) \sinh(t)\,i\right)
\end{eqnarray}$$
for all $t \in \mathbb{R}$.  (See the edit below for a derivation of this factorization.)  Since the LHS is a real polynomial, the roots in the expression above have conjugate symmetry.  Now take $t > 0$ and define the complex polynomial $r(x)$ of degree $n$ by including only the roots in the upper half plane:
$$ r(x) = \frac{2^n}{\sqrt{2 \cosh(2n\,t)}} \prod_{k=1}^{n}\left(x - \cos\left(\tfrac{(2k-1) \pi}{2n} - t\,i\right)\right).$$
Then $r(-x) = (-1)^n \,\overline{r}(x)$ where $\overline{r}$ means $r$ with conjugated coefficients.  Write $r = p + q\,i$ for real polynomials $p$ and $q$ then
$$p^2+q^2 = (p + q\,i)(p - q\, i) = r \,\overline{r} = 1 + \frac{T_{2n}}{\cosh(2n\, t)}.$$  So in fact we found a one-parameter family of good approximations to the circle on the interval $[-1,1]$.  (Larger $t$ give better approximations.)  The question is what this parameter signifies and which value of $t$ actually solves our problem as stated.
Since all roots of $r$ are in the upper half plane its restriction to $\mathbb{R}$ is a complex curve with strictly increasing argument, so it wraps the real line around the origin in counter clockwise direction.  One can show that $p$ and $q$ have degrees $n$ and $n-1$ respectively, both have only real roots and the roots of $q$ separate those of $p$.  The parameter $t$ controls how "fast" the curve wraps around the origin, where greater values of $t$ give "slower" curves that stay closer to the unit circle on $[-1,1]$.
The only restrictions that prevent us from taking aribrarily large values of $t$ are that the curve must begin and end on the unit circle and cover an angle of exactly $\tfrac{\pi}{2}$ over some interval contained in $[-1,1]$.  The largest zeroes of $T_{2n}$ are $\pm \cos(\tfrac{\pi}{4n})$ so if $\alpha = \cos(\tfrac{\pi}{4n})$ and we restrict $r$ to the interval $[-\alpha, \alpha]$ then at least it begins and ends on the unit circle.  Since $r(-\alpha) = (-1)^n \, \overline{r}(\alpha)$ the end point is obtained by reflecting the starting point in the real axis (for even $n$) or imaginary axis (for odd $n$).  Therefore if we take $t$ maximal such that $r(\alpha)^2$ is purely imaginary, so $p(\alpha) = \pm q(\alpha)$, then the curve spans an angle of precisely $\tfrac{\pi}{2}$.
To summarize the results of this fairly long story:

To get a degree $n$ approximation consider the polynomial $r(x)$ defined above that depends on an auxiliary real parameter $t>0$.
Let $\alpha = \cos(\tfrac{\pi}{4n})$.  Determine the maximal value $t>0$ for which $r(\alpha)^2 \in i\,\mathbb{R}$.
Then $|r(-\alpha)| = |r(\alpha)| = 1$ and $\left|\,|r(x)|^2 - 1\,\right| \leq \tfrac{1}{\cosh(2n \, t)}$ for $x \in [-\alpha, \alpha]$.  Moreover $r$ is the best approximation of a quarter circle on the interval $[-\alpha, \alpha]$.

The first few approximations found this way are:
$$ \begin{array}{c|c|c|c}
n & \alpha & t & \max \, \left| \, |r|^2-1 \, \right| \\
\hline
1 & 0.70710678 & 0.65847895 & 0.5 \\
2 & 0.92387953 & 1.2149195 & 0.015505028 \\
3 & 0.96592583 & 1.5982608 & 0.0001368784 \\
4 & 0.98078528 & 1.8786122 & 5.9437783 \times 10^{-7} \\
5 & 0.98768834 & 2.098419 & 1.5406786 \times 10^{-9} \\
6 & 0.99144486 & 2.2789419 & 2.6561189 \times 10^{-12} \\
7 & 0.99371221 & 2.4320125 & 3.2665949 \times 10^{-15} \\
8 & 0.99518473 & 2.5648448 & 3.0106701 \times 10^{-18} \\
9 & 0.9961947 & 2.6821493 & 2.1570627 \times 10^{-21} \\
10 & 0.99691733 & 2.7871679 & 1.2359399 \times 10^{-24}
\end{array}
$$
Edit: Here's how the factorization can be found.  The key property is that $$T_{2n}\left(\frac{x+x^{-1}}{2}\right) = \frac{x^{2n}+x^{-2n}}{2}$$ for all $x \neq 0$.  So $$1 + \frac{T_{2n}\left(\frac{x+x^{-1}}{2}\right)}{\cosh(2n\,t)} = \frac{2 \cosh(2n\,t) + x^{2n}+x^{-2n}}{2 \cosh(2n\,t)}$$ and this vanishes when $x^{2n} = -e^{\pm 2n \, t}$.  The roots are therefore $$ x= \exp\left(\frac{(2k-1)\pi\,i}{2n} \pm t\right)$$ for $k \in \{1, \dotsc, 2n\}$ and for such a root we have $$\frac{x+x^{-1}}{2} = \cos\left(\frac{(2k-1)\pi}{2n}\mp t\, i\right).$$  Since $\cos$ is even this gives $2n$ roots of the polynomial $$1+\frac{T_{2n}}{\cosh(2n \, t)}$$ of degree $2n$.  After fixing the proper leading coefficient the factorization follows.