[Math] Understanding what exactly an upper bound on an error is in numerical analysis

numerical methods

I think the hardest part of numerical analysis for me is understand what constitutes an "upper bound", and this has caused me alot of strife because often times my answer differs from the book, but I'm still "correct", which would imply to me that there are many upper bounds.

For example solving trapezoidal quadrature:

if $$f(x) = ((sinx)^2−2xsinx+1)$$

then

$$f''(x) = 2cos^2x – 2sin^2x + 2xsinx – 4cosx $$ on $ \xi \in (0.75,1.3)$ has an error bound of 0.02444080544 as I have found in this question.

However, it appears I can also just say that

$$sin,cos \le 1 \forall x$$

and $x$ is increasing on the domain $(0.75,1.3)$

so

$$-4\sin{2\xi}+6\sin(\xi)+2(\xi)sin(\xi)$$ can be written as $$-4 + 6 + 2(1.3)$$ which is $4.6$.

Plugging this into the error bound for the trapezoidal rule error gives us

$$|\frac{(0.55)^3}{12}(4.6)| = 0.0637770833333$$

Which also appears correct. However, how do I know if my error bound is correct? I guess thats the part I'm struggling on. What is the indicator that I'm approach the bound correctly? How do I know if I have the correct bound?

Best Answer

BaronVT already pointed out an error in your estimate for $-4\sin{2\xi}+6\sin(\xi)+2(\xi)\sin(\xi)$: the estimation process is not as simple as "replace all $\sin$ and $\cos$ with $1$". E.g., $\sin 2\xi\le 1$ does not imply $-4\sin 2\xi\le -4$; rather it's $-4\sin 2\xi\ge -4$. With the help of triangle inequality you can get a correct bound.

To your main question

How do I know if I have the correct bound?

There is no such thing as the correct upper bound. There is the smallest one (infimum), but it's usually impossible to find without knowing the exact result of integration -- and if we knew that, why would we need a numerical method in the first place?

If $0.02444$ is an upper bound for the error, then so are $0.03$, and $0.7$, and $42$, and $10^{78}$ -- these are upper bounds too. They are no less correct than $0.02444$. Some of them may be less useful, or in fact totally useless. But usefulness is somewhat subjective; there is no mathematical definition of it.

In practical terms: if you are taking a course in numerical analysis, then correct means "what your professor expects of you" (within some margin), and your indicator that an answer is correct is "it's close to the answer at the end of the book".

If an estimate calls for an upper bound on, say, $x\sin x+x^2\cos x$ on $[0,\pi/2]$, then it's reasonable to do
$$x\sin x+x^2\cos x\le x+x^2 \le (\pi/2)+(\pi/2)^2$$ But someone with more patience and energy can spend a few more minutes and come up with a better (smaller) bound. Or spend an hour and come up with a yet better bound. Or spend a day... you get the idea. What you need is a reasonably good bound obtainable with reasonable amount of effort, that's all.

Related Question