Gaussian Quadrature Formula for Integrating Polynomials of Degree 6

In summary: Thinking)In summary, the conversation discusses how to use the Gaussian quadrature formula to calculate the integral of a function, specifically in this case, the integral of 1/(x+3) from 0 to 1. The formula is given as the sum of the function evaluated at specific points multiplied by corresponding weights. The conversation also mentions the use of Legendre polynomials and the need for calculating the values of x_i and w_i. The weight function can be freely chosen, and the interval does not need to be shifted to [-1,1].
  • #1
mathmari
Gold Member
MHB
5,049
7
Hey! :eek:

I want to calculate the integral $$\int_0^1\frac{1}{x+3}\, dx$$ with the Gaussian quadrature formula that integrates exactly all polynomials of degree $6$.

The gaussian quadrature integrates exactly polynomials $\Phi (x)$ with maximum degree $2n-1$. In this case we consider $n=4$.

The formula is \begin{equation*}\int_{0}^1\frac{1}{x+3}\, dx\approx \sum_{i=1}^nf(x_i)\cdot w_i=f(x_1)\cdot w_1+f(x_2)\cdot w_2+f(x_3)\cdot w_3+f(x_4)\cdot w_4\end{equation*}

For the calculations of $w_i$ we need the following:
\begin{align*}&P_n(x)=(a_n+x)P_{n-1}(x)+c_nP_{n-2}(x) \\ &P_0=1, \ P_{-1}=0\end{align*} with \begin{equation*}a_n=-\frac{\langle x\cdot P_{n-1}, P_{n-1}\rangle_w}{\langle P_{n-1}, P_{n-1}\rangle_w}, \ \ \ , c_n=-\frac{\langle P_{n-1}, P_{n-1}\rangle_w}{\langle P_{n-2}, P_{n-2}\rangle_w}\end{equation*} right? What is in this case the weight function $w(x)$ ?

(Wondering)
 
Mathematics news on Phys.org
  • #2
Hey mathmari!

Can't we do a substitution on the integral so that it's on [-1,1]?
Then the standard weights apply, and we have the points and weights as given in Gaussian quadrature.
If we want to, afterwards we can do a reverse substitution to find the points on [0,1]. (Thinking)
 
  • #3
Klaas van Aarsen said:
Can't we do a substitution on the integral so that it's on [-1,1]?
Then the standard weights apply, and we have the points and weights as given in Gaussian quadrature.
If we want to, afterwards we can do a reverse substitution to find the points on [0,1]. (Thinking)

Ah ok, so we get \begin{equation*}\int_0^1\frac{1}{t+3}\, dt=\int_{-1}^1\frac{1}{\frac{1}{2}+\frac{x}{2}+3}\, \frac{1}{2}dx=\int_{-1}^1\frac{1}{x+7}\, dx\end{equation*}

Since we want that the Gaussian quadrature formula integrates exactly all polynomials of degree 6, do we consider $n=4$ ? (Wondering)
 
  • #4
mathmari said:
Ah ok, so we get \begin{equation*}\int_0^1\frac{1}{t+3}\, dt=\int_{-1}^1\frac{1}{\frac{1}{2}+\frac{x}{2}+3}\, \frac{1}{2}dx=\int_{-1}^1\frac{1}{x+7}\, dx\end{equation*}

Since we want that the Gaussian quadrature formula integrates exactly all polynomials of degree 6, do we consider $n=4$ ?

Yes.
And with $n=4$ we get exact integration of polynomials up to degree $2n-1=7$, so that includes indeed degree $6$. (Nod)
 
  • #5
Klaas van Aarsen said:
Yes.
And with $n=4$ we get exact integration of polynomials up to degree $2n-1=7$, so that includes indeed degree $6$. (Nod)

Ah ok! (Nerd)

If the values of $x_i$ and $w_i$ are not given and we have to calcualte them by ourself, how can we do that? In Wiki there is a formula for $w_i$, do we use this one? But what about $x_i$ ? (Wondering)
 
  • #6
mathmari said:
Ah ok!

