Approximation and sum of integrals.












0












$begingroup$



Consider the sum of integrals:
$$
int_0^2 left|f(x)-x^4right|^2 dx+ int_{-1}^1 left|f(x)-x^4right|^2 dx.$$

Find a polynomial of degree at most two, such that the sum above is the smallest.




Ok. I know that $f(x)=ax^2+bx+c$, but count it
$$
int_0^2 left|ax^2+bx+c-x^4right|^2 dx
+ int_{-1}^1 left|ax^2+bx+c-x^4right|^2 dx
$$

isn't effective.










share|cite|improve this question











$endgroup$








  • 5




    $begingroup$
    Why isn't it effective? The squaring removes any worry about the absolute value signs. Expand the square and you get an integral with an eighth degree polynomial. Do the integral and evaluate it. Now take the derivative with respect to $a,b,c$ and set to zero....
    $endgroup$
    – Ross Millikan
    Jan 9 at 22:53










  • $begingroup$
    So, I have :$int_{0}^{2}|ax^2+bx+c-x^4|^2 dx+ int_{-1}^{1}|ax^2+bx+c-x^4|^2 dx=frac{34a^2}{5}+8ab+frac{20ac}{3}-frac{260a}{7}+frac{10b^2}{3}+4bc-frac{64b}{3}+4c^2-frac{68c}{5}+frac{514}{9}$ And it does not look nice.
    $endgroup$
    – pawelK
    Jan 9 at 23:06










  • $begingroup$
    @pawelK why not nice? it is a quadratic in 3 variables, can you minimize this?
    $endgroup$
    – gt6989b
    Jan 9 at 23:19






  • 1




    $begingroup$
    I didn't check the computations, but that is exactly what I was suggesting. Yes, it is not a cute solution but it will get there.
    $endgroup$
    – Ross Millikan
    Jan 9 at 23:26
















0












$begingroup$



Consider the sum of integrals:
$$
int_0^2 left|f(x)-x^4right|^2 dx+ int_{-1}^1 left|f(x)-x^4right|^2 dx.$$

Find a polynomial of degree at most two, such that the sum above is the smallest.




Ok. I know that $f(x)=ax^2+bx+c$, but count it
$$
int_0^2 left|ax^2+bx+c-x^4right|^2 dx
+ int_{-1}^1 left|ax^2+bx+c-x^4right|^2 dx
$$

isn't effective.










share|cite|improve this question











$endgroup$








  • 5




    $begingroup$
    Why isn't it effective? The squaring removes any worry about the absolute value signs. Expand the square and you get an integral with an eighth degree polynomial. Do the integral and evaluate it. Now take the derivative with respect to $a,b,c$ and set to zero....
    $endgroup$
    – Ross Millikan
    Jan 9 at 22:53










  • $begingroup$
    So, I have :$int_{0}^{2}|ax^2+bx+c-x^4|^2 dx+ int_{-1}^{1}|ax^2+bx+c-x^4|^2 dx=frac{34a^2}{5}+8ab+frac{20ac}{3}-frac{260a}{7}+frac{10b^2}{3}+4bc-frac{64b}{3}+4c^2-frac{68c}{5}+frac{514}{9}$ And it does not look nice.
    $endgroup$
    – pawelK
    Jan 9 at 23:06










  • $begingroup$
    @pawelK why not nice? it is a quadratic in 3 variables, can you minimize this?
    $endgroup$
    – gt6989b
    Jan 9 at 23:19






  • 1




    $begingroup$
    I didn't check the computations, but that is exactly what I was suggesting. Yes, it is not a cute solution but it will get there.
    $endgroup$
    – Ross Millikan
    Jan 9 at 23:26














0












0








0





$begingroup$



Consider the sum of integrals:
$$
int_0^2 left|f(x)-x^4right|^2 dx+ int_{-1}^1 left|f(x)-x^4right|^2 dx.$$

Find a polynomial of degree at most two, such that the sum above is the smallest.




Ok. I know that $f(x)=ax^2+bx+c$, but count it
$$
int_0^2 left|ax^2+bx+c-x^4right|^2 dx
+ int_{-1}^1 left|ax^2+bx+c-x^4right|^2 dx
$$

isn't effective.










share|cite|improve this question











$endgroup$





