<s>[INST] Showing that $\int_{a}^{b} \frac{(x-x_1)(x-x_2)}{(x_0 - x_1)(x_0-x_2)} dx = \int_{-1}^{1} \frac{t(t-1)}{2} \frac{b-a}{2} dt$ I'm a second year math student, and I have some trouble understanding this equality in my book. I would appreciate a little help :)

Let $x_0=a,x_1=(a+b)/2,x_2=b$. \begin{align*} \int_{a}^{b}
 \frac{(x-x_1)(x-x_2)}{(x_0 - x_1)(x_0-x_2)} dx &= \int_{-1}^{1}
 \frac{t(t-1)}{2} \frac{b-a}{2} dt\\  \end{align*}

 [/INST] The substitution $t = \frac{x-x_1}{x_1-x_0}$ converts the left integral into the right:
We have $\frac{dx}{dt} = x_1 - x_0 = \frac{b-a}{2}$, and $\frac{x - x_2}{x_2 - x_0} = \frac{(x-x_1) - (x_2-x_1)}{2(x_1-x_0)} = \frac{1}{2}\left(t - \frac{x_2-x_1}{x_1-x_0}\right) = \frac{t-1}{2}$ since $x_2 - x_1 = x_1 - x_0$. Further, $\frac{a-x_1}{x_1-x_0} = \frac{x_0-x_1}{x_1-x_0} = -1$ and $\frac{b-x_1}{x_1-x_0} = \frac{x_2-x_1}{x_1-x_0} = 1$, so
\begin{align}
\int_a^b \frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}\,dx
&= \int_a^b \underbrace{\frac{x-x_1}{x_1-x_0}}_t \underbrace{\frac{x-x_2}{x_2-x_0}}_{\frac{t-1}{2}}\,dx\\
&= \int_{-1}^1 \frac{t(t-1)}{2} \underbrace{\frac{b-a}{2}\,dt}_{dx}.
\end{align}
</s>