If the values of $x_i$ and $w_i$ are not given and we have to calcualte them by ourself, how can we do that? In Wiki there is a formula for $w_i$, do we use this one? But what about $x_i$ ?

Looks like it yes.

Wiki also mentions:
the associated orthogonal polynomials are Legendre polynomials, denoted by Pn(x). With the n-th polynomial normalized to give Pn(1) = 1, the i-th Gauss node, xi, is the i-th root of Pn
(Thinking)
 
  • #7
mathmari said:
I want to calculate the integral $$\int_0^1\frac{1}{x+3}\, dx$$ with the Gaussian quadrature formula that integrates exactly all polynomials of degree $6$.

For the calculations of $w_i$ we need the following:
\begin{align*}&P_n(x)=(a_n+x)P_{n-1}(x)+c_nP_{n-2}(x) \\ &P_0=1, \ P_{-1}=0\end{align*} with \begin{equation*}a_n=-\frac{\langle x\cdot P_{n-1}, P_{n-1}\rangle_w}{\langle P_{n-1}, P_{n-1}\rangle_w}, \ \ \ , c_n=-\frac{\langle P_{n-1}, P_{n-1}\rangle_w}{\langle P_{n-2}, P_{n-2}\rangle_w}\end{equation*}

mathmari said:
If the values of $x_i$ and $w_i$ are not given and we have to calcualte them by ourself, how can we do that? In Wiki there is a formula for $w_i$, do we use this one? But what about $x_i$ ?

Wiki also mentions:
The integration problem can be expressed in a slightly more general way by introducing a positive weight function ω into the integrand, and allowing an interval other than [−1, 1]. That is, the problem is to calculate
$$\int _{a}^{b}\omega (x)\,f(x)\,dx$$
I believe we can freely pick $\omega(x)$. Whatever makes the calculations the easiest. (Wondering)

In our case we have $a=0$, $b=1$, and $\omega (x)\,f(x)=\frac{1}{x+3}$.
So I think we should either pick $\omega (x)=1$ or $\omega (x)=\frac{1}{x+3}$.

Suppose we pick $\omega (x)=1$.
Then:
\begin{equation*}a_1=-\frac{\langle x\cdot P_0, P_0\rangle_\omega}{\langle P_0, P_0\rangle_\omega}
= -\frac{\langle x\cdot 1, 1\rangle_\omega}{\langle 1, 1\rangle_\omega}
= -\frac{\int_0^1 \omega(x)x\,dx}{\int_0^1 \omega(x)\,dx}
= -\frac{\int_0^1 x\,dx}{\int_0^1 dx}
= -\frac {\frac 12}1 \\
P_1(x)=(a_1+x)P_0(x)+c_1P_{-1}(x)
= \left(-\frac 12+x\right)1+c_1\cdot 0 = x-\frac 12
\end{equation*}
(Thinking)

If we would pick $n=1$, then $x_i$ would be the $i$-th root of $P_1(x)$. That is, we would have $x_1=\frac 12$.
For $n=4$ we need to do a bit more work. (Sweating)
 
  • #8
Klaas van Aarsen said:
Wiki also mentions:
The integration problem can be expressed in a slightly more general way by introducing a positive weight function ω into the integrand, and allowing an interval other than [−1, 1]. That is, the problem is to calculate
$$\int _{a}^{b}\omega (x)\,f(x)\,dx$$
I believe we can freely pick $\omega(x)$. Whatever makes the calculations the easiest. (Wondering)

In our case we have $a=0$, $b=1$, and $\omega (x)\,f(x)=\frac{1}{x+3}$.
So I think we should either pick $\omega (x)=1$ or $\omega (x)=\frac{1}{x+3}$.
Ahh ok! So, do we not have to shift an arbitrary interval into $[-1,1]$ ? I thought that these formulas would hold only at $[-1,1]$. (Wondering)
 
  • #9
mathmari said:
Ahh ok! So, do we not have to shift an arbitrary interval into $[-1,1]$ ? I thought that these formulas would hold only at $[-1,1]$.