Consider the sum of integrals:
$$
int_0^2 left|f(x)-x^4right|^2 dx+ int_{-1}^1 left|f(x)-x^4right|^2 dx.$$

Find a polynomial of degree at most two, such that the sum above is the smallest.




Ok. I know that $f(x)=ax^2+bx+c$, but count it
$$
int_0^2 left|ax^2+bx+c-x^4right|^2 dx
+ int_{-1}^1 left|ax^2+bx+c-x^4right|^2 dx
$$

isn't effective.







integration approximation






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 9 at 23:18









gt6989b

34.5k22456




34.5k22456










asked Jan 9 at 22:46









pawelKpawelK

527




527








  • 5




    $begingroup$
    Why isn't it effective? The squaring removes any worry about the absolute value signs. Expand the square and you get an integral with an eighth degree polynomial. Do the integral and evaluate it. Now take the derivative with respect to $a,b,c$ and set to zero....
    $endgroup$
    – Ross Millikan
    Jan 9 at 22:53










  • $begingroup$
    So, I have :$int_{0}^{2}|ax^2+bx+c-x^4|^2 dx+ int_{-1}^{1}|ax^2+bx+c-x^4|^2 dx=frac{34a^2}{5}+8ab+frac{20ac}{3}-frac{260a}{7}+frac{10b^2}{3}+4bc-frac{64b}{3}+4c^2-frac{68c}{5}+frac{514}{9}$ And it does not look nice.
    $endgroup$
    – pawelK
    Jan 9 at 23:06










  • $begingroup$
    @pawelK why not nice? it is a quadratic in 3 variables, can you minimize this?
    $endgroup$
    – gt6989b
    Jan 9 at 23:19






  • 1




    $begingroup$
    I didn't check the computations, but that is exactly what I was suggesting. Yes, it is not a cute solution but it will get there.
    $endgroup$
    – Ross Millikan
    Jan 9 at 23:26














  • 5




    $begingroup$
    Why isn't it effective? The squaring removes any worry about the absolute value signs. Expand the square and you get an integral with an eighth degree polynomial. Do the integral and evaluate it. Now take the derivative with respect to $a,b,c$ and set to zero....
    $endgroup$
    – Ross Millikan
    Jan 9 at 22:53










  • $begingroup$
    So, I have :$int_{0}^{2}|ax^2+bx+c-x^4|^2 dx+ int_{-1}^{1}|ax^2+bx+c-x^4|^2 dx=frac{34a^2}{5}+8ab+frac{20ac}{3}-frac{260a}{7}+frac{10b^2}{3}+4bc-frac{64b}{3}+4c^2-frac{68c}{5}+frac{514}{9}$ And it does not look nice.
    $endgroup$
    – pawelK
    Jan 9 at 23:06










  • $begingroup$
    @pawelK why not nice? it is a quadratic in 3 variables, can you minimize this?
    $endgroup$
    – gt6989b
    Jan 9 at 23:19






  • 1




    $begingroup$
    I didn't check the computations, but that is exactly what I was suggesting. Yes, it is not a cute solution but it will get there.
    $endgroup$
    – Ross Millikan
    Jan 9 at 23:26








5




5




$begingroup$
Why isn't it effective? The squaring removes any worry about the absolute value signs. Expand the square and you get an integral with an eighth degree polynomial. Do the integral and evaluate it. Now take the derivative with respect to $a,b,c$ and set to zero....
$endgroup$
– Ross Millikan
Jan 9 at 22:53




$begingroup$
Why isn't it effective? The squaring removes any worry about the absolute value signs. Expand the square and you get an integral with an eighth degree polynomial. Do the integral and evaluate it. Now take the derivative with respect to $a,b,c$ and set to zero....
$endgroup$
– Ross Millikan
Jan 9 at 22:53












$begingroup$
So, I have :$int_{0}^{2}|ax^2+bx+c-x^4|^2 dx+ int_{-1}^{1}|ax^2+bx+c-x^4|^2 dx=frac{34a^2}{5}+8ab+frac{20ac}{3}-frac{260a}{7}+frac{10b^2}{3}+4bc-frac{64b}{3}+4c^2-frac{68c}{5}+frac{514}{9}$ And it does not look nice.
$endgroup$
– pawelK
Jan 9 at 23:06




