Can I move the integral inside the sum? [closed]
If I have $$\int_a^b\left(\sum_{i=0}^nf(x_i)\prod_{j=0 \\ j \neq i}^n \frac{x-x_i}{x_i-x_j} \right)dx$$ can I write $$\sum_{i=0}^nf(x_i)\prod_{j=0 \\ j \neq i}^n \int_a^b\left(\frac{x-x_i}{x_i-x_j}\right)dx$$ My intuition tells me I can because previous formulas don't use $x$ but I would be thankful if someone confirmed it.
Solution 1:
Notice that : $$ \prod_{j=0\\j\neq i}^{n}{\frac{x-x_{i}}{x_{i}-x_{j}}}=\frac{\left(x-x_{i}\right)^{n}}{\prod\limits_{j=0\\j\neq i}^{n}{\left(x_{i}-x_{j}\right)}} $$
Thus : $$ \int_{a}^{b}{\left(\prod_{j=0\\j\neq i}^{n}{\frac{x-x_{i}}{x_{i}-x_{j}}}\right)\mathrm{d}x}=\left[\frac{\left(x-x_{i}\right)^{n+1}}{\left(n+1\right)\prod\limits_{j=0\\j\neq i}^{n}{\left(x_{i}-x_{j}\right)}}\right]_{a}^{b} $$