How to trace equation from values of f(x) using Interpolation formulae












1














I have the following data, representing the values of a function at given points:



$f(1)=0$



$f(2)=5$



$f(3)=12$



$f(4)=21$



$f(5)=32$



I want to know the exact quadratic equation which was used above to get values of $f(x)$. How can I get to know it?



I remember that, at school, we used Newton's interpolation and backward/forward interpolation formula. But all I see on the internet regarding the above methods is that we can find $f(x)$ for any $x$ given the above table, eg. we can find $f(4.5)$ by using above table. However I need to trace the original quadratic formula: is there any way to do so?
(The answer should be $f(x)=x^2+2x-3$.)










share|cite|improve this question
























  • You can just solve for the coefficients; any three values gives you three linear equations in three unknowns. Or you can use Lagrange Interpolation.
    – lulu
    Dec 1 '18 at 13:37


















1














I have the following data, representing the values of a function at given points:



$f(1)=0$



$f(2)=5$



$f(3)=12$



$f(4)=21$



$f(5)=32$



I want to know the exact quadratic equation which was used above to get values of $f(x)$. How can I get to know it?



I remember that, at school, we used Newton's interpolation and backward/forward interpolation formula. But all I see on the internet regarding the above methods is that we can find $f(x)$ for any $x$ given the above table, eg. we can find $f(4.5)$ by using above table. However I need to trace the original quadratic formula: is there any way to do so?
(The answer should be $f(x)=x^2+2x-3$.)










share|cite|improve this question
























  • You can just solve for the coefficients; any three values gives you three linear equations in three unknowns. Or you can use Lagrange Interpolation.
    – lulu
    Dec 1 '18 at 13:37
















1












1








1







I have the following data, representing the values of a function at given points:



$f(1)=0$



$f(2)=5$



$f(3)=12$



$f(4)=21$



$f(5)=32$



I want to know the exact quadratic equation which was used above to get values of $f(x)$. How can I get to know it?



I remember that, at school, we used Newton's interpolation and backward/forward interpolation formula. But all I see on the internet regarding the above methods is that we can find $f(x)$ for any $x$ given the above table, eg. we can find $f(4.5)$ by using above table. However I need to trace the original quadratic formula: is there any way to do so?
(The answer should be $f(x)=x^2+2x-3$.)










share|cite|improve this question















I have the following data, representing the values of a function at given points:



$f(1)=0$



$f(2)=5$



$f(3)=12$



$f(4)=21$



$f(5)=32$



I want to know the exact quadratic equation which was used above to get values of $f(x)$. How can I get to know it?



I remember that, at school, we used Newton's interpolation and backward/forward interpolation formula. But all I see on the internet regarding the above methods is that we can find $f(x)$ for any $x$ given the above table, eg. we can find $f(4.5)$ by using above table. However I need to trace the original quadratic formula: is there any way to do so?
(The answer should be $f(x)=x^2+2x-3$.)







functions interpolation






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 1 '18 at 13:39









Daniele Tampieri

1,7261619




1,7261619










asked Dec 1 '18 at 13:31









help

84




84












  • You can just solve for the coefficients; any three values gives you three linear equations in three unknowns. Or you can use Lagrange Interpolation.
    – lulu
    Dec 1 '18 at 13:37




















  • You can just solve for the coefficients; any three values gives you three linear equations in three unknowns. Or you can use Lagrange Interpolation.
    – lulu
    Dec 1 '18 at 13:37


















You can just solve for the coefficients; any three values gives you three linear equations in three unknowns. Or you can use Lagrange Interpolation.
– lulu
Dec 1 '18 at 13:37






You can just solve for the coefficients; any three values gives you three linear equations in three unknowns. Or you can use Lagrange Interpolation.
– lulu
Dec 1 '18 at 13:37












2 Answers
2






active

oldest

votes


















1














We can use Lagrange Interpolation as mentioned in the comments by @lulu.



First, we find the Lagrange Polynomials for the five points:



$$L_0(x) = dfrac {(x - x_1) (x - x_2) (x-x _3) (x - x_4)} {(x_0 -
x_1 ) (x_0 - x_2)(x_0 - x_3) (x_ 0 -x_4)} \
L_1(x) = dfrac {(x - x_0) (x - x_2) (x-x _3) (x - x_4)} {(x_1 -x_0 ) (x_1 - x_2)(x_1 - x_3) (x_1 -x_4)} \
L_2(x) = dfrac {(x - x_0) (x - x_1) (x-x _3) (x - x_4)} {(x_2 -
x_0) (x_2 - x_1)(x_2 - x_3) (x_2 -x_4)}\
L_3(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_4)} {(x_3 -
x_0 ) (x_3 - x_1)(x_3 - x_2) (x_3 -x_4)} \
L_4(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_3)} {(x_4 -
x_0 ) (x_4- x_1)(x_4 - x_2) (x_4 -x_3)}$$



The final result is given by



$$f(x) = f(x_0) L_0(x) + f(x_1) L_1(x) + f(x_2) L_2(x) + f(x_3) L_3(x) + f(x_4) L_4(x)
= x^2+2 x-3$$



We can verify that $f(x)$ produces
$$f(1)=0, f(2)=5, f(3)=12, f(4)=21, f(5)=32$$