$begingroup$
So, I have :$int_{0}^{2}|ax^2+bx+c-x^4|^2 dx+ int_{-1}^{1}|ax^2+bx+c-x^4|^2 dx=frac{34a^2}{5}+8ab+frac{20ac}{3}-frac{260a}{7}+frac{10b^2}{3}+4bc-frac{64b}{3}+4c^2-frac{68c}{5}+frac{514}{9}$ And it does not look nice.
$endgroup$
– pawelK
Jan 9 at 23:06












$begingroup$
@pawelK why not nice? it is a quadratic in 3 variables, can you minimize this?
$endgroup$
– gt6989b
Jan 9 at 23:19




$begingroup$
@pawelK why not nice? it is a quadratic in 3 variables, can you minimize this?
$endgroup$
– gt6989b
Jan 9 at 23:19




1




1




$begingroup$
I didn't check the computations, but that is exactly what I was suggesting. Yes, it is not a cute solution but it will get there.
$endgroup$
– Ross Millikan
Jan 9 at 23:26




$begingroup$
I didn't check the computations, but that is exactly what I was suggesting. Yes, it is not a cute solution but it will get there.
$endgroup$
– Ross Millikan
Jan 9 at 23:26










2 Answers
2






active

oldest

votes


















2












$begingroup$

A « maybe » easier solution is to notice that you are asked to minimize $|f-X^4|^2$, over the $f in V$, where $V$ is a subspace of the ambient space $W=mathbb{R}_4[X]$ and $|cdot|$ is a Euclidean norm over $W$.



So there is an automatic procedure:




  1. Compute an orthonormal basis of $V$.

  2. Compute the inner products of $X^4$ with the elements of said basis.

  3. Take the corresponding element in $V$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Ok, I have: $int_{0}^{2}(ax^2+bx+c-x^4)1dx=0$ etc. But I we have two integrals and I will get different values $a,b,c$ for each integral.
    $endgroup$
    – pawelK
    Jan 13 at 22:04












  • $begingroup$
    Will it be $int_{0}^{2}(ax^2+bx+c-x^4)1dx+int_{-1}^{1}(ax^2+bx+c-x^4)1dx=0$?
    $endgroup$
    – pawelK
    Jan 13 at 22:11












  • $begingroup$
    Yes, and as well when you replace $1$ with $x$ and $x^2$.
    $endgroup$
    – Mindlack
    Jan 13 at 22:52



















0












$begingroup$

$F(a,b,c) = int_0^2 (ax^2+bx + c - x^4)^2 dx + int_{-1}^{1} (ax^2 + bx + c - x^4)^2 dx$



Differentiating under the integral sign.



$frac {F(a,b,c)}{partial a} = int_0^2 2(ax^2+bx + c - x^4)x^2 dx + int_{-1}^{1} 2(ax^2 + bx + c - x^4)x^2 dx = 0$



$frac {a}{5}x^5 + frac {b}{4} x^4 +frac {c}{3} x^2 + frac {1}{7} x^7|_0^2|_{-1}^1 = 0\
frac {34}{5}a + frac {16}{4} b +frac {10}{3} c = frac {130}{7}$



Do the same for the other variables, and you will get a system of linear equations.






share|cite|improve this answer









$endgroup$













    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%2f3068040%2fapproximation-and-sum-of-integrals%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









    2












    $begingroup$

    A « maybe » easier solution is to notice that you are asked to minimize $|f-X^4|^2$, over the $f in V$, where $V$ is a subspace of the ambient space $W=mathbb{R}_4[X]$ and $|cdot|$ is a Euclidean norm over $W$.



    So there is an automatic procedure:




    1. Compute an orthonormal basis of $V$.

    2. Compute the inner products of $X^4$ with the elements of said basis.

    3. Take the corresponding element in $V$.






    share|cite|improve this answer









    $endgroup$













    • $begingroup$
      Ok, I have: $int_{0}^{2}(ax^2+bx+c-x^4)1dx=0$ etc. But I we have two integrals and I will get different values $a,b,c$ for each integral.
      $endgroup$
      – pawelK
      Jan 13 at 22:04












    • $begingroup$
      Will it be $int_{0}^{2}(ax^2+bx+c-x^4)1dx+int_{-1}^{1}(ax^2+bx+c-x^4)1dx=0$?
      $endgroup$
      – pawelK
      Jan 13 at 22:11












    • $begingroup$
      Yes, and as well when you replace $1$ with $x$ and $x^2$.
      $endgroup$
      – Mindlack
      Jan 13 at 22:52
















    2












    $begingroup$

    A « maybe » easier solution is to notice that you are asked to minimize $|f-X^4|^2$, over the $f in V$, where $V$ is a subspace of the ambient space $W=mathbb{R}_4[X]$ and $|cdot|$ is a Euclidean norm over $W$.



    So there is an automatic procedure:




    1. Compute an orthonormal basis of $V$.

    2. Compute the inner products of $X^4$ with the elements of said basis.

    3. Take the corresponding element in $V$.






    share|cite|improve this answer









    $endgroup$













    • $begingroup$
      Ok, I have: $int_{0}^{2}(ax^2+bx+c-x^4)1dx=0$ etc. But I we have two integrals and I will get different values $a,b,c$ for each integral.
      $endgroup$
      – pawelK
      Jan 13 at 22:04












    • $begingroup$
      Will it be $int_{0}^{2}(ax^2+bx+c-x^4)1dx+int_{-1}^{1}(ax^2+bx+c-x^4)1dx=0$?
      $endgroup$
      – pawelK
      Jan 13 at 22:11












    • $begingroup$
      Yes, and as well when you replace $1$ with $x$ and $x^2$.
      $endgroup$
      – Mindlack
      Jan 13 at 22:52














    2












    2








    2





    $begingroup$

    A « maybe » easier solution is to notice that you are asked to minimize $|f-X^4|^2$, over the $f in V$, where $V$ is a subspace of the ambient space $W=mathbb{R}_4[X]$ and $|cdot|$ is a Euclidean norm over $W$.



    So there is an automatic procedure:




    1. Compute an orthonormal basis of $V$.

    2. Compute the inner products of $X^4$ with the elements of said basis.

    3. Take the corresponding element in $V$.






    share|cite|improve this answer









    $endgroup$



    A « maybe » easier solution is to notice that you are asked to minimize $|f-X^4|^2$, over the $f in V$, where $V$ is a subspace of the ambient space $W=mathbb{R}_4[X]$ and $|cdot|$ is a Euclidean norm over $W$.



    So there is an automatic procedure:




    1. Compute an orthonormal basis of $V$.

    2. Compute the inner products of $X^4$ with the elements of said basis.

    3. Take the corresponding element in $V$.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Jan 9 at 23:41









    MindlackMindlack

    4,780210




    4,780210












    • $begingroup$
      Ok, I have: $int_{0}^{2}(ax^2+bx+c-x^4)1dx=0$ etc. But I we have two integrals and I will get different values $a,b,c$ for each integral.
      $endgroup$
      – pawelK
      Jan 13 at 22:04












    • $begingroup$
      Will it be $int_{0}^{2}(ax^2+bx+c-x^4)1dx+int_{-1}^{1}(ax^2+bx+c-x^4)1dx=0$?
      $endgroup$
      – pawelK
      Jan 13 at 22:11












    • $begingroup$
      Yes, and as well when you replace $1$ with $x$ and $x^2$.
      $endgroup$
      – Mindlack
      Jan 13 at 22:52


















    • $begingroup$
      Ok, I have: $int_{0}^{2}(ax^2+bx+c-x^4)1dx=0$ etc. But I we have two integrals and I will get different values $a,b,c$ for each integral.
      $endgroup$
      – pawelK
      Jan 13 at 22:04












    • $begingroup$
      Will it be $int_{0}^{2}(ax^2+bx+c-x^4)1dx+int_{-1}^{1}(ax^2+bx+c-x^4)1dx=0$?
      $endgroup$
      – pawelK
      Jan 13 at 22:11












    • $begingroup$
      Yes, and as well when you replace $1$ with $x$ and $x^2$.
      $endgroup$
      – Mindlack
      Jan 13 at 22:52
















    $begingroup$
    Ok, I have: $int_{0}^{2}(ax^2+bx+c-x^4)1dx=0$ etc. But I we have two integrals and I will get different values $a,b,c$ for each integral.
    $endgroup$
    – pawelK
    Jan 13 at 22:04






    $begingroup$
    Ok, I have: $int_{0}^{2}(ax^2+bx+c-x^4)1dx=0$ etc. But I we have two integrals and I will get different values $a,b,c$ for each integral.
    $endgroup$
    – pawelK
    Jan 13 at 22:04














    $begingroup$
    Will it be $int_{0}^{2}(ax^2+bx+c-x^4)1dx+int_{-1}^{1}(ax^2+bx+c-x^4)1dx=0$?
    $endgroup$
    – pawelK
    Jan 13 at 22:11






    $begingroup$
    Will it be $int_{0}^{2}(ax^2+bx+c-x^4)1dx+int_{-1}^{1}(ax^2+bx+c-x^4)1dx=0$?
    $endgroup$
    – pawelK
    Jan 13 at 22:11














    $begingroup$
    Yes, and as well when you replace $1$ with $x$ and $x^2$.
    $endgroup$
    – Mindlack
    Jan 13 at 22:52




    $begingroup$
    Yes, and as well when you replace $1$ with $x$ and $x^2$.
    $endgroup$
    – Mindlack
    Jan 13 at 22:52











    0












    $begingroup$

    $F(a,b,c) = int_0^2 (ax^2+bx + c - x^4)^2 dx + int_{-1}^{1} (ax^2 + bx + c - x^4)^2 dx$



    Differentiating under the integral sign.



    $frac {F(a,b,c)}{partial a} = int_0^2 2(ax^2+bx + c - x^4)x^2 dx + int_{-1}^{1} 2(ax^2 + bx + c - x^4)x^2 dx = 0$



    $frac {a}{5}x^5 + frac {b}{4} x^4 +frac {c}{3} x^2 + frac {1}{7} x^7|_0^2|_{-1}^1 = 0\
    frac {34}{5}a + frac {16}{4} b +frac {10}{3} c = frac {130}{7}$



    Do the same for the other variables, and you will get a system of linear equations.






    share|cite|improve this answer









    $endgroup$


















      0












      $begingroup$

      $F(a,b,c) = int_0^2 (ax^2+bx + c - x^4)^2 dx + int_{-1}^{1} (ax^2 + bx + c - x^4)^2 dx$



      Differentiating under the integral sign.



      $frac {F(a,b,c)}{partial a} = int_0^2 2(ax^2+bx + c - x^4)x^2 dx + int_{-1}^{1} 2(ax^2 + bx + c - x^4)x^2 dx = 0$



      $frac {a}{5}x^5 + frac {b}{4} x^4 +frac {c}{3} x^2 + frac {1}{7} x^7|_0^2|_{-1}^1 = 0\
      frac {34}{5}a + frac {16}{4} b +frac {10}{3} c = frac {130}{7}$



      Do the same for the other variables, and you will get a system of linear equations.






      share|cite|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        $F(a,b,c) = int_0^2 (ax^2+bx + c - x^4)^2 dx + int_{-1}^{1} (ax^2 + bx + c - x^4)^2 dx$



        Differentiating under the integral sign.



        $frac {F(a,b,c)}{partial a} = int_0^2 2(ax^2+bx + c - x^4)x^2 dx + int_{-1}^{1} 2(ax^2 + bx + c - x^4)x^2 dx = 0$



        $frac {a}{5}x^5 + frac {b}{4} x^4 +frac {c}{3} x^2 + frac {1}{7} x^7|_0^2|_{-1}^1 = 0\
        frac {34}{5}a + frac {16}{4} b +frac {10}{3} c = frac {130}{7}$



        Do the same for the other variables, and you will get a system of linear equations.






        share|cite|improve this answer









        $endgroup$



        $F(a,b,c) = int_0^2 (ax^2+bx + c - x^4)^2 dx + int_{-1}^{1} (ax^2 + bx + c - x^4)^2 dx$



        Differentiating under the integral sign.



        $frac {F(a,b,c)}{partial a} = int_0^2 2(ax^2+bx + c - x^4)x^2 dx + int_{-1}^{1} 2(ax^2 + bx + c - x^4)x^2 dx = 0$



        $frac {a}{5}x^5 + frac {b}{4} x^4 +frac {c}{3} x^2 + frac {1}{7} x^7|_0^2|_{-1}^1 = 0\
        frac {34}{5}a + frac {16}{4} b +frac {10}{3} c = frac {130}{7}$



        Do the same for the other variables, and you will get a system of linear equations.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Jan 9 at 23:58









        Doug MDoug M

        45.3k31954




        45.3k31954






























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3068040%2fapproximation-and-sum-of-integrals%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

            Human spaceflight

            Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

            張江高科駅