# Integrating lagrange polynomial with equispaced points

Suppose we have some second order polynomial interpolant, $$P_2$$, defined on the equispaced points $$x_0, x_1, x_2$$, such that $$x_{j+1}-x_j=h$$. From $$P_2$$, we have Lagrange polynomials, $$L_0, L_1, L_2$$.

Suppose we want to integrate $$L_0$$ between $$x_0$$ and $$x_2$$. That would be,

$$\int_{x_0}^{x_2}L_0(x)dx = \frac{h}{3}$$

According to my professor, that is. However, I'm struggling to produce this result, so I'm hoping someone can help? Here is what I've done so far:

$$\int_{x_0}^{x_2}L_0(x)dx=\int_{x_0}^{x_2}\frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}dx=\int_{x_0}^{x_2}\frac{(x-x_1)(x-x_2)}{(-h)(-2h)}dx$$

$$=\frac{1}{2h^2}\int_{x_0}^{x_2}(x-x_1)(x-x_2)dx=\frac{1}{2h^2}\bigg[\int_{x_0}^{x_2}x^2dx-(x_2+x_1)\int_{x_0}^{x_2}xdx+x_{1}x_{2}\int_{x_0}^{x_2}dx\bigg]$$

$$=\frac{1}{2h^2}\bigg[ \frac{x_2^3-x_0^3}{3} - \frac{(x_2+x_1)(x_2^2-x_0^2)}{2}+x_{1}x_{2}(x_2-x_0)\bigg]=\frac{1}{2h^2}\bigg[ \frac{x_2^3-x_0^3}{3} - \frac{(x_2+x_1)(x_2^2-x_0^2)}{2}+2hx_{1}x_{2})\bigg]$$

But this is a lot of messy algebra and I can't seem to tidy it up to the simple result of $$h/3$$. My professor said this would be a simple exercise, so it makes me think I am missing something that would make the whole thing a lot easier?

Edit: I realised you can do u-substitution. See here for solution: http://www.cs.uleth.ca/~holzmann/notes/simpsons.pdf