No, the interval [-1,1] is merely a convenient choice, and tables are readily available for the resulting $P_n(x)$, $x_i$, and $w_i$.
Also, it's not so easy to find the roots of $P_n(x)$ for $n=4$, which is a 4-th degree polynomial after all. (Thinking)
 
  • #10
Klaas van Aarsen said:
No, the interval [-1,1] is merely a convenient choice, and tables are readily available for the resulting $P_n(x)$, $x_i$, and $w_i$.

So, do you suggest to let the interval of the integral at $[0,1]$ or to shift it to $[-1,1]$ ? (Wondering)
Klaas van Aarsen said:
Also, it's not so easy to find the roots of $P_n(x)$ for $n=4$, which is a 4-th degree polynomial after all. (Thinking)

But in this case we have to calculate the roots of the $4$th degree polynomial, or is there also an other way? (Wondering)
 
  • #11
mathmari said:
So, do you suggest to let the interval of the integral at $[0,1]$ or to shift it to $[-1,1]$ ?

It's easiest to approximate the integral with a Gaussian quadrature by shifting to $[-1,1]$ and using the tabulated data.
You had already almost done that. It makes sense to finish it, so that we can use it for comparisons.

However, I think the purpose of the problem is to learn about weight functions, weights, and how Gaussian quadrature really works. For that I think we should try both choices for $\omega(x)$ and see what we get.
Maybe one of them works out really well. (Wait)
mathmari said:
But in this case we have to calculate the roots of the $4$th degree polynomial, or is there also an other way?

I'm not sure yet. Maybe we will find a 4-th degree polynomial that is not so hard.
And anyway, we can always solve it with for instance Wolfram. (Thinking)
 
  • #12
I have done the following:

\begin{align*}&a_1=-\frac{\langle x\cdot P_0, P_0\rangle_\omega}{\langle P_0, P_0\rangle_\omega}
= -\frac{\langle x\cdot 1, 1\rangle_\omega}{\langle 1, 1\rangle_\omega}
= -\frac{\int_0^1 \omega(x)x\,dx}{\int_0^1 \omega(x)\,dx}
= -\frac{\int_0^1 x\,dx}{\int_0^1 dx}
= -\frac {\frac 12}1 \\
&P_1(x)=(a_1+x)P_0(x)+c_1P_{-1}(x)
= \left(-\frac 12+x\right)1+c_1\cdot 0 = x-\frac 12
\end{align*}

\begin{align*}&a_2=-\frac{\langle x\cdot P_{1}, P_{1}\rangle_w}{\langle P_{1}, P_{1}\rangle_w}=-\frac{\langle x\cdot \left (x-\frac 12\right ), x-\frac 12\rangle_w}{\langle x-\frac 12, x-\frac 12\rangle_w}=-\frac{\int_0^1x\cdot \left (x-\frac 12\right )\cdot w(x)\, dx}{\int_0^1\left (x-\frac 12\right )^2\cdot w(x)\, dx}=-\frac{\int_0^1\left (x^2-\frac x2\right )\, dx}{\int_0^1\left (x^2-x+\frac 14\right )\, dx}=-\frac{\frac{1}{12}}{\frac{1}{12}}=-1 \\ & c_2=-\frac{\langle P_{1}, P_{1}\rangle_w}{\langle P_{0}, P_{0}\rangle_w}=-\frac{\langle x-\frac 12, x-\frac 12\rangle_w}{\langle 1, 1\rangle_w}=-\frac{\int_0^1\left (x-\frac 12\right )^2\cdot w(x)\, dx}{\int_0^1 w(x)\, dx}=-\frac{\int_0^1\left (x-\frac 12\right )^2\, dx}{\int_0^1 1\, dx}=-\frac{\frac{1}{12}}{1}=-\frac{1}{12} \\ & P_2(x)=(a_2+x)P_{1}(x)+c_2P_{0}(x)=(-1+x)\cdot \left (x-\frac{1}{2}\right )-\frac{1}{12}\cdot 1=x^2-\frac{3x}{2}+\frac{5}{12}
\end{align*}

