Information Technology Reference
In-Depth Information
Since
y.x/ f.x/
for 1 x 2, it follows that also
Z 2
e x dx Z 2
1
y.x/dx:
1
In this case, we can compute both integrals and compare the result. We have
Z 2
e x dx D e.e 1/ 4:6708
1
and
Z 2
y.x/dx D Z 2
1
1
2 e C
1
2 e 2 5:0537;
eŒ1 C .e 1/.x 1/ dx D
1
so the relative error 3 is
j 4:6708 5:0537 j
4:6708
100% 7:4% :
We can generalize this approximation to any reasonable 4 function f and any
finite limits a and b.Again,welety D y.x/ be a linear function interpolating f in
3 Here we need to clarify our concepts. Let u be the exact number that we want to compute, and let
v be an approximation generated by some kind of method. Then we refer to
j
u
v
j
as the error of the computation and
j
u
v
j
j
is referred to as the relative error. If we want the latter to be in percentages, we compute
j
u
j
u
v
j
100%:
j
u
j
4 You may wonder whether “unreasonable” functions exist and we can assure you that they do. If
you follow advanced courses in mathematics dealing with the theory of integration, you will learn
about functions that would be very hard to get at with the trapezoidal method. To illustrate this, we
mention the function defined to be 1 for any rational value of x and 0 for any irrational values of x.
How would you define the integral of such a function? If you are interested in this topic, you can
read about it in, e.g., Royden's topic [25] on integration theory.
Less subtle, we may need the integral of discontinuous functions, or functions with jumps in
derivatives, and so on. In the present chapter we just assume that all functions under consideration
are “reasonable”, in the sense that they are smooth enough to justify the techniques we are studying.
Typically, functions with bounded derivatives up to second order are allowed in this chapter.
 
Search WWH ::




Custom Search