Determining an n for Numerical Integration

Click For Summary

Discussion Overview

The discussion revolves around the estimation of integrals using the trapezoidal approximation method, focusing on the error analysis associated with this numerical integration technique. Participants explore the role of the second derivative in determining error bounds and the implications of using absolute values in calculations.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • Some participants discuss the formula for error in trapezoidal approximation, specifically the role of the maximum value of the absolute value of the second derivative, ##M##, in estimating error.
  • There is a question about why the second derivative is used and why its absolute value is taken, with some participants seeking clarity on the implications of these choices.
  • One participant suggests that the maximum value of the second derivative, ##|f''(x)|##, should be 18 rather than 6, based on their interpretation of the function's behavior.
  • Another participant proposes that the choice of ##x = 1## is made to maximize ##f''## by inspection, indicating a method of finding the largest error.
  • Some participants express confusion about the relationship between the second derivative and the concavity of the original function, questioning whether analyzing ##f''## is necessary when the goal is to approximate the area under ##f##.
  • There is a mention of a Wikipedia entry that outlines the proof of the error formula, which some participants find complex and challenging to understand.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the maximum value of ##|f''(x)|##, with differing opinions on whether it should be 6 or 18. The discussion remains unresolved regarding the necessity of using absolute values in the error estimation process.

Contextual Notes

Some participants express limitations in their understanding of the mathematical proofs and notation involved in the error analysis, indicating a potential gap in foundational knowledge that affects their ability to engage fully with the topic.

opus
Gold Member
Messages
717
Reaction score
131
When estimating an integral using trapezoidal approximation, we can find the error or uncertainty in the estimation by:
##Error~in~T_n \leq \frac{M(b-a)^3}{12n^2}## where ##M## is the maximum value of the absolute value of f''(x) over [a,b], ##n## is the number of intervals, and ##T_n## is the trapezoidal approximation with n intervals.

If we want an estimation within a certain degree of accuracy, we find M, set in less than or equal to our desired maximum value of uncertainty, then solve for n. This will give us an n amount of intervals to use for the approximation to stay withing a specified range of error or uncertainty.

My question is two fold:
First, why is ##M## the absolute value of f''(x)? What is the role that the second derivative plays here and why absolute value?

Second, please see the attached image which is part of an example problem in my text. I don't know what they're doing when solving for the absolute value of f''(x). Clearly, the maximum would be 6e, as when we plug in 1 into the second derivative, this is what we get. But I don't know what they're doing to get this value. I am referring to the very bottom line of the attached image.
 

Attachments

  • Screen Shot 2019-01-24 at 11.00.21 AM.png
    Screen Shot 2019-01-24 at 11.00.21 AM.png
    13.7 KB · Views: 428
Physics news on Phys.org
So I hope I understood your problem correctly.

The error T in the result of a numerical calculation R should always be interpreted as this:

The result for the analytical solution S is with certainty 100% in the interval [R-T,R+T].

What you do is make a worst case analysis. In trapezoidal numerical integration, the errors come primarily from the local second derivative. So you look up in your function where the second derivative is largest, and then find that the final error will be smaller than the case where every trapezoid yields the worst case error. Is this helpful?
 
  • Like
Likes   Reactions: opus
I think they choose ##x = 1## because that will give the largest value for ##f''## by inspection.
 
  • Like
Likes   Reactions: opus
opus said:
When estimating an integral using trapezoidal approximation, we can find the error or uncertainty in the estimation by:
##Error~in~T_n \leq \frac{M(b-a)^3}{12n^2}## where ##M## is the maximum value of the absolute value of f''(x) over [a,b], ##n## is the number of intervals, and ##T_n## is the trapezoidal approximation with n intervals.

If we want an estimation within a certain degree of accuracy, we find M, set in less than or equal to our desired maximum value of uncertainty, then solve for n. This will give us an n amount of intervals to use for the approximation to stay withing a specified range of error or uncertainty.

