Why don't terms in the summation expression for an integral (almost) cancel out?
Clash 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...
integration
add a comment |Â
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...
integration
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
add a comment |Â
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...
integration
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
integration
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
add a comment |Â
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
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
edited 1 hour ago
answered 2 hours ago
Eric Wofsey
173k12199321
173k12199321
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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