1

I have been given a quadrature rule applied to

$I=\int_{a}^{b}f(x)\,dx$

which, for $a = -1, b = 1$, has nodes

$t_q= -1 + \frac{2q-1}{m}$ for $q=1,2,...,m$

In the case of 5 points, the nodes would be -0.8, -0.4, 0, 0.4, 0.8 for $t_1$, $t_2$, $t_3$, $t_4$, and $t_5$, respectively.
I reckon a Gaussian quadrature rule is being used but which one? And also, how can I find the weights of those nodes? Thank you

nurip
  • 11
  • 2
  • Does this arise in a particular problem? If so, please show us. It may give us a clue on how to find the weights. – Sean Roberson May 14 '23 at 20:41
  • I have nothing else. It is a question for an assignment. We have seen Simpsons rule, trapezium rule, gaussian rule (mainly legendres) but we hae seen Chevychebs in interpolation although not in quadrature but maybe they assume i can derive chevychevs by my own. What is in the question is all the information I have been given. – nurip May 14 '23 at 21:54
  • It’s not a Gaussian rule. – A rural reader May 15 '23 at 14:08
  • 1
    If the points all have the same weight, you get the composite midpoint rule. – Lutz Lehmann May 15 '23 at 16:16
  • The midpoint rule is the most simple Gaußian rule, the higher order Gaussian rules do not have equidistant segment-inner points. – Lutz Lehmann May 16 '23 at 11:29

1 Answers1

2

When you're after the weights for \begin{equation} \int_{-1}^1\, f(x)\, dx \approx w_{-2}f(-0.8) + w_{-1}f(-0.4) + w_{0}f(0) + w_{1}f(0.4) + w_{2}f(0.8) \end{equation} a pretty common strategy, but not the only one, is to require the rule to be exact for polynomials of a certain degree. If that's the case it's natural to choose symmetric weights, $w_{-2} = w_2$, $w_{-1} = w_1$ and to require exactness for constants, and $x$, $x^2$, $x^3$, $x^4$, $x^5$. The symmetric weights will ensure exactness for $x$, $x^3$, and $x^5$, so you're left with picking $w_0, w_1, w_2$ so that \begin{align} 2 &= w_2 + w_1 + w_0 + w_1 + w_2 \\ 2/3 &= w_2\cdot(-0.8)^2 + w_1\cdot(-0.4)^2 + w_0\cdot(0)^2 + w_1\cdot(0.4)^2 + w_2\cdot(0.8)^2 \\ 2/5 &= w_2\cdot(-0.8)^4 + w_1\cdot(-0.4)^4 + w_0\cdot(0)^4 + w_1\cdot(0.4)^4 + w_2\cdot(0.8)^4. \end{align} I get \begin{align} w_0 & =0.697916666666667, \\ w_1 &= 0.173611111111111, \\ w_2 &= 0.477430555555556. \end{align}

== ADDED ==

As a check, the rule above gives $\int_{-1}^1\, e^x\,dx \approx 2.35035\dots$, a relative error of $0.00002$.