My question is two fold:
First, why is ##M## the absolute value of f''(x)? What is the role that the second derivative plays here and why absolute value?

Second, please see the attached image which is part of an example problem in my text. I don't know what they're doing when solving for the absolute value of f''(x). Clearly, the maximum would be 6e, as when we plug in 1 into the second derivative, this is what we get. But I don't know what they're doing to get this value. I am referring to the very bottom line of the attached image.

Google is your friend. Do a search using keywords "trapezoidal rule error", and you will find articles that tell you all you want to know, and more.

Anyway, I do not agree with their calculation leading to ##|f''(x)| \leq 6##; I would say that ##|f''(x)| \leq 18,## because ##2 \times 3 \times e \leq 18.## So, I think you need to take ##M = 18## (or ##M = 6 e,## which is a bit less but harder to use and probably will not affect ##n## very much).
 
  • Like
Likes   Reactions: opus
Gigaz said:
So I hope I understood your problem correctly.

The error T in the result of a numerical calculation R should always be interpreted as this:

The result for the analytical solution S is with certainty 100% in the interval [R-T,R+T].

What you do is make a worst case analysis. In trapezoidal numerical integration, the errors come primarily from the local second derivative. So you look up in your function where the second derivative is largest, and then find that the final error will be smaller than the case where every trapezoid yields the worst case error. Is this helpful?
So to find the error of approximation with a problem like this, we need to graph it and see where in the interval that the second derivative is the largest (most concavity)? And this is where I have been confused in my research- we are using the trapezoids to "fill up" the area under neath the graph of ##f## Now depending on concavity of the graph of ##f##, that will determine if the approximation is an over estimate or under estimate in that interval. So why don't we just look at the graph of ##f## rather than the graph of ##f''##? Or do we look at the graph of ##f##, we are just concerned about ##f''## which is the concavity of ##f##?
 
jedishrfu said:
I think they choose ##x = 1## because that will give the largest value for ##f''## by inspection.
So then our errors are naturally going to be different for the intervals that we choose and depending on the interval, we can have either an under approximation or an over approximation?
 
Ray Vickson said:
Google is your friend. Do a search using keywords "trapezoidal rule error", and you will find articles that tell you all you want to know, and more.

Anyway, I do not agree with their calculation leading to ##|f''(x)| \leq 6##; I would say that ##|f''(x)| \leq 18,## because ##2 \times 3 \times e \leq 18.## So, I think you need to take ##M = 18## (or ##M = 6 e,## which is a bit less but harder to use and probably will not affect ##n## very much).
I've done the research but can't find an answer as to why we have an absolute value here.
 
opus said:
I've done the research but can't find an answer as to why we have an absolute value here.

The Wikipedia entry proves the formula
$$\text{error} = f''(\xi) \frac{(b-a)^3}{12 N^2}, $$
where ##f''(\xi) = \max_{x \in [a,b]} |f''(x)|.##

The article suppose the error measure to be ##> 0## because it measures an upper bound on the distance between the computed result and the true result. If you look more carefully into the proof you will realize that if
$$ m_1 = \min_{x \in [a,b]} f''(x) < 0$$ and $$m_2 = \max_{x \in [a,b]} f''(x) > 0$$ then the actual numerical error (positive or negative) satisfies
$$ m_1 (b-a)^3/(12 N^2 ) \leq \text{numerical error} \leq m_2 (b-a)^3/(12 N^2)$$ Therefore,
$$\text{error} \equiv |\text{numerical error}| \leq \max(|m_1|,|m_2|) (b-a)^3/(12N^2)\\ = \max_{x \in[a,b]} |f''(x)| (b-a)^3/(12 N^2)$$
 
  • Like
Likes   Reactions: opus
Ok thanks so much Ray, the key word distance there makes sense to me intuitively, but i went through that proof and its over my head currently. I just started Calculus 2 so the notation and techniques there were foreign and I didnt know what to even Google to clear up my confusion in the proof.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 24 ·
Replies
24
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K