This was an problem in today's exam in numerical methods and I would like to know if my solution is correct.
For approximating the integral $I(f) = \int_{-1}^{1} f(x) dx$ we take the quadrature formula $$ Q(f) = 2 \sum_{j = 0}^{n} \lambda_j f(x_j) $$ with supporting points $x_0, \ldots, x_n \in [-1, 1]$, which is exact for polynomials with degree up to $n$. Show that if $x_j = -x_{n - j}$ for $j \in \{ 0, \ldots, n \}$, we have $\lambda_j = \lambda_{n - j}$ for $j \in \{ 0, \ldots, n \}$.
What I've tried: For an odd function $f$, we have $$ Q(f) = \sum_{j = 0}^{n} \lambda_j f(x_j) + \sum_{j = 0}^{n} \lambda_j f(x_j) = \sum_{j = 0}^{n} \lambda_j f(x_j) + \sum_{j = 0}^{n} \lambda_{n - j} f(x_{n - j}) = \sum_{j = 0}^{n} (\lambda_j - \lambda_{n - j}) f(x_j). $$ Now let $f$ be an odd polynomial of degree less than or equal to $n$. Then the quadrature formula is equal to the integral and as $f$ is odd, we have $$ 0 = I(f) = Q(f) = \sum_{j = 0}^{n} (\lambda_j - \lambda_{n - j}) f(x_j). $$ Since this holds for all odd polynomials of degree less than or equal to $n$, I want to conclude that the coefficients $\lambda_j - \lambda_{n - j}$ are zero, i.e. $\lambda_j = \lambda_{n - j}$, but I am not sure if this is valid.
There are several ways to proceed:
There is also different approach to the problem. If $Q$ is exact for all polynomials of degree $n$ then we might apply it to $\ell_k(x)$: $$ \int_{-1}^1 \ell_k(x) dx = I(f) = Q(f) = \sum_{j=0}^n \lambda_j \ell_k(x_j) = \lambda_j. $$ On the other hand $$ \int_{-1}^1 \ell_k(x) dx = \int_{-1}^1 \ell_k(-x) dx = \int_{-1}^1 \ell_{n-k}(x) dx, $$ so it is necessary that $\lambda_j = \lambda_{n-j}$.