- #1

mathmari

Gold Member

MHB

- 5,049

- 7

Hey!

I am looking at the Gauss Quadrature to approximate integrals. I haven;t really understood the meaning of the weighting function. Could you explain that to me?

At each case, the points that we need depend on what weighting function we have, so which polynomials we consider or not?

For example, if we have the weighting function $w(x)=1$ we use the Legendre polynomials, and so their roots are the points that we need.

If we have $w(x)=\frac{1}{\sqrt{1-x^2}}$ we use the Chebychev-Polynomials.

If we have $w(x)=e^{-x^2}$ we use the Hermite polynomials.

If we have $w(x)=e^{-x}$ we use the Laguerre polynomials.

Right? Can we have also other weighting functions? (Wondering) Suppose we have the integral $\displaystyle{\int_{-1}^1\frac{\cos (x)}{\sqrt{1-x^2}}\, dx}$ with weighting function $w(x)= \frac{1}{\sqrt{1-x^2}}$.

We approxmate the integral by the sum \begin{equation*}\sum_{i=1}^n\Phi (x_i)w_i\end{equation*}

So we use the Chebychev-polynomials, $T_n(x)=\cos \left (\arccos x\right ), \ x\in [-1,1]$. We get so the points \begin{equation*}x_k=\cos \left (\frac{2k+1}{2n}\pi \right ), \ \ k=0, \ldots n-1\end{equation*}

The constant weight are given by $w_i=\frac{\pi}{n+1}$.

Applying the Gauss quadrature with two weights and two points, so we use $w_1=w_2=\frac{\pi}{2+1}=\frac{\pi}{3}$ and $x_1=\cos \left (\frac{\pi}{4} \right )=\frac{1}{\sqrt{2}}$ and $x_2=\cos \left (\frac{3}{4}\pi \right )=-\frac{1}{\sqrt{2}}$, right? (Wondering)

Let $f(x)=\cos (x)$.

We have the following:

\begin{equation*}\int_{-1}^1f(x)\cdot w(x)\, dx\approx \sum_{i=1}^2 f (x_i)w_i=f (x_1)w_1+f (x_2)w_2=\cos \left (\frac{1}{\sqrt{2}}\right ) \cdot \frac{\pi}{3}+\cos \left (-\frac{1}{\sqrt{2}}\right )\cdot \frac{\pi}{3}\approx 1.59225\end{equation*}

Is this correct? (Wondering)

I am looking at the Gauss Quadrature to approximate integrals. I haven;t really understood the meaning of the weighting function. Could you explain that to me?

At each case, the points that we need depend on what weighting function we have, so which polynomials we consider or not?

For example, if we have the weighting function $w(x)=1$ we use the Legendre polynomials, and so their roots are the points that we need.

If we have $w(x)=\frac{1}{\sqrt{1-x^2}}$ we use the Chebychev-Polynomials.

If we have $w(x)=e^{-x^2}$ we use the Hermite polynomials.

If we have $w(x)=e^{-x}$ we use the Laguerre polynomials.

Right? Can we have also other weighting functions? (Wondering) Suppose we have the integral $\displaystyle{\int_{-1}^1\frac{\cos (x)}{\sqrt{1-x^2}}\, dx}$ with weighting function $w(x)= \frac{1}{\sqrt{1-x^2}}$.

We approxmate the integral by the sum \begin{equation*}\sum_{i=1}^n\Phi (x_i)w_i\end{equation*}

So we use the Chebychev-polynomials, $T_n(x)=\cos \left (\arccos x\right ), \ x\in [-1,1]$. We get so the points \begin{equation*}x_k=\cos \left (\frac{2k+1}{2n}\pi \right ), \ \ k=0, \ldots n-1\end{equation*}

The constant weight are given by $w_i=\frac{\pi}{n+1}$.

Applying the Gauss quadrature with two weights and two points, so we use $w_1=w_2=\frac{\pi}{2+1}=\frac{\pi}{3}$ and $x_1=\cos \left (\frac{\pi}{4} \right )=\frac{1}{\sqrt{2}}$ and $x_2=\cos \left (\frac{3}{4}\pi \right )=-\frac{1}{\sqrt{2}}$, right? (Wondering)

Let $f(x)=\cos (x)$.

We have the following:

\begin{equation*}\int_{-1}^1f(x)\cdot w(x)\, dx\approx \sum_{i=1}^2 f (x_i)w_i=f (x_1)w_1+f (x_2)w_2=\cos \left (\frac{1}{\sqrt{2}}\right ) \cdot \frac{\pi}{3}+\cos \left (-\frac{1}{\sqrt{2}}\right )\cdot \frac{\pi}{3}\approx 1.59225\end{equation*}

Is this correct? (Wondering)

Last edited by a moderator: