Why don't terms in the summation expression for an integral (almost) cancel out?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












If I think of an integral, $int_a^b f(x) dx$ as roughly $sum f(x)delta x$ where $delta x$ is very very small, then can't I write this sum as



$$
f(x)x - f(x)(x-delta x) + f(x-delta x)(x-delta x) +dots -f(a)a
$$



Then, since $delta x$ is so small, assuming $f(x)$ is "smooth" in some sense, shouldn't $f(x) approx f(x-delta x)$ so $$f(x)(x-delta x) approx f(x-delta x)(x-delta x)$$



and then all terms would cancel out except for $f(x)x$ and $f(a)a$?



I.e. wouldn't this give $int_a^b f(x)dx approx f(x) x - f(a)a$?



Why does this not give a decent approximation?




For example, I think this is always exact for a constant function. I would then think it should be pretty good for any function that doesn't change too quickly at any point.




but what is "too quickly"



I thought it would also be pretty good for a linear function, but this is not the case...











share|cite|improve this question























  • How did you get to that sum?
    – inavda
    2 hours ago










  • @inavda $sum_i-aa^b f(a) delta x$ is $f(a)delta x + f(a+delta x)delta x + dots + f(b-delta x) delta x + f(b)delta x$, but I can replace all $delta x$ with $x-(x-delta x)$. Then I can separate the $x$ and $x-delta x$ parts. (note the sum i am taking in $delta x$ increments)
    – user106860
    2 hours ago







  • 5




    The error in your approximation looks like $f'(x) delta x$, but there are on the order of $frac1delta x$ terms in the sum, so you can't ignore it.
    – Qiaochu Yuan
    2 hours ago










  • @QiaochuYuan If you could elaborate on why the error looks like that and the number of terms I would gladly accept that as an answer. If not, I am grateful for at least you comment. Thank you. (Also, intuitively it seems like you are saying "the error is not so big if the derivative is not large, but because the sum has many terms in the end it is not negligible. I was thinking something along those lines but was thinking if I could make "the error" small enough the number of terms shouldn't matter).
    – user106860
    2 hours ago











  • @user106860 : $f(x - delta x)$ is approximately $f(x) - f'(x) delta x$ because the derivative of a function linearizes it there, or equivalently, it is the sensitivity to a vanishingly small change in the input, and $delta x$ is such a vanishing change.
    – The_Sympathizer
    42 mins ago















up vote
2
down vote

favorite












If I think of an integral, $int_a^b f(x) dx$ as roughly $sum f(x)delta x$ where $delta x$ is very very small, then can't I write this sum as



$$
f(x)x - f(x)(x-delta x) + f(x-delta x)(x-delta x) +dots -f(a)a
$$



Then, since $delta x$ is so small, assuming $f(x)$ is "smooth" in some sense, shouldn't $f(x) approx f(x-delta x)$ so $$f(x)(x-delta x) approx f(x-delta x)(x-delta x)$$



and then all terms would cancel out except for $f(x)x$ and $f(a)a$?



I.e. wouldn't this give $int_a^b f(x)dx approx f(x) x - f(a)a$?



Why does this not give a decent approximation?




For example, I think this is always exact for a constant function. I would then think it should be pretty good for any function that doesn't change too quickly at any point.




but what is "too quickly"



I thought it would also be pretty good for a linear function, but this is not the case...











share|cite|improve this question























  • How did you get to that sum?
    – inavda
    2 hours ago










  • @inavda $sum_i-aa^b f(a) delta x$ is $f(a)delta x + f(a+delta x)delta x + dots + f(b-delta x) delta x + f(b)delta x$, but I can replace all $delta x$ with $x-(x-delta x)$. Then I can separate the $x$ and $x-delta x$ parts. (note the sum i am taking in $delta x$ increments)
    – user106860
    2 hours ago







  • 5




    The error in your approximation looks like $f'(x) delta x$, but there are on the order of $frac1delta x$ terms in the sum, so you can't ignore it.
    – Qiaochu Yuan
    2 hours ago










  • @QiaochuYuan If you could elaborate on why the error looks like that and the number of terms I would gladly accept that as an answer. If not, I am grateful for at least you comment. Thank you. (Also, intuitively it seems like you are saying "the error is not so big if the derivative is not large, but because the sum has many terms in the end it is not negligible. I was thinking something along those lines but was thinking if I could make "the error" small enough the number of terms shouldn't matter).
    – user106860
    2 hours ago











  • @user106860 : $f(x - delta x)$ is approximately $f(x) - f'(x) delta x$ because the derivative of a function linearizes it there, or equivalently, it is the sensitivity to a vanishingly small change in the input, and $delta x$ is such a vanishing change.
    – The_Sympathizer
    42 mins ago













up vote
2
down vote

favorite









up vote
2
down vote

favorite











If I think of an integral, $int_a^b f(x) dx$ as roughly $sum f(x)delta x$ where $delta x$ is very very small, then can't I write this sum as



$$
f(x)x - f(x)(x-delta x) + f(x-delta x)(x-delta x) +dots -f(a)a
$$



Then, since $delta x$ is so small, assuming $f(x)$ is "smooth" in some sense, shouldn't $f(x) approx f(x-delta x)$ so $$f(x)(x-delta x) approx f(x-delta x)(x-delta x)$$



and then all terms would cancel out except for $f(x)x$ and $f(a)a$?



I.e. wouldn't this give $int_a^b f(x)dx approx f(x) x - f(a)a$?



Why does this not give a decent approximation?




For example, I think this is always exact for a constant function. I would then think it should be pretty good for any function that doesn't change too quickly at any point.




but what is "too quickly"



I thought it would also be pretty good for a linear function, but this is not the case...











share|cite|improve this question















If I think of an integral, $int_a^b f(x) dx$ as roughly $sum f(x)delta x$ where $delta x$ is very very small, then can't I write this sum as



$$
f(x)x - f(x)(x-delta x) + f(x-delta x)(x-delta x) +dots -f(a)a
$$



Then, since $delta x$ is so small, assuming $f(x)$ is "smooth" in some sense, shouldn't $f(x) approx f(x-delta x)$ so $$f(x)(x-delta x) approx f(x-delta x)(x-delta x)$$



and then all terms would cancel out except for $f(x)x$ and $f(a)a$?



I.e. wouldn't this give $int_a^b f(x)dx approx f(x) x - f(a)a$?



Why does this not give a decent approximation?




For example, I think this is always exact for a constant function. I would then think it should be pretty good for any function that doesn't change too quickly at any point.




but what is "too quickly"



I thought it would also be pretty good for a linear function, but this is not the case...








integration






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 2 hours ago

























asked 2 hours ago









user106860

359214




359214











  • How did you get to that sum?
    – inavda
    2 hours ago










  • @inavda $sum_i-aa^b f(a) delta x$ is $f(a)delta x + f(a+delta x)delta x + dots + f(b-delta x) delta x + f(b)delta x$, but I can replace all $delta x$ with $x-(x-delta x)$. Then I can separate the $x$ and $x-delta x$ parts. (note the sum i am taking in $delta x$ increments)
    – user106860
    2 hours ago







  • 5




    The error in your approximation looks like $f'(x) delta x$, but there are on the order of $frac1delta x$ terms in the sum, so you can't ignore it.
    – Qiaochu Yuan
    2 hours ago










  • @QiaochuYuan If you could elaborate on why the error looks like that and the number of terms I would gladly accept that as an answer. If not, I am grateful for at least you comment. Thank you. (Also, intuitively it seems like you are saying "the error is not so big if the derivative is not large, but because the sum has many terms in the end it is not negligible. I was thinking something along those lines but was thinking if I could make "the error" small enough the number of terms shouldn't matter).
    – user106860
    2 hours ago











  • @user106860 : $f(x - delta x)$ is approximately $f(x) - f'(x) delta x$ because the derivative of a function linearizes it there, or equivalently, it is the sensitivity to a vanishingly small change in the input, and $delta x$ is such a vanishing change.
    – The_Sympathizer
    42 mins ago

















  • How did you get to that sum?
    – inavda
    2 hours ago










  • @inavda $sum_i-aa^b f(a) delta x$ is $f(a)delta x + f(a+delta x)delta x + dots + f(b-delta x) delta x + f(b)delta x$, but I can replace all $delta x$ with $x-(x-delta x)$. Then I can separate the $x$ and $x-delta x$ parts. (note the sum i am taking in $delta x$ increments)
    – user106860
    2 hours ago







  • 5




    The error in your approximation looks like $f'(x) delta x$, but there are on the order of $frac1delta x$ terms in the sum, so you can't ignore it.
    – Qiaochu Yuan
    2 hours ago










  • @QiaochuYuan If you could elaborate on why the error looks like that and the number of terms I would gladly accept that as an answer. If not, I am grateful for at least you comment. Thank you. (Also, intuitively it seems like you are saying "the error is not so big if the derivative is not large, but because the sum has many terms in the end it is not negligible. I was thinking something along those lines but was thinking if I could make "the error" small enough the number of terms shouldn't matter).
    – user106860
    2 hours ago











  • @user106860 : $f(x - delta x)$ is approximately $f(x) - f'(x) delta x$ because the derivative of a function linearizes it there, or equivalently, it is the sensitivity to a vanishingly small change in the input, and $delta x$ is such a vanishing change.
    – The_Sympathizer
    42 mins ago
















How did you get to that sum?
– inavda
2 hours ago




How did you get to that sum?
– inavda
2 hours ago












@inavda $sum_i-aa^b f(a) delta x$ is $f(a)delta x + f(a+delta x)delta x + dots + f(b-delta x) delta x + f(b)delta x$, but I can replace all $delta x$ with $x-(x-delta x)$. Then I can separate the $x$ and $x-delta x$ parts. (note the sum i am taking in $delta x$ increments)
– user106860
2 hours ago





@inavda $sum_i-aa^b f(a) delta x$ is $f(a)delta x + f(a+delta x)delta x + dots + f(b-delta x) delta x + f(b)delta x$, but I can replace all $delta x$ with $x-(x-delta x)$. Then I can separate the $x$ and $x-delta x$ parts. (note the sum i am taking in $delta x$ increments)
– user106860
2 hours ago





5




5




The error in your approximation looks like $f'(x) delta x$, but there are on the order of $frac1delta x$ terms in the sum, so you can't ignore it.
– Qiaochu Yuan
2 hours ago




The error in your approximation looks like $f'(x) delta x$, but there are on the order of $frac1delta x$ terms in the sum, so you can't ignore it.
– Qiaochu Yuan
2 hours ago












@QiaochuYuan If you could elaborate on why the error looks like that and the number of terms I would gladly accept that as an answer. If not, I am grateful for at least you comment. Thank you. (Also, intuitively it seems like you are saying "the error is not so big if the derivative is not large, but because the sum has many terms in the end it is not negligible. I was thinking something along those lines but was thinking if I could make "the error" small enough the number of terms shouldn't matter).
– user106860
2 hours ago





@QiaochuYuan If you could elaborate on why the error looks like that and the number of terms I would gladly accept that as an answer. If not, I am grateful for at least you comment. Thank you. (Also, intuitively it seems like you are saying "the error is not so big if the derivative is not large, but because the sum has many terms in the end it is not negligible. I was thinking something along those lines but was thinking if I could make "the error" small enough the number of terms shouldn't matter).
– user106860
2 hours ago













@user106860 : $f(x - delta x)$ is approximately $f(x) - f'(x) delta x$ because the derivative of a function linearizes it there, or equivalently, it is the sensitivity to a vanishingly small change in the input, and $delta x$ is such a vanishing change.
– The_Sympathizer
42 mins ago





@user106860 : $f(x - delta x)$ is approximately $f(x) - f'(x) delta x$ because the derivative of a function linearizes it there, or equivalently, it is the sensitivity to a vanishingly small change in the input, and $delta x$ is such a vanishing change.
– The_Sympathizer
42 mins ago











1 Answer
1






active

oldest

votes

















up vote
4
down vote













Sure, $f(x) approx f(x-delta x)$, so you can pair off most of the terms in pairs that are approximately $0$. But they are only approximately zero, and there are a lot of them ($(b-a)/delta x$ of them, and $delta x$ is very small!). So, the total sum of them may still be non-negligible because there are so many of them.



Indeed, using the same reasoning, you could just say that in $sum f(x)delta x$ each term is very small, since $f(x)$ is bounded and $delta x$ is small. Your approach would then say that $0$ is a good approximation to the integral. Of course this is wrong, because although each term is small (roughly proportional to $delta x$), the number of terms is large in a way that cancels it out (proportional to $1/delta x$).



We can be more precise and say that $f(x)-f(x-delta x)approx f'(x) delta x$ if $f$ is differentiable. So, the errors in your terms are also roughly proportional to $delta x$, at least as long as $f'(x)$ is bounded and stays away from $0$. We can thus expect a non-negligible total error when we add up $(b-a)/delta x$ such errors.



To be even more precise, we can expect the error to be $int_a^b xf'(x), dx$, since each term of the error has the form $(x-delta x)(f(x)-f(delta x))approx xf'(x)delta x$. We can verify this rigorously: if you integrate $int_a^b f(x), dx$ by parts with $u=f(x)$ and $v=x$ (assuming $f$ is continuously differentiable) you get $$int_a^b f(x),dx=xf(x)bigg|_a^b-int_a^b xf'(x),dx=(bf(b)-af(a))-int_a^b xf'(x),dx.$$ The first term is exactly what you find with your approximation, so the error is indeed $int_a^b xf'(x),dx$. In this sense, then, the error you are making is akin to saying that the derivative of $xf(x)$ should be $f(x)$, which is what you get by differentiating just the $x$ factor but ignoring the fact that $f(x)$ may also be changing.






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',
    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%2f2988194%2fwhy-dont-terms-in-the-summation-expression-for-an-integral-almost-cancel-out%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote













    Sure, $f(x) approx f(x-delta x)$, so you can pair off most of the terms in pairs that are approximately $0$. But they are only approximately zero, and there are a lot of them ($(b-a)/delta x$ of them, and $delta x$ is very small!). So, the total sum of them may still be non-negligible because there are so many of them.



    Indeed, using the same reasoning, you could just say that in $sum f(x)delta x$ each term is very small, since $f(x)$ is bounded and $delta x$ is small. Your approach would then say that $0$ is a good approximation to the integral. Of course this is wrong, because although each term is small (roughly proportional to $delta x$), the number of terms is large in a way that cancels it out (proportional to $1/delta x$).



    We can be more precise and say that $f(x)-f(x-delta x)approx f'(x) delta x$ if $f$ is differentiable. So, the errors in your terms are also roughly proportional to $delta x$, at least as long as $f'(x)$ is bounded and stays away from $0$. We can thus expect a non-negligible total error when we add up $(b-a)/delta x$ such errors.



    To be even more precise, we can expect the error to be $int_a^b xf'(x), dx$, since each term of the error has the form $(x-delta x)(f(x)-f(delta x))approx xf'(x)delta x$. We can verify this rigorously: if you integrate $int_a^b f(x), dx$ by parts with $u=f(x)$ and $v=x$ (assuming $f$ is continuously differentiable) you get $$int_a^b f(x),dx=xf(x)bigg|_a^b-int_a^b xf'(x),dx=(bf(b)-af(a))-int_a^b xf'(x),dx.$$ The first term is exactly what you find with your approximation, so the error is indeed $int_a^b xf'(x),dx$. In this sense, then, the error you are making is akin to saying that the derivative of $xf(x)$ should be $f(x)$, which is what you get by differentiating just the $x$ factor but ignoring the fact that $f(x)$ may also be changing.






    share|cite|improve this answer


























      up vote
      4
      down vote













      Sure, $f(x) approx f(x-delta x)$, so you can pair off most of the terms in pairs that are approximately $0$. But they are only approximately zero, and there are a lot of them ($(b-a)/delta x$ of them, and $delta x$ is very small!). So, the total sum of them may still be non-negligible because there are so many of them.



      Indeed, using the same reasoning, you could just say that in $sum f(x)delta x$ each term is very small, since $f(x)$ is bounded and $delta x$ is small. Your approach would then say that $0$ is a good approximation to the integral. Of course this is wrong, because although each term is small (roughly proportional to $delta x$), the number of terms is large in a way that cancels it out (proportional to $1/delta x$).



      We can be more precise and say that $f(x)-f(x-delta x)approx f'(x) delta x$ if $f$ is differentiable. So, the errors in your terms are also roughly proportional to $delta x$, at least as long as $f'(x)$ is bounded and stays away from $0$. We can thus expect a non-negligible total error when we add up $(b-a)/delta x$ such errors.



      To be even more precise, we can expect the error to be $int_a^b xf'(x), dx$, since each term of the error has the form $(x-delta x)(f(x)-f(delta x))approx xf'(x)delta x$. We can verify this rigorously: if you integrate $int_a^b f(x), dx$ by parts with $u=f(x)$ and $v=x$ (assuming $f$ is continuously differentiable) you get $$int_a^b f(x),dx=xf(x)bigg|_a^b-int_a^b xf'(x),dx=(bf(b)-af(a))-int_a^b xf'(x),dx.$$ The first term is exactly what you find with your approximation, so the error is indeed $int_a^b xf'(x),dx$. In this sense, then, the error you are making is akin to saying that the derivative of $xf(x)$ should be $f(x)$, which is what you get by differentiating just the $x$ factor but ignoring the fact that $f(x)$ may also be changing.






      share|cite|improve this answer
























        up vote
        4
        down vote










        up vote
        4
        down vote









        Sure, $f(x) approx f(x-delta x)$, so you can pair off most of the terms in pairs that are approximately $0$. But they are only approximately zero, and there are a lot of them ($(b-a)/delta x$ of them, and $delta x$ is very small!). So, the total sum of them may still be non-negligible because there are so many of them.



        Indeed, using the same reasoning, you could just say that in $sum f(x)delta x$ each term is very small, since $f(x)$ is bounded and $delta x$ is small. Your approach would then say that $0$ is a good approximation to the integral. Of course this is wrong, because although each term is small (roughly proportional to $delta x$), the number of terms is large in a way that cancels it out (proportional to $1/delta x$).



        We can be more precise and say that $f(x)-f(x-delta x)approx f'(x) delta x$ if $f$ is differentiable. So, the errors in your terms are also roughly proportional to $delta x$, at least as long as $f'(x)$ is bounded and stays away from $0$. We can thus expect a non-negligible total error when we add up $(b-a)/delta x$ such errors.



        To be even more precise, we can expect the error to be $int_a^b xf'(x), dx$, since each term of the error has the form $(x-delta x)(f(x)-f(delta x))approx xf'(x)delta x$. We can verify this rigorously: if you integrate $int_a^b f(x), dx$ by parts with $u=f(x)$ and $v=x$ (assuming $f$ is continuously differentiable) you get $$int_a^b f(x),dx=xf(x)bigg|_a^b-int_a^b xf'(x),dx=(bf(b)-af(a))-int_a^b xf'(x),dx.$$ The first term is exactly what you find with your approximation, so the error is indeed $int_a^b xf'(x),dx$. In this sense, then, the error you are making is akin to saying that the derivative of $xf(x)$ should be $f(x)$, which is what you get by differentiating just the $x$ factor but ignoring the fact that $f(x)$ may also be changing.






        share|cite|improve this answer














        Sure, $f(x) approx f(x-delta x)$, so you can pair off most of the terms in pairs that are approximately $0$. But they are only approximately zero, and there are a lot of them ($(b-a)/delta x$ of them, and $delta x$ is very small!). So, the total sum of them may still be non-negligible because there are so many of them.



        Indeed, using the same reasoning, you could just say that in $sum f(x)delta x$ each term is very small, since $f(x)$ is bounded and $delta x$ is small. Your approach would then say that $0$ is a good approximation to the integral. Of course this is wrong, because although each term is small (roughly proportional to $delta x$), the number of terms is large in a way that cancels it out (proportional to $1/delta x$).



        We can be more precise and say that $f(x)-f(x-delta x)approx f'(x) delta x$ if $f$ is differentiable. So, the errors in your terms are also roughly proportional to $delta x$, at least as long as $f'(x)$ is bounded and stays away from $0$. We can thus expect a non-negligible total error when we add up $(b-a)/delta x$ such errors.



        To be even more precise, we can expect the error to be $int_a^b xf'(x), dx$, since each term of the error has the form $(x-delta x)(f(x)-f(delta x))approx xf'(x)delta x$. We can verify this rigorously: if you integrate $int_a^b f(x), dx$ by parts with $u=f(x)$ and $v=x$ (assuming $f$ is continuously differentiable) you get $$int_a^b f(x),dx=xf(x)bigg|_a^b-int_a^b xf'(x),dx=(bf(b)-af(a))-int_a^b xf'(x),dx.$$ The first term is exactly what you find with your approximation, so the error is indeed $int_a^b xf'(x),dx$. In this sense, then, the error you are making is akin to saying that the derivative of $xf(x)$ should be $f(x)$, which is what you get by differentiating just the $x$ factor but ignoring the fact that $f(x)$ may also be changing.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited 1 hour ago

























        answered 2 hours ago









        Eric Wofsey

        173k12199321




        173k12199321



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2988194%2fwhy-dont-terms-in-the-summation-expression-for-an-integral-almost-cancel-out%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            List of Gilmore Girls characters

            What does second last employer means? [closed]

            One-line joke