I am looking at approximating my function $f(x)$ using a Chebyshev and Legendre series and I ran into this question. Is interpolation using $n+1$ Chebyshev nodes the same as representing the function using the first $n+1$ Chebyshev coefficients in its Chebyshev series, i.e., is $$f(x) = \sum_{k=0}^n f(x_k) l_k(x)$$where $x_k$ are the Chebyshev nodes and $l_k(x)$ is the appropriate Lagrange polynomial associated with the $k^{th}$ node, the same as $$f(x) = \sum_{k=0}^n a_k T_k(x)$$where $T_k(x)$ is the $k^{th}$ Chebyshev polynomial and $a_k = \dfrac{\langle f, T_k\rangle}{\langle T_k, T_k\rangle}$?Here the inner product is the inner product using the appropriate weight function for the polynomials, i.e., $$\langle f, T_k \rangle = \int_{-1}^1 \dfrac{f(y)T_k(y)}{\sqrt{1-y^2}}dy$$Is the same true for Legendre interpolation and Legendre expansion as well, where the inner product is $$\langle f, P_k \rangle = \int_{-1}^1 f(y)P_k(y)dy$$? If so, could someone direct me to the proof of this?
Chebyshev and Legendre expansions
numerical analysis;polynomials