\begin{align*}&a_3=-\frac{\langle x\cdot P_{2}, P_{2}\rangle_w}{\langle P_{2}, P_{2}\rangle_w}=-\frac{\langle x\cdot \left (x^2-\frac{3x}{2}+\frac{5}{12} \right ), x^2-\frac{3x}{2}+\frac{5}{12}\rangle_w}{\langle x^2-\frac{3x}{2}+\frac{5}{12}, x^2-\frac{3x}{2}+\frac{5}{12}\rangle_w}=-\frac{\int_0^1 x\cdot \left (x^2-\frac{3x}{2}+\frac{5}{12} \right )^2\, dx}{\int_0^1 \left ( x^2-\frac{3x}{2}+\frac{5}{12}\right )^2\, dx}=-\frac{\frac{11}{1440}}{\frac{19}{720}}=-\frac{11}{38} \\ & c_3=-\frac{\langle P_{2}, P_{2}\rangle_w}{\langle P_{1}, P_{1}\rangle_w}=-\frac{\langle x^2-\frac{3x}{2}+\frac{5}{12}, x^2-\frac{3x}{2}+\frac{5}{12}\rangle_w}{\langle x-\frac 12, x-\frac 12\rangle_w}=-\frac{\int_0^1\left ( x^2-\frac{3x}{2}+\frac{5}{12}\right )^2\, dx}{\int_0^1\left ( x-\frac 12\right )^2\, dx}=-\frac{\frac{19}{720}}{\frac{1}{12}}=-\frac{19}{60} \\ & P_3(x)=(a_3+x)P_{2}(x)+c_3P_{1}(x)=\left (-\frac{11}{38}+x\right )\left (x^2-\frac{3x}{2}+\frac{5}{12}\right )-\frac{19}{60}\left (x-\frac 12\right ) \\ & =x^3-\frac{34}{19}x^2+\frac{203}{380}x+\frac{43}{1140}\end{align*}

\begin{align*}&a_4=-\frac{\langle x\cdot P_{3}, P_{3}\rangle_w}{\langle P_{3}, P_{3}\rangle_w}=-\frac{\int_0^1x\cdot \left (x^3-\frac{34}{19}x^2+\frac{203}{380}x+\frac{43}{1140}\right )^2\, dx}{\int_0^1\left (x^3-\frac{34}{19}x^2+\frac{203}{380}x+\frac{43}{1140}\right )^2\, dx}=-\frac{\frac{120583}{12129600}}{\frac{2087}{159600}}=-\frac{120583}{158612} \\ &c_4=-\frac{\langle P_{3}, P_{3}\rangle_w}{\langle P_{2}, P_{2}\rangle_w}=-\frac{\int_0^1 \left (x^3-\frac{34}{19}x^2+\frac{203}{380}x+\frac{43}{1140} \right )^2\, dx}{\int_0^1\left (x^2-\frac{3x}{2}+\frac{5}{12}\right )^2\, dx}=-\frac{\frac{2087}{159600}}{\frac{19}{720}}=-\frac{6261}{12635} \\ &P_4= (a_4+x)P_{3}(x)+c_4P_{2}(x)=\left (-\frac{120583}{158612}+x\right )\left (x^3-\frac{34}{19}x^2+\frac{203}{380}x+\frac{43}{1140}\right )-\frac{6261}{12635}\left (x^2-\frac{3x}{2}+\frac{5}{12}\right )\\ & =x^4-\frac{21285}{8348}x^3+\frac{1553409}{1110284}x^2+\frac{24973673}{66617040}x-\frac{15664717}{66617040}\end{align*}

But I must have done something wrong because the roots (as we see in Wolfram) are not the same as the ones that are in Wiki. Do you have an idea what I have done wrong? (Wondering)
 
  • #13
mathmari said:
I have done the following:

