# How do you Calculate the Points in Gaussian Quadrature?

• I

## Main Question or Discussion Point

How do you calculate the necessary points in a function to numerically integrate it using the Gaussian Quadrature?

If I were to evaluate a function using two points, the Gaussian Quadrature needs the value of the function at $\displaystyle{\pm \sqrt{\frac{1}{3}}}$ with weights of unity. How did they calculate the $\displaystyle{\pm \sqrt{\frac{1}{3}}}$?

I have looked through an example of how the points are located, and in this example, the point is estimated by dividing the length of the function into the number of required points (if the function is to be integrated with two points, the whole function is divided into three parts), and somehow narrow down the location of the point by using this relation:
\begin{equation*}
x - \frac{P_n\left(x\right)}{P_n'\left(x\right)}
\end{equation*}
where $x$ is the estimated point and the functions on the second term are the Legendre Polynomials. The result of this difference will be the new location of the point. This process is repeated until the result is almost zero.

If the above equation is acceptable, what is the concept behind the second term (the ratio between the Legendre Polynomials)?

The abscissas (or points) used in a Gauss-Legendre quadrature of order $n$ are the zeros of the Legendre polynomial of the same order, i.e. $P_n(x)$. So, for order 2 they are the two roots of $P_2(x)$. As you noted they are $\pm \sqrt{1/3}$. The formula you are giving is the Newton method. That is, you can find the root of a function f(x) by using the recursive relation
$x_{i+1}=x_i-\frac{f(x_i)}{f'(x_i)}$,
starting from a guess $x_0$. The method is derived by doing a Taylor expansion of $f(x)$ around $x=x_i$.