2
$\begingroup$

Description

Let $p(x)$ be a polynomial of degree $n$ and rational coefficients.

I'm interested in computing numerically the exact value of the integral $I$, which is also rational

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

Usually the numerical integral is computed by the sum of weights $w_i$ and function values at nodes $x_i$

$$\tilde{I} = \sum_{i=1}^{m} w_i \cdot p(x_i)$$

The exact integral can be obtained by

  • Newton-cotes formula with $m = 1+2\left\lfloor \dfrac{n}{2}\right\rfloor$ evaluation nodes
  • Gauss-legendre quadrature with $m = \left\lceil \dfrac{n+1}{2}\right\rceil$ nodes.

Clearly gauss-legendre uses less points than newton-cotes due to the fact Newton-cotes keeps the nodes fixed at equal distance and find the best weights, while gauss-legendre find the best nodes and weights.

But the problem with gauss-legendre is the fact its nodes are irrational, impossible to represent them in computer, while rational values can.

Then I asked myself if there's a numerical method such we allow the nodes $x_{i}$ to move (different from newton-cotes) while keeping $x_i$ and $w_{i}$ in rationals (different from gauss-legendre). But unfortunatelly I have no clue how to start it

Question

  • Is there some numerical method that uses $m \le 2\left\lfloor \dfrac{n}{2}\right\rfloor$ rational nodes and returns the exact value of $I$ ?

An equivalent question is:

  • Given constant $m$, what is the maximum degree $n$ such $I$ is equal to $\tilde{I}$?

Notes

Note 1: I don't know the values of the coefficients $c_i$ of $p(x)$ to compute

$$I = \sum_{i=0}^{n} c_{i} \cdot \dfrac{b^{i+1}-a^{i-1}}{i+1}$$

Finding these coefficients means evaluating $p(x)$ at $(n+1)$ nodes, which would be the same as newton-cotes

Note 2: Assume my computer has infinite integer precision and can represent any rational.

Note 3: For many the approximation of the gauss-legendre irrationals by float are enough, but trying to transform these irrationals into rationals (in computer) may lead to error.

$\endgroup$
2
  • $\begingroup$ "its nodes are irrational, impossible to represent them in computer" I think you underestimate the abilities of the computer. Such softwares as Maple and Mathematica are quite capable of computing with quantities like, say, "root of $x^3-x-1$". $\endgroup$ Commented Sep 9, 2023 at 3:40
  • $\begingroup$ @GerryMyerson True, but $n$ polynomial evaluations at rational points will be much faster than $n/2$ polynomial evaluations at general algebraic points. Anyway, I don't see this question as being about efficiency, rather about how precise a quadrature rule can be if its abscissae are rational. $\endgroup$ Commented Sep 9, 2023 at 12:41

1 Answer 1

1
$\begingroup$

It can be done with $n$ abscissae for odd $n$, though I'm not sure it can always be done with positive weights. Take $a=-1$, $b=1$ without loss of generality.

I'll do $n=5$. Consider $$I=w_0(f(-x_0)+f(x_0)) + w_1(f(-x_1)+f(x_1)) + w_2f(0).$$ The symmetry ensures that it integrates odd powers correctly. Make the three equations that say it works for $1$, $x^2$ and $x^4$, and solve for $w_0,w_1,w_2$ as rational functions of $x_0,x_1$. Put in any rational values of $x_0,x_1$ and you get rational weights. What I'm not sure about is whether you can always get positive rational weights.

For $n=5$: $x_0=1,x_1=\frac12$ gives $w_0=\frac{7}{45}$, $w_1=\frac{32}{45}$, $w_2=\frac{4}{45}$.

For $n=7$: $x_0=1$, $x_1=\frac23$, $x_2=\frac13$ gives $w_0=\frac{41}{420}$, $w_1=\frac{18}{35}$, $w_2=\frac{9}{140}$, $w_3=\frac{68}{105}$.

ADDED:

The problem for degree 7 and 5 abscissae symmetric about 0 comes done to whether $y$ and $\sqrt{(21y^2-15)/(35y^2-21)}$ can be rational at the same time. I didn't prove it but I suspect there are no solutions and therefore no rational quadrature rule of that form.

$\endgroup$
2
  • $\begingroup$ Indeed, but the final values are the same as Newton-cotes. I hadn't seen the error were of order $f^{2k}$ for $2k-1$ and $2k$. That means, integrate $n=0$ and $n=1$ requires only $1$ node, integrate $n=2$ and $n=3$ requires only $3$ nodes and so on. I updated the question with that $\endgroup$ Commented Sep 8, 2023 at 15:50
  • 2
    $\begingroup$ is this more efficient than finding the coefficients of the polynomial and integrating "by hand"? $\endgroup$ Commented Sep 8, 2023 at 15:52

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.