\begin{align*}&a_1=-\frac{\langle x\cdot P_0, P_0\rangle_\omega}{\langle P_0, P_0\rangle_\omega}
= -\frac{\langle x\cdot 1, 1\rangle_\omega}{\langle 1, 1\rangle_\omega}
= -\frac{\int_0^1 \omega(x)x\,dx}{\int_0^1 \omega(x)\,dx}
= -\frac{\int_0^1 x\,dx}{\int_0^1 dx}
= -\frac {\frac 12}1 \\
&P_1(x)=(a_1+x)P_0(x)+c_1P_{-1}(x)
= \left(-\frac 12+x\right)1+c_1\cdot 0 = x-\frac 12
\end{align*}

\begin{align*}&a_2=-\frac{\langle x\cdot P_{1}, P_{1}\rangle_w}{\langle P_{1}, P_{1}\rangle_w}
=-\frac{\langle x\cdot \left (x-\frac 12\right ), x-\frac 12\rangle_w}{\langle x-\frac 12, x-\frac 12\rangle_w}
=-\frac{\int_0^1x\cdot \left (x-\frac 12\right )\cdot w(x)\, dx}{\int_0^1\left (x-\frac 12\right )^2\cdot w(x)\, dx}=-\frac{\int_0^1\left (x^2-\frac x2\right )\, dx}{\int_0^1\left (x^2-x+\frac 14\right )\, dx}
=-\frac{\frac{1}{12}}{\frac{1}{12}}=-1
\end{align*}

Don't we have:
$$a_2=-\frac{\langle x\cdot P_{1}, P_{1}\rangle_w}{\langle P_{1}, P_{1}\rangle_w}=-\frac{\langle x\cdot \left (x-\frac 12\right ), x-\frac 12\rangle_w}{\langle x-\frac 12, x-\frac 12\rangle_w}=-\frac{\int_0^1x\cdot \left (x-\frac 12\right )^2\cdot w(x)\, dx}{\int_0^1\left (x-\frac 12\right )^2\cdot w(x)\, dx}$$
That is, with a square in the numerator? (Thinking)

mathmari said:
But I must have done something wrong because the roots (as we see in Wolfram) are not the same as the ones that are in Wiki. Do you have an idea what I have done wrong? (Wondering)

We wouldn't get exactly the same roots, since we have scaled [-1,1] to [0,1].
But we should get more or less the same distribution yes.
And I would also expect the roots to be in the interval [0,1], because otherwise we cannot use them to calculate $f(x_i)$. (Worried)
 
  • #14
Klaas van Aarsen said:
Don't we have:
$$a_2=-\frac{\langle x\cdot P_{1}, P_{1}\rangle_w}{\langle P_{1}, P_{1}\rangle_w}=-\frac{\langle x\cdot \left (x-\frac 12\right ), x-\frac 12\rangle_w}{\langle x-\frac 12, x-\frac 12\rangle_w}=-\frac{\int_0^1x\cdot \left (x-\frac 12\right )^2\cdot w(x)\, dx}{\int_0^1\left (x-\frac 12\right )^2\cdot w(x)\, dx}$$
That is, with a square in the numerator? (Thinking)

Ahh yes. I did the calculations again and now I get the following:
\begin{align*}&a_1=-\frac{\langle x\cdot P_0, P_0\rangle_\omega}{\langle P_0, P_0\rangle_\omega}
= -\frac{\langle x\cdot 1, 1\rangle_\omega}{\langle 1, 1\rangle_\omega}
= -\frac{\int_0^1 \omega(x)x\,dx}{\int_0^1 \omega(x)\,dx}
= -\frac{\int_0^1 x\,dx}{\int_0^1 dx}
= -\frac {\frac 12}1 \\
&P_1(x)=(a_1+x)P_0(x)+c_1P_{-1}(x)
= \left(-\frac 12+x\right)1+c_1\cdot 0 = x-\frac 12
\end{align*}