share|cite|improve this answer































    0














    For a potentially less computationally intense method (also included in lulu's comment), you can solve a system of three equations.



    You know that the general form of a quadratic equation is $$f(x)=ax^2+bx+c,$$ and since there are three unknowns ($a$, $b$, and $c$), you can plug in values from three points for $f(x)$ and $x$ and solve the resulting system of equations, drawing on the idea that any three points in the plane uniquely determine a parabola. For example, using the first three points you list, you would obtain the following system:



    $$begin{align}
    0&=a+b+c \
    5&=4a+2b+c \
    12&=9a+3b+c
    end{align}$$



    This does indeed give the desired result of $a=1$, $b=2$, $c=-3$.






    share|cite|improve this answer





















      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "69"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3021341%2fhow-to-trace-equation-from-values-of-fx-using-interpolation-formulae%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      We can use Lagrange Interpolation as mentioned in the comments by @lulu.



      First, we find the Lagrange Polynomials for the five points:



      $$L_0(x) = dfrac {(x - x_1) (x - x_2) (x-x _3) (x - x_4)} {(x_0 -
      x_1 ) (x_0 - x_2)(x_0 - x_3) (x_ 0 -x_4)} \
      L_1(x) = dfrac {(x - x_0) (x - x_2) (x-x _3) (x - x_4)} {(x_1 -x_0 ) (x_1 - x_2)(x_1 - x_3) (x_1 -x_4)} \
      L_2(x) = dfrac {(x - x_0) (x - x_1) (x-x _3) (x - x_4)} {(x_2 -
      x_0) (x_2 - x_1)(x_2 - x_3) (x_2 -x_4)}\
      L_3(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_4)} {(x_3 -
      x_0 ) (x_3 - x_1)(x_3 - x_2) (x_3 -x_4)} \
      L_4(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_3)} {(x_4 -
      x_0 ) (x_4- x_1)(x_4 - x_2) (x_4 -x_3)}$$



      The final result is given by



      $$f(x) = f(x_0) L_0(x) + f(x_1) L_1(x) + f(x_2) L_2(x) + f(x_3) L_3(x) + f(x_4) L_4(x)
      = x^2+2 x-3$$



      We can verify that $f(x)$ produces
      $$f(1)=0, f(2)=5, f(3)=12, f(4)=21, f(5)=32$$






      share|cite|improve this answer




























        1














        We can use Lagrange Interpolation as mentioned in the comments by @lulu.



        First, we find the Lagrange Polynomials for the five points:



        $$L_0(x) = dfrac {(x - x_1) (x - x_2) (x-x _3) (x - x_4)} {(x_0 -
        x_1 ) (x_0 - x_2)(x_0 - x_3) (x_ 0 -x_4)} \
        L_1(x) = dfrac {(x - x_0) (x - x_2) (x-x _3) (x - x_4)} {(x_1 -x_0 ) (x_1 - x_2)(x_1 - x_3) (x_1 -x_4)} \
        L_2(x) = dfrac {(x - x_0) (x - x_1) (x-x _3) (x - x_4)} {(x_2 -
        x_0) (x_2 - x_1)(x_2 - x_3) (x_2 -x_4)}\
        L_3(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_4)} {(x_3 -
        x_0 ) (x_3 - x_1)(x_3 - x_2) (x_3 -x_4)} \
        L_4(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_3)} {(x_4 -
        x_0 ) (x_4- x_1)(x_4 - x_2) (x_4 -x_3)}$$



        The final result is given by



        $$f(x) = f(x_0) L_0(x) + f(x_1) L_1(x) + f(x_2) L_2(x) + f(x_3) L_3(x) + f(x_4) L_4(x)
        = x^2+2 x-3$$



        We can verify that $f(x)$ produces
        $$f(1)=0, f(2)=5, f(3)=12, f(4)=21, f(5)=32$$






        share|cite|improve this answer


























          1












          1








          1






          We can use Lagrange Interpolation as mentioned in the comments by @lulu.



          First, we find the Lagrange Polynomials for the five points:



          $$L_0(x) = dfrac {(x - x_1) (x - x_2) (x-x _3) (x - x_4)} {(x_0 -
          x_1 ) (x_0 - x_2)(x_0 - x_3) (x_ 0 -x_4)} \
          L_1(x) = dfrac {(x - x_0) (x - x_2) (x-x _3) (x - x_4)} {(x_1 -x_0 ) (x_1 - x_2)(x_1 - x_3) (x_1 -x_4)} \
          L_2(x) = dfrac {(x - x_0) (x - x_1) (x-x _3) (x - x_4)} {(x_2 -
          x_0) (x_2 - x_1)(x_2 - x_3) (x_2 -x_4)}\
          L_3(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_4)} {(x_3 -
          x_0 ) (x_3 - x_1)(x_3 - x_2) (x_3 -x_4)} \
          L_4(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_3)} {(x_4 -
          x_0 ) (x_4- x_1)(x_4 - x_2) (x_4 -x_3)}$$



          The final result is given by



          $$f(x) = f(x_0) L_0(x) + f(x_1) L_1(x) + f(x_2) L_2(x) + f(x_3) L_3(x) + f(x_4) L_4(x)
          = x^2+2 x-3$$



          We can verify that $f(x)$ produces
          $$f(1)=0, f(2)=5, f(3)=12, f(4)=21, f(5)=32$$






          share|cite|improve this answer














          We can use Lagrange Interpolation as mentioned in the comments by @lulu.



          First, we find the Lagrange Polynomials for the five points:



          $$L_0(x) = dfrac {(x - x_1) (x - x_2) (x-x _3) (x - x_4)} {(x_0 -
          x_1 ) (x_0 - x_2)(x_0 - x_3) (x_ 0 -x_4)} \
          L_1(x) = dfrac {(x - x_0) (x - x_2) (x-x _3) (x - x_4)} {(x_1 -x_0 ) (x_1 - x_2)(x_1 - x_3) (x_1 -x_4)} \
          L_2(x) = dfrac {(x - x_0) (x - x_1) (x-x _3) (x - x_4)} {(x_2 -
          x_0) (x_2 - x_1)(x_2 - x_3) (x_2 -x_4)}\
          L_3(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_4)} {(x_3 -
          x_0 ) (x_3 - x_1)(x_3 - x_2) (x_3 -x_4)} \
          L_4(x) = dfrac {(x - x_0) (x - x_1) (x-x _2) (x - x_3)} {(x_4 -
          x_0 ) (x_4- x_1)(x_4 - x_2) (x_4 -x_3)}$$



          The final result is given by



          $$f(x) = f(x_0) L_0(x) + f(x_1) L_1(x) + f(x_2) L_2(x) + f(x_3) L_3(x) + f(x_4) L_4(x)
          = x^2+2 x-3$$



          We can verify that $f(x)$ produces
          $$f(1)=0, f(2)=5, f(3)=12, f(4)=21, f(5)=32$$







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Dec 1 '18 at 16:24

























          answered Dec 1 '18 at 14:11









          Moo

          5,53131020




          5,53131020























              0














              For a potentially less computationally intense method (also included in lulu's comment), you can solve a system of three equations.



              You know that the general form of a quadratic equation is $$f(x)=ax^2+bx+c,$$ and since there are three unknowns ($a$, $b$, and $c$), you can plug in values from three points for $f(x)$ and $x$ and solve the resulting system of equations, drawing on the idea that any three points in the plane uniquely determine a parabola. For example, using the first three points you list, you would obtain the following system:



              $$begin{align}
              0&=a+b+c \
              5&=4a+2b+c \
              12&=9a+3b+c
              end{align}$$



              This does indeed give the desired result of $a=1$, $b=2$, $c=-3$.






              share|cite|improve this answer


























                0














                For a potentially less computationally intense method (also included in lulu's comment), you can solve a system of three equations.



                You know that the general form of a quadratic equation is $$f(x)=ax^2+bx+c,$$ and since there are three unknowns ($a$, $b$, and $c$), you can plug in values from three points for $f(x)$ and $x$ and solve the resulting system of equations, drawing on the idea that any three points in the plane uniquely determine a parabola. For example, using the first three points you list, you would obtain the following system:



                $$begin{align}
                0&=a+b+c \
                5&=4a+2b+c \
                12&=9a+3b+c
                end{align}$$



                This does indeed give the desired result of $a=1$, $b=2$, $c=-3$.






                share|cite|improve this answer
























                  0












                  0








                  0






                  For a potentially less computationally intense method (also included in lulu's comment), you can solve a system of three equations.



                  You know that the general form of a quadratic equation is $$f(x)=ax^2+bx+c,$$ and since there are three unknowns ($a$, $b$, and $c$), you can plug in values from three points for $f(x)$ and $x$ and solve the resulting system of equations, drawing on the idea that any three points in the plane uniquely determine a parabola. For example, using the first three points you list, you would obtain the following system:



                  $$begin{align}
                  0&=a+b+c \
                  5&=4a+2b+c \
                  12&=9a+3b+c
                  end{align}$$



                  This does indeed give the desired result of $a=1$, $b=2$, $c=-3$.






                  share|cite|improve this answer












                  For a potentially less computationally intense method (also included in lulu's comment), you can solve a system of three equations.



                  You know that the general form of a quadratic equation is $$f(x)=ax^2+bx+c,$$ and since there are three unknowns ($a$, $b$, and $c$), you can plug in values from three points for $f(x)$ and $x$ and solve the resulting system of equations, drawing on the idea that any three points in the plane uniquely determine a parabola. For example, using the first three points you list, you would obtain the following system:



                  $$begin{align}
                  0&=a+b+c \
                  5&=4a+2b+c \
                  12&=9a+3b+c
                  end{align}$$



                  This does indeed give the desired result of $a=1$, $b=2$, $c=-3$.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Dec 1 '18 at 16:14









                  Robert Howard

                  1,9161822




                  1,9161822






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematics Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3021341%2fhow-to-trace-equation-from-values-of-fx-using-interpolation-formulae%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Wiesbaden

                      To store a contact into the json file from server.js file using a class in NodeJS

                      Marschland