Application to the case \( N=2 \)
If we wish to integrate
$$
\begin{equation*}
\int_{-1}^1f(x)dx,
\end{equation*}
$$
with \( f(x)=x^2 \), we approximate
$$
\begin{equation*}
I=\int_{-1}^1x^2dx \approx \sum_{i=0}^{N-1}\omega_ix_i^2.
\end{equation*}
$$