\begin{align*}&a_2=-\frac{\langle x\cdot P_{1}, P_{1}\rangle_w}{\langle P_{1}, P_{1}\rangle_w}=-\frac{\langle x\cdot \left (x-\frac 12\right ), x-\frac 12\rangle_w}{\langle x-\frac 12, x-\frac 12\rangle_w}=-\frac{\int_0^1x\cdot \left (x-\frac 12\right )^2\cdot w(x)\, dx}{\int_0^1\left (x-\frac 12\right )^2\cdot w(x)\, dx}=-\frac{\int_0^1x\cdot \left (x-\frac 12\right )^2\, dx}{\int_0^1\left (x-\frac 12\right )^2\, dx}=-\frac{\frac{1}{24}}{\frac{1}{12}}=-\frac{1}{2} \\ & c_2=-\frac{\langle P_{1}, P_{1}\rangle_w}{\langle P_{0}, P_{0}\rangle_w}=-\frac{\langle x-\frac 12, x-\frac 12\rangle_w}{\langle 1, 1\rangle_w}=-\frac{\int_0^1\left (x-\frac 12\right )^2\cdot w(x)\, dx}{\int_0^1 w(x)\, dx}=-\frac{\int_0^1\left (x-\frac 12\right )^2\, dx}{\int_0^1 1\, dx}=-\frac{\frac{1}{12}}{1}=-\frac{1}{12} \\ & P_2(x)=(a_2+x)P_{1}(x)+c_2P_{0}(x)=\left (-\frac{1}{2}+x\right )\cdot \left (x-\frac{1}{2}\right )-\frac{1}{12}\cdot 1=x^2-x+\frac{1}{6}
\end{align*}

\begin{align*}&a_3=-\frac{\langle x\cdot P_{2}, P_{2}\rangle_w}{\langle P_{2}, P_{2}\rangle_w}=-\frac{\langle x\cdot \left (x^2-x+\frac{1}{6} \right ), x^2-x+\frac{1}{6}\rangle_w}{\langle x^2-x+\frac{1}{6}, x^2-x+\frac{1}{6}\rangle_w}=-\frac{\int_0^1 x\cdot \left (x^2-x+\frac{1}{6} \right )^2\, dx}{\int_0^1 \left ( x^2-x+\frac{1}{6}\right )^2\, dx}=-\frac{\frac{1}{360}}{\frac{1}{180}}=-\frac{1}{2} \\ & c_3=-\frac{\langle P_{2}, P_{2}\rangle_w}{\langle P_{1}, P_{1}\rangle_w}=-\frac{\langle x^2-x+\frac{1}{6}, x^2-x+\frac{1}{6}\rangle_w}{\langle x-\frac 12, x-\frac 12\rangle_w}=-\frac{\int_0^1\left ( x^2-x+\frac{1}{6}\right )^2\, dx}{\int_0^1\left ( x-\frac 12\right )^2\, dx}=-\frac{\frac{1}{180}}{\frac{1}{12}}=-\frac{1}{15} \\ & P_3(x)=(a_3+x)P_{2}(x)+c_3P_{1}(x)=\left (-\frac{1}{2}+x\right )\left (x^2-x+\frac{1}{6}\right )-\frac{1}{15}\left (x-\frac 12\right )=x^3-\frac{3}{2}x^2+\frac{3}{5}x-\frac{1}{20}\end{align*}

\begin{align*}&a_4=-\frac{\langle x\cdot P_{3}, P_{3}\rangle_w}{\langle P_{3}, P_{3}\rangle_w}=-\frac{\int_0^1x\cdot \left (x^3-\frac{3}{2}x^2+\frac{3}{5}x-\frac{1}{20}\right )^2\, dx}{\int_0^1\left (x^3-\frac{3}{2}x^2+\frac{3}{5}x-\frac{1}{20}\right )^2\, dx}=-\frac{\frac{1}{5600}}{\frac{1}{2800}}=-\frac{1}{2} \\ &c_4=-\frac{\langle P_{3}, P_{3}\rangle_w}{\langle P_{2}, P_{2}\rangle_w}=-\frac{\int_0^1 \left (x^3-\frac{3}{2}x^2+\frac{3}{5}x-\frac{1}{20} \right )^2\, dx}{\int_0^1\left (x^2-x+\frac{1}{6}\right )^2\, dx}=-\frac{\frac{1}{2800}}{\frac{1}{180}}=-\frac{9}{140} \\ &P_4= (a_4+x)P_{3}(x)+c_4P_{2}(x)=\left (-\frac{1}{2}+x\right )\left (x^3-\frac{3}{2}x^2+\frac{3}{5}x-\frac{1}{20}\right )-\frac{9}{140}\left (x^2-x+\frac{1}{6}\right )=x^4-2x^3+\frac{9}{7}x^2-\frac{2}{7}x+\frac{1}{70}\end{align*}

