Interpolation polynomial on arbitrary functions

    Introduction


    Greetings, dear readers! Today I propose to reflect on the following task:

    Given$ n $ pairs of points on the plane $ (x_1; y_1), ..., (x_n; y_n) $. Everything$ x_i $are different. Need to find polynomial$ M (x) $ such that $ M (x_i) = y_i $where $ i \ in \ {1, ..., n \} $

    Translating into Russian we have: Ivan made $ n $points on the plane, and Mary, having this information, should come up with a function that (at least) will go through all these points. In the framework of the current article, our task is to help Mary in a roundabout way.

    “Why in a roundabout way?” You ask. The answer is traditional: this article is a continuation of a series of amateurish articles about mathematics, the purpose of which is to popularize the mathematical world.

    Process


    To begin with, it is worth noting that a certain number of interpolation polynomials already, of course, exist. These polynomials are just designed to solve the desired problem. Among them are especially known such as the Lagrange and Newton polynomials .

    It is also necessary to clarify what “arbitrary functions” are (the term comes from the title of the current article). By them is meant any unary function whose result is a bijective mapping of the argument.

    In the framework of the article, I propose to take the decimal logarithm for such a function$ \ lg $ and the following points:

    $ (0; 0) \\ (1; 1) \\ (2; 3) \\ (3; 0) $


    Representing them on the plane, something like this should turn out:

    image
    It is easy to notice that now the number of pairs of points is equal to$ n = 4 $.

    When solving this problem, a certain system of equations comes to mind, where the number of linearly independent lines is$ n $. What kind of system of equations is this?

    Let's try to write a function as a sum of decimal logarithms with coefficients (so that the number of coefficients is equal to$ n $):

    $ f (x) = a \ log (x + 3) + b \ log (x + 2) + c \ log (x + 1) + d $


    Arguments for $ \ lg $different to avoid linear dependence of strings in the future (you can think of others). And also, considering that the domain of definition of the function is at least$ \ in [0; 3] $ (based on points specified by the condition), we thus ensure the existence of a range of values ​​for the function $ \ lg $in this area of ​​definition.

    Since we know$ n $ pairs of points, then we turn to them in order to construct the following trivial system:

    $ \ begin {cases} \ displaystyle {f (0) = 0 \ Rightarrow a \ lg (3) + b \ lg (2) + c \ lg (1) + d = 0 \\ f (1) = 1 \ Rightarrow a \ log (4) + b \ log (3) + c \ log (2) + d = 1 \\ f (2) = 3 \ Rightarrow a \ log (5) + b \ log (4) + c \ lg (3) + d = 3 \\ f (3) = 0 \ Rightarrow a \ lg (6) + b \ lg (5) + c \ lg (4) + d = 0} \ end {cases} $


    The triviality of the system is that we simply find such $ a, b, c, d $that will satisfy the entire set of conditions.

    Actually solving this system relatively$ a, b, c, d $ we get the following solution:

    $ \ begin {cases} \ displaystyle {a = \ frac {(5 \ lg ^ 2 (2) - 5 \ lg (2) \ lg (3) + \ lg (8/3) \ lg (5)) \ log (10)} {3 \ log ^ 3 (2) - \ log (9/5) \ log ^ 2 (2) + \ log ^ 2 (3) \ log (20) - \ log (2) \ log (5) \ lg (243/5)} \\ b = \ frac {\ lg (675/512) \ lg (2) \ lg (10)} {- 3 \ lg ^ 3 (2) + \ lg ( 9/5) \ log ^ 2 (2) - \ log ^ 2 (3) \ log (20) + \ log (2) \ log (5) \ log (243/5)} \\ c = \ frac { \ log (10) (2 \ log ^ 2 (2) + \ log (2) (\ log (3) - 7 \ log (5)) + \ log (5) \ log (45))} {3 \ log ^ 3 (2) - \ log (9/5) \ log ^ 2 (2) + \ log ^ 2 (3) \ log (20) - \ log (2) \ log (5) \ log (243 / 5)} \\ d = \ frac {-9 \ log ^ 3 (2) + \ log ^ 2 (2) \ log (25/9) + \ log ^ 2 (3) \ log (5) + \ log (243/125) \ log (2) \ log (3)} {3 \ log ^ 3 (2) - \ log (9/5) \ log ^ 2 (2) + \ log ^ 2 (3) \ log (20) - \ lg (2) \ lg (5) \ lg (243/5)}} \ end {cases} $


    On this, the task naturally comes to an end, it remains only to write it into a single function:

    $ f (x) = \ frac {(5 \ log ^ 2 (2) - 5 \ log (2) \ log (3) + \ log (8/3) \ log (5)) \ log (10)} {3 \ log ^ 3 (2) - \ log (9/5) \ log ^ 2 (2) + \ log ^ 2 (3) \ log (20) - \ log (2) \ log (5) \ log (243/5)} \ lg (x + 3) \\ + \ frac {\ lg (675/512) \ lg (2) \ lg (10)} {- 3 \ lg ^ 3 (2) + \ lg (9/5) \ log ^ 2 (2) - \ log ^ 2 (3) \ log (20) + \ log (2) \ log (5) \ log (243/5)} \ log (x + 2 ) \\ + \ frac {\ log (10) (2 \ log ^ 2 (2) + \ log (2) (\ log (3) - 7 \ log (5)) + \ log (5) \ log ( 45))} {3 \ log ^ 3 (2) - \ log (9/5) \ log ^ 2 (2) + \ log ^ 2 (3) \ log (20) - \ log (2) \ log ( 5) \ lg (243/5)} \ log (x + 1) \\ + \ frac {-9 \ log ^ 3 (2) + \ log ^ 2 (2) \ log (25/9) + \ log ^ 2 (3) \ log (5) + \ log (243/125) \ log (2) \ log (3)} {3 \ log ^ 3 (2) - \ log (9/5) \ log ^ 2 (2) + \ log ^ 2 (3) \ log (20) - \ log (2) \ log (5) \ log (243/5)} $


    She, of course, will go through a given set of points. A graph of the function will look like this:

    image
    Also, for the sake of clarity, we can give an approximated system of solutions:

    $ \ begin {cases} \ displaystyle {a \ approx-3428.6 \\ b \ approx3789.2 \\ c \ approx-790.20 \\ d \ approx495.22} \ end {cases} $


    Then the approximated form of the function will be as follows:

    $ f (x) = - 3428.6 \ lg (x + 3) +3789.2 \ lg (x + 2) -790.20 \ lg (x + 1) + 495.22 $


    Of course, no one says that the resulting function will be minimal (the same Lagrange polynomial will give a shorter form). However, this method allows you to express a function through a set of arbitrary functions (though, bearing in mind the restrictions specified above in the article).

    Various examples


    For dessert, we similarly construct a function in radicals :

    $ f (x) = ax ^ 3 + bx ^ 2 + cx + d $


    We compose a system of equations for finding the coefficients:

    $ \ begin {cases} \ displaystyle {f (0) = 0 \ Rightarrow d = 0 \\ f (1) = 1 \ Rightarrow a + b + c + d = 1 \\ f (2) = 3 \ Rightarrow 8a + 4b + 2c + d = 3 \\ f (3) = 0 \ Rightarrow 27a + 9b + 3c + d = 0} \ end {cases} $


    Her solution is unique and looks as follows:

    $ \ begin {cases} \ displaystyle {a = -1 \\ b = \ frac {7} {2} \\ c = - \ frac {3} {2} \\ d = 0} \ end {cases} $


    Then the finished function is as follows:

    $ f (x) = - x ^ 3 + \ frac {7} {2} x ^ 2- \ frac {3} {2} x $


    Which, in combination, is the Lagrange polynomial for a given set of points (since it implicitly implements the radical form of the algorithm from the article). The graph on the area of ​​the given points looks like this:

    image

    The most interesting in this story is that arbitrary functions for constructing the final function can and should be combined. In other words, a function can be built immediately on radicals and logarithms, or maybe on something else (exponential functions, factorials, etc.). If only the obtained set of functions provided linear independence of the rows in the selection of coefficients. In general form for given$ n $ pairs of points it looks like this:

    $ f (x) = a_1 * g_1 (x) + ... + a_n * g_n (x) $


    Where $ a_1, .., a_n $ - the coefficients to be found through the system of equations (SLAE), and $ g_1, ..., g_n $- some functions that provide linear independence in finding the coefficients.

    And then - according to the algorithm above, everything is exactly the same. Not forgetting that$ g_1, ..., g_n $must be defined at conditionally specified points.

    For example, you can show a function consisting of completely different basic functions:

    $ f (x) = ax ^ 2 + b2 ^ x + cx + d $


    In order to satisfy a given set of points, the coefficients will then be the following (found strictly according to the algorithm from the article):

    $ \ begin {cases} \ displaystyle {a = \ frac {7} {2} \\ b = -6 \\ c = \ frac {7} {2} \\ d = 6} \ end {cases} $


    And the function itself will be like this:

    $ f (x) = \ frac {7} {2} x ^ 2-6 * 2 ^ x + \ frac {7} {2} x + 6 $


    The graph will look almost the same as the previous one (in the area of ​​the given points).
    If you want a more “smooth” schedule, then you can look in the direction of the factorial form, for example this:

    $ f (x) = a (x + 2)! + b (x + 1)! + cx! + d $


    Find the coefficients:

    $$ display $$ \ begin {cases} \ displaystyle {2a + b + c + d = 0 \\ 6a + 2b + c + d = 1 \\ 24a + 6b + 2c + d = 3 \\ 120a + 24b + 6c + d = 0} \ end {cases} \ Rightarrow \ begin {cases} \ displaystyle {a = -13/16 \\ b = 17/4 \\ c = -3/8 \\ d = -9 / 4 } \ end {cases} $$ display $$


    Substitute these in the finished function:

    $ f (x) = - \ frac {13} {16} (x + 2)! + \ frac {17} {4} (x + 1)! - \ frac {3} {8} x! - \ frac {9} {4} $


    And also enjoy a very good schedule:
    image

    Why is this needed?


    Yes, at least in order to imagine a bunch of ropes tightened with plastic clamps :)
    image
    ( * Here we just laid all the charts on top of each other )

    That's all for the current article, I recommend playing on your own.

    All the best,
    Peter was with you.

    Also popular now: