Professional Documents
Culture Documents
Numerical computation.
and when numerical approximation
Why should we use
Ex
Sexex,I*dx. Ssin(x2dx, etc.
(2)
What is
$fixdx?
Remann sum: Divide [a, b] into
a subintervals [xix, xi]
Sfixidx lim
=
If(xY)
=
ox
nc i 1
Thus
Ifxidx = If(x)OXwhen i is "large"
i1
=
x*
Approximation rules (choices of x =[xi -, x:]) An
Xi-1 Xi
left end
x
approximation
x =Xi-1, (n 2,f(xi_)ox
=
end approximation
Right
*
x* =
Xi, Rn 2,f(xi)ox
=
Midpoint
* rule
x* xi
=
=
x
x:Mn 24f(x:)ox
=
Trapezoidal
* rule
Tn I((n
=
Rn)
+
I(f(xi 1)0x
=
i1
=
-
f(xi)0x)
+
X2,f(x)
= f(x)
+
The area of the ith trapezoidal is
(f(xi 1) f(xi).
-> -
+
a
=
1,b 2,n 5 = =
1a
-x
2a =
=
5
=
0.2
=
xo x, x= x3 x4 X5
Xi a 20x 1
= +
=
0.22
+ 0 =5
(i
xo 1,
=
X1 1.2,
=
X2 1.4,
=
X3 1.6, x 1.8,
= =
X5 2 =
cal
Trapezoidal rule
x 1.7,
=
x* 1.9.
=
Ex. f(x) I,
=
[1,2]
x=
fix) =
-
42 f(x) Es
=
Error bound
1E 1+
=s
2.13
IEml* 4r2 =
=
Take n 5,
=
(Ei) 552=
<
IEm1 I
is:=t 0.003334.
=
=s
rule:
Trapezoidal (ET1*
<0.0001 E
let IEi1=
IEM) E =
=
(a).a
=
0, b 1,=
n 10
=
ox
=
1a 1 =
0.1
=
Xi a
=
i.0x
+
0.1i0xi /0
=
:e [Xi-1, Xi]
Xi I(Xi
=
-
1
+
xi) I(0.1(i 1)
=
-
0.1i)
+
0.1i
=
-
0.0512i =10
Mn =
f(x) x =
-0.05)
e
(0.12
..1
=
i1 =
=
fex.
(b) f(x) ex =
2
f(x) 2xex"
=
f(x) (2
= 4x4)ex"
+
If(x) (2
=
4x))ex
+
6e k
=
=
x = [0,1]
1 Eml -> a = -
, 0.007
=
=
linn-Sexx)-30,007
=>
n 10
=
Another
approximation of(af(x)dx
Q:Can we do better?
Whati s
Simpson's Rule?
line the
Previous rules are use
to
segments approximate
to curve
Simpson'srule:
approximate
the curve in each subinterval
by a
quadratic
function (parabolas, ax bx +
c)
+
+
Q,(x) a,x bix Ci
= +
a2 x
bax 2z
+
Q2(x)
=
x) c
+
Yo
=
()
S
-
C Y, (2)
=
A(ox) B0x
+
c
+
=
y =
(z)
Ia,(xdx (A(x =
-
x) B(x + -
x) cdx+
↑
area under the
(*Ax Bx
=
+ cdx
+
parabola -
X
4y.)
yox(% y2
+
+
Similarly j*4
x2
Q2(x)dX 50x(yi = +
y4 435)
+
↑
area under the 2nd parabola
*
2i
I X2i =2
QixdX 50x (Yzi-z Yei+ 4Yai-1)
=
+
I
area under the ith parabola
dan
I *
zi 2
-
Qi(x)dx (f(xa-
-
) 4f(xni-i)
* f(x))
+
Runk:
f(x) x,
=
f(x) -
=
x2, f(x) 5,
= +(x) =
-
4
f(x) 25
=
If "(x) =
x 24 k
=
x = [1,2]
->
Take n 8
=
(n is even).
(b) f(x) ex.
=
n 10
=
1):e*dx 1.462681)
-