Professional Documents
Culture Documents
CAMPUS DO SERTO
EIXO DE TECNOLOGIA
INTEGRAO NUMRICA
Introduo
Introduo
Exemplo: Calcular o valor da integral definida abaixo.
1
0.9
0.8
0.7
x2
dx = ?
0.6
f(x)
0.5
0.4
0.3
0.2
0.1
0
-5
-4
-3
-2
-1
x
Introduo
f ( x) = ?
f ( x)dx = ?
a
Introduo
computacional
do
clculo
de
Ideia Bsica
Ideia Bsica
f ( x)dx w f ( x )
a
i =0
Frmulas de Newton-Cotes
xn = a + nh
xi = a + i h, com i = 0,1,..., n
Frmulas de Newton-Cotes
i =0
f ( x)dx
( x xk )
f ( xi )
dx
( xi xk )
a k =0,k i
b
( x xk )
wi =
dx
( xi xk )
a k =0,k i
b
Frmulas de Newton-Cotes
Regra do Trapzio
x0 = a e x1 = b
Frmulas de Newton-Cotes
Regra do Trapzio
A partir da frmula de Newton-Cotes, podem-se
encontrar os pesos usados no polinmio.
( x xk )
wi =
dx
( xi xk )
a k =0,k i
b
( x xk )
w0 =
dx
( xi xk )
x0 k = 0 , k i
x1
n =1
( x x1 )
1 ( x x1 )
w0 =
dx =
x0 x1
( x0 x1 )
2
x0
x1
2 x1
x0
Frmulas de Newton-Cotes
Regra do Trapzio
( x x1 )
1 ( x x1 )
w0 =
dx =
( x0 x1 )
x0 x1
2
x0
x1
2 x1
x0
ba
h=
= x1 x0
n
( x x1 )
1 ( x x1 )
w0 =
dx =
( x0 x1 )
2
h
x0
x1
2 x1
x0
h
=
2
Frmulas de Newton-Cotes
Regra do Trapzio
( x xk )
1 ( x x0 )
w1 =
dx =
( xi xk )
x1 x0
2
x0 k = 0 , k i
x1
n =1
1 ( x x0 )
w1 =
h
2
b
Logo,
2 x1
x0
2 x1
x0
h
=
2
h
f(x)dx [ f(x0 ) + f(x1 )]
2
rea do Trapzio!
Frmulas de Newton-Cotes
Regra do Trapzio
Graficamente
Frmulas de Newton-Cotes
Regra do Trapzio
Aplicao: calcular a integral aproximada da funo
abaixo no intervalo [0,1].
f ( x) = 1 + e
Soluo analtica:
1
I = 1+ e
0
)dx = x e
x 1
0
= 1 e
) (0 e ) = 1,6321
0
Frmulas de Newton-Cotes
Regra do Trapzio
Soluo numrica:
b
h
f(x)dx [ f(x0 ) + f(x1 )]
2
1 0
1
I
[ f( 0 ) + f( 1 )] (2 + 1,3679) = 1,684
2
2
Frmulas de Newton-Cotes
Regra de Simpson
a+b
x0 = a, x1 =
2
e x2 = b
Frmulas de Newton-Cotes
Regra de Simpson
A partir da frmula de Newton-Cotes, podem-se
encontrar os pesos usados no polinmio.
( x xk )
wi =
dx
( xi xk )
a k =0,k i
b
( x x1 ) ( x x2 )
h
w0 =
dx =
( x0 x1 ) ( x0 x2 )
3
x0
x2
( x xk )
w0 =
dx
( xi xk )
x0 k = 0 , k i
x2
n=2
b a x2 x0
h=
=
n
2
Frmulas de Newton-Cotes
Regra de Simpson
( x x0 ) ( x x2 )
4h
w1 =
dx =
( x1 x0 ) ( x1 x2 )
3
x0
x2
( x x0 ) ( x x1 )
h
w2 =
dx =
( x2 x0 ) ( x2 x1 )
3
x0
x2
Logo,
h
f(x)dx [ f(x0 ) + 4 f(x1 ) + f ( x2 )]
3
rea sob a Parbola!
Frmulas de Newton-Cotes
Regra de Simpson
Graficamente
Frmulas de Newton-Cotes
Regra de Simpson
f ( x) = 1 + e
Soluo numrica:
b
h
f(x)dx [ f(x0 ) + 4 f(x1 ) + f ( x2 )]
3
Frmulas de Newton-Cotes
Regra de Simpson
b a 1 0 1
h=
=
=
n
2
2
1 1
x1 = a + h = 0 + =
2 2
h
1
I [ f(x0 ) + 4 f(x1 ) + f ( x2 )] ( f (0) + 4 f (0,5) + f (1) )
3
6
1
I (2 + 4 1,6065 + 1,3679 ) 1,6323
6
sol_analtica = 1,6321
Frmulas de Newton-Cotes
Outros Casos
Grau do polinmio
Regra do trapzio
Regra de Simpson
Regra de Boole
Frmulas de Newton-Cotes
Frmulas Repetidas
x0 = a, xi = xi 1 + h h = xi xi 1 e xn = b
Frmulas de Newton-Cotes
I = f ( x)dx =
a
b
I =
a
I =
a
x1
x2
xn
x0
x1
xn1
h
f ( x)dx [ f ( x0 ) + 2 f ( x1 ) + 2 f ( x2 ) + + f ( xn )]
2
n 1
h
f ( x)dx f ( x0 ) + 2 f ( xi ) + f ( xn )
2
i =1
Frmulas de Newton-Cotes
Graficamente
Frmulas de Newton-Cotes
Algoritmo
Dados h, f(xi) para i=0:n
1 soma = 0
2 Para i=1:n-1, faa
soma=soma+f(xi)
3 I=(h/2)*(f(x0)+2*soma+f(xn))
Frmulas de Newton-Cotes
f ( x) = 1 + e
Soluo:
b
I =
a
n 1
h
f ( x)dx f ( x0 ) + 2 f ( xi ) + f ( xn )
2
i =1
Frmulas de Newton-Cotes
I =
a
n 1
h
f ( x)dx f ( x0 ) + 2 f ( xi ) + f ( xn )
2
i =1
3
h
I f ( x0 ) + 2 f ( xi ) + f ( x4 )
2
i =1
h
I [ f ( x0 ) + 2( f ( x1 ) + f ( x2 ) + f ( x3 ) ) + f ( x4 )]
2
b a 1 0
h=
=
= 0,25
n
4
Frmulas de Newton-Cotes
h
I [ f ( x0 ) + 2( f ( x1 ) + f ( x2 ) + f ( x3 ) ) + f ( x4 )]
2
0,25
I
[ f (0) + 2( f (0,25) + f (0,5) + f (0,75) ) + f (1)]
2
0,25
I
[2 + 2(1,7788 + 1,6065 + 1,4724) + 1,3679]
2
I 1,6354
Frmulas de Newton-Cotes
I = f ( x)dx =
a
x2
x4
x2 n
x0
x2
x2 n2
h
I [ f ( x0 ) + 4 f ( x1 ) + 2 f ( x2 ) + 4 f ( x3 ) + 2 f ( x4 ) + + f ( xn )]
3
Frmulas de Newton-Cotes
ESR
(b a )h 4
M4
180
M 4 = mx f ( 4 ) ( x)
x[ x0 , xn ]
Frmulas de Newton-Cotes
Algoritmo
Dados h, f(xi) para i=0:n com n par
1 soma = 0
2 Para i=1:n-1, faa
3 Se i par
4-
soma=soma+4f(xi)
5 Seno
6-
soma=soma+2f(xi)
7 I=(h/3)*(f(x0)+soma+f(xn))
Frmulas de Newton-Cotes
f ( x) = 1 + e
Soluo:
h
I [ f ( x0 ) + 4 f ( x1 ) + 2 f ( x2 ) + 4 f ( x3 ) + 2 f ( x4 ) + + f ( xn )]
3
Frmulas de Newton-Cotes
h
I [ f ( x0 ) + 4 f ( x1 ) + 2 f ( x2 ) + 4 f ( x3 ) + 2 f ( x4 ) + f ( x5 )]
3
b a 1 0
= 0,25
h=
=
n
4
0,25
[ f (0) + 4 f (0,25) + 2 f (0,5) + 4 f (0.75) + f (1)]
I
3
0,25
[2 + 4 1,7788 + 2 1,6065 + 4 1,4724 + 1,3679] = 1,6321
I
3