# Thread: [SOLVED] Chebyshev polynomial approximation

1. ## [SOLVED] Chebyshev polynomial approximation

The series

$\Phi_n(x) = \frac{1}{2} c_0 T_0(x) + c_1 T_1(x) + \ldots+ c_n T_n(x)$

is a least squares Chebyshev polynomial approximation of f(x) on [-1,1], if

$c_j = \frac{2}{\pi} \int_{-1}^1\frac{f(x) T_j(x)}{\sqrt{1-x^2}} d x, \quad j=0,1,2,\ldots,n.$

Find the quadratic least squares Chebyshev polynomial approximation of
$g(z) = \pi \left(9+3 z^2\right) \sqrt{(2-z) z}$, on $z \in [0,2]$.
-----------------------------
Their answer (I don't know where I went wrong):
$\Phi_2(z) = \frac{1}{15} \left( 42+ \left(1032 \right) z + \left(-456 \right) z^2\right)$

---------------

My working:

Let $x=z-1$ (to map to [-1,1] interval).
$\therefore z = x+1$.

$\therefore f(x)=\pi(9+3(x+1)^2)\sqrt{(2-(x+1))(x+1)}$
$= \pi(9+3(x+1)^2)\sqrt{1-x^2}$.

Then

$c_j = 2\int_{-1}^1(9+3(x+1)^2)T_j(x)\,dx$
So, (you can compute on Maple),
$c_0 = 52,\; c_1=8,\;c_2=\frac{164}{5}$

So $\Phi_2({\color{red}x})=\frac{1}{2}\cdot 52\cdot 1+8x+\frac{164}{5}(2x^2-1)$

Then to map back to $z \in [0,2]$,
$\Phi_2(z)=26+8(z-1)+\frac{164}{5}(2(z-1)^2-1)$.

Now, simplifying is optional, but this answer is not correct (apparently).

Any idea what I did wrong? Or is this the wrong forum for this stuff?

2. I found the error.

Oops. Silly me. I entered the data incorrectly into maple. $c_2$ should be $\frac{-76}{5}$, not $\frac{164}{5}
$
.

The rest is fine.