Is there a way s that we can verify if we got the correct polynomial? (Wondering)
Klaas van Aarsen said:
We wouldn't get exactly the same roots, since we have scaled [-1,1] to [0,1].
But we should get more or less the same distribution yes.
And I would also expect the roots to be in the interval [0,1], because otherwise we cannot use them to calculate $f(x_i)$. (Worried)

Now we get these roots: Wolfram, which are in the interval $[0,1]$.

(Wondering)
 
Last edited by a moderator:
  • #15
mathmari said:
Is there a way that we can verify if we got the correct polynomial?

Yes. We can verify if $\langle P_i,P_j\rangle_w=\delta_{ij}$. (Thinking)

mathmari said:
Now we get these roots: Wolfram, which are in the interval $[0,1]$.

That looks about right. Nice! (Happy)
 
  • #16
Klaas van Aarsen said:
Yes. We can verify if $\langle P_i,P_j\rangle_w=\delta_{ij}$. (Thinking)

But it doesn't hold that $\langle P_i,P_i\rangle_w=1$, does it? (Wondering)

If we took the other weight function, $w(x)=\frac{1}{x+3}$ instead of $w(x)=1$, would we get other polynomials? (Wondering)
 
Last edited by a moderator:
  • #17
mathmari said:
But it doesn't hold that $\langle P_i,P_i\rangle_w=1$, does it?

True. The polynomials are orthogonal, but they have not been normalized to $1$. (Blush)
So we should have for each $i\ne j$ that $\langle P_i,P_j\rangle_w=0$.

mathmari said:
If we took the other weight function, $w(x)=\frac{1}{x+3}$ instead of $w(x)=1$, would we get other polynomials?

I think so yes. (Thinking)
 
  • #18
Klaas van Aarsen said:
True. The polynomials are orthogonal, but they have not been normalized to $1$. (Blush)
So we should have for each $i\ne j$ that $\langle P_i,P_j\rangle_w=0$.

Ah ok! (Malthe)
Klaas van Aarsen said:
I think so yes. (Thinking)

But both are corrects, aren't they? (Wondering)
 
  • #19
mathmari said:
Ah ok!

But both are corrects, aren't they?

Yes. (Nod)
 

What is the Gaussian quadrature formula?

The Gaussian quadrature formula is a numerical integration method used to approximate the value of a definite integral. It is based on the principle of choosing the optimal points and weights to approximate the integral with the highest possible accuracy.

How does the Gaussian quadrature formula work?

The formula works by breaking down the integral into a sum of smaller integrals, each of which is approximated by a weighted sum of function values at specific points. The points and weights are chosen in such a way that the error in the approximation is minimized.

What are the advantages of using the Gaussian quadrature formula?

One of the main advantages of using this formula is its high accuracy, especially when compared to other numerical integration methods. It also requires fewer function evaluations, making it more efficient and faster to compute.

What types of integrals can be approximated using the Gaussian quadrature formula?

The Gaussian quadrature formula can be used to approximate integrals of any continuous function over a finite interval. It is particularly useful for integrals with high degrees of smoothness, such as polynomials or trigonometric functions.

Can the Gaussian quadrature formula handle integrals with singularities or discontinuities?

No, the formula is not suitable for integrals with singularities or discontinuities. In such cases, other numerical integration methods, such as adaptive quadrature, may be more appropriate.

Similar threads

Replies
6
Views
927
  • General Math
Replies
12
Views
1K
  • General Math
Replies
4
Views
711
Replies
3
Views
1K
  • Calculus
Replies
2
Views
1K
Replies
2
Views
2K
Replies
2
Views
1K
Replies
1
Views
394
Replies
2
Views
620
Replies
3
Views
732
Back
Top