The series

$\displaystyle \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

$\displaystyle 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

$\displaystyle g(z) = \pi \left(9+3 z^2\right) \sqrt{(2-z) z}$, on $\displaystyle z \in [0,2]$.

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

Their answer (I don't know where I went wrong):

$\displaystyle \Phi_2(z) = \frac{1}{15} \left( 42+ \left(1032 \right) z + \left(-456 \right) z^2\right)$

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

My working:

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

$\displaystyle \therefore z = x+1$.

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

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

Then

$\displaystyle c_j = 2\int_{-1}^1(9+3(x+1)^2)T_j(x)\,dx$

So, (you can compute on Maple),

$\displaystyle c_0 = 52,\; c_1=8,\;c_2=\frac{164}{5}$

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

Then to map back to $\displaystyle z \in [0,2]$,

$\displaystyle \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?