Escolar Documentos
Profissional Documentos
Cultura Documentos
Objectivos
No fim desta aula, os estudantes devem ser capazes de:
• Integrar funções tabeladas e analíticas através das fórmulas dos Trapézios e de Simpson;
• Estimar os erros de integração de funções analíticas.
. .
f (x) = f (x0 + θh) ≈ y0 + θ△y0 . Vamos calcular o integral de f (x) no intervalo [x0 ; x1 ] :
∫ x1 ∫ x1 ∫ x1
f (x)dx = f (x0 + θh)dx ≈ (y0 + θ△y0 )dx
x0 x0 x0
∫ ( )
x1
y1 − y0 h
f (x)dx ≈ h y0 + = (y0 + y1 )
x0 2 2
Deste modo, em cada intervalo [x0 ; x1 ], [x1 ; x2 ], [x2 ; x3 ], ..., [xn−1 ; xn ], temos as seguintes
2
aproximações do integral
∫ xi
f (x)dx, i = 1, 2, 3, ..., n:
xi−1
∫ x1
h
f (x) = f (x0 + θh) ≈ y0 + θ△y0 , x ∈ [x0 ; x1 ] =⇒ f (x)dx ≈ (y0 + y1 );
2
∫ x2 x0
h
f (x) = f (x1 + θh) ≈ y1 + θ△y1 , x ∈ [x1 ; x2 ] =⇒ f (x)dx ≈ (y1 + y2 );
2
∫x1x3
h
f (x) = f (x2 + θh) ≈ y2 + θ△y2 , x ∈ [x2 ; x3 ] =⇒ f (x)dx ≈ (y2 + y3 );
x2 2
..
. ∫ xn
h
f (x) = f (xn−1 + θh) ≈ yn−1 + θ△yn−1 , x ∈ [xn−1 ; xn ] =⇒ f (x)dx ≈ (yn−1 + yn ).
xn−1 2
∫xn
h
f (x)dx ≈ [y0 + yn + 2(y1 + y2 + y3 + ... + yn−2 + yn−1 )] (7)
2
x0
h2 ′′
En ≤ (xn − x0 ) max |f (x)| (8)
12 x 0 ≤x≤x n
θ(θ − 1) 2
f (x) = f (x0 + θh) ≈ y0 + θ△y0 + △ y0
2
Vamos calcular o integral de f (x) no intervalo [x0 ; x2 ]
∫ x2 ∫ x2 ∫ x2 [ ]
θ(θ − 1) 2
f (x)dx = f (x0 + θh)dx ≈ y0 + θ△y0 + △ y0 dx
x0 x0 x0 2
Determinemos os novos limites de integração: x = x0 + θh =⇒ dx = hdθ ; quando x =
x2 − x0 2h
x0 =⇒ θ = 0, enquanto que para x = x2 =⇒ θ = = = 2. Portanto,
h h
∫ x2 ∫ x2 [ ]
θ(θ − 1) 2
f (x)dx ≈ y0 + θ△y0 + △ y0 hdθ =
x0 x0 2
3
( ) 2
θ2 θ3 θ2 4
= h θy0 + △y0 + △ y0 − △ y0
2 2
= h(2y0 + 2△y0 + △2 y0 − △2 y0 )
2 6 4 0 3
Mas como △y0 = y1 − y0 e △2 y0 = y2 − 2y1 + y0 , obtemos:
∫ x2 ∫ x2
h
f (x)dx = f (x0 + θh)dx ≈ (y0 + 4y1 + y2 )
x0 x0 3
Deste modo, em cada intervalo [x0 ; x2 ], [x2 ; x4 ], [x4 ; x6 ], ..., [x2n−2 ; x2n ], temos as seguintes apro-
ximações do integral
∫ x2i
f (x)dx, i = 1, 2, 3, ..., n:
x2i−2
θ(θ − 1) 2
f (x) = f (x0 + θh) ≈ y0 + θ△y0 + △ y0 , x ∈ [x0 ; x2 ] =⇒
2
∫ x2
h
=⇒ f (x)dx ≈ (y0 + 4y1 + y2 );
x0 3
θ(θ − 1) 2
f (x) = f (x2 + θh) ≈ y2 + θ△y2 + △ y2 , x ∈ [x2 ; x4 ] =⇒
2
∫ x4
h
=⇒ f (x)dx ≈ (y2 + 4y3 + y4 );
x2 3
θ(θ − 1) 2
f (x) = f (x4 + θh) ≈ y4 + θ△y4 + △ y4 , x ∈ [x4 ; x6 ] =⇒
2
∫ x6
h
=⇒ f (x)dx ≈ (y4 + 4y5 + y6 );
x4 3
..
.
θ(θ − 1) 2
f (x) = f (x2n−2 + θh) ≈ y2n−2 + θ△y2n−2 + △ y2n−2 , x ∈ [x2n−2 ; x2n ] =⇒
2
∫ x2n
h
=⇒ f (x)dx ≈ (y2n−2 + 4y2n−1 + y2n ).
x2n−2 3
∫x2n
h
f (x)dx ≈ [y0 + y2n + 4(y1 + y3 + y5 + ... + y2n−1 ) + 2(y2 + y4 + y6 + ... + y2n−2 )] (9)
3
x0
h4
En ≤ (x2n − x0 ) max |f (4) (x)| (10)
180 x0 ≤x≤x2n
Suponhamos que é conhecida a expressão analítica de una função f (x), continua no inter-
valo [a; b]. Para integrar esta função podemos utilizar as fórmulas de integração dos Trapézios
e/ou de Simpson, sendo necessário para o efeito dividir o intervalo [a; b] num número adequado
4
1) Escolher o número inteiro N , relativo às divisões do intervalo [a, b], sendo par se quiser
usar a fórmula de Simpson.
b−a
2) Calcular o valor de h a partir da fórmula h = .
N
Notas:
∫2
sin(x)
dx
x
1
Resolução
1) Escolhemos N = 10, um número par porque iremos usar as duas fórmulas (Trapézios e
Simpson).
b−a 2−1
2) h = = = 0, 1
N 10
sin 1
3) x0 = 1 =⇒ f (x0 ) = f (1) = = 0, 84147
1
xi = x0 + 0, 1 · i ⇐⇒ xi = 1 + 0, 1 · i
x1 = 1 + 1 · 0, 1 = 1 + 0, 1 = 1, 1 =⇒ f (x1 ) = f (1, 2) = sin1,11,1 = 0, 81019
x2 = 1 + 2 · 0, 1 = 1 + 0, 2 = 1, 2 =⇒ f (x2 ) = f (1) = sin1,21,2 = 0, 77670
..
.
Apresentamos os resultados na tabela abaixo:
5
sin x
i x (x dado em radianos)
x
0 1 0, 84147
1 1, 1 0, 81019
2 1, 2 0, 77670
3 1, 3 0, 74120
4 1, 4 0, 70389
5 1, 5 0, 66500
6 1, 6 0, 62473
7 1, 7 0, 58333
8 1, 8 0, 54103
9 1, 9 0, 49805
10 2, 0 0, 45465
∫2
sin x 0, 1
dx ≈ [0, 84147+0, 45465+2(0, 81019+0, 77670+0, 74120+0, 70389+0, 66500+
x 2
1
0, 62473 + 0, 58333 + 0, 54103 + 0, 49805)] = 0.65922
∫2
sin x 0, 1
dx ≈ [0, 84147+0, 45465+4(0, 81019+0, 74120+0, 66500+0, 58333+0, 49805)+
x 3
1
2(0, 77670 + 0, 70389 + 0, 62473 + 0, 54103)] = 0.65933
Exemplo 2. Achar o número mínimo de intervalos que se pode usar para obter o valor do
integral
∫2
e−x dx com o erro inferior a ε = 0.001, utilizando a fórmula de Trapézios.
2
Resolução
h2 ′′
Rn ≤ (xn − x0 ) max |f (x)|
12 x0 ≤x≤xn
′′
f (x) = −2e−x (1 − 2x2 ).
2
6
′′
Atendendo que f (x) não é monótona no intervalo [1; 2], vamos calcular a terceira derivada,
isto é,
′′′
f (x) = 4xe−x (−2x2 + 3)
2
√
′′′ −x2 3
De f (x) = 0 =⇒ 4xe (−2x2 + 3) = 0 ⇐⇒ x = 0 ∨ x = ± .
2
√
3
Deste modo, o extremo absoluto so poderá ser atingido num dos pontos 1, e 2.
2
′′ 2
f (1) = −2e−1 (1 − 212 ) = = 0.7358
2
(√ ) e √
′′ 3 3 4 e
f = −2e 2 (1 − 3) = 2 = 0.8925
2 e
′′ 14
f (2) = −2e−1 (1 − 8) = 4 = 0.2564
2
e
′′
max |f (x)| = max{0.7358; 0.8925; 0.2564} = 0.8925.
1≤x≤2
h2 ′′ (xn − x0 )3 ′′
Rn ≤ (xn − x0 ) max |f (x)| < 0.001 =⇒ 2
max |f (x)| < 0.001
12 ≤x≤x 12N ≤x≤x
x 0 n
√ x0 n
(2 − 1)3 0.8925
=⇒ · 0.8925 < 0.001 ⇐⇒ N > = 8.6241
12N 2 0.0120
Assim, atendendo que N deve ser um número natural, o minimo é N = 9
Exemplo 3. Calcule, com precisão não superior a 0.0002, o integral através do método dos
Trapézios
∫4
e−x+1 · (x + 1)2 dx
3
Resolução
Atendendo que f ′′ (x) não é monótona no intervalo [3; 4], determinemos a terceira derivada,
isto é,
′′′
f (x) = (−x2 + 4x − 1) · e−x+1 .
′′′ √ √
De f (x) = 0 =⇒ (−x2 + 4x − 1) · e−x+1 = 0 ⇐⇒ x = 2 − 3∈
/ [3; 4] ∨ x = 2 + 3 ∈ [3; 4].
′′ √
max |f (x)| = max{f ′′ (3); f ′′ (2 + 3); f ′′ (4)} = max{0.2707; 0.3556; 0.3485} = 0.3556.
3≤x≤4
7
(b − a)3 ′′ (4 − 3)3
max |f (x)| ≤ 0.0002 =⇒ · 0, 3556 ≤ 0.0002 ⇐⇒ N > 12.1724
12N 2 a≤x≤b 12N 2
Para assegurar que o valor do erro absoluto cometido no cálculo do integral dado não ex-
ceda a 0.0002, deve-se considerar, no mínimo, N = 13.
i xi yi = f (xi )
0 3.0000 2.1654
1 3.0769 2.0829
2 3.1538 2.0022
3 3.2308 1.9232
4 3.3077 1.8462
5 3.3846 1.7711
6 3.4615 1.6980
7 3.5385 1.6270
8 3.6154 1.5580
9 3.6923 1.4911
10 3.7692 1.4264
11 3.8462 1.3637
12 3.9232 1.3032
13 4.0000 1.2447
∫4
e−x+1 · (x + 1)2 dx ≈ 1.6768
3