📜 ⬆️ ⬇️

Representation of arbitrary polynomials in the form of finite differences with an arbitrary step

Introduction


This article discusses the possibility of representing an arbitrary polynomial of an arbitrary integer degree n as finite differences. The approach in this article differs from the existing ones in that all formulas are derived for an arbitrary polynomial with arbitrary coefficients, as well as in that an arbitrary, rather than unit, interval is used as an interval between points. The obtained formulas are universal, and can be used without change both for calculating the “future” and “past” values ​​of the polynomial. That is, for example, for any curve expressed by a quadratic equation with arbitrary coefficients, it is possible to calculate all the values ​​with only 3 previously known values ​​of y taken at an arbitrary equal interval φ. As a consequence, the assertion is introduced that through (n + 1) equidistant points one and only one curve can be drawn, expressed by a polynomial of degree n.

Disclaimer


I'm not a mathematician, I'm just a programmer with 20 years of experience. I conducted independent research, but did not find the same conclusions that I made in this article. I would be grateful for any comments and “tips” on existing developments, the conclusions of which are similar (or close) to mine.

general information


To begin with, I will give a general formula for calculating the function S (t) given by a polynomial of degree n and expressed through (n + 1) previous values ​​taken at an equal interval of φ:


That is, for example, for a polynomial of degree n = 1 (normal line), this formula will look like:


For a polynomial of degree n = 2, this formula will have the form:


And so on. Detailed mathematical proof is provided in this document . I also prepared a verification code executed in the form of JavaScript code. You can get it by this link . In the same article I will show some practical conclusions and options for using the obtained equations.

Construct polynomials of degree 2


For a common understanding, a “polynomial of degree 2” is expressed using the following formula:


However, as it turned out, you can calculate all the values ​​of a given polynomial (in fact, you can only calculate the values ​​of a polynomial at nodes with some arbitrary step φ) using the “finite difference” equation:


That is, on the basis of any three values ​​of the function S (t) taken at an equal arbitrary interval φ, you can get all the values ​​of the polynomial. Let's show it on real data. Let the real polynomial be expressed by the following function:


Now we calculate the values ​​of the function R (t) at the points t = 111, t = 115 and t = 119. That is, the step φ in this case is equal to 4. The values ​​obtained will be R (111) = 12546, R (115) = 13458 and R (119) = 14402. Now we calculate the following two polynomial values ​​using an equation with finite differences:



It is easy to calculate that the values ​​calculated using the formula in finite differences completely coincide with the values ​​calculated using the "standard" formula for a second-degree polynomial.
')
Also, a formula in finite differences allows one to calculate the “back” values ​​without changing the formula itself. For example, to calculate R (107) and R (103), we get the following:



Again, it is not difficult to calculate that the values ​​obtained using the finite difference formulas completely coincide with the values ​​calculated using the “standard” formula for the second degree polynomial.

For all subsequent degrees, the results will be similar. I have tested polynomials up to the 99th degree: the results obtained with the help of “standard” formulas completely coincide with the results obtained with the help of finite differences.

Addition


I would also like to note that to construct a polynomial of degree n, it is not necessary to have exactly (n + 1) equidistant points — one can be arbitrarily larger (denoted by (m + 1)). But in this case, you need to use the formula for a polynomial of degree m. This can be illustrated by the following example:


That is, for a polynomial of the second degree, you can use formulas from the fourth and third polynomials - the result will still be correct.

findings


Formulas in finite differences allow us to compute (and express as a formula) any polynomial of a function of any integer degree. For an equation in finite differences, it does not matter which coefficients were used for which degrees of the polynomial. For an equation in finite differences, it does not matter at what interval the initial points were taken - the interval can be arbitrarily small, or arbitrarily large. Computations in finite differences have potentially higher accuracy than computations via “standard” formulas (due to the absence of power functions). The function for a polynomial in finite differences is expressed without power functions and, as a consequence, it can have only one value for the given variables. And, therefore, through (n + 1) equally spaced points, one and only one curve can be drawn, expressed by a polynomial of degree n.

Source: https://habr.com/ru/post/446924/


All Articles