TITLE: How to use Chebyshev Polynomials to approximate $\sin(x)$ and $\cos(x)$ within the interval $[−π,π]$?
QUESTION [15 upvotes]: I have approximated $\sin(x)$ and $\cos (x)$ using the Taylor Series (Maclaurin Series) with the following results:
$$f(x)=f(0)+\frac{f^{(1)}(0)}{1!}(x-0)+\frac{f^{(2)}(0)}{2!}(x-0)^2+\frac{f^{(3)}(0)}{3!}(x-0)^3+\cdots$$
$$\begin{align}\implies \sin(x)&=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\frac{x^9}{9!}-\cdots\\&=\sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!}x^{2n+1} \end{align}$$
$$f(x)=f(a)+\frac{f^{(1)}(a)}{1!}(x-a)+\frac{f^{(2)}(a)}{2!}(x-a)^2+\frac{f^{(3)}(a)}{3!}(x-a)^3+\cdots$$
$$\begin{align} \implies \cos(x)&=1-\frac{x^2}{2!}+\frac{x^4}{4!}-\frac{x^6}{6!}+\frac{x^8}{8!}-\frac{x^10}{10!}+\cdots \\&=\sum_{n=0}^{\infty} \frac{(-1)^n}{(2n)!}x^{2n} \end{align}$$
How can I use Chebyshev Polynomials to approximate $\sin(x)$ and $\cos(x)$ within the interval $[−π,π]$?
Thanks in advance!

REPLY [12 votes]: Assume that we want to approximate $\cos(x)$ over $I=[-1,1]$. The Taylor series gives:
$$ \cos(x) = \sum_{n=0}^{+\infty}\frac{(-1)^n}{(2n)!} x^{2n}\tag{1} $$
while the Fourier-Chebyshev series is given by:
$$ \cos(x) = J_0(1) + 2\sum_{n\geq 1}(-1)^n J_{2n}(1) T_{2n}(x)\tag{2}$$
where:
$$ \frac{2}{\pi}\int_{-1}^{1}\frac{\cos(x) T_n(x)}{\sqrt{1-x^2}}\,dx = \frac{2}{\pi}\int_{-\pi/2}^{\pi/2}\cos(\cos x)\cos(nx)\,dx\tag{3}$$
is a Bessel function of the first kind and $T_{n}(x)$ is a Chebyshev polynomial of the first kind. Since both $x^n$ and $T_n(x)$ are bounded by $1$ on $I$, the accuracy of the approximation just depends on how fast $J_{2n}(1)$ decays to zero. Since:
$$ J_{2n}(1) = \sum_{l\geq 0}\frac{(-1)^l}{4^{l+n}(2n+l)!},\qquad \left|J_{2n}(1)\right|\approx\frac{1}{4^n(2n)!}\tag{4}$$
we have that the Taylor approximation pointwise outperforms $(2)$ in the region $|x|\leq\frac{1}{2}$, while the $L^2$-approximation $(2)$ is more accurate than $(1)$ near the endpoints of $I$, and in uniform terms. However, its coefficients are less trivial to compute. 
It is also interesting to mention that, by expanding $T_{2n}(x)$ and equating the coefficients of $x^{2m}$ in $(1)$ and $(2)$ we get an interesting identity about the Bessel function of the first kind. The same happens if we integrate the square of both sides of $(2)$, multiplied by $\frac{1}{\sqrt{1-x^2}}$, over $I$.
Here we have a graph of the approximation error for $n=5$. The Taylor series gives the blue graph, the Fourier-Chebyshev series gives the red graph.
$\hspace1in$
This is the same graph over the subinterval $\left[-\frac{2}{3},\frac{2}{3}\right]$:
$\hspace1in$